You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

261 lines
8.1 KiB

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