2010-06-28 22:43:11 +08:00
namespace Eigen {
2013-01-07 06:48:59 +08:00
/** \eigenManualPage TopicLinearAlgebraDecompositions Catalogue of dense decompositions
2010-06-28 22:43:11 +08:00
2013-01-07 06:48:59 +08:00
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.
2016-07-21 18:32:02 +08:00
To get an overview of the true relative speed of the different decomposition, check this \link DenseDecompositionBenchmark benchmark \endlink.
2010-06-28 22:43:11 +08:00
\section TopicLinAlgBigTable Catalogue of decompositions offered by Eigen
2010-10-19 21:25:00 +08:00
<table class="manual-vl">
2010-06-28 22:43:11 +08:00
<tr>
2010-10-19 21:25:00 +08:00
<th class="meta"></th>
<th class="meta" colspan="5">Generic information, not Eigen-specific</th>
<th class="meta" colspan="3">Eigen-specific</th>
2010-06-28 22:43:11 +08:00
</tr>
<tr>
2010-10-19 21:25:00 +08:00
<th>Decomposition</th>
<th>Requirements on the matrix</th>
<th>Speed</th>
<th>Algorithm reliability and accuracy</th>
<th>Rank-revealing</th>
<th>Allows to compute (besides linear solving)</th>
<th>Linear solver provided by Eigen</th>
<th>Maturity of Eigen's implementation</th>
<th>Optimizations</th>
2010-06-28 22:43:11 +08:00
</tr>
<tr>
<td>PartialPivLU</td>
<td>Invertible</td>
<td>Fast</td>
<td>Depends on condition number</td>
<td>-</td>
<td>-</td>
<td>Yes</td>
<td>Excellent</td>
2011-10-15 03:21:38 +08:00
<td>Blocking, Implicit MT</td>
2010-06-28 22:43:11 +08:00
</tr>
2010-10-19 21:25:00 +08:00
<tr class="alt">
2010-06-28 22:43:11 +08:00
<td>FullPivLU</td>
<td>-</td>
<td>Slow</td>
<td>Proven</td>
<td>Yes</td>
<td>-</td>
<td>Yes</td>
<td>Excellent</td>
2010-06-30 02:44:51 +08:00
<td>-</td>
2010-06-28 22:43:11 +08:00
</tr>
<tr>
<td>HouseholderQR</td>
<td>-</td>
<td>Fast</td>
<td>Depends on condition number</td>
2010-06-29 22:02:33 +08:00
<td>-</td>
2010-06-28 22:43:11 +08:00
<td>Orthogonalization</td>
<td>Yes</td>
<td>Excellent</td>
2010-06-30 02:44:51 +08:00
<td>Blocking</td>
2010-06-28 22:43:11 +08:00
</tr>
2010-10-19 21:25:00 +08:00
<tr class="alt">
2010-06-28 22:43:11 +08:00
<td>ColPivHouseholderQR</td>
<td>-</td>
<td>Fast</td>
<td>Good</td>
<td>Yes</td>
<td>Orthogonalization</td>
<td>Yes</td>
<td>Excellent</td>
2010-06-30 02:44:51 +08:00
<td><em>Soon: blocking</em></td>
2010-06-28 22:43:11 +08:00
</tr>
<tr>
<td>FullPivHouseholderQR</td>
<td>-</td>
<td>Slow</td>
<td>Proven</td>
<td>Yes</td>
<td>Orthogonalization</td>
<td>Yes</td>
<td>Average</td>
2010-06-30 02:44:51 +08:00
<td>-</td>
2010-06-28 22:43:11 +08:00
</tr>
2010-10-19 21:25:00 +08:00
<tr class="alt">
2010-06-28 22:43:11 +08:00
<td>LLT</td>
<td>Positive definite</td>
<td>Very fast</td>
<td>Depends on condition number</td>
<td>-</td>
<td>-</td>
<td>Yes</td>
2010-06-30 02:44:51 +08:00
<td>Excellent</td>
2011-10-15 03:21:38 +08:00
<td>Blocking</td>
2010-06-28 22:43:11 +08:00
</tr>
<tr>
<td>LDLT</td>
2010-06-30 16:37:23 +08:00
<td>Positive or negative semidefinite<sup><a href="#note1">1</a></sup></td>
2010-06-28 22:43:11 +08:00
<td>Very fast</td>
<td>Good</td>
<td>-</td>
<td>-</td>
<td>Yes</td>
2010-06-30 02:44:51 +08:00
<td>Excellent</td>
<td><em>Soon: blocking</em></td>
2010-06-28 22:43:11 +08:00
</tr>
2010-10-19 21:25:00 +08:00
<tr><th class="inter" colspan="9">\n Singular values and eigenvalues decompositions</th></tr>
2010-06-30 16:37:23 +08:00
2010-06-28 22:43:11 +08:00
<tr>
2010-10-15 21:44:43 +08:00
<td>JacobiSVD (two-sided)</td>
2010-06-28 22:43:11 +08:00
<td>-</td>
<td>Slow (but fast for small matrices)</td>
2014-06-17 15:37:07 +08:00
<td>Proven<sup><a href="#note3">3</a></sup></td>
2010-06-28 22:43:11 +08:00
<td>Yes</td>
<td>Singular values/vectors, least squares</td>
2010-10-15 21:44:43 +08:00
<td>Yes (and does least squares)</td>
2010-06-28 22:43:11 +08:00
<td>Excellent</td>
2010-10-15 21:44:43 +08:00
<td>R-SVD</td>
2010-06-28 22:43:11 +08:00
</tr>
2010-10-19 22:07:04 +08:00
<tr class="alt">
2010-06-28 22:43:11 +08:00
<td>SelfAdjointEigenSolver</td>
<td>Self-adjoint</td>
2010-06-30 16:37:23 +08:00
<td>Fast-average<sup><a href="#note2">2</a></sup></td>
2010-06-28 22:43:11 +08:00
<td>Good</td>
<td>Yes</td>
<td>Eigenvalues/vectors</td>
<td>-</td>
2014-06-17 15:37:07 +08:00
<td>Excellent</td>
2011-10-15 03:21:38 +08:00
<td><em>Closed forms for 2x2 and 3x3</em></td>
2010-06-28 22:43:11 +08:00
</tr>
<tr>
<td>ComplexEigenSolver</td>
<td>Square</td>
2010-06-30 16:37:23 +08:00
<td>Slow-very slow<sup><a href="#note2">2</a></sup></td>
2010-06-30 02:59:23 +08:00
<td>Depends on condition number</td>
2010-06-28 22:43:11 +08:00
<td>Yes</td>
<td>Eigenvalues/vectors</td>
<td>-</td>
2010-06-30 02:44:51 +08:00
<td>Average</td>
<td>-</td>
2010-06-28 22:43:11 +08:00
</tr>
2010-10-19 22:07:04 +08:00
<tr class="alt">
2010-06-28 22:43:11 +08:00
<td>EigenSolver</td>
<td>Square and real</td>
2010-06-30 16:37:23 +08:00
<td>Average-slow<sup><a href="#note2">2</a></sup></td>
2010-06-30 02:59:23 +08:00
<td>Depends on condition number</td>
2010-06-28 22:43:11 +08:00
<td>Yes</td>
<td>Eigenvalues/vectors</td>
<td>-</td>
2010-06-30 17:41:23 +08:00
<td>Average</td>
2010-06-30 02:44:51 +08:00
<td>-</td>
2010-06-28 22:43:11 +08:00
</tr>
<tr>
<td>GeneralizedSelfAdjointEigenSolver</td>
<td>Square</td>
2010-06-30 16:37:23 +08:00
<td>Fast-average<sup><a href="#note2">2</a></sup></td>
2010-06-30 02:44:51 +08:00
<td>Depends on condition number</td>
2010-06-28 22:43:11 +08:00
<td>-</td>
<td>Generalized eigenvalues/vectors</td>
<td>-</td>
2010-06-30 02:44:51 +08:00
<td>Good</td>
<td>-</td>
2010-06-28 22:43:11 +08:00
</tr>
2010-10-19 21:25:00 +08:00
<tr><th class="inter" colspan="9">\n Helper decompositions</th></tr>
2010-06-30 16:37:23 +08:00
2010-06-28 22:43:11 +08:00
<tr>
<td>RealSchur</td>
<td>Square and real</td>
2010-06-30 16:37:23 +08:00
<td>Average-slow<sup><a href="#note2">2</a></sup></td>
2010-06-30 02:59:23 +08:00
<td>Depends on condition number</td>
2010-06-28 22:43:11 +08:00
<td>Yes</td>
<td>-</td>
<td>-</td>
2010-06-30 17:41:23 +08:00
<td>Average</td>
2010-06-30 02:44:51 +08:00
<td>-</td>
2010-06-28 22:43:11 +08:00
</tr>
2010-10-19 22:07:04 +08:00
<tr class="alt">
2010-06-30 02:59:23 +08:00
<td>ComplexSchur</td>
2010-06-30 17:41:23 +08:00
<td>Square</td>
2010-06-30 16:37:23 +08:00
<td>Slow-very slow<sup><a href="#note2">2</a></sup></td>
2010-06-30 02:59:23 +08:00
<td>Depends on condition number</td>
<td>Yes</td>
<td>-</td>
<td>-</td>
<td>Average</td>
<td>-</td>
</tr>
2010-10-19 22:07:04 +08:00
<tr class="alt">
2010-06-28 22:43:11 +08:00
<td>Tridiagonalization</td>
<td>Self-adjoint</td>
<td>Fast</td>
<td>Good</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>Good</td>
2010-06-30 02:59:23 +08:00
<td><em>Soon: blocking</em></td>
2010-06-28 22:43:11 +08:00
</tr>
<tr>
<td>HessenbergDecomposition</td>
2010-06-30 16:37:23 +08:00
<td>Square</td>
2010-06-30 02:44:51 +08:00
<td>Average</td>
<td>Good</td>
2010-06-28 22:43:11 +08:00
<td>-</td>
<td>-</td>
<td>-</td>
2010-06-30 02:44:51 +08:00
<td>Good</td>
2010-06-30 02:59:23 +08:00
<td><em>Soon: blocking</em></td>
2010-06-28 22:43:11 +08:00
</tr>
</table>
2010-06-30 16:37:23 +08:00
\b Notes:
<ul>
2010-07-01 07:27:30 +08:00
<li><a name="note1">\b 1: </a>There exist two variants of the LDLT algorithm. Eigen's one produces a pure diagonal D matrix, and therefore it cannot handle indefinite matrices, unlike Lapack's one which produces a block diagonal D matrix.</li>
<li><a name="note2">\b 2: </a>Eigenvalues, SVD and Schur decompositions rely on iterative algorithms. Their convergence speed depends on how well the eigenvalues are separated.</li>
2010-10-15 21:44:43 +08:00
<li><a name="note3">\b 3: </a>Our JacobiSVD is two-sided, making for proven and optimal precision for square matrices. For non-square matrices, we have to use a QR preconditioner first. The default choice, ColPivHouseholderQR, is already very reliable, but if you want it to be proven, use FullPivHouseholderQR instead.
2010-06-30 16:37:23 +08:00
</ul>
2010-06-28 22:43:11 +08:00
\section TopicLinAlgTerminology Terminology
2010-06-30 16:37:23 +08:00
<dl>
<dt><b>Selfadjoint</b></dt>
<dd>For a real matrix, selfadjoint is a synonym for symmetric. For a complex matrix, selfadjoint is a synonym for \em hermitian.
More generally, a matrix \f$ A \f$ is selfadjoint if and only if it is equal to its adjoint \f$ A^* \f$. The adjoint is also called the \em conjugate \em transpose. </dd>
<dt><b>Positive/negative definite</b></dt>
<dd>A selfadjoint matrix \f$ A \f$ is positive definite if \f$ v^* A v > 0 \f$ for any non zero vector \f$ v \f$.
In the same vein, it is negative definite if \f$ v^* A v < 0 \f$ for any non zero vector \f$ v \f$ </dd>
<dt><b>Positive/negative semidefinite</b></dt>
<dd>A selfadjoint matrix \f$ A \f$ is positive semi-definite if \f$ v^* A v \ge 0 \f$ for any non zero vector \f$ v \f$.
In the same vein, it is negative semi-definite if \f$ v^* A v \le 0 \f$ for any non zero vector \f$ v \f$ </dd>
2010-06-28 22:43:11 +08:00
2010-06-30 16:37:23 +08:00
<dt><b>Blocking</b></dt>
2010-06-30 17:41:23 +08:00
<dd>Means the algorithm can work per block, whence guaranteeing a good scaling of the performance for large matrices.</dd>
2011-10-15 03:21:38 +08:00
<dt><b>Implicit Multi Threading (MT)</b></dt>
<dd>Means the algorithm can take advantage of multicore processors via OpenMP. "Implicit" means the algortihm itself is not parallelized, but that it relies on parallelized matrix-matrix product rountines.</dd>
<dt><b>Explicit Multi Threading (MT)</b></dt>
2014-03-08 13:44:56 +08:00
<dd>Means the algorithm is explicitly parallelized to take advantage of multicore processors via OpenMP.</dd>
2010-06-30 16:37:23 +08:00
<dt><b>Meta-unroller</b></dt>
<dd>Means the algorithm is automatically and explicitly unrolled for very small fixed size matrices.</dd>
<dt><b></b></dt>
<dd></dd>
</dl>
2010-06-28 22:43:11 +08:00
2016-07-21 18:32:02 +08:00
2010-06-28 22:43:11 +08:00
*/
}