14typedef CwiseUnaryOp<internal::scalar_abs_op<Scalar>,
const Derived> CwiseAbsReturnType;
15typedef CwiseUnaryOp<internal::scalar_abs2_op<Scalar>,
const Derived> CwiseAbs2ReturnType;
16typedef CwiseUnaryOp<internal::scalar_arg_op<Scalar>,
const Derived> CwiseArgReturnType;
17typedef CwiseUnaryOp<internal::scalar_carg_op<Scalar>,
const Derived> CwiseCArgReturnType;
18typedef CwiseUnaryOp<internal::scalar_sqrt_op<Scalar>,
const Derived> CwiseSqrtReturnType;
19typedef CwiseUnaryOp<internal::scalar_cbrt_op<Scalar>,
const Derived> CwiseCbrtReturnType;
20typedef CwiseUnaryOp<internal::scalar_square_op<Scalar>,
const Derived> CwiseSquareReturnType;
21typedef CwiseUnaryOp<internal::scalar_sign_op<Scalar>,
const Derived> CwiseSignReturnType;
22typedef CwiseUnaryOp<internal::scalar_inverse_op<Scalar>,
const Derived> CwiseInverseReturnType;
29EIGEN_DOC_UNARY_ADDONS(cwiseAbs, absolute value)
33EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const CwiseAbsReturnType cwiseAbs()
const {
34 return CwiseAbsReturnType(derived());
42EIGEN_DOC_UNARY_ADDONS(cwiseAbs2, squared absolute value)
46EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const CwiseAbs2ReturnType cwiseAbs2()
const {
47 return CwiseAbs2ReturnType(derived());
55EIGEN_DOC_UNARY_ADDONS(cwiseSqrt, square - root)
59EIGEN_DEVICE_FUNC
inline const CwiseSqrtReturnType cwiseSqrt()
const {
return CwiseSqrtReturnType(derived()); }
63EIGEN_DOC_UNARY_ADDONS(cwiseCbrt, cube - root)
67EIGEN_DEVICE_FUNC
inline const CwiseCbrtReturnType cwiseCbrt()
const {
return CwiseCbrtReturnType(derived()); }
71EIGEN_DOC_UNARY_ADDONS(cwiseSquare, square)
75EIGEN_DEVICE_FUNC
inline const CwiseSquareReturnType cwiseSquare()
const {
return CwiseSquareReturnType(derived()); }
82EIGEN_DOC_UNARY_ADDONS(cwiseSign, sign
function)
84EIGEN_DEVICE_FUNC
inline const CwiseSignReturnType cwiseSign()
const {
return CwiseSignReturnType(derived()); }
91EIGEN_DOC_UNARY_ADDONS(cwiseInverse, inverse)
95EIGEN_DEVICE_FUNC
inline const CwiseInverseReturnType cwiseInverse()
const {
return CwiseInverseReturnType(derived()); }
102EIGEN_DOC_UNARY_ADDONS(cwiseArg, arg)
104EIGEN_DEVICE_FUNC
inline const CwiseArgReturnType cwiseArg()
const {
return CwiseArgReturnType(derived()); }
106EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const CwiseCArgReturnType cwiseCArg()
const {
107 return CwiseCArgReturnType(derived());
110template <
typename ScalarExponent>
111using CwisePowReturnType =
112 std::enable_if_t<internal::is_arithmetic<typename NumTraits<ScalarExponent>::Real>::value,
113 CwiseUnaryOp<internal::scalar_unary_pow_op<Scalar, ScalarExponent>,
const Derived>>;
115template <
typename ScalarExponent>
116EIGEN_DEVICE_FUNC
inline const CwisePowReturnType<ScalarExponent> cwisePow(
const ScalarExponent& exponent)
const {
117 return CwisePowReturnType<ScalarExponent>(derived(), internal::scalar_unary_pow_op<Scalar, ScalarExponent>(exponent));