mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fixes #1387 for compilation error in JacobiSVD with HouseholderQRPreconditioner that occurs when input is a compile-time row vector.
This commit is contained in:
@@ -36,6 +36,9 @@ void jacobisvd(const MatrixType& a = MatrixType(), bool pickrandom = true)
|
||||
template<typename MatrixType> void jacobisvd_verify_assert(const MatrixType& m)
|
||||
{
|
||||
svd_verify_assert<JacobiSVD<MatrixType> >(m);
|
||||
svd_verify_assert<JacobiSVD<MatrixType, FullPivHouseholderQRPreconditioner> >(m, true);
|
||||
svd_verify_assert<JacobiSVD<MatrixType, ColPivHouseholderQRPreconditioner> >(m);
|
||||
svd_verify_assert<JacobiSVD<MatrixType, HouseholderQRPreconditioner> >(m);
|
||||
Index rows = m.rows();
|
||||
Index cols = m.cols();
|
||||
|
||||
|
||||
@@ -462,7 +462,7 @@ void svd_preallocate()
|
||||
}
|
||||
|
||||
template<typename SvdType,typename MatrixType>
|
||||
void svd_verify_assert(const MatrixType& m)
|
||||
void svd_verify_assert(const MatrixType& m, bool fullOnly = false)
|
||||
{
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
Index rows = m.rows();
|
||||
@@ -489,8 +489,17 @@ void svd_verify_assert(const MatrixType& m)
|
||||
VERIFY_RAISES_ASSERT(svd.matrixV())
|
||||
svd.singularValues();
|
||||
VERIFY_RAISES_ASSERT(svd.solve(rhs))
|
||||
|
||||
if (ColsAtCompileTime == Dynamic)
|
||||
|
||||
svd.compute(a, ComputeFullU);
|
||||
svd.matrixU();
|
||||
VERIFY_RAISES_ASSERT(svd.matrixV())
|
||||
VERIFY_RAISES_ASSERT(svd.solve(rhs))
|
||||
svd.compute(a, ComputeFullV);
|
||||
svd.matrixV();
|
||||
VERIFY_RAISES_ASSERT(svd.matrixU())
|
||||
VERIFY_RAISES_ASSERT(svd.solve(rhs))
|
||||
|
||||
if (!fullOnly && ColsAtCompileTime == Dynamic)
|
||||
{
|
||||
svd.compute(a, ComputeThinU);
|
||||
svd.matrixU();
|
||||
|
||||
Reference in New Issue
Block a user