From 407b6208604d2822b1067ac64949e78a9167572b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 12 Nov 2018 06:42:35 +0100 Subject: eigen update --- eigen/doc/LeastSquares.dox | 2 +- eigen/doc/Pitfalls.dox | 6 +++++ eigen/doc/PreprocessorDirectives.dox | 4 ++++ eigen/doc/TopicLinearAlgebraDecompositions.dox | 14 ++++++++++- eigen/doc/TutorialLinearAlgebra.dox | 28 ++++++++++++++++++---- eigen/doc/UsingIntelMKL.dox | 2 ++ eigen/doc/eigen_navtree_hacks.js | 4 ++++ eigen/doc/eigendoxy.css | 5 ++++ eigen/doc/eigendoxy_footer.html.in | 4 ++-- eigen/doc/eigendoxy_header.html.in | 18 +++++++------- eigen/doc/examples/Cwise_lgamma.cpp | 2 +- eigen/doc/examples/TutorialLinAlgSVDSolve.cpp | 2 +- .../Tutorial_simple_example_dynamic_size.cpp | 2 +- eigen/doc/examples/matrixfree_cg.cpp | 1 + .../special_examples/Tutorial_sparse_example.cpp | 6 ++++- 15 files changed, 78 insertions(+), 22 deletions(-) (limited to 'eigen/doc') diff --git a/eigen/doc/LeastSquares.dox b/eigen/doc/LeastSquares.dox index e2191a2..24dfe4b 100644 --- a/eigen/doc/LeastSquares.dox +++ b/eigen/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/eigen/doc/Pitfalls.dox b/eigen/doc/Pitfalls.dox index cf42eff..3f39505 100644 --- a/eigen/doc/Pitfalls.dox +++ b/eigen/doc/Pitfalls.dox @@ -2,10 +2,16 @@ namespace Eigen { /** \page TopicPitfalls Common pitfalls + \section TopicPitfalls_template_keyword Compilation error with template methods See this \link TopicTemplateKeyword page \endlink. +\section TopicPitfalls_aliasing Aliasing + +Don't miss this \link TopicAliasing page \endlink on aliasing, +especially if you got wrong results in statements where the destination appears on the right hand side of the expression. + \section TopicPitfalls_auto_keyword C++11 and the auto keyword In short: do not use the auto keywords with Eigen's expressions, unless you are 100% sure about what you are doing. In particular, do not use the auto keyword as a replacement for a Matrix<> type. Here is an example: diff --git a/eigen/doc/PreprocessorDirectives.dox b/eigen/doc/PreprocessorDirectives.dox index f01b39a..40cceb9 100644 --- a/eigen/doc/PreprocessorDirectives.dox +++ b/eigen/doc/PreprocessorDirectives.dox @@ -120,6 +120,10 @@ run time. However, these assertions do cost time and can thus be turned off. - \b \c EIGEN_STACK_ALLOCATION_LIMIT - defines the maximum bytes for a buffer to be allocated on the stack. For internal temporary buffers, dynamic memory allocation is employed as a fall back. For fixed-size matrices or arrays, exceeding this threshold raises a compile time assertion. Use 0 to set no limit. Default is 128 KB. + - \b \c EIGEN_STRONG_INLINE - This macro is used to qualify critical functions and methods that we expect the compiler to inline. + By default it is defined to \c __forceinline for MSVC and ICC, and to \c inline for other compilers. A tipical usage is to + define it to \c inline for MSVC users wanting faster compilation times, at the risk of performance degradations in some rare + cases for which MSVC inliner fails to do a good job. - \c EIGEN_DONT_ALIGN - Deprecated, it is a synonym for \c EIGEN_MAX_ALIGN_BYTES=0. It disables alignment completely. %Eigen will not try to align its objects and does not expect that any objects passed to it are aligned. This will turn off vectorization if \b EIGEN_UNALIGNED_VECTORIZE=1. Not defined by default. diff --git a/eigen/doc/TopicLinearAlgebraDecompositions.dox b/eigen/doc/TopicLinearAlgebraDecompositions.dox index 4914706..d9db677 100644 --- a/eigen/doc/TopicLinearAlgebraDecompositions.dox +++ b/eigen/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/eigen/doc/TutorialLinearAlgebra.dox b/eigen/doc/TutorialLinearAlgebra.dox index cb92cee..a727241 100644 --- a/eigen/doc/TutorialLinearAlgebra.dox +++ b/eigen/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/eigen/doc/UsingIntelMKL.dox b/eigen/doc/UsingIntelMKL.dox index a1a3a18..6de14af 100644 --- a/eigen/doc/UsingIntelMKL.dox +++ b/eigen/doc/UsingIntelMKL.dox @@ -63,6 +63,8 @@ In addition you can choose which parts will be substituted by defining one or mu
\c EIGEN_USE_MKL_ALL Defines \c EIGEN_USE_BLAS, \c EIGEN_USE_LAPACKE, and \c EIGEN_USE_MKL_VML
+The options can be combined with \b MKL_DIRECT_CALL to enable MKL direct call feature. This may help to increase performance of some MKL BLAS (?GEMM, ?GEMV, ?TRSM, ?AXPY and ?DOT) and LAPACK (LU, Cholesky and QR) routines for very small matrices. To make it work properly, the macro \c EIGEN_USE_MKL must also be defined in the case none of the other \c EIGEN_USE_MKL_* macros has been defined. + Note that the BLAS and LAPACKE backends can be enabled for any F77 compatible BLAS and LAPACK libraries. See this \link TopicUsingBlasLapack page \endlink for the details. Finally, the PARDISO sparse solver shipped with Intel MKL can be used through the \ref PardisoLU, \ref PardisoLLT and \ref PardisoLDLT classes of the \ref PardisoSupport_Module. diff --git a/eigen/doc/eigen_navtree_hacks.js b/eigen/doc/eigen_navtree_hacks.js index bd7e02b..39c59f7 100644 --- a/eigen/doc/eigen_navtree_hacks.js +++ b/eigen/doc/eigen_navtree_hacks.js @@ -65,6 +65,10 @@ function getNode(o, po) function resizeHeight() { var toc = $("#nav-toc"); + var header = $("#header"); + var content = $("#doc-content"); + var navtree = $("#nav-path"); + var sidenav = $("#side-nav"); var tocHeight = toc.height(); // <- we added this line var headerHeight = header.height(); var footerHeight = footer.height(); diff --git a/eigen/doc/eigendoxy.css b/eigen/doc/eigendoxy.css index 6274e6c..9a036d2 100644 --- a/eigen/doc/eigendoxy.css +++ b/eigen/doc/eigendoxy.css @@ -214,3 +214,8 @@ h3.version { td.width20em p.endtd { width: 20em; } + +/* needed for huge screens */ +.ui-resizable-e { + background-repeat: repeat-y; +} \ No newline at end of file diff --git a/eigen/doc/eigendoxy_footer.html.in b/eigen/doc/eigendoxy_footer.html.in index 878244a..9ac0596 100644 --- a/eigen/doc/eigendoxy_footer.html.in +++ b/eigen/doc/eigendoxy_footer.html.in @@ -5,14 +5,14 @@ $navpath + doxygen $doxygenversion diff --git a/eigen/doc/eigendoxy_header.html.in b/eigen/doc/eigendoxy_header.html.in index 0f3859f..bb149f8 100644 --- a/eigen/doc/eigendoxy_header.html.in +++ b/eigen/doc/eigendoxy_header.html.in @@ -4,25 +4,23 @@ + $projectname: $title $title - - - + + + $treeview $search $mathjax - + - -
-
@@ -30,10 +28,10 @@ $mathjax - Logo + Logo - +
$projectname  $projectnumber
@@ -42,7 +40,7 @@ $mathjax - +
$projectbrief
diff --git a/eigen/doc/examples/Cwise_lgamma.cpp b/eigen/doc/examples/Cwise_lgamma.cpp index f1c4f50..6bfaccb 100644 --- a/eigen/doc/examples/Cwise_lgamma.cpp +++ b/eigen/doc/examples/Cwise_lgamma.cpp @@ -6,4 +6,4 @@ int main() { Array4d v(0.5,10,0,-1); std::cout << v.lgamma() << std::endl; -} \ No newline at end of file +} diff --git a/eigen/doc/examples/TutorialLinAlgSVDSolve.cpp b/eigen/doc/examples/TutorialLinAlgSVDSolve.cpp index 9fbc031..f109f04 100644 --- a/eigen/doc/examples/TutorialLinAlgSVDSolve.cpp +++ b/eigen/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; } diff --git a/eigen/doc/examples/Tutorial_simple_example_dynamic_size.cpp b/eigen/doc/examples/Tutorial_simple_example_dynamic_size.cpp index 0f0280e..defcb1e 100644 --- a/eigen/doc/examples/Tutorial_simple_example_dynamic_size.cpp +++ b/eigen/doc/examples/Tutorial_simple_example_dynamic_size.cpp @@ -10,7 +10,7 @@ int main() MatrixXi m(size,size+1); // a (size)x(size+1)-matrix of int's for (int j=0; j #include +#include typedef Eigen::SparseMatrix SpMat; // declares a column-major sparse matrix type of double typedef Eigen::Triplet T; @@ -9,7 +10,10 @@ void saveAsBitmap(const Eigen::VectorXd& x, int n, const char* filename); int main(int argc, char** argv) { - assert(argc==2); + if(argc!=2) { + std::cerr << "Error: expected one and only one argument.\n"; + return -1; + } int n = 300; // size of the image int m = n*n; // number of unknows (=number of pixels) -- cgit v1.2.3