diff --git a/Eigen/src/SVD/SVD.h b/Eigen/src/SVD/SVD.h index acc567f94..ddc0de4ce 100644 --- a/Eigen/src/SVD/SVD.h +++ b/Eigen/src/SVD/SVD.h @@ -98,7 +98,6 @@ template class SVD } void compute(const MatrixType& matrix); - SVD& sort(); template void computeUnitaryPositive(UnitaryType *unitary, PositiveType *positive) const; @@ -392,7 +391,7 @@ void SVD::compute(const MatrixType& matrix) for (int i=0; i::compute(const MatrixType& matrix) m_isInitialized = true; } -template -SVD& SVD::sort() -{ - ei_assert(m_isInitialized && "SVD is not initialized."); - - int mu = m_matU.rows(); - int mv = m_matV.rows(); - int n = m_matU.cols(); - - for (int i=0; i p) - { - k = j; - p = m_sigma.coeff(j); - } - } - if (k != i) - { - m_sigma.coeffRef(k) = m_sigma.coeff(i); // i.e. - m_sigma.coeffRef(i) = p; // swaps the i-th and the k-th elements - - int j = mu; - for(int s=0; j!=0; ++s, --j) - std::swap(m_matU.coeffRef(s,i), m_matU.coeffRef(s,k)); - - j = mv; - for (int s=0; j!=0; ++s, --j) - std::swap(m_matV.coeffRef(s,i), m_matV.coeffRef(s,k)); - } - } - return *this; -} - /** \returns the solution of \f$ A x = b \f$ using the current SVD decomposition of A. * The parts of the solution corresponding to zero singular values are ignored. * diff --git a/test/svd.cpp b/test/svd.cpp index 93e5ea017..2ccd94764 100644 --- a/test/svd.cpp +++ b/test/svd.cpp @@ -95,7 +95,6 @@ template void svd_verify_assert() VERIFY_RAISES_ASSERT(svd.matrixU()) VERIFY_RAISES_ASSERT(svd.singularValues()) VERIFY_RAISES_ASSERT(svd.matrixV()) - VERIFY_RAISES_ASSERT(svd.sort()) VERIFY_RAISES_ASSERT(svd.computeUnitaryPositive(&tmp,&tmp)) VERIFY_RAISES_ASSERT(svd.computePositiveUnitary(&tmp,&tmp)) VERIFY_RAISES_ASSERT(svd.computeRotationScaling(&tmp,&tmp))