From 89a134ba0b40b7cfc4554e3f06813fd32bbe2ede Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Sun, 13 Jan 2008 19:55:23 +0000 Subject: 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. --- Eigen/src/Core/Ones.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Eigen/src/Core/Ones.h') diff --git a/Eigen/src/Core/Ones.h b/Eigen/src/Core/Ones.h index 1d3ee6af0..02011ec48 100644 --- a/Eigen/src/Core/Ones.h +++ b/Eigen/src/Core/Ones.h @@ -43,12 +43,14 @@ template class Ones : NoOperatorEquals, private: enum { RowsAtCompileTime = MatrixType::Traits::RowsAtCompileTime, - ColsAtCompileTime = MatrixType::Traits::ColsAtCompileTime + ColsAtCompileTime = MatrixType::Traits::ColsAtCompileTime, + MaxRowsAtCompileTime = MatrixType::Traits::MaxRowsAtCompileTime, + MaxColsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime }; const Ones& _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, int) const { @@ -65,7 +67,8 @@ template class Ones : NoOperatorEquals, } protected: - const int m_rows, m_cols; + const IntAtRunTimeIfDynamic m_rows; + const IntAtRunTimeIfDynamic m_cols; }; /** \returns an expression of a matrix where all coefficients equal one. -- cgit v1.2.3