Warning, file /include/eigen3/Eigen/src/plugins/CommonCwiseUnaryOps.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef EIGEN_PARSED_BY_DOXYGEN
0014
0015
0016 typedef typename internal::conditional<NumTraits<Scalar>::IsComplex,
0017 const CwiseUnaryOp<internal::scalar_conjugate_op<Scalar>, const Derived>,
0018 const Derived&
0019 >::type ConjugateReturnType;
0020
0021 typedef typename internal::conditional<NumTraits<Scalar>::IsComplex,
0022 const CwiseUnaryOp<internal::scalar_real_op<Scalar>, const Derived>,
0023 const Derived&
0024 >::type RealReturnType;
0025
0026 typedef typename internal::conditional<NumTraits<Scalar>::IsComplex,
0027 CwiseUnaryView<internal::scalar_real_ref_op<Scalar>, Derived>,
0028 Derived&
0029 >::type NonConstRealReturnType;
0030
0031 typedef CwiseUnaryOp<internal::scalar_imag_op<Scalar>, const Derived> ImagReturnType;
0032
0033 typedef CwiseUnaryView<internal::scalar_imag_ref_op<Scalar>, Derived> NonConstImagReturnType;
0034
0035 typedef CwiseUnaryOp<internal::scalar_opposite_op<Scalar>, const Derived> NegativeReturnType;
0036
0037 #endif
0038
0039
0040
0041 EIGEN_DOC_UNARY_ADDONS(operator-,opposite)
0042
0043 EIGEN_DEVICE_FUNC
0044 inline const NegativeReturnType
0045 operator-() const { return NegativeReturnType(derived()); }
0046
0047
0048 template<class NewType> struct CastXpr { typedef typename internal::cast_return_type<Derived,const CwiseUnaryOp<internal::scalar_cast_op<Scalar, NewType>, const Derived> >::type Type; };
0049
0050
0051
0052
0053
0054
0055 EIGEN_DOC_UNARY_ADDONS(cast,conversion function)
0056
0057
0058
0059 template<typename NewType>
0060 EIGEN_DEVICE_FUNC
0061 typename CastXpr<NewType>::Type
0062 cast() const
0063 {
0064 return typename CastXpr<NewType>::Type(derived());
0065 }
0066
0067
0068
0069 EIGEN_DOC_UNARY_ADDONS(conjugate,complex conjugate)
0070
0071
0072 EIGEN_DEVICE_FUNC
0073 inline ConjugateReturnType
0074 conjugate() const
0075 {
0076 return ConjugateReturnType(derived());
0077 }
0078
0079
0080
0081 EIGEN_DOC_UNARY_ADDONS(conjugate,complex conjugate)
0082
0083
0084 template<bool Cond>
0085 EIGEN_DEVICE_FUNC
0086 inline typename internal::conditional<Cond,ConjugateReturnType,const Derived&>::type
0087 conjugateIf() const
0088 {
0089 typedef typename internal::conditional<Cond,ConjugateReturnType,const Derived&>::type ReturnType;
0090 return ReturnType(derived());
0091 }
0092
0093
0094
0095 EIGEN_DOC_UNARY_ADDONS(real,real part function)
0096
0097
0098 EIGEN_DEVICE_FUNC
0099 inline RealReturnType
0100 real() const { return RealReturnType(derived()); }
0101
0102
0103
0104 EIGEN_DOC_UNARY_ADDONS(imag,imaginary part function)
0105
0106
0107 EIGEN_DEVICE_FUNC
0108 inline const ImagReturnType
0109 imag() const { return ImagReturnType(derived()); }
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128 EIGEN_DOC_UNARY_ADDONS(unaryExpr,unary function)
0129
0130
0131
0132 template<typename CustomUnaryOp>
0133 EIGEN_DEVICE_FUNC
0134 inline const CwiseUnaryOp<CustomUnaryOp, const Derived>
0135 unaryExpr(const CustomUnaryOp& func = CustomUnaryOp()) const
0136 {
0137 return CwiseUnaryOp<CustomUnaryOp, const Derived>(derived(), func);
0138 }
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149 EIGEN_DOC_UNARY_ADDONS(unaryViewExpr,unary function)
0150
0151
0152
0153 template<typename CustomViewOp>
0154 EIGEN_DEVICE_FUNC
0155 inline const CwiseUnaryView<CustomViewOp, const Derived>
0156 unaryViewExpr(const CustomViewOp& func = CustomViewOp()) const
0157 {
0158 return CwiseUnaryView<CustomViewOp, const Derived>(derived(), func);
0159 }
0160
0161
0162
0163 EIGEN_DOC_UNARY_ADDONS(real,real part function)
0164
0165
0166 EIGEN_DEVICE_FUNC
0167 inline NonConstRealReturnType
0168 real() { return NonConstRealReturnType(derived()); }
0169
0170
0171
0172 EIGEN_DOC_UNARY_ADDONS(imag,imaginary part function)
0173
0174
0175 EIGEN_DEVICE_FUNC
0176 inline NonConstImagReturnType
0177 imag() { return NonConstImagReturnType(derived()); }