allow to do xpr = solve(b) etc... just by adding a dummy MatrixBase::resize()

This commit is contained in:
Benoit Jacob
2009-09-22 01:41:09 -04:00
parent 4f9e270343
commit 176c26feb5
2 changed files with 17 additions and 4 deletions

View File

@@ -189,11 +189,24 @@ template<typename Derived> class MatrixBase
/** \returns the size of the inner dimension according to the storage order,
* i.e., the number of rows for a columns major matrix, and the number of cols otherwise */
int innerSize() const { return (int(Flags)&RowMajorBit) ? this->cols() : this->rows(); }
/** Only plain matrices, not expressions may be resized; therefore the only useful resize method is
* Matrix::resize(). The present method only asserts that the new size equals the old size, and does
* nothing else.
*/
void resize(int size)
{ ei_assert(size == this->size() && "MatrixBase::resize() does not actually allow to resize."); }
/** Only plain matrices, not expressions may be resized; therefore the only useful resize method is
* Matrix::resize(). The present method only asserts that the new size equals the old size, and does
* nothing else.
*/
void resize(int rows, int cols)
{ ei_assert(rows == this->rows() && cols == this->cols() && "MatrixBase::resize() does not actually allow to resize."); }
#ifndef EIGEN_PARSED_BY_DOXYGEN
/** \internal the plain matrix type corresponding to this expression. Note that is not necessarily
* exactly the return type of eval(): in the case of plain matrices, the return type of eval() is a const
* reference to a matrix, not a matrix! It guaranteed however, that the return type of eval() is either
* reference to a matrix, not a matrix! It is however guaranteed that the return type of eval() is either
* PlainMatrixType or const PlainMatrixType&.
*/
typedef typename ei_plain_matrix_type<Derived>::type PlainMatrixType;