* fix unit test for rectangular matrices.
 * enforce that rows >= cols since various places in the code assume that.
This commit is contained in:
Benoit Jacob
2010-09-23 09:51:08 -04:00
parent 62bf04b339
commit c253cc3d53
2 changed files with 19 additions and 17 deletions

View File

@@ -38,6 +38,8 @@ template<typename MatrixType, typename Rhs> struct ei_svd_solve_impl;
*
* This class performs a standard SVD decomposition of a real matrix A of size \c M x \c N.
*
* Requires M >= N, in other words, at least as many rows as columns.
*
* \sa MatrixBase::SVD()
*/
template<typename _MatrixType> class SVD
@@ -440,11 +442,8 @@ SVD<MatrixType>& SVD<MatrixType>::compute(const MatrixType& matrix)
}
}
}
m_matU.setZero();
if (m>=n)
m_matU.block(0,0,m,n) = A;
else
m_matU = A.block(0,0,m,m);
m_matU.leftCols(n) = A;
m_matU.rightCols(m-n).setZero();
m_isInitialized = true;
return *this;