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:
Benoit Jacob
2008-01-13 19:55:23 +00:00
parent e05a1aba1d
commit 89a134ba0b
29 changed files with 280 additions and 292 deletions

View File

@@ -79,7 +79,43 @@ template<typename Scalar, typename Derived> class MatrixBase
= Derived::RowsAtCompileTime == Dynamic || Derived::ColsAtCompileTime == Dynamic
? Dynamic : Derived::RowsAtCompileTime * Derived::ColsAtCompileTime
};
/** This value is equal to the maximum possible number of rows that this expression
* might have. If this expression might have an arbitrarily high number of rows,
* this value is set to \a Dynamic.
*
* This value is useful to know when evaluating an expression, in order to determine
* whether it is possible to avoid doing a dynamic memory allocation.
*
* \sa RowsAtCompileTime, MaxColsAtCompileTime, MaxSizeAtCompileTime
*/
enum { MaxRowsAtCompileTime = Derived::MaxRowsAtCompileTime };
/** This value is equal to the maximum possible number of columns that this expression
* might have. If this expression might have an arbitrarily high number of columns,
* this value is set to \a Dynamic.
*
* This value is useful to know when evaluating an expression, in order to determine
* whether it is possible to avoid doing a dynamic memory allocation.
*
* \sa ColsAtCompileTime, MaxRowsAtCompileTime, MaxSizeAtCompileTime
*/
enum { MaxColsAtCompileTime = Derived::MaxColsAtCompileTime };
/** This value is equal to the maximum possible number of coefficients that this expression
* might have. If this expression might have an arbitrarily high number of coefficients,
* this value is set to \a Dynamic.
*
* This value is useful to know when evaluating an expression, in order to determine
* whether it is possible to avoid doing a dynamic memory allocation.
*
* \sa SizeAtCompileTime, MaxRowsAtCompileTime, MaxColsAtCompileTime
*/
enum { MaxSizeAtCompileTime
= Derived::MaxRowsAtCompileTime == Dynamic || Derived::MaxColsAtCompileTime == Dynamic
? Dynamic : Derived::MaxRowsAtCompileTime * Derived::MaxColsAtCompileTime
};
/** This is set to true if either the number of rows or the number of
* columns is known at compile-time to be equal to 1. Indeed, in that case,
* we are dealing with a column-vector (if there is only one column) or with