aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/MatrixBase.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2009-05-20 15:41:23 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2009-05-20 15:41:23 +0200
commitdd45c4805ced4ad8ead743875f42259e9b6a2795 (patch)
tree22ba6d80c2f8d60721e38adf579ffb6bba23d0f5 /Eigen/src/Core/MatrixBase.h
parent6ecd02d7ec85f07e02559cb311d4dd07e844a72d (diff)
* add a writable generic coeff wise expression (CwiseUnaryView)
* add writable .real() and .imag() functions
Diffstat (limited to 'Eigen/src/Core/MatrixBase.h')
-rw-r--r--Eigen/src/Core/MatrixBase.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h
index 7df9f307b..4e689f614 100644
--- a/Eigen/src/Core/MatrixBase.h
+++ b/Eigen/src/Core/MatrixBase.h
@@ -217,10 +217,20 @@ template<typename Derived> class MatrixBase
const CwiseUnaryOp<ei_scalar_conjugate_op<Scalar>, Derived>,
const Derived&
>::ret ConjugateReturnType;
+ /** \internal the return type of MatrixBase::real() const */
+ typedef typename ei_meta_if<NumTraits<Scalar>::IsComplex,
+ const CwiseUnaryOp<ei_scalar_real_op<Scalar>, Derived>,
+ const Derived&
+ >::ret RealReturnType;
/** \internal the return type of MatrixBase::real() */
- typedef CwiseUnaryOp<ei_scalar_real_op<Scalar>, Derived> RealReturnType;
- /** \internal the return type of MatrixBase::imag() */
+ typedef typename ei_meta_if<NumTraits<Scalar>::IsComplex,
+ CwiseUnaryView<ei_scalar_real_op<Scalar>, Derived>,
+ Derived&
+ >::ret NonConstRealReturnType;
+ /** \internal the return type of MatrixBase::imag() const */
typedef CwiseUnaryOp<ei_scalar_imag_op<Scalar>, Derived> ImagReturnType;
+ /** \internal the return type of MatrixBase::imag() */
+ typedef CwiseUnaryView<ei_scalar_imag_op<Scalar>, Derived> NonConstImagReturnType;
/** \internal the return type of MatrixBase::adjoint() */
typedef Eigen::Transpose<NestByValue<typename ei_cleantype<ConjugateReturnType>::type> >
AdjointReturnType;
@@ -543,11 +553,16 @@ template<typename Derived> class MatrixBase
ConjugateReturnType conjugate() const;
- const RealReturnType real() const;
+ RealReturnType real() const;
+ NonConstRealReturnType real();
const ImagReturnType imag() const;
+ NonConstImagReturnType imag();
template<typename CustomUnaryOp>
const CwiseUnaryOp<CustomUnaryOp, Derived> unaryExpr(const CustomUnaryOp& func = CustomUnaryOp()) const;
+
+ template<typename CustomViewOp>
+ const CwiseUnaryView<CustomViewOp, Derived> unaryViewExpr(const CustomViewOp& func = CustomViewOp()) const;
template<typename CustomBinaryOp, typename OtherDerived>
const CwiseBinaryOp<CustomBinaryOp, Derived, OtherDerived>