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()); }
66EIGEN_DOC_UNARY_ADDONS(cwiseCbrt, cube - root)
70EIGEN_DEVICE_FUNC
inline const CwiseCbrtReturnType cwiseCbrt()
const {
return CwiseCbrtReturnType(derived()); }
74EIGEN_DOC_UNARY_ADDONS(cwiseSquare, square)
78EIGEN_DEVICE_FUNC
inline const CwiseSquareReturnType cwiseSquare()
const {
return CwiseSquareReturnType(derived()); }
85EIGEN_DOC_UNARY_ADDONS(cwiseSign, sign
function)
87EIGEN_DEVICE_FUNC
inline const CwiseSignReturnType cwiseSign()
const {
return CwiseSignReturnType(derived()); }
94EIGEN_DOC_UNARY_ADDONS(cwiseInverse, inverse)
98EIGEN_DEVICE_FUNC
inline const CwiseInverseReturnType cwiseInverse()
const {
return CwiseInverseReturnType(derived()); }
105EIGEN_DOC_UNARY_ADDONS(cwiseArg, arg)
107EIGEN_DEVICE_FUNC
inline const CwiseArgReturnType cwiseArg()
const {
return CwiseArgReturnType(derived()); }
109EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const CwiseCArgReturnType cwiseCArg()
const {
110 return CwiseCArgReturnType(derived());
113template <
typename ScalarExponent>
114using CwisePowReturnType =
115 std::enable_if_t<internal::is_arithmetic<typename NumTraits<ScalarExponent>::Real>::value,
116 CwiseUnaryOp<internal::scalar_unary_pow_op<Scalar, ScalarExponent>,
const Derived>>;
118template <
typename ScalarExponent>
119EIGEN_DEVICE_FUNC
inline const CwisePowReturnType<ScalarExponent> cwisePow(
const ScalarExponent& exponent)
const {
120 return CwisePowReturnType<ScalarExponent>(derived(), internal::scalar_unary_pow_op<Scalar, ScalarExponent>(exponent));