mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-03-25 18:50:40 +08:00
cleanup in Eval; instead introduce convenient typedefs in Matrix
for naming special related matrix types: RowType, ColumnType, BlockType
This commit is contained in:
parent
183bf54d27
commit
e20aceb6eb
@ -55,13 +55,15 @@ template<typename Expression> class Eval : NoOperatorEquals,
|
||||
{
|
||||
public:
|
||||
typedef typename Expression::Scalar Scalar;
|
||||
typedef Matrix<Scalar, Expression::Traits::RowsAtCompileTime, Expression::Traits::ColsAtCompileTime, EIGEN_DEFAULT_MATRIX_STORAGE_ORDER,
|
||||
Expression::Traits::MaxRowsAtCompileTime,
|
||||
Expression::Traits::MaxColsAtCompileTime> MatrixType;
|
||||
typedef Expression Base;
|
||||
friend class MatrixBase<Scalar, Expression>;
|
||||
|
||||
Eval(const Expression& expression) : MatrixType(expression) {}
|
||||
typedef Matrix<Scalar,
|
||||
Expression::Traits::RowsAtCompileTime,
|
||||
Expression::Traits::ColsAtCompileTime,
|
||||
EIGEN_DEFAULT_MATRIX_STORAGE_ORDER,
|
||||
Expression::Traits::MaxRowsAtCompileTime,
|
||||
Expression::Traits::MaxColsAtCompileTime> Base;
|
||||
|
||||
Eval() : Base() {}
|
||||
explicit Eval(const Expression& other) : Base(other) {}
|
||||
};
|
||||
|
||||
/** Evaluates *this, which can be any expression, and returns the obtained matrix.
|
||||
|
@ -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<Scalar, RowsAtCompileTime, 1,
|
||||
StorageOrder, MaxRowsAtCompileTime, 1> ColumnType;
|
||||
typedef Matrix<Scalar, 1, ColsAtCompileTime,
|
||||
StorageOrder, 1, MaxColsAtCompileTime> RowType;
|
||||
|
||||
/** \returns a const pointer to the data array of this matrix */
|
||||
const Scalar *data() const
|
||||
{ return m_array.data(); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user