From e20aceb6ebbc3ba68b9b110897ea5ef0a73c81ba Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Mon, 14 Jan 2008 11:25:09 +0000 Subject: [PATCH] cleanup in Eval; instead introduce convenient typedefs in Matrix for naming special related matrix types: RowType, ColumnType, BlockType --- Eigen/src/Core/Eval.h | 16 +++++++++------- Eigen/src/Core/Matrix.h | 13 +++++++++++++ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/Eigen/src/Core/Eval.h b/Eigen/src/Core/Eval.h index abb8cafcd..b41ee0d7c 100644 --- a/Eigen/src/Core/Eval.h +++ b/Eigen/src/Core/Eval.h @@ -55,13 +55,15 @@ template class Eval : NoOperatorEquals, { public: typedef typename Expression::Scalar Scalar; - typedef Matrix MatrixType; - typedef Expression Base; - friend class MatrixBase; - - Eval(const Expression& expression) : MatrixType(expression) {} + typedef Matrix Base; + + Eval() : Base() {} + explicit Eval(const Expression& other) : Base(other) {} }; /** Evaluates *this, which can be any expression, and returns the obtained matrix. diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h index 6a1d22fda..df68553bf 100644 --- a/Eigen/src/Core/Matrix.h +++ b/Eigen/src/Core/Matrix.h @@ -149,6 +149,19 @@ class Matrix : public MatrixBase<_Scalar, Matrix<_Scalar, _Rows, _Cols, } public: + typedef Matrix< + Scalar, + RowsAtCompileTime == 1 ? 1 : Dynamic, + ColsAtCompileTime == 1 ? 1 : Dynamic, + StorageOrder, + RowsAtCompileTime == 1 ? 1 : MaxRowsAtCompileTime, + ColsAtCompileTime == 1 ? 1 : MaxColsAtCompileTime + > BlockType; + typedef Matrix ColumnType; + typedef Matrix RowType; + /** \returns a const pointer to the data array of this matrix */ const Scalar *data() const { return m_array.data(); }