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

@@ -40,7 +40,6 @@ template<typename MatrixType> void lu_non_invertible()
typename ei_lu_kernel_impl<MatrixType>::ReturnMatrixType m1kernel = lu.kernel();
typename ei_lu_image_impl <MatrixType>::ReturnMatrixType m1image = lu.image();
std::cout << "rows:" << rows << " cols:" << cols << " | " << rank << " ----- " << lu.rank() << std::endl;
VERIFY(rank == lu.rank());
VERIFY(cols - lu.rank() == lu.dimensionOfKernel());
VERIFY(!lu.isInjective());
@@ -54,7 +53,8 @@ template<typename MatrixType> void lu_non_invertible()
m2 = MatrixType::Random(cols,cols2);
m3 = m1*m2;
m2 = MatrixType::Random(cols,cols2);
m2 = lu.solve(m3);
// test that the code, which does resize(), may be applied to an xpr
m2.block(0,0,cols,cols2) = lu.solve(m3);
VERIFY_IS_APPROX(m3, m1*m2);
typedef Matrix<typename MatrixType::Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> SquareMatrixType;