mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
big architecture change dissociating "actual" dimensions from "maximum possible"
dimension. The advantage is that evaluating a dynamic-sized block in a fixed-size matrix no longer causes a dynamic memory allocation. Other new thing: IntAtRunTimeIfDynamic allows storing an integer at zero cost if it is known at compile time.
This commit is contained in:
@@ -50,12 +50,14 @@ template<typename MatrixType> class Identity : NoOperatorEquals,
|
||||
private:
|
||||
enum {
|
||||
RowsAtCompileTime = MatrixType::Traits::RowsAtCompileTime,
|
||||
ColsAtCompileTime = MatrixType::Traits::ColsAtCompileTime
|
||||
ColsAtCompileTime = MatrixType::Traits::ColsAtCompileTime,
|
||||
MaxRowsAtCompileTime = MatrixType::Traits::MaxRowsAtCompileTime,
|
||||
MaxColsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime
|
||||
};
|
||||
|
||||
const Identity& _ref() const { return *this; }
|
||||
int _rows() const { return m_rows; }
|
||||
int _cols() const { return m_cols; }
|
||||
int _rows() const { return m_rows.value(); }
|
||||
int _cols() const { return m_cols.value(); }
|
||||
|
||||
Scalar _coeff(int row, int col) const
|
||||
{
|
||||
@@ -63,7 +65,8 @@ template<typename MatrixType> class Identity : NoOperatorEquals,
|
||||
}
|
||||
|
||||
protected:
|
||||
const int m_rows, m_cols;
|
||||
const IntAtRunTimeIfDynamic<RowsAtCompileTime> m_rows;
|
||||
const IntAtRunTimeIfDynamic<ColsAtCompileTime> m_cols;
|
||||
};
|
||||
|
||||
/** \returns an expression of the identity matrix (not necessarily square).
|
||||
|
||||
Reference in New Issue
Block a user