diff --git a/Eigen/src/SVD/SVD.h b/Eigen/src/SVD/SVD.h index d117c1583..da43cc9ca 100644 --- a/Eigen/src/SVD/SVD.h +++ b/Eigen/src/SVD/SVD.h @@ -61,6 +61,8 @@ template class SVD public: + SVD() {} // a user who relied on compiler-generated default compiler reported problems with MSVC in 2.0.7 + SVD(const MatrixType& matrix) : m_matU(matrix.rows(), std::min(matrix.rows(), matrix.cols())), m_matV(matrix.cols(),matrix.cols()), @@ -108,6 +110,7 @@ void SVD::compute(const MatrixType& matrix) const int n = matrix.cols(); const int nu = std::min(m,n); ei_assert(m>=n && "In Eigen 2.0, SVD only works for MxN matrices with M>=N. Sorry!"); + ei_assert(m>1 && "In Eigen 2.0, SVD doesn't work on 1x1 matrices"); m_matU.resize(m, nu); m_matU.setZero(); diff --git a/test/svd.cpp b/test/svd.cpp index 688c3f402..3158782d8 100644 --- a/test/svd.cpp +++ b/test/svd.cpp @@ -95,5 +95,8 @@ void test_svd() // complex are not implemented yet // CALL_SUBTEST( svd(MatrixXcd(6,6)) ); // CALL_SUBTEST( svd(MatrixXcf(3,3)) ); + SVD s; + MatrixXf m = MatrixXf::Random(10,1); + s.compute(m); } }