From e798466871ceef80a5bd78eba460735fca829a8c Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 11 Apr 2018 10:46:11 +0200 Subject: bug #1538: update manual pages regarding BDCSVD. --- doc/LeastSquares.dox | 2 +- doc/TopicLinearAlgebraDecompositions.dox | 14 +++++++++++++- doc/TutorialLinearAlgebra.dox | 28 ++++++++++++++++++++++++---- doc/examples/TutorialLinAlgSVDSolve.cpp | 2 +- 4 files changed, 39 insertions(+), 7 deletions(-) diff --git a/doc/LeastSquares.dox b/doc/LeastSquares.dox index e2191a22f..24dfe4b4f 100644 --- a/doc/LeastSquares.dox +++ b/doc/LeastSquares.dox @@ -16,7 +16,7 @@ equations is the fastest but least accurate, and the QR decomposition is in betw \section LeastSquaresSVD Using the SVD decomposition -The \link JacobiSVD::solve() solve() \endlink method in the JacobiSVD class can be directly used to +The \link BDCSVD::solve() solve() \endlink method in the BDCSVD class can be directly used to solve linear squares systems. It is not enough to compute only the singular values (the default for this class); you also need the singular vectors but the thin SVD decomposition suffices for computing least squares solutions: diff --git a/doc/TopicLinearAlgebraDecompositions.dox b/doc/TopicLinearAlgebraDecompositions.dox index 991f964cc..0965da872 100644 --- a/doc/TopicLinearAlgebraDecompositions.dox +++ b/doc/TopicLinearAlgebraDecompositions.dox @@ -4,7 +4,7 @@ namespace Eigen { This page presents a catalogue of the dense matrix decompositions offered by Eigen. For an introduction on linear solvers and decompositions, check this \link TutorialLinearAlgebra page \endlink. -To get an overview of the true relative speed of the different decomposition, check this \link DenseDecompositionBenchmark benchmark \endlink. +To get an overview of the true relative speed of the different decompositions, check this \link DenseDecompositionBenchmark benchmark \endlink. \section TopicLinAlgBigTable Catalogue of decompositions offered by Eigen @@ -113,6 +113,18 @@ To get an overview of the true relative speed of the different decomposition, ch \n Singular values and eigenvalues decompositions + + BDCSVD (divide \& conquer) + - + One of the fastest SVD algorithms + Excellent + Yes + Singular values/vectors, least squares + Yes (and does least squares) + Excellent + Blocked bidiagonalization + + JacobiSVD (two-sided) - diff --git a/doc/TutorialLinearAlgebra.dox b/doc/TutorialLinearAlgebra.dox index cb92ceeae..a72724143 100644 --- a/doc/TutorialLinearAlgebra.dox +++ b/doc/TutorialLinearAlgebra.dox @@ -73,7 +73,7 @@ depending on your matrix and the trade-off you want to make: ColPivHouseholderQR colPivHouseholderQr() None - ++ + + - +++ @@ -85,6 +85,14 @@ depending on your matrix and the trade-off you want to make: - - +++ + + CompleteOrthogonalDecomposition + completeOrthogonalDecomposition() + None + + + - + +++ + LLT llt() @@ -101,15 +109,24 @@ depending on your matrix and the trade-off you want to make: + ++ + + BDCSVD + bdcSvd() + None + - + - + +++ + JacobiSVD jacobiSvd() None - - - + - - - - +++ +To get an overview of the true relative speed of the different decompositions, check this \link DenseDecompositionBenchmark benchmark \endlink. All of these decompositions offer a solve() method that works as in the above example. @@ -183,8 +200,11 @@ Here is an example: \section TutorialLinAlgLeastsquares Least squares solving -The most accurate method to do least squares solving is with a SVD decomposition. Eigen provides one -as the JacobiSVD class, and its solve() is doing least-squares solving. +The most accurate method to do least squares solving is with a SVD decomposition. +Eigen provides two implementations. +The recommended one is the BDCSVD class, which scale well for large problems +and automatically fall-back to the JacobiSVD class for smaller problems. +For both classes, their solve() method is doing least-squares solving. Here is an example: diff --git a/doc/examples/TutorialLinAlgSVDSolve.cpp b/doc/examples/TutorialLinAlgSVDSolve.cpp index 9fbc031de..f109f04e5 100644 --- a/doc/examples/TutorialLinAlgSVDSolve.cpp +++ b/doc/examples/TutorialLinAlgSVDSolve.cpp @@ -11,5 +11,5 @@ int main() VectorXf b = VectorXf::Random(3); cout << "Here is the right hand side b:\n" << b << endl; cout << "The least-squares solution is:\n" - << A.jacobiSvd(ComputeThinU | ComputeThinV).solve(b) << endl; + << A.bdcSvd(ComputeThinU | ComputeThinV).solve(b) << endl; } -- cgit v1.2.3