13 #ifndef EIGEN_PARSED_BY_DOXYGEN 16 typedef CwiseUnaryOp<internal::scalar_multiple_op<Scalar>,
const Derived> ScalarMultipleReturnType;
17 typedef CwiseUnaryOp<internal::scalar_multiple2_op<Scalar,std::complex<Scalar> >,
const Derived> ScalarComplexMultipleReturnType;
20 typedef CwiseUnaryOp<internal::scalar_quotient1_op<Scalar>,
const Derived> ScalarQuotient1ReturnType;
22 typedef typename internal::conditional<NumTraits<Scalar>::IsComplex,
23 const CwiseUnaryOp<internal::scalar_conjugate_op<Scalar>,
const Derived>,
25 >::type ConjugateReturnType;
27 typedef typename internal::conditional<NumTraits<Scalar>::IsComplex,
28 const CwiseUnaryOp<internal::scalar_real_op<Scalar>,
const Derived>,
30 >::type RealReturnType;
32 typedef typename internal::conditional<NumTraits<Scalar>::IsComplex,
33 CwiseUnaryView<internal::scalar_real_ref_op<Scalar>, Derived>,
35 >::type NonConstRealReturnType;
37 typedef CwiseUnaryOp<internal::scalar_imag_op<Scalar>,
const Derived> ImagReturnType;
39 typedef CwiseUnaryView<internal::scalar_imag_ref_op<Scalar>, Derived> NonConstImagReturnType;
41 typedef CwiseUnaryOp<internal::scalar_opposite_op<Scalar>,
const Derived> NegativeReturnType;
44 #endif // not EIGEN_PARSED_BY_DOXYGEN 49 inline const NegativeReturnType
50 operator-()
const {
return NegativeReturnType(derived()); }
55 inline const ScalarMultipleReturnType
56 operator*(
const Scalar& scalar)
const 58 return ScalarMultipleReturnType(derived(), internal::scalar_multiple_op<Scalar>(scalar));
61 #ifdef EIGEN_PARSED_BY_DOXYGEN 62 const ScalarMultipleReturnType operator*(
const RealScalar& scalar)
const;
67 inline const ScalarQuotient1ReturnType
68 operator/(
const Scalar& scalar)
const 70 return ScalarQuotient1ReturnType(derived(), internal::scalar_quotient1_op<Scalar>(scalar));
75 inline const ScalarComplexMultipleReturnType
76 operator*(
const std::complex<Scalar>& scalar)
const 78 return ScalarComplexMultipleReturnType(derived(), internal::scalar_multiple2_op<Scalar,std::complex<Scalar> >(scalar));
82 inline friend const ScalarMultipleReturnType
83 operator*(
const Scalar& scalar,
const StorageBaseType& matrix)
84 {
return matrix*scalar; }
87 inline friend const CwiseUnaryOp<internal::scalar_multiple2_op<Scalar,std::complex<Scalar> >,
const Derived>
88 operator*(
const std::complex<Scalar>& scalar,
const StorageBaseType& matrix)
89 {
return matrix*scalar; }
92 template<
class NewType>
struct CastXpr {
typedef typename internal::cast_return_type<Derived,const CwiseUnaryOp<internal::scalar_cast_op<Scalar, NewType>,
const Derived> >::type Type; };
101 template<
typename NewType>
103 typename CastXpr<NewType>::Type
106 return typename CastXpr<NewType>::Type(derived());
113 inline ConjugateReturnType
116 return ConjugateReturnType(derived());
123 inline RealReturnType
124 real()
const {
return RealReturnType(derived()); }
130 inline const ImagReturnType
131 imag()
const {
return ImagReturnType(derived()); }
152 template<
typename CustomUnaryOp>
154 inline const CwiseUnaryOp<CustomUnaryOp, const Derived>
155 unaryExpr(
const CustomUnaryOp& func = CustomUnaryOp())
const 157 return CwiseUnaryOp<CustomUnaryOp, const Derived>(derived(), func);
171 template<
typename CustomViewOp>
173 inline const CwiseUnaryView<CustomViewOp, const Derived>
174 unaryViewExpr(
const CustomViewOp& func = CustomViewOp())
const 176 return CwiseUnaryView<CustomViewOp, const Derived>(derived(), func);
183 inline NonConstRealReturnType
184 real() {
return NonConstRealReturnType(derived()); }
190 inline NonConstImagReturnType
191 imag() {
return NonConstImagReturnType(derived()); }