1namespace Eigen { 2 3/** \page TopicLinearAlgebraDecompositions Linear algebra and decompositions 4 5 6\section TopicLinAlgBigTable Catalogue of decompositions offered by Eigen 7 8<table class="manual-vl"> 9 10 <tr> 11 <th class="meta"></th> 12 <th class="meta" colspan="5">Generic information, not Eigen-specific</th> 13 <th class="meta" colspan="3">Eigen-specific</th> 14 </tr> 15 16 <tr> 17 <th>Decomposition</th> 18 <th>Requirements on the matrix</th> 19 <th>Speed</th> 20 <th>Algorithm reliability and accuracy</th> 21 <th>Rank-revealing</th> 22 <th>Allows to compute (besides linear solving)</th> 23 <th>Linear solver provided by Eigen</th> 24 <th>Maturity of Eigen's implementation</th> 25 <th>Optimizations</th> 26 </tr> 27 28 <tr> 29 <td>PartialPivLU</td> 30 <td>Invertible</td> 31 <td>Fast</td> 32 <td>Depends on condition number</td> 33 <td>-</td> 34 <td>-</td> 35 <td>Yes</td> 36 <td>Excellent</td> 37 <td>Blocking, Implicit MT</td> 38 </tr> 39 40 <tr class="alt"> 41 <td>FullPivLU</td> 42 <td>-</td> 43 <td>Slow</td> 44 <td>Proven</td> 45 <td>Yes</td> 46 <td>-</td> 47 <td>Yes</td> 48 <td>Excellent</td> 49 <td>-</td> 50 </tr> 51 52 <tr> 53 <td>HouseholderQR</td> 54 <td>-</td> 55 <td>Fast</td> 56 <td>Depends on condition number</td> 57 <td>-</td> 58 <td>Orthogonalization</td> 59 <td>Yes</td> 60 <td>Excellent</td> 61 <td>Blocking</td> 62 </tr> 63 64 <tr class="alt"> 65 <td>ColPivHouseholderQR</td> 66 <td>-</td> 67 <td>Fast</td> 68 <td>Good</td> 69 <td>Yes</td> 70 <td>Orthogonalization</td> 71 <td>Yes</td> 72 <td>Excellent</td> 73 <td><em>Soon: blocking</em></td> 74 </tr> 75 76 <tr> 77 <td>FullPivHouseholderQR</td> 78 <td>-</td> 79 <td>Slow</td> 80 <td>Proven</td> 81 <td>Yes</td> 82 <td>Orthogonalization</td> 83 <td>Yes</td> 84 <td>Average</td> 85 <td>-</td> 86 </tr> 87 88 <tr class="alt"> 89 <td>LLT</td> 90 <td>Positive definite</td> 91 <td>Very fast</td> 92 <td>Depends on condition number</td> 93 <td>-</td> 94 <td>-</td> 95 <td>Yes</td> 96 <td>Excellent</td> 97 <td>Blocking</td> 98 </tr> 99 100 <tr> 101 <td>LDLT</td> 102 <td>Positive or negative semidefinite<sup><a href="#note1">1</a></sup></td> 103 <td>Very fast</td> 104 <td>Good</td> 105 <td>-</td> 106 <td>-</td> 107 <td>Yes</td> 108 <td>Excellent</td> 109 <td><em>Soon: blocking</em></td> 110 </tr> 111 112 <tr><th class="inter" colspan="9">\n Singular values and eigenvalues decompositions</th></tr> 113 114 <tr> 115 <td>JacobiSVD (two-sided)</td> 116 <td>-</td> 117 <td>Slow (but fast for small matrices)</td> 118 <td>Excellent-Proven<sup><a href="#note3">3</a></sup></td> 119 <td>Yes</td> 120 <td>Singular values/vectors, least squares</td> 121 <td>Yes (and does least squares)</td> 122 <td>Excellent</td> 123 <td>R-SVD</td> 124 </tr> 125 126 <tr class="alt"> 127 <td>SelfAdjointEigenSolver</td> 128 <td>Self-adjoint</td> 129 <td>Fast-average<sup><a href="#note2">2</a></sup></td> 130 <td>Good</td> 131 <td>Yes</td> 132 <td>Eigenvalues/vectors</td> 133 <td>-</td> 134 <td>Good</td> 135 <td><em>Closed forms for 2x2 and 3x3</em></td> 136 </tr> 137 138 <tr> 139 <td>ComplexEigenSolver</td> 140 <td>Square</td> 141 <td>Slow-very slow<sup><a href="#note2">2</a></sup></td> 142 <td>Depends on condition number</td> 143 <td>Yes</td> 144 <td>Eigenvalues/vectors</td> 145 <td>-</td> 146 <td>Average</td> 147 <td>-</td> 148 </tr> 149 150 <tr class="alt"> 151 <td>EigenSolver</td> 152 <td>Square and real</td> 153 <td>Average-slow<sup><a href="#note2">2</a></sup></td> 154 <td>Depends on condition number</td> 155 <td>Yes</td> 156 <td>Eigenvalues/vectors</td> 157 <td>-</td> 158 <td>Average</td> 159 <td>-</td> 160 </tr> 161 162 <tr> 163 <td>GeneralizedSelfAdjointEigenSolver</td> 164 <td>Square</td> 165 <td>Fast-average<sup><a href="#note2">2</a></sup></td> 166 <td>Depends on condition number</td> 167 <td>-</td> 168 <td>Generalized eigenvalues/vectors</td> 169 <td>-</td> 170 <td>Good</td> 171 <td>-</td> 172 </tr> 173 174 <tr><th class="inter" colspan="9">\n Helper decompositions</th></tr> 175 176 <tr> 177 <td>RealSchur</td> 178 <td>Square and real</td> 179 <td>Average-slow<sup><a href="#note2">2</a></sup></td> 180 <td>Depends on condition number</td> 181 <td>Yes</td> 182 <td>-</td> 183 <td>-</td> 184 <td>Average</td> 185 <td>-</td> 186 </tr> 187 188 <tr class="alt"> 189 <td>ComplexSchur</td> 190 <td>Square</td> 191 <td>Slow-very slow<sup><a href="#note2">2</a></sup></td> 192 <td>Depends on condition number</td> 193 <td>Yes</td> 194 <td>-</td> 195 <td>-</td> 196 <td>Average</td> 197 <td>-</td> 198 </tr> 199 200 <tr class="alt"> 201 <td>Tridiagonalization</td> 202 <td>Self-adjoint</td> 203 <td>Fast</td> 204 <td>Good</td> 205 <td>-</td> 206 <td>-</td> 207 <td>-</td> 208 <td>Good</td> 209 <td><em>Soon: blocking</em></td> 210 </tr> 211 212 <tr> 213 <td>HessenbergDecomposition</td> 214 <td>Square</td> 215 <td>Average</td> 216 <td>Good</td> 217 <td>-</td> 218 <td>-</td> 219 <td>-</td> 220 <td>Good</td> 221 <td><em>Soon: blocking</em></td> 222 </tr> 223 224</table> 225 226\b Notes: 227<ul> 228<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> 229<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> 230<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. 231</ul> 232 233\section TopicLinAlgTerminology Terminology 234 235<dl> 236 <dt><b>Selfadjoint</b></dt> 237 <dd>For a real matrix, selfadjoint is a synonym for symmetric. For a complex matrix, selfadjoint is a synonym for \em hermitian. 238 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> 239 <dt><b>Positive/negative definite</b></dt> 240 <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$. 241 In the same vein, it is negative definite if \f$ v^* A v < 0 \f$ for any non zero vector \f$ v \f$ </dd> 242 <dt><b>Positive/negative semidefinite</b></dt> 243 <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$. 244 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> 245 246 <dt><b>Blocking</b></dt> 247 <dd>Means the algorithm can work per block, whence guaranteeing a good scaling of the performance for large matrices.</dd> 248 <dt><b>Implicit Multi Threading (MT)</b></dt> 249 <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> 250 <dt><b>Explicit Multi Threading (MT)</b></dt> 251 <dd>Means the algorithm is explicitely parallelized to take advantage of multicore processors via OpenMP.</dd> 252 <dt><b>Meta-unroller</b></dt> 253 <dd>Means the algorithm is automatically and explicitly unrolled for very small fixed size matrices.</dd> 254 <dt><b></b></dt> 255 <dd></dd> 256</dl> 257 258*/ 259 260} 261