@smake/eigen 1.0.2 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (435) hide show
  1. package/README.md +1 -1
  2. package/eigen/Eigen/AccelerateSupport +52 -0
  3. package/eigen/Eigen/Cholesky +18 -21
  4. package/eigen/Eigen/CholmodSupport +28 -28
  5. package/eigen/Eigen/Core +235 -326
  6. package/eigen/Eigen/Eigenvalues +16 -14
  7. package/eigen/Eigen/Geometry +21 -24
  8. package/eigen/Eigen/Householder +9 -8
  9. package/eigen/Eigen/IterativeLinearSolvers +8 -4
  10. package/eigen/Eigen/Jacobi +14 -14
  11. package/eigen/Eigen/KLUSupport +43 -0
  12. package/eigen/Eigen/LU +16 -20
  13. package/eigen/Eigen/MetisSupport +12 -12
  14. package/eigen/Eigen/OrderingMethods +54 -54
  15. package/eigen/Eigen/PaStiXSupport +23 -20
  16. package/eigen/Eigen/PardisoSupport +17 -14
  17. package/eigen/Eigen/QR +18 -21
  18. package/eigen/Eigen/QtAlignedMalloc +5 -13
  19. package/eigen/Eigen/SPQRSupport +21 -14
  20. package/eigen/Eigen/SVD +23 -18
  21. package/eigen/Eigen/Sparse +1 -4
  22. package/eigen/Eigen/SparseCholesky +18 -23
  23. package/eigen/Eigen/SparseCore +18 -17
  24. package/eigen/Eigen/SparseLU +12 -8
  25. package/eigen/Eigen/SparseQR +16 -14
  26. package/eigen/Eigen/StdDeque +5 -2
  27. package/eigen/Eigen/StdList +5 -2
  28. package/eigen/Eigen/StdVector +5 -2
  29. package/eigen/Eigen/SuperLUSupport +30 -24
  30. package/eigen/Eigen/ThreadPool +80 -0
  31. package/eigen/Eigen/UmfPackSupport +19 -17
  32. package/eigen/Eigen/Version +14 -0
  33. package/eigen/Eigen/src/AccelerateSupport/AccelerateSupport.h +423 -0
  34. package/eigen/Eigen/src/AccelerateSupport/InternalHeaderCheck.h +3 -0
  35. package/eigen/Eigen/src/Cholesky/InternalHeaderCheck.h +3 -0
  36. package/eigen/Eigen/src/Cholesky/LDLT.h +377 -401
  37. package/eigen/Eigen/src/Cholesky/LLT.h +332 -360
  38. package/eigen/Eigen/src/Cholesky/LLT_LAPACKE.h +81 -56
  39. package/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +620 -521
  40. package/eigen/Eigen/src/CholmodSupport/InternalHeaderCheck.h +3 -0
  41. package/eigen/Eigen/src/Core/ArithmeticSequence.h +239 -0
  42. package/eigen/Eigen/src/Core/Array.h +341 -294
  43. package/eigen/Eigen/src/Core/ArrayBase.h +190 -203
  44. package/eigen/Eigen/src/Core/ArrayWrapper.h +127 -171
  45. package/eigen/Eigen/src/Core/Assign.h +30 -40
  46. package/eigen/Eigen/src/Core/AssignEvaluator.h +711 -589
  47. package/eigen/Eigen/src/Core/Assign_MKL.h +130 -125
  48. package/eigen/Eigen/src/Core/BandMatrix.h +268 -283
  49. package/eigen/Eigen/src/Core/Block.h +375 -398
  50. package/eigen/Eigen/src/Core/CommaInitializer.h +86 -97
  51. package/eigen/Eigen/src/Core/ConditionEstimator.h +51 -53
  52. package/eigen/Eigen/src/Core/CoreEvaluators.h +1356 -1026
  53. package/eigen/Eigen/src/Core/CoreIterators.h +73 -59
  54. package/eigen/Eigen/src/Core/CwiseBinaryOp.h +114 -132
  55. package/eigen/Eigen/src/Core/CwiseNullaryOp.h +726 -617
  56. package/eigen/Eigen/src/Core/CwiseTernaryOp.h +77 -103
  57. package/eigen/Eigen/src/Core/CwiseUnaryOp.h +56 -68
  58. package/eigen/Eigen/src/Core/CwiseUnaryView.h +132 -95
  59. package/eigen/Eigen/src/Core/DenseBase.h +632 -571
  60. package/eigen/Eigen/src/Core/DenseCoeffsBase.h +511 -624
  61. package/eigen/Eigen/src/Core/DenseStorage.h +512 -509
  62. package/eigen/Eigen/src/Core/DeviceWrapper.h +153 -0
  63. package/eigen/Eigen/src/Core/Diagonal.h +169 -210
  64. package/eigen/Eigen/src/Core/DiagonalMatrix.h +351 -274
  65. package/eigen/Eigen/src/Core/DiagonalProduct.h +12 -10
  66. package/eigen/Eigen/src/Core/Dot.h +172 -222
  67. package/eigen/Eigen/src/Core/EigenBase.h +75 -85
  68. package/eigen/Eigen/src/Core/Fill.h +138 -0
  69. package/eigen/Eigen/src/Core/FindCoeff.h +464 -0
  70. package/eigen/Eigen/src/Core/ForceAlignedAccess.h +90 -109
  71. package/eigen/Eigen/src/Core/Fuzzy.h +82 -105
  72. package/eigen/Eigen/src/Core/GeneralProduct.h +327 -263
  73. package/eigen/Eigen/src/Core/GenericPacketMath.h +1472 -360
  74. package/eigen/Eigen/src/Core/GlobalFunctions.h +194 -151
  75. package/eigen/Eigen/src/Core/IO.h +147 -139
  76. package/eigen/Eigen/src/Core/IndexedView.h +321 -0
  77. package/eigen/Eigen/src/Core/InnerProduct.h +260 -0
  78. package/eigen/Eigen/src/Core/InternalHeaderCheck.h +3 -0
  79. package/eigen/Eigen/src/Core/Inverse.h +56 -66
  80. package/eigen/Eigen/src/Core/Map.h +124 -142
  81. package/eigen/Eigen/src/Core/MapBase.h +256 -281
  82. package/eigen/Eigen/src/Core/MathFunctions.h +1620 -938
  83. package/eigen/Eigen/src/Core/MathFunctionsImpl.h +233 -71
  84. package/eigen/Eigen/src/Core/Matrix.h +491 -416
  85. package/eigen/Eigen/src/Core/MatrixBase.h +468 -453
  86. package/eigen/Eigen/src/Core/NestByValue.h +66 -85
  87. package/eigen/Eigen/src/Core/NoAlias.h +79 -85
  88. package/eigen/Eigen/src/Core/NumTraits.h +235 -148
  89. package/eigen/Eigen/src/Core/PartialReduxEvaluator.h +253 -0
  90. package/eigen/Eigen/src/Core/PermutationMatrix.h +461 -511
  91. package/eigen/Eigen/src/Core/PlainObjectBase.h +871 -894
  92. package/eigen/Eigen/src/Core/Product.h +260 -139
  93. package/eigen/Eigen/src/Core/ProductEvaluators.h +863 -714
  94. package/eigen/Eigen/src/Core/Random.h +161 -136
  95. package/eigen/Eigen/src/Core/RandomImpl.h +262 -0
  96. package/eigen/Eigen/src/Core/RealView.h +250 -0
  97. package/eigen/Eigen/src/Core/Redux.h +366 -336
  98. package/eigen/Eigen/src/Core/Ref.h +308 -209
  99. package/eigen/Eigen/src/Core/Replicate.h +94 -106
  100. package/eigen/Eigen/src/Core/Reshaped.h +398 -0
  101. package/eigen/Eigen/src/Core/ReturnByValue.h +49 -55
  102. package/eigen/Eigen/src/Core/Reverse.h +136 -145
  103. package/eigen/Eigen/src/Core/Select.h +70 -140
  104. package/eigen/Eigen/src/Core/SelfAdjointView.h +262 -285
  105. package/eigen/Eigen/src/Core/SelfCwiseBinaryOp.h +23 -20
  106. package/eigen/Eigen/src/Core/SkewSymmetricMatrix3.h +382 -0
  107. package/eigen/Eigen/src/Core/Solve.h +97 -111
  108. package/eigen/Eigen/src/Core/SolveTriangular.h +131 -129
  109. package/eigen/Eigen/src/Core/SolverBase.h +138 -101
  110. package/eigen/Eigen/src/Core/StableNorm.h +156 -160
  111. package/eigen/Eigen/src/Core/StlIterators.h +619 -0
  112. package/eigen/Eigen/src/Core/Stride.h +91 -88
  113. package/eigen/Eigen/src/Core/Swap.h +70 -38
  114. package/eigen/Eigen/src/Core/Transpose.h +295 -273
  115. package/eigen/Eigen/src/Core/Transpositions.h +272 -317
  116. package/eigen/Eigen/src/Core/TriangularMatrix.h +670 -755
  117. package/eigen/Eigen/src/Core/VectorBlock.h +59 -72
  118. package/eigen/Eigen/src/Core/VectorwiseOp.h +668 -630
  119. package/eigen/Eigen/src/Core/Visitor.h +480 -216
  120. package/eigen/Eigen/src/Core/arch/AVX/Complex.h +407 -293
  121. package/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +79 -388
  122. package/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +2935 -491
  123. package/eigen/Eigen/src/Core/arch/AVX/Reductions.h +353 -0
  124. package/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +279 -22
  125. package/eigen/Eigen/src/Core/arch/AVX512/Complex.h +472 -0
  126. package/eigen/Eigen/src/Core/arch/AVX512/GemmKernel.h +1245 -0
  127. package/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +85 -333
  128. package/eigen/Eigen/src/Core/arch/AVX512/MathFunctionsFP16.h +75 -0
  129. package/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +2490 -649
  130. package/eigen/Eigen/src/Core/arch/AVX512/PacketMathFP16.h +1413 -0
  131. package/eigen/Eigen/src/Core/arch/AVX512/Reductions.h +297 -0
  132. package/eigen/Eigen/src/Core/arch/AVX512/TrsmKernel.h +1167 -0
  133. package/eigen/Eigen/src/Core/arch/AVX512/TrsmUnrolls.inc +1219 -0
  134. package/eigen/Eigen/src/Core/arch/AVX512/TypeCasting.h +277 -0
  135. package/eigen/Eigen/src/Core/arch/AVX512/TypeCastingFP16.h +130 -0
  136. package/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +521 -298
  137. package/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +39 -280
  138. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +3686 -0
  139. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +205 -0
  140. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +901 -0
  141. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMAbfloat16.h +742 -0
  142. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixVectorProduct.inc +2818 -0
  143. package/eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h +3391 -723
  144. package/eigen/Eigen/src/Core/arch/AltiVec/TypeCasting.h +153 -0
  145. package/eigen/Eigen/src/Core/arch/Default/BFloat16.h +866 -0
  146. package/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +113 -14
  147. package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +2634 -0
  148. package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +227 -0
  149. package/eigen/Eigen/src/Core/arch/Default/Half.h +1091 -0
  150. package/eigen/Eigen/src/Core/arch/Default/Settings.h +11 -13
  151. package/eigen/Eigen/src/Core/arch/GPU/Complex.h +244 -0
  152. package/eigen/Eigen/src/Core/arch/GPU/MathFunctions.h +104 -0
  153. package/eigen/Eigen/src/Core/arch/GPU/PacketMath.h +1712 -0
  154. package/eigen/Eigen/src/Core/arch/GPU/Tuple.h +268 -0
  155. package/eigen/Eigen/src/Core/arch/GPU/TypeCasting.h +77 -0
  156. package/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h +23 -0
  157. package/eigen/Eigen/src/Core/arch/HVX/PacketMath.h +1088 -0
  158. package/eigen/Eigen/src/Core/arch/LSX/Complex.h +520 -0
  159. package/eigen/Eigen/src/Core/arch/LSX/GeneralBlockPanelKernel.h +23 -0
  160. package/eigen/Eigen/src/Core/arch/LSX/MathFunctions.h +43 -0
  161. package/eigen/Eigen/src/Core/arch/LSX/PacketMath.h +2866 -0
  162. package/eigen/Eigen/src/Core/arch/LSX/TypeCasting.h +526 -0
  163. package/eigen/Eigen/src/Core/arch/MSA/Complex.h +620 -0
  164. package/eigen/Eigen/src/Core/arch/MSA/MathFunctions.h +379 -0
  165. package/eigen/Eigen/src/Core/arch/MSA/PacketMath.h +1237 -0
  166. package/eigen/Eigen/src/Core/arch/NEON/Complex.h +531 -289
  167. package/eigen/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +243 -0
  168. package/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +50 -73
  169. package/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +5915 -579
  170. package/eigen/Eigen/src/Core/arch/NEON/TypeCasting.h +1642 -0
  171. package/eigen/Eigen/src/Core/arch/NEON/UnaryFunctors.h +57 -0
  172. package/eigen/Eigen/src/Core/arch/SSE/Complex.h +366 -334
  173. package/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +40 -514
  174. package/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +2164 -675
  175. package/eigen/Eigen/src/Core/arch/SSE/Reductions.h +324 -0
  176. package/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +188 -35
  177. package/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h +48 -0
  178. package/eigen/Eigen/src/Core/arch/SVE/PacketMath.h +674 -0
  179. package/eigen/Eigen/src/Core/arch/SVE/TypeCasting.h +52 -0
  180. package/eigen/Eigen/src/Core/arch/SYCL/InteropHeaders.h +227 -0
  181. package/eigen/Eigen/src/Core/arch/SYCL/MathFunctions.h +303 -0
  182. package/eigen/Eigen/src/Core/arch/SYCL/PacketMath.h +576 -0
  183. package/eigen/Eigen/src/Core/arch/SYCL/TypeCasting.h +83 -0
  184. package/eigen/Eigen/src/Core/arch/ZVector/Complex.h +434 -261
  185. package/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +160 -53
  186. package/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +1073 -605
  187. package/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +123 -117
  188. package/eigen/Eigen/src/Core/functors/BinaryFunctors.h +594 -322
  189. package/eigen/Eigen/src/Core/functors/NullaryFunctors.h +204 -118
  190. package/eigen/Eigen/src/Core/functors/StlFunctors.h +110 -97
  191. package/eigen/Eigen/src/Core/functors/TernaryFunctors.h +34 -7
  192. package/eigen/Eigen/src/Core/functors/UnaryFunctors.h +1158 -530
  193. package/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +2329 -1333
  194. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +328 -364
  195. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +191 -178
  196. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +85 -82
  197. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +154 -73
  198. package/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +396 -542
  199. package/eigen/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +80 -77
  200. package/eigen/Eigen/src/Core/products/Parallelizer.h +208 -92
  201. package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +331 -375
  202. package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +206 -224
  203. package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +139 -146
  204. package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h +58 -61
  205. package/eigen/Eigen/src/Core/products/SelfadjointProduct.h +71 -71
  206. package/eigen/Eigen/src/Core/products/SelfadjointRank2Update.h +48 -46
  207. package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix.h +294 -369
  208. package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +246 -238
  209. package/eigen/Eigen/src/Core/products/TriangularMatrixVector.h +244 -247
  210. package/eigen/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h +212 -192
  211. package/eigen/Eigen/src/Core/products/TriangularSolverMatrix.h +328 -275
  212. package/eigen/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +108 -109
  213. package/eigen/Eigen/src/Core/products/TriangularSolverVector.h +70 -93
  214. package/eigen/Eigen/src/Core/util/Assert.h +158 -0
  215. package/eigen/Eigen/src/Core/util/BlasUtil.h +413 -290
  216. package/eigen/Eigen/src/Core/util/ConfigureVectorization.h +543 -0
  217. package/eigen/Eigen/src/Core/util/Constants.h +314 -263
  218. package/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +130 -78
  219. package/eigen/Eigen/src/Core/util/EmulateArray.h +270 -0
  220. package/eigen/Eigen/src/Core/util/ForwardDeclarations.h +450 -224
  221. package/eigen/Eigen/src/Core/util/GpuHipCudaDefines.inc +101 -0
  222. package/eigen/Eigen/src/Core/util/GpuHipCudaUndefines.inc +45 -0
  223. package/eigen/Eigen/src/Core/util/IndexedViewHelper.h +487 -0
  224. package/eigen/Eigen/src/Core/util/IntegralConstant.h +279 -0
  225. package/eigen/Eigen/src/Core/util/MKL_support.h +39 -30
  226. package/eigen/Eigen/src/Core/util/Macros.h +939 -646
  227. package/eigen/Eigen/src/Core/util/MaxSizeVector.h +139 -0
  228. package/eigen/Eigen/src/Core/util/Memory.h +1042 -650
  229. package/eigen/Eigen/src/Core/util/Meta.h +618 -426
  230. package/eigen/Eigen/src/Core/util/MoreMeta.h +638 -0
  231. package/eigen/Eigen/src/Core/util/ReenableStupidWarnings.h +32 -19
  232. package/eigen/Eigen/src/Core/util/ReshapedHelper.h +51 -0
  233. package/eigen/Eigen/src/Core/util/Serializer.h +209 -0
  234. package/eigen/Eigen/src/Core/util/StaticAssert.h +51 -164
  235. package/eigen/Eigen/src/Core/util/SymbolicIndex.h +445 -0
  236. package/eigen/Eigen/src/Core/util/XprHelper.h +793 -538
  237. package/eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h +246 -277
  238. package/eigen/Eigen/src/Eigenvalues/ComplexSchur.h +299 -319
  239. package/eigen/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h +52 -48
  240. package/eigen/Eigen/src/Eigenvalues/EigenSolver.h +413 -456
  241. package/eigen/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +309 -325
  242. package/eigen/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +157 -171
  243. package/eigen/Eigen/src/Eigenvalues/HessenbergDecomposition.h +292 -310
  244. package/eigen/Eigen/src/Eigenvalues/InternalHeaderCheck.h +3 -0
  245. package/eigen/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +91 -107
  246. package/eigen/Eigen/src/Eigenvalues/RealQZ.h +539 -606
  247. package/eigen/Eigen/src/Eigenvalues/RealSchur.h +348 -382
  248. package/eigen/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +41 -35
  249. package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +579 -600
  250. package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +47 -44
  251. package/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +434 -461
  252. package/eigen/Eigen/src/Geometry/AlignedBox.h +307 -214
  253. package/eigen/Eigen/src/Geometry/AngleAxis.h +135 -137
  254. package/eigen/Eigen/src/Geometry/EulerAngles.h +163 -74
  255. package/eigen/Eigen/src/Geometry/Homogeneous.h +289 -333
  256. package/eigen/Eigen/src/Geometry/Hyperplane.h +152 -161
  257. package/eigen/Eigen/src/Geometry/InternalHeaderCheck.h +3 -0
  258. package/eigen/Eigen/src/Geometry/OrthoMethods.h +168 -145
  259. package/eigen/Eigen/src/Geometry/ParametrizedLine.h +141 -104
  260. package/eigen/Eigen/src/Geometry/Quaternion.h +595 -497
  261. package/eigen/Eigen/src/Geometry/Rotation2D.h +110 -108
  262. package/eigen/Eigen/src/Geometry/RotationBase.h +148 -145
  263. package/eigen/Eigen/src/Geometry/Scaling.h +115 -90
  264. package/eigen/Eigen/src/Geometry/Transform.h +896 -953
  265. package/eigen/Eigen/src/Geometry/Translation.h +100 -98
  266. package/eigen/Eigen/src/Geometry/Umeyama.h +79 -84
  267. package/eigen/Eigen/src/Geometry/arch/Geometry_SIMD.h +154 -0
  268. package/eigen/Eigen/src/Householder/BlockHouseholder.h +54 -42
  269. package/eigen/Eigen/src/Householder/Householder.h +104 -122
  270. package/eigen/Eigen/src/Householder/HouseholderSequence.h +416 -382
  271. package/eigen/Eigen/src/Householder/InternalHeaderCheck.h +3 -0
  272. package/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +153 -166
  273. package/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +127 -138
  274. package/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +95 -124
  275. package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +269 -267
  276. package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +246 -259
  277. package/eigen/Eigen/src/IterativeLinearSolvers/InternalHeaderCheck.h +3 -0
  278. package/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +218 -217
  279. package/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +80 -103
  280. package/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +59 -63
  281. package/eigen/Eigen/src/Jacobi/InternalHeaderCheck.h +3 -0
  282. package/eigen/Eigen/src/Jacobi/Jacobi.h +256 -291
  283. package/eigen/Eigen/src/KLUSupport/InternalHeaderCheck.h +3 -0
  284. package/eigen/Eigen/src/KLUSupport/KLUSupport.h +339 -0
  285. package/eigen/Eigen/src/LU/Determinant.h +60 -63
  286. package/eigen/Eigen/src/LU/FullPivLU.h +561 -626
  287. package/eigen/Eigen/src/LU/InternalHeaderCheck.h +3 -0
  288. package/eigen/Eigen/src/LU/InverseImpl.h +213 -275
  289. package/eigen/Eigen/src/LU/PartialPivLU.h +407 -435
  290. package/eigen/Eigen/src/LU/PartialPivLU_LAPACKE.h +54 -40
  291. package/eigen/Eigen/src/LU/arch/InverseSize4.h +353 -0
  292. package/eigen/Eigen/src/MetisSupport/InternalHeaderCheck.h +3 -0
  293. package/eigen/Eigen/src/MetisSupport/MetisSupport.h +81 -93
  294. package/eigen/Eigen/src/OrderingMethods/Amd.h +250 -282
  295. package/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +950 -1103
  296. package/eigen/Eigen/src/OrderingMethods/InternalHeaderCheck.h +3 -0
  297. package/eigen/Eigen/src/OrderingMethods/Ordering.h +111 -122
  298. package/eigen/Eigen/src/PaStiXSupport/InternalHeaderCheck.h +3 -0
  299. package/eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h +524 -570
  300. package/eigen/Eigen/src/PardisoSupport/InternalHeaderCheck.h +3 -0
  301. package/eigen/Eigen/src/PardisoSupport/PardisoSupport.h +385 -429
  302. package/eigen/Eigen/src/QR/ColPivHouseholderQR.h +494 -473
  303. package/eigen/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +120 -56
  304. package/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +223 -137
  305. package/eigen/Eigen/src/QR/FullPivHouseholderQR.h +517 -460
  306. package/eigen/Eigen/src/QR/HouseholderQR.h +412 -278
  307. package/eigen/Eigen/src/QR/HouseholderQR_LAPACKE.h +32 -23
  308. package/eigen/Eigen/src/QR/InternalHeaderCheck.h +3 -0
  309. package/eigen/Eigen/src/SPQRSupport/InternalHeaderCheck.h +3 -0
  310. package/eigen/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +263 -261
  311. package/eigen/Eigen/src/SVD/BDCSVD.h +872 -679
  312. package/eigen/Eigen/src/SVD/BDCSVD_LAPACKE.h +174 -0
  313. package/eigen/Eigen/src/SVD/InternalHeaderCheck.h +3 -0
  314. package/eigen/Eigen/src/SVD/JacobiSVD.h +585 -543
  315. package/eigen/Eigen/src/SVD/JacobiSVD_LAPACKE.h +85 -49
  316. package/eigen/Eigen/src/SVD/SVDBase.h +281 -160
  317. package/eigen/Eigen/src/SVD/UpperBidiagonalization.h +202 -237
  318. package/eigen/Eigen/src/SparseCholesky/InternalHeaderCheck.h +3 -0
  319. package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +769 -590
  320. package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +318 -129
  321. package/eigen/Eigen/src/SparseCore/AmbiVector.h +202 -251
  322. package/eigen/Eigen/src/SparseCore/CompressedStorage.h +184 -236
  323. package/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +140 -184
  324. package/eigen/Eigen/src/SparseCore/InternalHeaderCheck.h +3 -0
  325. package/eigen/Eigen/src/SparseCore/SparseAssign.h +174 -111
  326. package/eigen/Eigen/src/SparseCore/SparseBlock.h +408 -477
  327. package/eigen/Eigen/src/SparseCore/SparseColEtree.h +100 -112
  328. package/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +531 -280
  329. package/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +559 -347
  330. package/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +100 -108
  331. package/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +185 -191
  332. package/eigen/Eigen/src/SparseCore/SparseDiagonalProduct.h +71 -71
  333. package/eigen/Eigen/src/SparseCore/SparseDot.h +49 -47
  334. package/eigen/Eigen/src/SparseCore/SparseFuzzy.h +13 -11
  335. package/eigen/Eigen/src/SparseCore/SparseMap.h +243 -253
  336. package/eigen/Eigen/src/SparseCore/SparseMatrix.h +1614 -1142
  337. package/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +403 -357
  338. package/eigen/Eigen/src/SparseCore/SparsePermutation.h +186 -115
  339. package/eigen/Eigen/src/SparseCore/SparseProduct.h +100 -91
  340. package/eigen/Eigen/src/SparseCore/SparseRedux.h +22 -24
  341. package/eigen/Eigen/src/SparseCore/SparseRef.h +268 -295
  342. package/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h +371 -414
  343. package/eigen/Eigen/src/SparseCore/SparseSolverBase.h +78 -87
  344. package/eigen/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +81 -95
  345. package/eigen/Eigen/src/SparseCore/SparseTranspose.h +62 -71
  346. package/eigen/Eigen/src/SparseCore/SparseTriangularView.h +132 -144
  347. package/eigen/Eigen/src/SparseCore/SparseUtil.h +146 -115
  348. package/eigen/Eigen/src/SparseCore/SparseVector.h +426 -372
  349. package/eigen/Eigen/src/SparseCore/SparseView.h +164 -193
  350. package/eigen/Eigen/src/SparseCore/TriangularSolver.h +129 -170
  351. package/eigen/Eigen/src/SparseLU/InternalHeaderCheck.h +3 -0
  352. package/eigen/Eigen/src/SparseLU/SparseLU.h +814 -618
  353. package/eigen/Eigen/src/SparseLU/SparseLUImpl.h +61 -48
  354. package/eigen/Eigen/src/SparseLU/SparseLU_Memory.h +102 -118
  355. package/eigen/Eigen/src/SparseLU/SparseLU_Structs.h +38 -35
  356. package/eigen/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +273 -255
  357. package/eigen/Eigen/src/SparseLU/SparseLU_Utils.h +44 -49
  358. package/eigen/Eigen/src/SparseLU/SparseLU_column_bmod.h +104 -108
  359. package/eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h +90 -101
  360. package/eigen/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +57 -58
  361. package/eigen/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +43 -55
  362. package/eigen/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +74 -71
  363. package/eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h +125 -133
  364. package/eigen/Eigen/src/SparseLU/SparseLU_panel_dfs.h +136 -159
  365. package/eigen/Eigen/src/SparseLU/SparseLU_pivotL.h +51 -52
  366. package/eigen/Eigen/src/SparseLU/SparseLU_pruneL.h +67 -73
  367. package/eigen/Eigen/src/SparseLU/SparseLU_relax_snode.h +24 -26
  368. package/eigen/Eigen/src/SparseQR/InternalHeaderCheck.h +3 -0
  369. package/eigen/Eigen/src/SparseQR/SparseQR.h +451 -490
  370. package/eigen/Eigen/src/StlSupport/StdDeque.h +28 -105
  371. package/eigen/Eigen/src/StlSupport/StdList.h +28 -84
  372. package/eigen/Eigen/src/StlSupport/StdVector.h +28 -108
  373. package/eigen/Eigen/src/StlSupport/details.h +48 -50
  374. package/eigen/Eigen/src/SuperLUSupport/InternalHeaderCheck.h +3 -0
  375. package/eigen/Eigen/src/SuperLUSupport/SuperLUSupport.h +634 -732
  376. package/eigen/Eigen/src/ThreadPool/Barrier.h +70 -0
  377. package/eigen/Eigen/src/ThreadPool/CoreThreadPoolDevice.h +336 -0
  378. package/eigen/Eigen/src/ThreadPool/EventCount.h +241 -0
  379. package/eigen/Eigen/src/ThreadPool/ForkJoin.h +140 -0
  380. package/eigen/Eigen/src/ThreadPool/InternalHeaderCheck.h +4 -0
  381. package/eigen/Eigen/src/ThreadPool/NonBlockingThreadPool.h +587 -0
  382. package/eigen/Eigen/src/ThreadPool/RunQueue.h +230 -0
  383. package/eigen/Eigen/src/ThreadPool/ThreadCancel.h +21 -0
  384. package/eigen/Eigen/src/ThreadPool/ThreadEnvironment.h +43 -0
  385. package/eigen/Eigen/src/ThreadPool/ThreadLocal.h +289 -0
  386. package/eigen/Eigen/src/ThreadPool/ThreadPoolInterface.h +50 -0
  387. package/eigen/Eigen/src/ThreadPool/ThreadYield.h +16 -0
  388. package/eigen/Eigen/src/UmfPackSupport/InternalHeaderCheck.h +3 -0
  389. package/eigen/Eigen/src/UmfPackSupport/UmfPackSupport.h +480 -380
  390. package/eigen/Eigen/src/misc/Image.h +41 -43
  391. package/eigen/Eigen/src/misc/InternalHeaderCheck.h +3 -0
  392. package/eigen/Eigen/src/misc/Kernel.h +39 -41
  393. package/eigen/Eigen/src/misc/RealSvd2x2.h +19 -21
  394. package/eigen/Eigen/src/misc/blas.h +83 -426
  395. package/eigen/Eigen/src/misc/lapacke.h +9976 -16182
  396. package/eigen/Eigen/src/misc/lapacke_helpers.h +163 -0
  397. package/eigen/Eigen/src/misc/lapacke_mangling.h +4 -5
  398. package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.inc +344 -0
  399. package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.inc +544 -0
  400. package/eigen/Eigen/src/plugins/BlockMethods.inc +1370 -0
  401. package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.inc +116 -0
  402. package/eigen/Eigen/src/plugins/CommonCwiseUnaryOps.inc +167 -0
  403. package/eigen/Eigen/src/plugins/IndexedViewMethods.inc +192 -0
  404. package/eigen/Eigen/src/plugins/InternalHeaderCheck.inc +3 -0
  405. package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.inc +331 -0
  406. package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.inc +118 -0
  407. package/eigen/Eigen/src/plugins/ReshapedMethods.inc +133 -0
  408. package/lib/LibEigen.d.ts +4 -0
  409. package/lib/LibEigen.js +14 -0
  410. package/lib/index.d.ts +1 -1
  411. package/lib/index.js +7 -3
  412. package/package.json +2 -10
  413. package/eigen/Eigen/CMakeLists.txt +0 -19
  414. package/eigen/Eigen/src/Core/BooleanRedux.h +0 -164
  415. package/eigen/Eigen/src/Core/arch/CUDA/Complex.h +0 -103
  416. package/eigen/Eigen/src/Core/arch/CUDA/Half.h +0 -675
  417. package/eigen/Eigen/src/Core/arch/CUDA/MathFunctions.h +0 -91
  418. package/eigen/Eigen/src/Core/arch/CUDA/PacketMath.h +0 -333
  419. package/eigen/Eigen/src/Core/arch/CUDA/PacketMathHalf.h +0 -1124
  420. package/eigen/Eigen/src/Core/arch/CUDA/TypeCasting.h +0 -212
  421. package/eigen/Eigen/src/Core/util/NonMPL2.h +0 -3
  422. package/eigen/Eigen/src/Geometry/arch/Geometry_SSE.h +0 -161
  423. package/eigen/Eigen/src/LU/arch/Inverse_SSE.h +0 -338
  424. package/eigen/Eigen/src/SparseCore/MappedSparseMatrix.h +0 -67
  425. package/eigen/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +0 -280
  426. package/eigen/Eigen/src/misc/lapack.h +0 -152
  427. package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.h +0 -332
  428. package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h +0 -552
  429. package/eigen/Eigen/src/plugins/BlockMethods.h +0 -1058
  430. package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.h +0 -115
  431. package/eigen/Eigen/src/plugins/CommonCwiseUnaryOps.h +0 -163
  432. package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h +0 -152
  433. package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h +0 -85
  434. package/lib/eigen.d.ts +0 -2
  435. package/lib/eigen.js +0 -15
@@ -10,523 +10,711 @@
10
10
  #ifndef EIGEN_SIMPLICIAL_CHOLESKY_H
11
11
  #define EIGEN_SIMPLICIAL_CHOLESKY_H
12
12
 
13
- namespace Eigen {
13
+ // IWYU pragma: private
14
+ #include "./InternalHeaderCheck.h"
14
15
 
15
- enum SimplicialCholeskyMode {
16
- SimplicialCholeskyLLT,
17
- SimplicialCholeskyLDLT
18
- };
16
+ namespace Eigen {
17
+
18
+ enum SimplicialCholeskyMode { SimplicialCholeskyLLT, SimplicialCholeskyLDLT };
19
19
 
20
20
  namespace internal {
21
- template<typename CholMatrixType, typename InputMatrixType>
22
- struct simplicial_cholesky_grab_input {
23
- typedef CholMatrixType const * ConstCholMatrixPtr;
24
- static void run(const InputMatrixType& input, ConstCholMatrixPtr &pmat, CholMatrixType &tmp)
25
- {
26
- tmp = input;
27
- pmat = &tmp;
28
- }
29
- };
30
-
31
- template<typename MatrixType>
32
- struct simplicial_cholesky_grab_input<MatrixType,MatrixType> {
33
- typedef MatrixType const * ConstMatrixPtr;
34
- static void run(const MatrixType& input, ConstMatrixPtr &pmat, MatrixType &/*tmp*/)
35
- {
36
- pmat = &input;
37
- }
38
- };
39
- } // end namespace internal
21
+ template <typename CholMatrixType, typename InputMatrixType>
22
+ struct simplicial_cholesky_grab_input {
23
+ typedef CholMatrixType const* ConstCholMatrixPtr;
24
+ static void run(const InputMatrixType& input, ConstCholMatrixPtr& pmat, CholMatrixType& tmp) {
25
+ tmp = input;
26
+ pmat = &tmp;
27
+ }
28
+ };
29
+
30
+ template <typename MatrixType>
31
+ struct simplicial_cholesky_grab_input<MatrixType, MatrixType> {
32
+ typedef MatrixType const* ConstMatrixPtr;
33
+ static void run(const MatrixType& input, ConstMatrixPtr& pmat, MatrixType& /*tmp*/) { pmat = &input; }
34
+ };
35
+ } // end namespace internal
40
36
 
41
37
  /** \ingroup SparseCholesky_Module
42
- * \brief A base class for direct sparse Cholesky factorizations
43
- *
44
- * This is a base class for LL^T and LDL^T Cholesky factorizations of sparse matrices that are
45
- * selfadjoint and positive definite. These factorizations allow for solving A.X = B where
46
- * X and B can be either dense or sparse.
47
- *
48
- * In order to reduce the fill-in, a symmetric permutation P is applied prior to the factorization
49
- * such that the factorized matrix is P A P^-1.
50
- *
51
- * \tparam Derived the type of the derived class, that is the actual factorization type.
52
- *
53
- */
54
- template<typename Derived>
55
- class SimplicialCholeskyBase : public SparseSolverBase<Derived>
56
- {
57
- typedef SparseSolverBase<Derived> Base;
58
- using Base::m_isInitialized;
59
-
60
- public:
61
- typedef typename internal::traits<Derived>::MatrixType MatrixType;
62
- typedef typename internal::traits<Derived>::OrderingType OrderingType;
63
- enum { UpLo = internal::traits<Derived>::UpLo };
64
- typedef typename MatrixType::Scalar Scalar;
65
- typedef typename MatrixType::RealScalar RealScalar;
66
- typedef typename MatrixType::StorageIndex StorageIndex;
67
- typedef SparseMatrix<Scalar,ColMajor,StorageIndex> CholMatrixType;
68
- typedef CholMatrixType const * ConstCholMatrixPtr;
69
- typedef Matrix<Scalar,Dynamic,1> VectorType;
70
- typedef Matrix<StorageIndex,Dynamic,1> VectorI;
71
-
72
- enum {
73
- ColsAtCompileTime = MatrixType::ColsAtCompileTime,
74
- MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
75
- };
76
-
77
- public:
78
-
79
- using Base::derived;
80
-
81
- /** Default constructor */
82
- SimplicialCholeskyBase()
83
- : m_info(Success), m_shiftOffset(0), m_shiftScale(1)
84
- {}
85
-
86
- explicit SimplicialCholeskyBase(const MatrixType& matrix)
87
- : m_info(Success), m_shiftOffset(0), m_shiftScale(1)
88
- {
89
- derived().compute(matrix);
90
- }
38
+ * \brief A base class for direct sparse Cholesky factorizations
39
+ *
40
+ * This is a base class for LL^T and LDL^T Cholesky factorizations of sparse matrices that are
41
+ * selfadjoint and positive definite. These factorizations allow for solving A.X = B where
42
+ * X and B can be either dense or sparse.
43
+ *
44
+ * In order to reduce the fill-in, a symmetric permutation P is applied prior to the factorization
45
+ * such that the factorized matrix is P A P^-1.
46
+ *
47
+ * \tparam Derived the type of the derived class, that is the actual factorization type.
48
+ *
49
+ */
50
+ template <typename Derived>
51
+ class SimplicialCholeskyBase : public SparseSolverBase<Derived> {
52
+ typedef SparseSolverBase<Derived> Base;
53
+ using Base::m_isInitialized;
54
+
55
+ public:
56
+ typedef typename internal::traits<Derived>::MatrixType MatrixType;
57
+ typedef typename internal::traits<Derived>::OrderingType OrderingType;
58
+ enum { UpLo = internal::traits<Derived>::UpLo };
59
+ typedef typename MatrixType::Scalar Scalar;
60
+ typedef typename MatrixType::RealScalar RealScalar;
61
+ typedef typename internal::traits<Derived>::DiagonalScalar DiagonalScalar;
62
+ typedef typename MatrixType::StorageIndex StorageIndex;
63
+ typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
64
+ typedef CholMatrixType const* ConstCholMatrixPtr;
65
+ typedef Matrix<Scalar, Dynamic, 1> VectorType;
66
+ typedef Matrix<StorageIndex, Dynamic, 1> VectorI;
67
+
68
+ enum { ColsAtCompileTime = MatrixType::ColsAtCompileTime, MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime };
69
+
70
+ public:
71
+ using Base::derived;
72
+
73
+ /** Default constructor */
74
+ SimplicialCholeskyBase()
75
+ : m_info(Success), m_factorizationIsOk(false), m_analysisIsOk(false), m_shiftOffset(0), m_shiftScale(1) {}
76
+
77
+ explicit SimplicialCholeskyBase(const MatrixType& matrix)
78
+ : m_info(Success), m_factorizationIsOk(false), m_analysisIsOk(false), m_shiftOffset(0), m_shiftScale(1) {
79
+ derived().compute(matrix);
80
+ }
91
81
 
92
- ~SimplicialCholeskyBase()
93
- {
94
- }
82
+ ~SimplicialCholeskyBase() {}
95
83
 
96
- Derived& derived() { return *static_cast<Derived*>(this); }
97
- const Derived& derived() const { return *static_cast<const Derived*>(this); }
98
-
99
- inline Index cols() const { return m_matrix.cols(); }
100
- inline Index rows() const { return m_matrix.rows(); }
101
-
102
- /** \brief Reports whether previous computation was successful.
103
- *
104
- * \returns \c Success if computation was succesful,
105
- * \c NumericalIssue if the matrix.appears to be negative.
106
- */
107
- ComputationInfo info() const
108
- {
109
- eigen_assert(m_isInitialized && "Decomposition is not initialized.");
110
- return m_info;
111
- }
112
-
113
- /** \returns the permutation P
114
- * \sa permutationPinv() */
115
- const PermutationMatrix<Dynamic,Dynamic,StorageIndex>& permutationP() const
116
- { return m_P; }
117
-
118
- /** \returns the inverse P^-1 of the permutation P
119
- * \sa permutationP() */
120
- const PermutationMatrix<Dynamic,Dynamic,StorageIndex>& permutationPinv() const
121
- { return m_Pinv; }
122
-
123
- /** Sets the shift parameters that will be used to adjust the diagonal coefficients during the numerical factorization.
124
- *
125
- * During the numerical factorization, the diagonal coefficients are transformed by the following linear model:\n
126
- * \c d_ii = \a offset + \a scale * \c d_ii
127
- *
128
- * The default is the identity transformation with \a offset=0, and \a scale=1.
129
- *
130
- * \returns a reference to \c *this.
131
- */
132
- Derived& setShift(const RealScalar& offset, const RealScalar& scale = 1)
133
- {
134
- m_shiftOffset = offset;
135
- m_shiftScale = scale;
136
- return derived();
137
- }
84
+ Derived& derived() { return *static_cast<Derived*>(this); }
85
+ const Derived& derived() const { return *static_cast<const Derived*>(this); }
86
+
87
+ inline Index cols() const { return m_matrix.cols(); }
88
+ inline Index rows() const { return m_matrix.rows(); }
89
+
90
+ /** \brief Reports whether previous computation was successful.
91
+ *
92
+ * \returns \c Success if computation was successful,
93
+ * \c NumericalIssue if the matrix.appears to be negative.
94
+ */
95
+ ComputationInfo info() const {
96
+ eigen_assert(m_isInitialized && "Decomposition is not initialized.");
97
+ return m_info;
98
+ }
99
+
100
+ /** \returns the permutation P
101
+ * \sa permutationPinv() */
102
+ const PermutationMatrix<Dynamic, Dynamic, StorageIndex>& permutationP() const { return m_P; }
103
+
104
+ /** \returns the inverse P^-1 of the permutation P
105
+ * \sa permutationP() */
106
+ const PermutationMatrix<Dynamic, Dynamic, StorageIndex>& permutationPinv() const { return m_Pinv; }
107
+
108
+ /** Sets the shift parameters that will be used to adjust the diagonal coefficients during the numerical
109
+ * factorization.
110
+ *
111
+ * During the numerical factorization, the diagonal coefficients are transformed by the following linear model:\n
112
+ * \c d_ii = \a offset + \a scale * \c d_ii
113
+ *
114
+ * The default is the identity transformation with \a offset=0, and \a scale=1.
115
+ *
116
+ * \returns a reference to \c *this.
117
+ */
118
+ Derived& setShift(const DiagonalScalar& offset, const DiagonalScalar& scale = 1) {
119
+ m_shiftOffset = offset;
120
+ m_shiftScale = scale;
121
+ return derived();
122
+ }
138
123
 
139
124
  #ifndef EIGEN_PARSED_BY_DOXYGEN
140
- /** \internal */
141
- template<typename Stream>
142
- void dumpMemory(Stream& s)
143
- {
144
- int total = 0;
145
- s << " L: " << ((total+=(m_matrix.cols()+1) * sizeof(int) + m_matrix.nonZeros()*(sizeof(int)+sizeof(Scalar))) >> 20) << "Mb" << "\n";
146
- s << " diag: " << ((total+=m_diag.size() * sizeof(Scalar)) >> 20) << "Mb" << "\n";
147
- s << " tree: " << ((total+=m_parent.size() * sizeof(int)) >> 20) << "Mb" << "\n";
148
- s << " nonzeros: " << ((total+=m_nonZerosPerCol.size() * sizeof(int)) >> 20) << "Mb" << "\n";
149
- s << " perm: " << ((total+=m_P.size() * sizeof(int)) >> 20) << "Mb" << "\n";
150
- s << " perm^-1: " << ((total+=m_Pinv.size() * sizeof(int)) >> 20) << "Mb" << "\n";
151
- s << " TOTAL: " << (total>> 20) << "Mb" << "\n";
152
- }
125
+ /** \internal */
126
+ template <typename Stream>
127
+ void dumpMemory(Stream& s) {
128
+ int total = 0;
129
+ s << " L: "
130
+ << ((total += (m_matrix.cols() + 1) * sizeof(int) + m_matrix.nonZeros() * (sizeof(int) + sizeof(Scalar))) >> 20)
131
+ << "Mb"
132
+ << "\n";
133
+ s << " diag: " << ((total += m_diag.size() * sizeof(Scalar)) >> 20) << "Mb"
134
+ << "\n";
135
+ s << " tree: " << ((total += m_parent.size() * sizeof(int)) >> 20) << "Mb"
136
+ << "\n";
137
+ s << " nonzeros: " << ((total += m_workSpace.size() * sizeof(int)) >> 20) << "Mb"
138
+ << "\n";
139
+ s << " perm: " << ((total += m_P.size() * sizeof(int)) >> 20) << "Mb"
140
+ << "\n";
141
+ s << " perm^-1: " << ((total += m_Pinv.size() * sizeof(int)) >> 20) << "Mb"
142
+ << "\n";
143
+ s << " TOTAL: " << (total >> 20) << "Mb"
144
+ << "\n";
145
+ }
153
146
 
154
- /** \internal */
155
- template<typename Rhs,typename Dest>
156
- void _solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest> &dest) const
157
- {
158
- eigen_assert(m_factorizationIsOk && "The decomposition is not in a valid state for solving, you must first call either compute() or symbolic()/numeric()");
159
- eigen_assert(m_matrix.rows()==b.rows());
147
+ /** \internal */
148
+ template <typename Rhs, typename Dest>
149
+ void _solve_impl(const MatrixBase<Rhs>& b, MatrixBase<Dest>& dest) const {
150
+ eigen_assert(m_factorizationIsOk &&
151
+ "The decomposition is not in a valid state for solving, you must first call either compute() or "
152
+ "symbolic()/numeric()");
153
+ eigen_assert(m_matrix.rows() == b.rows());
160
154
 
161
- if(m_info!=Success)
162
- return;
155
+ if (m_info != Success) return;
163
156
 
164
- if(m_P.size()>0)
165
- dest = m_P * b;
166
- else
167
- dest = b;
157
+ if (m_P.size() > 0)
158
+ dest = m_P * b;
159
+ else
160
+ dest = b;
168
161
 
169
- if(m_matrix.nonZeros()>0) // otherwise L==I
170
- derived().matrixL().solveInPlace(dest);
162
+ if (m_matrix.nonZeros() > 0) // otherwise L==I
163
+ derived().matrixL().solveInPlace(dest);
171
164
 
172
- if(m_diag.size()>0)
173
- dest = m_diag.asDiagonal().inverse() * dest;
165
+ if (m_diag.size() > 0) dest = m_diag.asDiagonal().inverse() * dest;
174
166
 
175
- if (m_matrix.nonZeros()>0) // otherwise U==I
176
- derived().matrixU().solveInPlace(dest);
167
+ if (m_matrix.nonZeros() > 0) // otherwise U==I
168
+ derived().matrixU().solveInPlace(dest);
177
169
 
178
- if(m_P.size()>0)
179
- dest = m_Pinv * dest;
180
- }
181
-
182
- template<typename Rhs,typename Dest>
183
- void _solve_impl(const SparseMatrixBase<Rhs> &b, SparseMatrixBase<Dest> &dest) const
184
- {
185
- internal::solve_sparse_through_dense_panels(derived(), b, dest);
186
- }
170
+ if (m_P.size() > 0) dest = m_Pinv * dest;
171
+ }
187
172
 
188
- #endif // EIGEN_PARSED_BY_DOXYGEN
173
+ template <typename Rhs, typename Dest>
174
+ void _solve_impl(const SparseMatrixBase<Rhs>& b, SparseMatrixBase<Dest>& dest) const {
175
+ internal::solve_sparse_through_dense_panels(derived(), b, dest);
176
+ }
189
177
 
190
- protected:
191
-
192
- /** Computes the sparse Cholesky decomposition of \a matrix */
193
- template<bool DoLDLT>
194
- void compute(const MatrixType& matrix)
195
- {
196
- eigen_assert(matrix.rows()==matrix.cols());
197
- Index size = matrix.cols();
198
- CholMatrixType tmp(size,size);
199
- ConstCholMatrixPtr pmat;
200
- ordering(matrix, pmat, tmp);
201
- analyzePattern_preordered(*pmat, DoLDLT);
202
- factorize_preordered<DoLDLT>(*pmat);
203
- }
204
-
205
- template<bool DoLDLT>
206
- void factorize(const MatrixType& a)
207
- {
208
- eigen_assert(a.rows()==a.cols());
209
- Index size = a.cols();
210
- CholMatrixType tmp(size,size);
211
- ConstCholMatrixPtr pmat;
212
-
213
- if(m_P.size()==0 && (UpLo&Upper)==Upper)
214
- {
215
- // If there is no ordering, try to directly use the input matrix without any copy
216
- internal::simplicial_cholesky_grab_input<CholMatrixType,MatrixType>::run(a, pmat, tmp);
217
- }
218
- else
219
- {
220
- tmp.template selfadjointView<Upper>() = a.template selfadjointView<UpLo>().twistedBy(m_P);
221
- pmat = &tmp;
222
- }
223
-
224
- factorize_preordered<DoLDLT>(*pmat);
178
+ #endif // EIGEN_PARSED_BY_DOXYGEN
179
+
180
+ protected:
181
+ /** Computes the sparse Cholesky decomposition of \a matrix */
182
+ template <bool DoLDLT, bool NonHermitian>
183
+ void compute(const MatrixType& matrix) {
184
+ eigen_assert(matrix.rows() == matrix.cols());
185
+ Index size = matrix.cols();
186
+ CholMatrixType tmp(size, size);
187
+ ConstCholMatrixPtr pmat;
188
+ ordering<NonHermitian>(matrix, pmat, tmp);
189
+ analyzePattern_preordered(*pmat, DoLDLT);
190
+ factorize_preordered<DoLDLT, NonHermitian>(*pmat);
191
+ }
192
+
193
+ template <bool DoLDLT, bool NonHermitian>
194
+ void factorize(const MatrixType& a) {
195
+ eigen_assert(a.rows() == a.cols());
196
+ Index size = a.cols();
197
+ CholMatrixType tmp(size, size);
198
+ ConstCholMatrixPtr pmat;
199
+
200
+ if (m_P.size() == 0 && (int(UpLo) & int(Upper)) == Upper) {
201
+ // If there is no ordering, try to directly use the input matrix without any copy
202
+ internal::simplicial_cholesky_grab_input<CholMatrixType, MatrixType>::run(a, pmat, tmp);
203
+ } else {
204
+ internal::permute_symm_to_symm<UpLo, Upper, NonHermitian>(a, tmp, m_P.indices().data());
205
+ pmat = &tmp;
225
206
  }
226
207
 
227
- template<bool DoLDLT>
228
- void factorize_preordered(const CholMatrixType& a);
208
+ factorize_preordered<DoLDLT, NonHermitian>(*pmat);
209
+ }
229
210
 
230
- void analyzePattern(const MatrixType& a, bool doLDLT)
231
- {
232
- eigen_assert(a.rows()==a.cols());
233
- Index size = a.cols();
234
- CholMatrixType tmp(size,size);
235
- ConstCholMatrixPtr pmat;
236
- ordering(a, pmat, tmp);
237
- analyzePattern_preordered(*pmat,doLDLT);
238
- }
239
- void analyzePattern_preordered(const CholMatrixType& a, bool doLDLT);
240
-
241
- void ordering(const MatrixType& a, ConstCholMatrixPtr &pmat, CholMatrixType& ap);
242
-
243
- /** keeps off-diagonal entries; drops diagonal entries */
244
- struct keep_diag {
245
- inline bool operator() (const Index& row, const Index& col, const Scalar&) const
246
- {
247
- return row!=col;
248
- }
249
- };
250
-
251
- mutable ComputationInfo m_info;
252
- bool m_factorizationIsOk;
253
- bool m_analysisIsOk;
254
-
255
- CholMatrixType m_matrix;
256
- VectorType m_diag; // the diagonal coefficients (LDLT mode)
257
- VectorI m_parent; // elimination tree
258
- VectorI m_nonZerosPerCol;
259
- PermutationMatrix<Dynamic,Dynamic,StorageIndex> m_P; // the permutation
260
- PermutationMatrix<Dynamic,Dynamic,StorageIndex> m_Pinv; // the inverse permutation
261
-
262
- RealScalar m_shiftOffset;
263
- RealScalar m_shiftScale;
211
+ template <bool DoLDLT, bool NonHermitian>
212
+ void factorize_preordered(const CholMatrixType& a);
213
+
214
+ template <bool DoLDLT, bool NonHermitian>
215
+ void analyzePattern(const MatrixType& a) {
216
+ eigen_assert(a.rows() == a.cols());
217
+ Index size = a.cols();
218
+ CholMatrixType tmp(size, size);
219
+ ConstCholMatrixPtr pmat;
220
+ ordering<NonHermitian>(a, pmat, tmp);
221
+ analyzePattern_preordered(*pmat, DoLDLT);
222
+ }
223
+ void analyzePattern_preordered(const CholMatrixType& a, bool doLDLT);
224
+
225
+ template <bool NonHermitian>
226
+ void ordering(const MatrixType& a, ConstCholMatrixPtr& pmat, CholMatrixType& ap);
227
+
228
+ inline DiagonalScalar getDiag(Scalar x) { return internal::traits<Derived>::getDiag(x); }
229
+ inline Scalar getSymm(Scalar x) { return internal::traits<Derived>::getSymm(x); }
230
+
231
+ /** keeps off-diagonal entries; drops diagonal entries */
232
+ struct keep_diag {
233
+ inline bool operator()(const Index& row, const Index& col, const Scalar&) const { return row != col; }
234
+ };
235
+
236
+ mutable ComputationInfo m_info;
237
+ bool m_factorizationIsOk;
238
+ bool m_analysisIsOk;
239
+
240
+ CholMatrixType m_matrix;
241
+ VectorType m_diag; // the diagonal coefficients (LDLT mode)
242
+ VectorI m_parent; // elimination tree
243
+ VectorI m_workSpace;
244
+ PermutationMatrix<Dynamic, Dynamic, StorageIndex> m_P; // the permutation
245
+ PermutationMatrix<Dynamic, Dynamic, StorageIndex> m_Pinv; // the inverse permutation
246
+
247
+ DiagonalScalar m_shiftOffset;
248
+ DiagonalScalar m_shiftScale;
264
249
  };
265
250
 
266
- template<typename _MatrixType, int _UpLo = Lower, typename _Ordering = AMDOrdering<typename _MatrixType::StorageIndex> > class SimplicialLLT;
267
- template<typename _MatrixType, int _UpLo = Lower, typename _Ordering = AMDOrdering<typename _MatrixType::StorageIndex> > class SimplicialLDLT;
268
- template<typename _MatrixType, int _UpLo = Lower, typename _Ordering = AMDOrdering<typename _MatrixType::StorageIndex> > class SimplicialCholesky;
251
+ template <typename MatrixType_, int UpLo_ = Lower,
252
+ typename Ordering_ = AMDOrdering<typename MatrixType_::StorageIndex> >
253
+ class SimplicialLLT;
254
+ template <typename MatrixType_, int UpLo_ = Lower,
255
+ typename Ordering_ = AMDOrdering<typename MatrixType_::StorageIndex> >
256
+ class SimplicialLDLT;
257
+ template <typename MatrixType_, int UpLo_ = Lower,
258
+ typename Ordering_ = AMDOrdering<typename MatrixType_::StorageIndex> >
259
+ class SimplicialNonHermitianLLT;
260
+ template <typename MatrixType_, int UpLo_ = Lower,
261
+ typename Ordering_ = AMDOrdering<typename MatrixType_::StorageIndex> >
262
+ class SimplicialNonHermitianLDLT;
263
+ template <typename MatrixType_, int UpLo_ = Lower,
264
+ typename Ordering_ = AMDOrdering<typename MatrixType_::StorageIndex> >
265
+ class SimplicialCholesky;
269
266
 
270
267
  namespace internal {
271
268
 
272
- template<typename _MatrixType, int _UpLo, typename _Ordering> struct traits<SimplicialLLT<_MatrixType,_UpLo,_Ordering> >
273
- {
274
- typedef _MatrixType MatrixType;
275
- typedef _Ordering OrderingType;
276
- enum { UpLo = _UpLo };
277
- typedef typename MatrixType::Scalar Scalar;
278
- typedef typename MatrixType::StorageIndex StorageIndex;
279
- typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
280
- typedef TriangularView<const CholMatrixType, Eigen::Lower> MatrixL;
281
- typedef TriangularView<const typename CholMatrixType::AdjointReturnType, Eigen::Upper> MatrixU;
282
- static inline MatrixL getL(const MatrixType& m) { return MatrixL(m); }
283
- static inline MatrixU getU(const MatrixType& m) { return MatrixU(m.adjoint()); }
269
+ template <typename MatrixType_, int UpLo_, typename Ordering_>
270
+ struct traits<SimplicialLLT<MatrixType_, UpLo_, Ordering_> > {
271
+ typedef MatrixType_ MatrixType;
272
+ typedef Ordering_ OrderingType;
273
+ enum { UpLo = UpLo_ };
274
+ typedef typename MatrixType::Scalar Scalar;
275
+ typedef typename MatrixType::RealScalar DiagonalScalar;
276
+ typedef typename MatrixType::StorageIndex StorageIndex;
277
+ typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
278
+ typedef TriangularView<const CholMatrixType, Eigen::Lower> MatrixL;
279
+ typedef TriangularView<const typename CholMatrixType::AdjointReturnType, Eigen::Upper> MatrixU;
280
+ static inline MatrixL getL(const CholMatrixType& m) { return MatrixL(m); }
281
+ static inline MatrixU getU(const CholMatrixType& m) { return MatrixU(m.adjoint()); }
282
+ static inline DiagonalScalar getDiag(Scalar x) { return numext::real(x); }
283
+ static inline Scalar getSymm(Scalar x) { return numext::conj(x); }
284
284
  };
285
285
 
286
- template<typename _MatrixType,int _UpLo, typename _Ordering> struct traits<SimplicialLDLT<_MatrixType,_UpLo,_Ordering> >
287
- {
288
- typedef _MatrixType MatrixType;
289
- typedef _Ordering OrderingType;
290
- enum { UpLo = _UpLo };
291
- typedef typename MatrixType::Scalar Scalar;
292
- typedef typename MatrixType::StorageIndex StorageIndex;
293
- typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
294
- typedef TriangularView<const CholMatrixType, Eigen::UnitLower> MatrixL;
286
+ template <typename MatrixType_, int UpLo_, typename Ordering_>
287
+ struct traits<SimplicialLDLT<MatrixType_, UpLo_, Ordering_> > {
288
+ typedef MatrixType_ MatrixType;
289
+ typedef Ordering_ OrderingType;
290
+ enum { UpLo = UpLo_ };
291
+ typedef typename MatrixType::Scalar Scalar;
292
+ typedef typename MatrixType::RealScalar DiagonalScalar;
293
+ typedef typename MatrixType::StorageIndex StorageIndex;
294
+ typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
295
+ typedef TriangularView<const CholMatrixType, Eigen::UnitLower> MatrixL;
295
296
  typedef TriangularView<const typename CholMatrixType::AdjointReturnType, Eigen::UnitUpper> MatrixU;
296
- static inline MatrixL getL(const MatrixType& m) { return MatrixL(m); }
297
- static inline MatrixU getU(const MatrixType& m) { return MatrixU(m.adjoint()); }
297
+ static inline MatrixL getL(const CholMatrixType& m) { return MatrixL(m); }
298
+ static inline MatrixU getU(const CholMatrixType& m) { return MatrixU(m.adjoint()); }
299
+ static inline DiagonalScalar getDiag(Scalar x) { return numext::real(x); }
300
+ static inline Scalar getSymm(Scalar x) { return numext::conj(x); }
298
301
  };
299
302
 
300
- template<typename _MatrixType, int _UpLo, typename _Ordering> struct traits<SimplicialCholesky<_MatrixType,_UpLo,_Ordering> >
301
- {
302
- typedef _MatrixType MatrixType;
303
- typedef _Ordering OrderingType;
304
- enum { UpLo = _UpLo };
303
+ template <typename MatrixType_, int UpLo_, typename Ordering_>
304
+ struct traits<SimplicialNonHermitianLLT<MatrixType_, UpLo_, Ordering_> > {
305
+ typedef MatrixType_ MatrixType;
306
+ typedef Ordering_ OrderingType;
307
+ enum { UpLo = UpLo_ };
308
+ typedef typename MatrixType::Scalar Scalar;
309
+ typedef typename MatrixType::Scalar DiagonalScalar;
310
+ typedef typename MatrixType::StorageIndex StorageIndex;
311
+ typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
312
+ typedef TriangularView<const CholMatrixType, Eigen::Lower> MatrixL;
313
+ typedef TriangularView<const typename CholMatrixType::ConstTransposeReturnType, Eigen::Upper> MatrixU;
314
+ static inline MatrixL getL(const CholMatrixType& m) { return MatrixL(m); }
315
+ static inline MatrixU getU(const CholMatrixType& m) { return MatrixU(m.transpose()); }
316
+ static inline DiagonalScalar getDiag(Scalar x) { return x; }
317
+ static inline Scalar getSymm(Scalar x) { return x; }
305
318
  };
306
319
 
307
- }
320
+ template <typename MatrixType_, int UpLo_, typename Ordering_>
321
+ struct traits<SimplicialNonHermitianLDLT<MatrixType_, UpLo_, Ordering_> > {
322
+ typedef MatrixType_ MatrixType;
323
+ typedef Ordering_ OrderingType;
324
+ enum { UpLo = UpLo_ };
325
+ typedef typename MatrixType::Scalar Scalar;
326
+ typedef typename MatrixType::Scalar DiagonalScalar;
327
+ typedef typename MatrixType::StorageIndex StorageIndex;
328
+ typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
329
+ typedef TriangularView<const CholMatrixType, Eigen::UnitLower> MatrixL;
330
+ typedef TriangularView<const typename CholMatrixType::ConstTransposeReturnType, Eigen::UnitUpper> MatrixU;
331
+ static inline MatrixL getL(const CholMatrixType& m) { return MatrixL(m); }
332
+ static inline MatrixU getU(const CholMatrixType& m) { return MatrixU(m.transpose()); }
333
+ static inline DiagonalScalar getDiag(Scalar x) { return x; }
334
+ static inline Scalar getSymm(Scalar x) { return x; }
335
+ };
336
+
337
+ template <typename MatrixType_, int UpLo_, typename Ordering_>
338
+ struct traits<SimplicialCholesky<MatrixType_, UpLo_, Ordering_> > {
339
+ typedef MatrixType_ MatrixType;
340
+ typedef Ordering_ OrderingType;
341
+ enum { UpLo = UpLo_ };
342
+ typedef typename MatrixType::Scalar Scalar;
343
+ typedef typename MatrixType::RealScalar DiagonalScalar;
344
+ static inline DiagonalScalar getDiag(Scalar x) { return numext::real(x); }
345
+ static inline Scalar getSymm(Scalar x) { return numext::conj(x); }
346
+ };
347
+
348
+ } // namespace internal
308
349
 
309
350
  /** \ingroup SparseCholesky_Module
310
- * \class SimplicialLLT
311
- * \brief A direct sparse LLT Cholesky factorizations
312
- *
313
- * This class provides a LL^T Cholesky factorizations of sparse matrices that are
314
- * selfadjoint and positive definite. The factorization allows for solving A.X = B where
315
- * X and B can be either dense or sparse.
316
- *
317
- * In order to reduce the fill-in, a symmetric permutation P is applied prior to the factorization
318
- * such that the factorized matrix is P A P^-1.
319
- *
320
- * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<>
321
- * \tparam _UpLo the triangular part that will be used for the computations. It can be Lower
322
- * or Upper. Default is Lower.
323
- * \tparam _Ordering The ordering method to use, either AMDOrdering<> or NaturalOrdering<>. Default is AMDOrdering<>
324
- *
325
- * \implsparsesolverconcept
326
- *
327
- * \sa class SimplicialLDLT, class AMDOrdering, class NaturalOrdering
328
- */
329
- template<typename _MatrixType, int _UpLo, typename _Ordering>
330
- class SimplicialLLT : public SimplicialCholeskyBase<SimplicialLLT<_MatrixType,_UpLo,_Ordering> >
331
- {
332
- public:
333
- typedef _MatrixType MatrixType;
334
- enum { UpLo = _UpLo };
335
- typedef SimplicialCholeskyBase<SimplicialLLT> Base;
336
- typedef typename MatrixType::Scalar Scalar;
337
- typedef typename MatrixType::RealScalar RealScalar;
338
- typedef typename MatrixType::StorageIndex StorageIndex;
339
- typedef SparseMatrix<Scalar,ColMajor,Index> CholMatrixType;
340
- typedef Matrix<Scalar,Dynamic,1> VectorType;
341
- typedef internal::traits<SimplicialLLT> Traits;
342
- typedef typename Traits::MatrixL MatrixL;
343
- typedef typename Traits::MatrixU MatrixU;
344
- public:
345
- /** Default constructor */
346
- SimplicialLLT() : Base() {}
347
- /** Constructs and performs the LLT factorization of \a matrix */
348
- explicit SimplicialLLT(const MatrixType& matrix)
349
- : Base(matrix) {}
350
-
351
- /** \returns an expression of the factor L */
352
- inline const MatrixL matrixL() const {
353
- eigen_assert(Base::m_factorizationIsOk && "Simplicial LLT not factorized");
354
- return Traits::getL(Base::m_matrix);
355
- }
351
+ * \class SimplicialLLT
352
+ * \brief A direct sparse LLT Cholesky factorizations
353
+ *
354
+ * This class provides a LL^T Cholesky factorizations of sparse matrices that are
355
+ * selfadjoint and positive definite. The factorization allows for solving A.X = B where
356
+ * X and B can be either dense or sparse.
357
+ *
358
+ * In order to reduce the fill-in, a symmetric permutation P is applied prior to the factorization
359
+ * such that the factorized matrix is P A P^-1.
360
+ *
361
+ * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
362
+ * \tparam UpLo_ the triangular part that will be used for the computations. It can be Lower
363
+ * or Upper. Default is Lower.
364
+ * \tparam Ordering_ The ordering method to use, either AMDOrdering<> or NaturalOrdering<>. Default is AMDOrdering<>
365
+ *
366
+ * \implsparsesolverconcept
367
+ *
368
+ * \sa class SimplicialLDLT, class AMDOrdering, class NaturalOrdering
369
+ */
370
+ template <typename MatrixType_, int UpLo_, typename Ordering_>
371
+ class SimplicialLLT : public SimplicialCholeskyBase<SimplicialLLT<MatrixType_, UpLo_, Ordering_> > {
372
+ public:
373
+ typedef MatrixType_ MatrixType;
374
+ enum { UpLo = UpLo_ };
375
+ typedef SimplicialCholeskyBase<SimplicialLLT> Base;
376
+ typedef typename MatrixType::Scalar Scalar;
377
+ typedef typename MatrixType::RealScalar RealScalar;
378
+ typedef typename MatrixType::StorageIndex StorageIndex;
379
+ typedef SparseMatrix<Scalar, ColMajor, Index> CholMatrixType;
380
+ typedef Matrix<Scalar, Dynamic, 1> VectorType;
381
+ typedef internal::traits<SimplicialLLT> Traits;
382
+ typedef typename Traits::MatrixL MatrixL;
383
+ typedef typename Traits::MatrixU MatrixU;
384
+
385
+ public:
386
+ /** Default constructor */
387
+ SimplicialLLT() : Base() {}
388
+ /** Constructs and performs the LLT factorization of \a matrix */
389
+ explicit SimplicialLLT(const MatrixType& matrix) : Base(matrix) {}
390
+
391
+ /** \returns an expression of the factor L */
392
+ inline const MatrixL matrixL() const {
393
+ eigen_assert(Base::m_factorizationIsOk && "Simplicial LLT not factorized");
394
+ return Traits::getL(Base::m_matrix);
395
+ }
356
396
 
357
- /** \returns an expression of the factor U (= L^*) */
358
- inline const MatrixU matrixU() const {
359
- eigen_assert(Base::m_factorizationIsOk && "Simplicial LLT not factorized");
360
- return Traits::getU(Base::m_matrix);
361
- }
362
-
363
- /** Computes the sparse Cholesky decomposition of \a matrix */
364
- SimplicialLLT& compute(const MatrixType& matrix)
365
- {
366
- Base::template compute<false>(matrix);
367
- return *this;
368
- }
397
+ /** \returns an expression of the factor U (= L^*) */
398
+ inline const MatrixU matrixU() const {
399
+ eigen_assert(Base::m_factorizationIsOk && "Simplicial LLT not factorized");
400
+ return Traits::getU(Base::m_matrix);
401
+ }
369
402
 
370
- /** Performs a symbolic decomposition on the sparcity of \a matrix.
371
- *
372
- * This function is particularly useful when solving for several problems having the same structure.
373
- *
374
- * \sa factorize()
375
- */
376
- void analyzePattern(const MatrixType& a)
377
- {
378
- Base::analyzePattern(a, false);
379
- }
403
+ /** Computes the sparse Cholesky decomposition of \a matrix */
404
+ SimplicialLLT& compute(const MatrixType& matrix) {
405
+ Base::template compute<false, false>(matrix);
406
+ return *this;
407
+ }
380
408
 
381
- /** Performs a numeric decomposition of \a matrix
382
- *
383
- * The given matrix must has the same sparcity than the matrix on which the symbolic decomposition has been performed.
384
- *
385
- * \sa analyzePattern()
386
- */
387
- void factorize(const MatrixType& a)
388
- {
389
- Base::template factorize<false>(a);
390
- }
409
+ /** Performs a symbolic decomposition on the sparsity of \a matrix.
410
+ *
411
+ * This function is particularly useful when solving for several problems having the same structure.
412
+ *
413
+ * \sa factorize()
414
+ */
415
+ void analyzePattern(const MatrixType& a) { Base::template analyzePattern<false, false>(a); }
416
+
417
+ /** Performs a numeric decomposition of \a matrix
418
+ *
419
+ * The given matrix must have the same sparsity than the matrix on which the symbolic decomposition has been
420
+ * performed.
421
+ *
422
+ * \sa analyzePattern()
423
+ */
424
+ void factorize(const MatrixType& a) { Base::template factorize<false, false>(a); }
425
+
426
+ /** \returns the determinant of the underlying matrix from the current factorization */
427
+ Scalar determinant() const {
428
+ Scalar detL = Base::m_matrix.diagonal().prod();
429
+ return numext::abs2(detL);
430
+ }
431
+ };
391
432
 
392
- /** \returns the determinant of the underlying matrix from the current factorization */
393
- Scalar determinant() const
394
- {
395
- Scalar detL = Base::m_matrix.diagonal().prod();
396
- return numext::abs2(detL);
397
- }
433
+ /** \ingroup SparseCholesky_Module
434
+ * \class SimplicialLDLT
435
+ * \brief A direct sparse LDLT Cholesky factorizations without square root.
436
+ *
437
+ * This class provides a LDL^T Cholesky factorizations without square root of sparse matrices that are
438
+ * selfadjoint and positive definite. The factorization allows for solving A.X = B where
439
+ * X and B can be either dense or sparse.
440
+ *
441
+ * In order to reduce the fill-in, a symmetric permutation P is applied prior to the factorization
442
+ * such that the factorized matrix is P A P^-1.
443
+ *
444
+ * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
445
+ * \tparam UpLo_ the triangular part that will be used for the computations. It can be Lower
446
+ * or Upper. Default is Lower.
447
+ * \tparam Ordering_ The ordering method to use, either AMDOrdering<> or NaturalOrdering<>. Default is AMDOrdering<>
448
+ *
449
+ * \implsparsesolverconcept
450
+ *
451
+ * \sa class SimplicialLLT, class AMDOrdering, class NaturalOrdering
452
+ */
453
+ template <typename MatrixType_, int UpLo_, typename Ordering_>
454
+ class SimplicialLDLT : public SimplicialCholeskyBase<SimplicialLDLT<MatrixType_, UpLo_, Ordering_> > {
455
+ public:
456
+ typedef MatrixType_ MatrixType;
457
+ enum { UpLo = UpLo_ };
458
+ typedef SimplicialCholeskyBase<SimplicialLDLT> Base;
459
+ typedef typename MatrixType::Scalar Scalar;
460
+ typedef typename MatrixType::RealScalar RealScalar;
461
+ typedef typename MatrixType::StorageIndex StorageIndex;
462
+ typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
463
+ typedef Matrix<Scalar, Dynamic, 1> VectorType;
464
+ typedef internal::traits<SimplicialLDLT> Traits;
465
+ typedef typename Traits::MatrixL MatrixL;
466
+ typedef typename Traits::MatrixU MatrixU;
467
+
468
+ public:
469
+ /** Default constructor */
470
+ SimplicialLDLT() : Base() {}
471
+
472
+ /** Constructs and performs the LLT factorization of \a matrix */
473
+ explicit SimplicialLDLT(const MatrixType& matrix) : Base(matrix) {}
474
+
475
+ /** \returns a vector expression of the diagonal D */
476
+ inline const VectorType vectorD() const {
477
+ eigen_assert(Base::m_factorizationIsOk && "Simplicial LDLT not factorized");
478
+ return Base::m_diag;
479
+ }
480
+ /** \returns an expression of the factor L */
481
+ inline const MatrixL matrixL() const {
482
+ eigen_assert(Base::m_factorizationIsOk && "Simplicial LDLT not factorized");
483
+ return Traits::getL(Base::m_matrix);
484
+ }
485
+
486
+ /** \returns an expression of the factor U (= L^*) */
487
+ inline const MatrixU matrixU() const {
488
+ eigen_assert(Base::m_factorizationIsOk && "Simplicial LDLT not factorized");
489
+ return Traits::getU(Base::m_matrix);
490
+ }
491
+
492
+ /** Computes the sparse Cholesky decomposition of \a matrix */
493
+ SimplicialLDLT& compute(const MatrixType& matrix) {
494
+ Base::template compute<true, false>(matrix);
495
+ return *this;
496
+ }
497
+
498
+ /** Performs a symbolic decomposition on the sparsity of \a matrix.
499
+ *
500
+ * This function is particularly useful when solving for several problems having the same structure.
501
+ *
502
+ * \sa factorize()
503
+ */
504
+ void analyzePattern(const MatrixType& a) { Base::template analyzePattern<true, false>(a); }
505
+
506
+ /** Performs a numeric decomposition of \a matrix
507
+ *
508
+ * The given matrix must have the same sparsity than the matrix on which the symbolic decomposition has been
509
+ * performed.
510
+ *
511
+ * \sa analyzePattern()
512
+ */
513
+ void factorize(const MatrixType& a) { Base::template factorize<true, false>(a); }
514
+
515
+ /** \returns the determinant of the underlying matrix from the current factorization */
516
+ Scalar determinant() const { return Base::m_diag.prod(); }
398
517
  };
399
518
 
400
519
  /** \ingroup SparseCholesky_Module
401
- * \class SimplicialLDLT
402
- * \brief A direct sparse LDLT Cholesky factorizations without square root.
403
- *
404
- * This class provides a LDL^T Cholesky factorizations without square root of sparse matrices that are
405
- * selfadjoint and positive definite. The factorization allows for solving A.X = B where
406
- * X and B can be either dense or sparse.
407
- *
408
- * In order to reduce the fill-in, a symmetric permutation P is applied prior to the factorization
409
- * such that the factorized matrix is P A P^-1.
410
- *
411
- * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<>
412
- * \tparam _UpLo the triangular part that will be used for the computations. It can be Lower
413
- * or Upper. Default is Lower.
414
- * \tparam _Ordering The ordering method to use, either AMDOrdering<> or NaturalOrdering<>. Default is AMDOrdering<>
415
- *
416
- * \implsparsesolverconcept
417
- *
418
- * \sa class SimplicialLLT, class AMDOrdering, class NaturalOrdering
419
- */
420
- template<typename _MatrixType, int _UpLo, typename _Ordering>
421
- class SimplicialLDLT : public SimplicialCholeskyBase<SimplicialLDLT<_MatrixType,_UpLo,_Ordering> >
422
- {
423
- public:
424
- typedef _MatrixType MatrixType;
425
- enum { UpLo = _UpLo };
426
- typedef SimplicialCholeskyBase<SimplicialLDLT> Base;
427
- typedef typename MatrixType::Scalar Scalar;
428
- typedef typename MatrixType::RealScalar RealScalar;
429
- typedef typename MatrixType::StorageIndex StorageIndex;
430
- typedef SparseMatrix<Scalar,ColMajor,StorageIndex> CholMatrixType;
431
- typedef Matrix<Scalar,Dynamic,1> VectorType;
432
- typedef internal::traits<SimplicialLDLT> Traits;
433
- typedef typename Traits::MatrixL MatrixL;
434
- typedef typename Traits::MatrixU MatrixU;
435
- public:
436
- /** Default constructor */
437
- SimplicialLDLT() : Base() {}
438
-
439
- /** Constructs and performs the LLT factorization of \a matrix */
440
- explicit SimplicialLDLT(const MatrixType& matrix)
441
- : Base(matrix) {}
442
-
443
- /** \returns a vector expression of the diagonal D */
444
- inline const VectorType vectorD() const {
445
- eigen_assert(Base::m_factorizationIsOk && "Simplicial LDLT not factorized");
446
- return Base::m_diag;
447
- }
448
- /** \returns an expression of the factor L */
449
- inline const MatrixL matrixL() const {
450
- eigen_assert(Base::m_factorizationIsOk && "Simplicial LDLT not factorized");
451
- return Traits::getL(Base::m_matrix);
452
- }
520
+ * \class SimplicialNonHermitianLLT
521
+ * \brief A direct sparse LLT Cholesky factorizations, for symmetric non-hermitian matrices.
522
+ *
523
+ * This class provides a LL^T Cholesky factorizations of sparse matrices that are
524
+ * symmetric but not hermitian. For real matrices, this is equivalent to the regular LLT factorization.
525
+ * The factorization allows for solving A.X = B where X and B can be either dense or sparse.
526
+ *
527
+ * In order to reduce the fill-in, a symmetric permutation P is applied prior to the factorization
528
+ * such that the factorized matrix is P A P^-1.
529
+ *
530
+ * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
531
+ * \tparam UpLo_ the triangular part that will be used for the computations. It can be Lower
532
+ * or Upper. Default is Lower.
533
+ * \tparam Ordering_ The ordering method to use, either AMDOrdering<> or NaturalOrdering<>. Default is AMDOrdering<>
534
+ *
535
+ * \implsparsesolverconcept
536
+ *
537
+ * \sa class SimplicialNonHermitianLDLT, SimplicialLLT, class AMDOrdering, class NaturalOrdering
538
+ */
539
+ template <typename MatrixType_, int UpLo_, typename Ordering_>
540
+ class SimplicialNonHermitianLLT
541
+ : public SimplicialCholeskyBase<SimplicialNonHermitianLLT<MatrixType_, UpLo_, Ordering_> > {
542
+ public:
543
+ typedef MatrixType_ MatrixType;
544
+ enum { UpLo = UpLo_ };
545
+ typedef SimplicialCholeskyBase<SimplicialNonHermitianLLT> Base;
546
+ typedef typename MatrixType::Scalar Scalar;
547
+ typedef typename MatrixType::RealScalar RealScalar;
548
+ typedef typename MatrixType::StorageIndex StorageIndex;
549
+ typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
550
+ typedef Matrix<Scalar, Dynamic, 1> VectorType;
551
+ typedef internal::traits<SimplicialNonHermitianLLT> Traits;
552
+ typedef typename Traits::MatrixL MatrixL;
553
+ typedef typename Traits::MatrixU MatrixU;
554
+
555
+ public:
556
+ /** Default constructor */
557
+ SimplicialNonHermitianLLT() : Base() {}
558
+
559
+ /** Constructs and performs the LLT factorization of \a matrix */
560
+ explicit SimplicialNonHermitianLLT(const MatrixType& matrix) : Base(matrix) {}
561
+
562
+ /** \returns an expression of the factor L */
563
+ inline const MatrixL matrixL() const {
564
+ eigen_assert(Base::m_factorizationIsOk && "Simplicial LLT not factorized");
565
+ return Traits::getL(Base::m_matrix);
566
+ }
453
567
 
454
- /** \returns an expression of the factor U (= L^*) */
455
- inline const MatrixU matrixU() const {
456
- eigen_assert(Base::m_factorizationIsOk && "Simplicial LDLT not factorized");
457
- return Traits::getU(Base::m_matrix);
458
- }
568
+ /** \returns an expression of the factor U (= L^*) */
569
+ inline const MatrixU matrixU() const {
570
+ eigen_assert(Base::m_factorizationIsOk && "Simplicial LLT not factorized");
571
+ return Traits::getU(Base::m_matrix);
572
+ }
459
573
 
460
- /** Computes the sparse Cholesky decomposition of \a matrix */
461
- SimplicialLDLT& compute(const MatrixType& matrix)
462
- {
463
- Base::template compute<true>(matrix);
464
- return *this;
465
- }
466
-
467
- /** Performs a symbolic decomposition on the sparcity of \a matrix.
468
- *
469
- * This function is particularly useful when solving for several problems having the same structure.
470
- *
471
- * \sa factorize()
472
- */
473
- void analyzePattern(const MatrixType& a)
474
- {
475
- Base::analyzePattern(a, true);
476
- }
574
+ /** Computes the sparse Cholesky decomposition of \a matrix */
575
+ SimplicialNonHermitianLLT& compute(const MatrixType& matrix) {
576
+ Base::template compute<false, true>(matrix);
577
+ return *this;
578
+ }
477
579
 
478
- /** Performs a numeric decomposition of \a matrix
479
- *
480
- * The given matrix must has the same sparcity than the matrix on which the symbolic decomposition has been performed.
481
- *
482
- * \sa analyzePattern()
483
- */
484
- void factorize(const MatrixType& a)
485
- {
486
- Base::template factorize<true>(a);
487
- }
580
+ /** Performs a symbolic decomposition on the sparsity of \a matrix.
581
+ *
582
+ * This function is particularly useful when solving for several problems having the same structure.
583
+ *
584
+ * \sa factorize()
585
+ */
586
+ void analyzePattern(const MatrixType& a) { Base::template analyzePattern<false, true>(a); }
587
+
588
+ /** Performs a numeric decomposition of \a matrix
589
+ *
590
+ * The given matrix must have the same sparsity than the matrix on which the symbolic decomposition has been
591
+ * performed.
592
+ *
593
+ * \sa analyzePattern()
594
+ */
595
+ void factorize(const MatrixType& a) { Base::template factorize<false, true>(a); }
596
+
597
+ /** \returns the determinant of the underlying matrix from the current factorization */
598
+ Scalar determinant() const {
599
+ Scalar detL = Base::m_matrix.diagonal().prod();
600
+ return detL * detL;
601
+ }
602
+ };
488
603
 
489
- /** \returns the determinant of the underlying matrix from the current factorization */
490
- Scalar determinant() const
491
- {
492
- return Base::m_diag.prod();
493
- }
604
+ /** \ingroup SparseCholesky_Module
605
+ * \class SimplicialNonHermitianLDLT
606
+ * \brief A direct sparse LDLT Cholesky factorizations without square root, for symmetric non-hermitian matrices.
607
+ *
608
+ * This class provides a LDL^T Cholesky factorizations without square root of sparse matrices that are
609
+ * symmetric but not hermitian. For real matrices, this is equivalent to the regular LDLT factorization.
610
+ * The factorization allows for solving A.X = B where X and B can be either dense or sparse.
611
+ *
612
+ * In order to reduce the fill-in, a symmetric permutation P is applied prior to the factorization
613
+ * such that the factorized matrix is P A P^-1.
614
+ *
615
+ * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
616
+ * \tparam UpLo_ the triangular part that will be used for the computations. It can be Lower
617
+ * or Upper. Default is Lower.
618
+ * \tparam Ordering_ The ordering method to use, either AMDOrdering<> or NaturalOrdering<>. Default is AMDOrdering<>
619
+ *
620
+ * \implsparsesolverconcept
621
+ *
622
+ * \sa class SimplicialNonHermitianLLT, SimplicialLDLT, class AMDOrdering, class NaturalOrdering
623
+ */
624
+ template <typename MatrixType_, int UpLo_, typename Ordering_>
625
+ class SimplicialNonHermitianLDLT
626
+ : public SimplicialCholeskyBase<SimplicialNonHermitianLDLT<MatrixType_, UpLo_, Ordering_> > {
627
+ public:
628
+ typedef MatrixType_ MatrixType;
629
+ enum { UpLo = UpLo_ };
630
+ typedef SimplicialCholeskyBase<SimplicialNonHermitianLDLT> Base;
631
+ typedef typename MatrixType::Scalar Scalar;
632
+ typedef typename MatrixType::RealScalar RealScalar;
633
+ typedef typename MatrixType::StorageIndex StorageIndex;
634
+ typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
635
+ typedef Matrix<Scalar, Dynamic, 1> VectorType;
636
+ typedef internal::traits<SimplicialNonHermitianLDLT> Traits;
637
+ typedef typename Traits::MatrixL MatrixL;
638
+ typedef typename Traits::MatrixU MatrixU;
639
+
640
+ public:
641
+ /** Default constructor */
642
+ SimplicialNonHermitianLDLT() : Base() {}
643
+
644
+ /** Constructs and performs the LLT factorization of \a matrix */
645
+ explicit SimplicialNonHermitianLDLT(const MatrixType& matrix) : Base(matrix) {}
646
+
647
+ /** \returns a vector expression of the diagonal D */
648
+ inline const VectorType vectorD() const {
649
+ eigen_assert(Base::m_factorizationIsOk && "Simplicial LDLT not factorized");
650
+ return Base::m_diag;
651
+ }
652
+ /** \returns an expression of the factor L */
653
+ inline const MatrixL matrixL() const {
654
+ eigen_assert(Base::m_factorizationIsOk && "Simplicial LDLT not factorized");
655
+ return Traits::getL(Base::m_matrix);
656
+ }
657
+
658
+ /** \returns an expression of the factor U (= L^*) */
659
+ inline const MatrixU matrixU() const {
660
+ eigen_assert(Base::m_factorizationIsOk && "Simplicial LDLT not factorized");
661
+ return Traits::getU(Base::m_matrix);
662
+ }
663
+
664
+ /** Computes the sparse Cholesky decomposition of \a matrix */
665
+ SimplicialNonHermitianLDLT& compute(const MatrixType& matrix) {
666
+ Base::template compute<true, true>(matrix);
667
+ return *this;
668
+ }
669
+
670
+ /** Performs a symbolic decomposition on the sparsity of \a matrix.
671
+ *
672
+ * This function is particularly useful when solving for several problems having the same structure.
673
+ *
674
+ * \sa factorize()
675
+ */
676
+ void analyzePattern(const MatrixType& a) { Base::template analyzePattern<true, true>(a); }
677
+
678
+ /** Performs a numeric decomposition of \a matrix
679
+ *
680
+ * The given matrix must have the same sparsity than the matrix on which the symbolic decomposition has been
681
+ * performed.
682
+ *
683
+ * \sa analyzePattern()
684
+ */
685
+ void factorize(const MatrixType& a) { Base::template factorize<true, true>(a); }
686
+
687
+ /** \returns the determinant of the underlying matrix from the current factorization */
688
+ Scalar determinant() const { return Base::m_diag.prod(); }
494
689
  };
495
690
 
496
691
  /** \deprecated use SimplicialLDLT or class SimplicialLLT
497
- * \ingroup SparseCholesky_Module
498
- * \class SimplicialCholesky
499
- *
500
- * \sa class SimplicialLDLT, class SimplicialLLT
501
- */
502
- template<typename _MatrixType, int _UpLo, typename _Ordering>
503
- class SimplicialCholesky : public SimplicialCholeskyBase<SimplicialCholesky<_MatrixType,_UpLo,_Ordering> >
504
- {
505
- public:
506
- typedef _MatrixType MatrixType;
507
- enum { UpLo = _UpLo };
508
- typedef SimplicialCholeskyBase<SimplicialCholesky> Base;
509
- typedef typename MatrixType::Scalar Scalar;
510
- typedef typename MatrixType::RealScalar RealScalar;
511
- typedef typename MatrixType::StorageIndex StorageIndex;
512
- typedef SparseMatrix<Scalar,ColMajor,StorageIndex> CholMatrixType;
513
- typedef Matrix<Scalar,Dynamic,1> VectorType;
514
- typedef internal::traits<SimplicialCholesky> Traits;
515
- typedef internal::traits<SimplicialLDLT<MatrixType,UpLo> > LDLTTraits;
516
- typedef internal::traits<SimplicialLLT<MatrixType,UpLo> > LLTTraits;
517
- public:
518
- SimplicialCholesky() : Base(), m_LDLT(true) {}
519
-
520
- explicit SimplicialCholesky(const MatrixType& matrix)
521
- : Base(), m_LDLT(true)
522
- {
523
- compute(matrix);
524
- }
525
-
526
- SimplicialCholesky& setMode(SimplicialCholeskyMode mode)
527
- {
528
- switch(mode)
529
- {
692
+ * \ingroup SparseCholesky_Module
693
+ * \class SimplicialCholesky
694
+ *
695
+ * \sa class SimplicialLDLT, class SimplicialLLT
696
+ */
697
+ template <typename MatrixType_, int UpLo_, typename Ordering_>
698
+ class SimplicialCholesky : public SimplicialCholeskyBase<SimplicialCholesky<MatrixType_, UpLo_, Ordering_> > {
699
+ public:
700
+ typedef MatrixType_ MatrixType;
701
+ enum { UpLo = UpLo_ };
702
+ typedef SimplicialCholeskyBase<SimplicialCholesky> Base;
703
+ typedef typename MatrixType::Scalar Scalar;
704
+ typedef typename MatrixType::RealScalar RealScalar;
705
+ typedef typename MatrixType::StorageIndex StorageIndex;
706
+ typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
707
+ typedef Matrix<Scalar, Dynamic, 1> VectorType;
708
+ typedef internal::traits<SimplicialLDLT<MatrixType, UpLo> > LDLTTraits;
709
+ typedef internal::traits<SimplicialLLT<MatrixType, UpLo> > LLTTraits;
710
+
711
+ public:
712
+ SimplicialCholesky() : Base(), m_LDLT(true) {}
713
+
714
+ explicit SimplicialCholesky(const MatrixType& matrix) : Base(), m_LDLT(true) { compute(matrix); }
715
+
716
+ SimplicialCholesky& setMode(SimplicialCholeskyMode mode) {
717
+ switch (mode) {
530
718
  case SimplicialCholeskyLLT:
531
719
  m_LDLT = false;
532
720
  break;
@@ -535,155 +723,146 @@ public:
535
723
  break;
536
724
  default:
537
725
  break;
538
- }
539
-
540
- return *this;
541
726
  }
542
727
 
543
- inline const VectorType vectorD() const {
544
- eigen_assert(Base::m_factorizationIsOk && "Simplicial Cholesky not factorized");
545
- return Base::m_diag;
546
- }
547
- inline const CholMatrixType rawMatrix() const {
548
- eigen_assert(Base::m_factorizationIsOk && "Simplicial Cholesky not factorized");
549
- return Base::m_matrix;
550
- }
551
-
552
- /** Computes the sparse Cholesky decomposition of \a matrix */
553
- SimplicialCholesky& compute(const MatrixType& matrix)
728
+ return *this;
729
+ }
730
+
731
+ inline const VectorType vectorD() const {
732
+ eigen_assert(Base::m_factorizationIsOk && "Simplicial Cholesky not factorized");
733
+ return Base::m_diag;
734
+ }
735
+ inline const CholMatrixType rawMatrix() const {
736
+ eigen_assert(Base::m_factorizationIsOk && "Simplicial Cholesky not factorized");
737
+ return Base::m_matrix;
738
+ }
739
+
740
+ /** Computes the sparse Cholesky decomposition of \a matrix */
741
+ SimplicialCholesky& compute(const MatrixType& matrix) {
742
+ if (m_LDLT)
743
+ Base::template compute<true, false>(matrix);
744
+ else
745
+ Base::template compute<false, false>(matrix);
746
+ return *this;
747
+ }
748
+
749
+ /** Performs a symbolic decomposition on the sparsity of \a matrix.
750
+ *
751
+ * This function is particularly useful when solving for several problems having the same structure.
752
+ *
753
+ * \sa factorize()
754
+ */
755
+ void analyzePattern(const MatrixType& a) {
756
+ if (m_LDLT)
757
+ Base::template analyzePattern<true, false>(a);
758
+ else
759
+ Base::template analyzePattern<false, false>(a);
760
+ }
761
+
762
+ /** Performs a numeric decomposition of \a matrix
763
+ *
764
+ * The given matrix must have the same sparsity than the matrix on which the symbolic decomposition has been
765
+ * performed.
766
+ *
767
+ * \sa analyzePattern()
768
+ */
769
+ void factorize(const MatrixType& a) {
770
+ if (m_LDLT)
771
+ Base::template factorize<true, false>(a);
772
+ else
773
+ Base::template factorize<false, false>(a);
774
+ }
775
+
776
+ /** \internal */
777
+ template <typename Rhs, typename Dest>
778
+ void _solve_impl(const MatrixBase<Rhs>& b, MatrixBase<Dest>& dest) const {
779
+ eigen_assert(Base::m_factorizationIsOk &&
780
+ "The decomposition is not in a valid state for solving, you must first call either compute() or "
781
+ "symbolic()/numeric()");
782
+ eigen_assert(Base::m_matrix.rows() == b.rows());
783
+
784
+ if (Base::m_info != Success) return;
785
+
786
+ if (Base::m_P.size() > 0)
787
+ dest = Base::m_P * b;
788
+ else
789
+ dest = b;
790
+
791
+ if (Base::m_matrix.nonZeros() > 0) // otherwise L==I
554
792
  {
555
- if(m_LDLT)
556
- Base::template compute<true>(matrix);
793
+ if (m_LDLT)
794
+ LDLTTraits::getL(Base::m_matrix).solveInPlace(dest);
557
795
  else
558
- Base::template compute<false>(matrix);
559
- return *this;
796
+ LLTTraits::getL(Base::m_matrix).solveInPlace(dest);
560
797
  }
561
798
 
562
- /** Performs a symbolic decomposition on the sparcity of \a matrix.
563
- *
564
- * This function is particularly useful when solving for several problems having the same structure.
565
- *
566
- * \sa factorize()
567
- */
568
- void analyzePattern(const MatrixType& a)
569
- {
570
- Base::analyzePattern(a, m_LDLT);
571
- }
799
+ if (Base::m_diag.size() > 0) dest = Base::m_diag.real().asDiagonal().inverse() * dest;
572
800
 
573
- /** Performs a numeric decomposition of \a matrix
574
- *
575
- * The given matrix must has the same sparcity than the matrix on which the symbolic decomposition has been performed.
576
- *
577
- * \sa analyzePattern()
578
- */
579
- void factorize(const MatrixType& a)
801
+ if (Base::m_matrix.nonZeros() > 0) // otherwise I==I
580
802
  {
581
- if(m_LDLT)
582
- Base::template factorize<true>(a);
803
+ if (m_LDLT)
804
+ LDLTTraits::getU(Base::m_matrix).solveInPlace(dest);
583
805
  else
584
- Base::template factorize<false>(a);
806
+ LLTTraits::getU(Base::m_matrix).solveInPlace(dest);
585
807
  }
586
808
 
587
- /** \internal */
588
- template<typename Rhs,typename Dest>
589
- void _solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest> &dest) const
590
- {
591
- eigen_assert(Base::m_factorizationIsOk && "The decomposition is not in a valid state for solving, you must first call either compute() or symbolic()/numeric()");
592
- eigen_assert(Base::m_matrix.rows()==b.rows());
809
+ if (Base::m_P.size() > 0) dest = Base::m_Pinv * dest;
810
+ }
593
811
 
594
- if(Base::m_info!=Success)
595
- return;
812
+ /** \internal */
813
+ template <typename Rhs, typename Dest>
814
+ void _solve_impl(const SparseMatrixBase<Rhs>& b, SparseMatrixBase<Dest>& dest) const {
815
+ internal::solve_sparse_through_dense_panels(*this, b, dest);
816
+ }
596
817
 
597
- if(Base::m_P.size()>0)
598
- dest = Base::m_P * b;
599
- else
600
- dest = b;
601
-
602
- if(Base::m_matrix.nonZeros()>0) // otherwise L==I
603
- {
604
- if(m_LDLT)
605
- LDLTTraits::getL(Base::m_matrix).solveInPlace(dest);
606
- else
607
- LLTTraits::getL(Base::m_matrix).solveInPlace(dest);
608
- }
609
-
610
- if(Base::m_diag.size()>0)
611
- dest = Base::m_diag.real().asDiagonal().inverse() * dest;
612
-
613
- if (Base::m_matrix.nonZeros()>0) // otherwise I==I
614
- {
615
- if(m_LDLT)
616
- LDLTTraits::getU(Base::m_matrix).solveInPlace(dest);
617
- else
618
- LLTTraits::getU(Base::m_matrix).solveInPlace(dest);
619
- }
620
-
621
- if(Base::m_P.size()>0)
622
- dest = Base::m_Pinv * dest;
623
- }
624
-
625
- /** \internal */
626
- template<typename Rhs,typename Dest>
627
- void _solve_impl(const SparseMatrixBase<Rhs> &b, SparseMatrixBase<Dest> &dest) const
628
- {
629
- internal::solve_sparse_through_dense_panels(*this, b, dest);
630
- }
631
-
632
- Scalar determinant() const
633
- {
634
- if(m_LDLT)
635
- {
636
- return Base::m_diag.prod();
637
- }
638
- else
639
- {
640
- Scalar detL = Diagonal<const CholMatrixType>(Base::m_matrix).prod();
641
- return numext::abs2(detL);
642
- }
818
+ Scalar determinant() const {
819
+ if (m_LDLT) {
820
+ return Base::m_diag.prod();
821
+ } else {
822
+ Scalar detL = Diagonal<const CholMatrixType>(Base::m_matrix).prod();
823
+ return numext::abs2(detL);
643
824
  }
644
-
645
- protected:
646
- bool m_LDLT;
825
+ }
826
+
827
+ protected:
828
+ bool m_LDLT;
647
829
  };
648
830
 
649
- template<typename Derived>
650
- void SimplicialCholeskyBase<Derived>::ordering(const MatrixType& a, ConstCholMatrixPtr &pmat, CholMatrixType& ap)
651
- {
652
- eigen_assert(a.rows()==a.cols());
831
+ template <typename Derived>
832
+ template <bool NonHermitian>
833
+ void SimplicialCholeskyBase<Derived>::ordering(const MatrixType& a, ConstCholMatrixPtr& pmat, CholMatrixType& ap) {
834
+ eigen_assert(a.rows() == a.cols());
653
835
  const Index size = a.rows();
654
836
  pmat = &ap;
655
837
  // Note that ordering methods compute the inverse permutation
656
- if(!internal::is_same<OrderingType,NaturalOrdering<Index> >::value)
657
- {
838
+ if (!internal::is_same<OrderingType, NaturalOrdering<StorageIndex> >::value) {
658
839
  {
659
840
  CholMatrixType C;
660
- C = a.template selfadjointView<UpLo>();
661
-
841
+ internal::permute_symm_to_fullsymm<UpLo, NonHermitian>(a, C, NULL);
842
+
662
843
  OrderingType ordering;
663
- ordering(C,m_Pinv);
844
+ ordering(C, m_Pinv);
664
845
  }
665
846
 
666
- if(m_Pinv.size()>0) m_P = m_Pinv.inverse();
667
- else m_P.resize(0);
668
-
669
- ap.resize(size,size);
670
- ap.template selfadjointView<Upper>() = a.template selfadjointView<UpLo>().twistedBy(m_P);
671
- }
672
- else
673
- {
847
+ if (m_Pinv.size() > 0)
848
+ m_P = m_Pinv.inverse();
849
+ else
850
+ m_P.resize(0);
851
+
852
+ ap.resize(size, size);
853
+ internal::permute_symm_to_symm<UpLo, Upper, NonHermitian>(a, ap, m_P.indices().data());
854
+ } else {
674
855
  m_Pinv.resize(0);
675
856
  m_P.resize(0);
676
- if(int(UpLo)==int(Lower) || MatrixType::IsRowMajor)
677
- {
857
+ if (int(UpLo) == int(Lower) || MatrixType::IsRowMajor) {
678
858
  // we have to transpose the lower part to to the upper one
679
- ap.resize(size,size);
680
- ap.template selfadjointView<Upper>() = a.template selfadjointView<UpLo>();
681
- }
682
- else
683
- internal::simplicial_cholesky_grab_input<CholMatrixType,MatrixType>::run(a, pmat, ap);
684
- }
859
+ ap.resize(size, size);
860
+ internal::permute_symm_to_symm<UpLo, Upper, NonHermitian>(a, ap, NULL);
861
+ } else
862
+ internal::simplicial_cholesky_grab_input<CholMatrixType, MatrixType>::run(a, pmat, ap);
863
+ }
685
864
  }
686
865
 
687
- } // end namespace Eigen
866
+ } // end namespace Eigen
688
867
 
689
- #endif // EIGEN_SIMPLICIAL_CHOLESKY_H
868
+ #endif // EIGEN_SIMPLICIAL_CHOLESKY_H