@smake/eigen 1.1.0 → 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 (431) hide show
  1. package/README.md +1 -1
  2. package/eigen/Eigen/AccelerateSupport +52 -0
  3. package/eigen/Eigen/Cholesky +18 -20
  4. package/eigen/Eigen/CholmodSupport +28 -28
  5. package/eigen/Eigen/Core +187 -120
  6. package/eigen/Eigen/Eigenvalues +16 -13
  7. package/eigen/Eigen/Geometry +18 -18
  8. package/eigen/Eigen/Householder +9 -7
  9. package/eigen/Eigen/IterativeLinearSolvers +8 -4
  10. package/eigen/Eigen/Jacobi +14 -13
  11. package/eigen/Eigen/KLUSupport +23 -21
  12. package/eigen/Eigen/LU +15 -16
  13. package/eigen/Eigen/MetisSupport +12 -12
  14. package/eigen/Eigen/OrderingMethods +54 -51
  15. package/eigen/Eigen/PaStiXSupport +23 -21
  16. package/eigen/Eigen/PardisoSupport +17 -14
  17. package/eigen/Eigen/QR +18 -20
  18. package/eigen/Eigen/QtAlignedMalloc +5 -12
  19. package/eigen/Eigen/SPQRSupport +21 -14
  20. package/eigen/Eigen/SVD +23 -17
  21. package/eigen/Eigen/Sparse +1 -2
  22. package/eigen/Eigen/SparseCholesky +18 -15
  23. package/eigen/Eigen/SparseCore +18 -17
  24. package/eigen/Eigen/SparseLU +9 -9
  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 +366 -405
  37. package/eigen/Eigen/src/Cholesky/LLT.h +323 -367
  38. package/eigen/Eigen/src/Cholesky/LLT_LAPACKE.h +81 -56
  39. package/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +585 -529
  40. package/eigen/Eigen/src/CholmodSupport/InternalHeaderCheck.h +3 -0
  41. package/eigen/Eigen/src/Core/ArithmeticSequence.h +143 -317
  42. package/eigen/Eigen/src/Core/Array.h +329 -370
  43. package/eigen/Eigen/src/Core/ArrayBase.h +190 -203
  44. package/eigen/Eigen/src/Core/ArrayWrapper.h +126 -170
  45. package/eigen/Eigen/src/Core/Assign.h +30 -40
  46. package/eigen/Eigen/src/Core/AssignEvaluator.h +651 -604
  47. package/eigen/Eigen/src/Core/Assign_MKL.h +125 -120
  48. package/eigen/Eigen/src/Core/BandMatrix.h +267 -282
  49. package/eigen/Eigen/src/Core/Block.h +371 -390
  50. package/eigen/Eigen/src/Core/CommaInitializer.h +85 -100
  51. package/eigen/Eigen/src/Core/ConditionEstimator.h +51 -53
  52. package/eigen/Eigen/src/Core/CoreEvaluators.h +1214 -937
  53. package/eigen/Eigen/src/Core/CoreIterators.h +72 -63
  54. package/eigen/Eigen/src/Core/CwiseBinaryOp.h +112 -129
  55. package/eigen/Eigen/src/Core/CwiseNullaryOp.h +676 -702
  56. package/eigen/Eigen/src/Core/CwiseTernaryOp.h +77 -103
  57. package/eigen/Eigen/src/Core/CwiseUnaryOp.h +55 -67
  58. package/eigen/Eigen/src/Core/CwiseUnaryView.h +127 -92
  59. package/eigen/Eigen/src/Core/DenseBase.h +630 -658
  60. package/eigen/Eigen/src/Core/DenseCoeffsBase.h +511 -628
  61. package/eigen/Eigen/src/Core/DenseStorage.h +511 -590
  62. package/eigen/Eigen/src/Core/DeviceWrapper.h +153 -0
  63. package/eigen/Eigen/src/Core/Diagonal.h +168 -207
  64. package/eigen/Eigen/src/Core/DiagonalMatrix.h +346 -317
  65. package/eigen/Eigen/src/Core/DiagonalProduct.h +12 -10
  66. package/eigen/Eigen/src/Core/Dot.h +167 -217
  67. package/eigen/Eigen/src/Core/EigenBase.h +74 -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 -113
  71. package/eigen/Eigen/src/Core/Fuzzy.h +82 -105
  72. package/eigen/Eigen/src/Core/GeneralProduct.h +315 -261
  73. package/eigen/Eigen/src/Core/GenericPacketMath.h +1182 -520
  74. package/eigen/Eigen/src/Core/GlobalFunctions.h +193 -157
  75. package/eigen/Eigen/src/Core/IO.h +131 -156
  76. package/eigen/Eigen/src/Core/IndexedView.h +209 -125
  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 +50 -59
  80. package/eigen/Eigen/src/Core/Map.h +123 -141
  81. package/eigen/Eigen/src/Core/MapBase.h +255 -282
  82. package/eigen/Eigen/src/Core/MathFunctions.h +1247 -1201
  83. package/eigen/Eigen/src/Core/MathFunctionsImpl.h +162 -99
  84. package/eigen/Eigen/src/Core/Matrix.h +463 -494
  85. package/eigen/Eigen/src/Core/MatrixBase.h +468 -470
  86. package/eigen/Eigen/src/Core/NestByValue.h +58 -52
  87. package/eigen/Eigen/src/Core/NoAlias.h +79 -86
  88. package/eigen/Eigen/src/Core/NumTraits.h +206 -206
  89. package/eigen/Eigen/src/Core/PartialReduxEvaluator.h +163 -142
  90. package/eigen/Eigen/src/Core/PermutationMatrix.h +461 -511
  91. package/eigen/Eigen/src/Core/PlainObjectBase.h +858 -972
  92. package/eigen/Eigen/src/Core/Product.h +246 -130
  93. package/eigen/Eigen/src/Core/ProductEvaluators.h +779 -671
  94. package/eigen/Eigen/src/Core/Random.h +153 -164
  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 +334 -314
  98. package/eigen/Eigen/src/Core/Ref.h +259 -257
  99. package/eigen/Eigen/src/Core/Replicate.h +92 -104
  100. package/eigen/Eigen/src/Core/Reshaped.h +215 -271
  101. package/eigen/Eigen/src/Core/ReturnByValue.h +47 -55
  102. package/eigen/Eigen/src/Core/Reverse.h +133 -148
  103. package/eigen/Eigen/src/Core/Select.h +68 -140
  104. package/eigen/Eigen/src/Core/SelfAdjointView.h +254 -290
  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 +88 -102
  108. package/eigen/Eigen/src/Core/SolveTriangular.h +126 -124
  109. package/eigen/Eigen/src/Core/SolverBase.h +132 -133
  110. package/eigen/Eigen/src/Core/StableNorm.h +113 -147
  111. package/eigen/Eigen/src/Core/StlIterators.h +404 -248
  112. package/eigen/Eigen/src/Core/Stride.h +90 -92
  113. package/eigen/Eigen/src/Core/Swap.h +70 -39
  114. package/eigen/Eigen/src/Core/Transpose.h +258 -295
  115. package/eigen/Eigen/src/Core/Transpositions.h +270 -333
  116. package/eigen/Eigen/src/Core/TriangularMatrix.h +642 -743
  117. package/eigen/Eigen/src/Core/VectorBlock.h +59 -72
  118. package/eigen/Eigen/src/Core/VectorwiseOp.h +653 -704
  119. package/eigen/Eigen/src/Core/Visitor.h +464 -308
  120. package/eigen/Eigen/src/Core/arch/AVX/Complex.h +380 -187
  121. package/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +65 -163
  122. package/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +2145 -638
  123. package/eigen/Eigen/src/Core/arch/AVX/Reductions.h +353 -0
  124. package/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +253 -60
  125. package/eigen/Eigen/src/Core/arch/AVX512/Complex.h +278 -228
  126. package/eigen/Eigen/src/Core/arch/AVX512/GemmKernel.h +1245 -0
  127. package/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +48 -269
  128. package/eigen/Eigen/src/Core/arch/AVX512/MathFunctionsFP16.h +75 -0
  129. package/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +1597 -754
  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 +229 -41
  135. package/eigen/Eigen/src/Core/arch/AVX512/TypeCastingFP16.h +130 -0
  136. package/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +420 -184
  137. package/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +40 -49
  138. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +2962 -2213
  139. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +196 -212
  140. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +713 -441
  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 +2380 -1362
  144. package/eigen/Eigen/src/Core/arch/AltiVec/TypeCasting.h +153 -0
  145. package/eigen/Eigen/src/Core/arch/Default/BFloat16.h +390 -224
  146. package/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +78 -67
  147. package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +1784 -799
  148. package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +167 -50
  149. package/eigen/Eigen/src/Core/arch/Default/Half.h +528 -379
  150. package/eigen/Eigen/src/Core/arch/Default/Settings.h +10 -12
  151. package/eigen/Eigen/src/Core/arch/GPU/Complex.h +244 -0
  152. package/eigen/Eigen/src/Core/arch/GPU/MathFunctions.h +41 -40
  153. package/eigen/Eigen/src/Core/arch/GPU/PacketMath.h +550 -523
  154. package/eigen/Eigen/src/Core/arch/GPU/Tuple.h +268 -0
  155. package/eigen/Eigen/src/Core/arch/GPU/TypeCasting.h +27 -30
  156. package/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h +8 -8
  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 +54 -82
  164. package/eigen/Eigen/src/Core/arch/MSA/MathFunctions.h +84 -92
  165. package/eigen/Eigen/src/Core/arch/MSA/PacketMath.h +51 -47
  166. package/eigen/Eigen/src/Core/arch/NEON/Complex.h +454 -306
  167. package/eigen/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +175 -115
  168. package/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +23 -30
  169. package/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +4366 -2857
  170. package/eigen/Eigen/src/Core/arch/NEON/TypeCasting.h +616 -393
  171. package/eigen/Eigen/src/Core/arch/NEON/UnaryFunctors.h +57 -0
  172. package/eigen/Eigen/src/Core/arch/SSE/Complex.h +350 -198
  173. package/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +38 -149
  174. package/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +1791 -912
  175. package/eigen/Eigen/src/Core/arch/SSE/Reductions.h +324 -0
  176. package/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +128 -40
  177. package/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h +10 -6
  178. package/eigen/Eigen/src/Core/arch/SVE/PacketMath.h +156 -234
  179. package/eigen/Eigen/src/Core/arch/SVE/TypeCasting.h +6 -3
  180. package/eigen/Eigen/src/Core/arch/SYCL/InteropHeaders.h +27 -32
  181. package/eigen/Eigen/src/Core/arch/SYCL/MathFunctions.h +119 -117
  182. package/eigen/Eigen/src/Core/arch/SYCL/PacketMath.h +325 -419
  183. package/eigen/Eigen/src/Core/arch/SYCL/TypeCasting.h +15 -17
  184. package/eigen/Eigen/src/Core/arch/ZVector/Complex.h +325 -181
  185. package/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +94 -83
  186. package/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +811 -458
  187. package/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +121 -124
  188. package/eigen/Eigen/src/Core/functors/BinaryFunctors.h +576 -370
  189. package/eigen/Eigen/src/Core/functors/NullaryFunctors.h +194 -109
  190. package/eigen/Eigen/src/Core/functors/StlFunctors.h +95 -112
  191. package/eigen/Eigen/src/Core/functors/TernaryFunctors.h +34 -7
  192. package/eigen/Eigen/src/Core/functors/UnaryFunctors.h +1038 -749
  193. package/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +1883 -1375
  194. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +312 -370
  195. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +189 -176
  196. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +84 -81
  197. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +154 -73
  198. package/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +292 -337
  199. package/eigen/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +80 -77
  200. package/eigen/Eigen/src/Core/products/Parallelizer.h +207 -105
  201. package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +327 -388
  202. package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +206 -224
  203. package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +138 -147
  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 -47
  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 -277
  212. package/eigen/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +108 -109
  213. package/eigen/Eigen/src/Core/products/TriangularSolverVector.h +68 -94
  214. package/eigen/Eigen/src/Core/util/Assert.h +158 -0
  215. package/eigen/Eigen/src/Core/util/BlasUtil.h +342 -303
  216. package/eigen/Eigen/src/Core/util/ConfigureVectorization.h +348 -317
  217. package/eigen/Eigen/src/Core/util/Constants.h +297 -262
  218. package/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +130 -90
  219. package/eigen/Eigen/src/Core/util/EmulateArray.h +270 -0
  220. package/eigen/Eigen/src/Core/util/ForwardDeclarations.h +449 -247
  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 +417 -116
  224. package/eigen/Eigen/src/Core/util/IntegralConstant.h +211 -204
  225. package/eigen/Eigen/src/Core/util/MKL_support.h +39 -37
  226. package/eigen/Eigen/src/Core/util/Macros.h +655 -773
  227. package/eigen/Eigen/src/Core/util/MaxSizeVector.h +139 -0
  228. package/eigen/Eigen/src/Core/util/Memory.h +970 -748
  229. package/eigen/Eigen/src/Core/util/Meta.h +581 -633
  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 +17 -17
  233. package/eigen/Eigen/src/Core/util/Serializer.h +209 -0
  234. package/eigen/Eigen/src/Core/util/StaticAssert.h +50 -166
  235. package/eigen/Eigen/src/Core/util/SymbolicIndex.h +377 -225
  236. package/eigen/Eigen/src/Core/util/XprHelper.h +784 -547
  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 +89 -105
  246. package/eigen/Eigen/src/Eigenvalues/RealQZ.h +537 -607
  247. package/eigen/Eigen/src/Eigenvalues/RealSchur.h +342 -381
  248. package/eigen/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +41 -35
  249. package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +541 -595
  250. package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +47 -44
  251. package/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +430 -462
  252. package/eigen/Eigen/src/Geometry/AlignedBox.h +226 -227
  253. package/eigen/Eigen/src/Geometry/AngleAxis.h +131 -133
  254. package/eigen/Eigen/src/Geometry/EulerAngles.h +163 -74
  255. package/eigen/Eigen/src/Geometry/Homogeneous.h +285 -333
  256. package/eigen/Eigen/src/Geometry/Hyperplane.h +151 -160
  257. package/eigen/Eigen/src/Geometry/InternalHeaderCheck.h +3 -0
  258. package/eigen/Eigen/src/Geometry/OrthoMethods.h +168 -146
  259. package/eigen/Eigen/src/Geometry/ParametrizedLine.h +127 -127
  260. package/eigen/Eigen/src/Geometry/Quaternion.h +566 -506
  261. package/eigen/Eigen/src/Geometry/Rotation2D.h +107 -105
  262. package/eigen/Eigen/src/Geometry/RotationBase.h +148 -145
  263. package/eigen/Eigen/src/Geometry/Scaling.h +113 -106
  264. package/eigen/Eigen/src/Geometry/Transform.h +858 -936
  265. package/eigen/Eigen/src/Geometry/Translation.h +94 -92
  266. package/eigen/Eigen/src/Geometry/Umeyama.h +79 -84
  267. package/eigen/Eigen/src/Geometry/arch/Geometry_SIMD.h +90 -104
  268. package/eigen/Eigen/src/Householder/BlockHouseholder.h +51 -46
  269. package/eigen/Eigen/src/Householder/Householder.h +102 -124
  270. package/eigen/Eigen/src/Householder/HouseholderSequence.h +412 -453
  271. package/eigen/Eigen/src/Householder/InternalHeaderCheck.h +3 -0
  272. package/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +149 -162
  273. package/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +124 -119
  274. package/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +92 -104
  275. package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +251 -243
  276. package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +224 -228
  277. package/eigen/Eigen/src/IterativeLinearSolvers/InternalHeaderCheck.h +3 -0
  278. package/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +178 -227
  279. package/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +79 -84
  280. package/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +54 -60
  281. package/eigen/Eigen/src/Jacobi/InternalHeaderCheck.h +3 -0
  282. package/eigen/Eigen/src/Jacobi/Jacobi.h +252 -308
  283. package/eigen/Eigen/src/KLUSupport/InternalHeaderCheck.h +3 -0
  284. package/eigen/Eigen/src/KLUSupport/KLUSupport.h +208 -227
  285. package/eigen/Eigen/src/LU/Determinant.h +50 -69
  286. package/eigen/Eigen/src/LU/FullPivLU.h +545 -596
  287. package/eigen/Eigen/src/LU/InternalHeaderCheck.h +3 -0
  288. package/eigen/Eigen/src/LU/InverseImpl.h +206 -285
  289. package/eigen/Eigen/src/LU/PartialPivLU.h +390 -428
  290. package/eigen/Eigen/src/LU/PartialPivLU_LAPACKE.h +54 -40
  291. package/eigen/Eigen/src/LU/arch/InverseSize4.h +72 -70
  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 +243 -265
  295. package/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +831 -1004
  296. package/eigen/Eigen/src/OrderingMethods/InternalHeaderCheck.h +3 -0
  297. package/eigen/Eigen/src/OrderingMethods/Ordering.h +112 -119
  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 -430
  302. package/eigen/Eigen/src/QR/ColPivHouseholderQR.h +479 -479
  303. package/eigen/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +120 -56
  304. package/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +166 -153
  305. package/eigen/Eigen/src/QR/FullPivHouseholderQR.h +495 -475
  306. package/eigen/Eigen/src/QR/HouseholderQR.h +394 -285
  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 +244 -264
  311. package/eigen/Eigen/src/SVD/BDCSVD.h +817 -713
  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 +577 -543
  315. package/eigen/Eigen/src/SVD/JacobiSVD_LAPACKE.h +85 -49
  316. package/eigen/Eigen/src/SVD/SVDBase.h +242 -182
  317. package/eigen/Eigen/src/SVD/UpperBidiagonalization.h +200 -235
  318. package/eigen/Eigen/src/SparseCholesky/InternalHeaderCheck.h +3 -0
  319. package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +765 -594
  320. package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +308 -94
  321. package/eigen/Eigen/src/SparseCore/AmbiVector.h +202 -251
  322. package/eigen/Eigen/src/SparseCore/CompressedStorage.h +184 -252
  323. package/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +134 -178
  324. package/eigen/Eigen/src/SparseCore/InternalHeaderCheck.h +3 -0
  325. package/eigen/Eigen/src/SparseCore/SparseAssign.h +149 -140
  326. package/eigen/Eigen/src/SparseCore/SparseBlock.h +403 -440
  327. package/eigen/Eigen/src/SparseCore/SparseColEtree.h +100 -112
  328. package/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +525 -303
  329. package/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +555 -339
  330. package/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +100 -108
  331. package/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +169 -197
  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 +1603 -1245
  337. package/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +403 -350
  338. package/eigen/Eigen/src/SparseCore/SparsePermutation.h +186 -115
  339. package/eigen/Eigen/src/SparseCore/SparseProduct.h +94 -97
  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 +370 -416
  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 +138 -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 +756 -710
  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 +245 -301
  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 +89 -100
  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 +124 -132
  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 +450 -502
  370. package/eigen/Eigen/src/StlSupport/StdDeque.h +28 -93
  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 -730
  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 +428 -464
  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 +9972 -16179
  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.h → BlockMethods.inc} +434 -506
  401. package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.inc +116 -0
  402. package/eigen/Eigen/src/plugins/{CommonCwiseUnaryOps.h → CommonCwiseUnaryOps.inc} +58 -68
  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/package.json +1 -1
  409. package/eigen/COPYING.APACHE +0 -203
  410. package/eigen/COPYING.BSD +0 -26
  411. package/eigen/COPYING.GPL +0 -674
  412. package/eigen/COPYING.LGPL +0 -502
  413. package/eigen/COPYING.MINPACK +0 -51
  414. package/eigen/COPYING.MPL2 +0 -373
  415. package/eigen/COPYING.README +0 -18
  416. package/eigen/Eigen/src/Core/BooleanRedux.h +0 -162
  417. package/eigen/Eigen/src/Core/arch/CUDA/Complex.h +0 -258
  418. package/eigen/Eigen/src/Core/arch/Default/TypeCasting.h +0 -120
  419. package/eigen/Eigen/src/Core/arch/SYCL/SyclMemoryModel.h +0 -694
  420. package/eigen/Eigen/src/Core/util/NonMPL2.h +0 -3
  421. package/eigen/Eigen/src/SparseCore/MappedSparseMatrix.h +0 -67
  422. package/eigen/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +0 -280
  423. package/eigen/Eigen/src/misc/lapack.h +0 -152
  424. package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.h +0 -358
  425. package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h +0 -696
  426. package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.h +0 -115
  427. package/eigen/Eigen/src/plugins/IndexedViewMethods.h +0 -262
  428. package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h +0 -152
  429. package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h +0 -95
  430. package/eigen/Eigen/src/plugins/ReshapedMethods.h +0 -149
  431. package/eigen/README.md +0 -5
@@ -10,61 +10,53 @@
10
10
  #ifndef EIGEN_SUPERLUSUPPORT_H
11
11
  #define EIGEN_SUPERLUSUPPORT_H
12
12
 
13
+ // IWYU pragma: private
14
+ #include "./InternalHeaderCheck.h"
15
+
13
16
  namespace Eigen {
14
17
 
15
18
  #if defined(SUPERLU_MAJOR_VERSION) && (SUPERLU_MAJOR_VERSION >= 5)
16
- #define DECL_GSSVX(PREFIX,FLOATTYPE,KEYTYPE) \
17
- extern "C" { \
18
- extern void PREFIX##gssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *, \
19
- char *, FLOATTYPE *, FLOATTYPE *, SuperMatrix *, SuperMatrix *, \
20
- void *, int, SuperMatrix *, SuperMatrix *, \
21
- FLOATTYPE *, FLOATTYPE *, FLOATTYPE *, FLOATTYPE *, \
22
- GlobalLU_t *, mem_usage_t *, SuperLUStat_t *, int *); \
23
- } \
24
- inline float SuperLU_gssvx(superlu_options_t *options, SuperMatrix *A, \
25
- int *perm_c, int *perm_r, int *etree, char *equed, \
26
- FLOATTYPE *R, FLOATTYPE *C, SuperMatrix *L, \
27
- SuperMatrix *U, void *work, int lwork, \
28
- SuperMatrix *B, SuperMatrix *X, \
29
- FLOATTYPE *recip_pivot_growth, \
30
- FLOATTYPE *rcond, FLOATTYPE *ferr, FLOATTYPE *berr, \
31
- SuperLUStat_t *stats, int *info, KEYTYPE) { \
32
- mem_usage_t mem_usage; \
33
- GlobalLU_t gLU; \
34
- PREFIX##gssvx(options, A, perm_c, perm_r, etree, equed, R, C, L, \
35
- U, work, lwork, B, X, recip_pivot_growth, rcond, \
36
- ferr, berr, &gLU, &mem_usage, stats, info); \
37
- return mem_usage.for_lu; /* bytes used by the factor storage */ \
19
+ #define DECL_GSSVX(PREFIX, FLOATTYPE, KEYTYPE) \
20
+ extern "C" { \
21
+ extern void PREFIX##gssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *, char *, FLOATTYPE *, FLOATTYPE *, \
22
+ SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *, SuperMatrix *, FLOATTYPE *, \
23
+ FLOATTYPE *, FLOATTYPE *, FLOATTYPE *, GlobalLU_t *, mem_usage_t *, SuperLUStat_t *, \
24
+ int *); \
25
+ } \
26
+ inline float SuperLU_gssvx(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, int *etree, \
27
+ char *equed, FLOATTYPE *R, FLOATTYPE *C, SuperMatrix *L, SuperMatrix *U, void *work, \
28
+ int lwork, SuperMatrix *B, SuperMatrix *X, FLOATTYPE *recip_pivot_growth, \
29
+ FLOATTYPE *rcond, FLOATTYPE *ferr, FLOATTYPE *berr, SuperLUStat_t *stats, int *info, \
30
+ KEYTYPE) { \
31
+ mem_usage_t mem_usage; \
32
+ GlobalLU_t gLU; \
33
+ PREFIX##gssvx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work, lwork, B, X, recip_pivot_growth, rcond, \
34
+ ferr, berr, &gLU, &mem_usage, stats, info); \
35
+ return mem_usage.for_lu; /* bytes used by the factor storage */ \
38
36
  }
39
- #else // version < 5.0
40
- #define DECL_GSSVX(PREFIX,FLOATTYPE,KEYTYPE) \
41
- extern "C" { \
42
- extern void PREFIX##gssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *, \
43
- char *, FLOATTYPE *, FLOATTYPE *, SuperMatrix *, SuperMatrix *, \
44
- void *, int, SuperMatrix *, SuperMatrix *, \
45
- FLOATTYPE *, FLOATTYPE *, FLOATTYPE *, FLOATTYPE *, \
46
- mem_usage_t *, SuperLUStat_t *, int *); \
47
- } \
48
- inline float SuperLU_gssvx(superlu_options_t *options, SuperMatrix *A, \
49
- int *perm_c, int *perm_r, int *etree, char *equed, \
50
- FLOATTYPE *R, FLOATTYPE *C, SuperMatrix *L, \
51
- SuperMatrix *U, void *work, int lwork, \
52
- SuperMatrix *B, SuperMatrix *X, \
53
- FLOATTYPE *recip_pivot_growth, \
54
- FLOATTYPE *rcond, FLOATTYPE *ferr, FLOATTYPE *berr, \
55
- SuperLUStat_t *stats, int *info, KEYTYPE) { \
56
- mem_usage_t mem_usage; \
57
- PREFIX##gssvx(options, A, perm_c, perm_r, etree, equed, R, C, L, \
58
- U, work, lwork, B, X, recip_pivot_growth, rcond, \
59
- ferr, berr, &mem_usage, stats, info); \
60
- return mem_usage.for_lu; /* bytes used by the factor storage */ \
37
+ #else // version < 5.0
38
+ #define DECL_GSSVX(PREFIX, FLOATTYPE, KEYTYPE) \
39
+ extern "C" { \
40
+ extern void PREFIX##gssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *, char *, FLOATTYPE *, FLOATTYPE *, \
41
+ SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *, SuperMatrix *, FLOATTYPE *, \
42
+ FLOATTYPE *, FLOATTYPE *, FLOATTYPE *, mem_usage_t *, SuperLUStat_t *, int *); \
43
+ } \
44
+ inline float SuperLU_gssvx(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, int *etree, \
45
+ char *equed, FLOATTYPE *R, FLOATTYPE *C, SuperMatrix *L, SuperMatrix *U, void *work, \
46
+ int lwork, SuperMatrix *B, SuperMatrix *X, FLOATTYPE *recip_pivot_growth, \
47
+ FLOATTYPE *rcond, FLOATTYPE *ferr, FLOATTYPE *berr, SuperLUStat_t *stats, int *info, \
48
+ KEYTYPE) { \
49
+ mem_usage_t mem_usage; \
50
+ PREFIX##gssvx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work, lwork, B, X, recip_pivot_growth, rcond, \
51
+ ferr, berr, &mem_usage, stats, info); \
52
+ return mem_usage.for_lu; /* bytes used by the factor storage */ \
61
53
  }
62
54
  #endif
63
55
 
64
- DECL_GSSVX(s,float,float)
65
- DECL_GSSVX(c,float,std::complex<float>)
66
- DECL_GSSVX(d,double,double)
67
- DECL_GSSVX(z,double,std::complex<double>)
56
+ DECL_GSSVX(s, float, float)
57
+ DECL_GSSVX(c, float, std::complex<float>)
58
+ DECL_GSSVX(d, double, double)
59
+ DECL_GSSVX(z, double, std::complex<double>)
68
60
 
69
61
  #ifdef MILU_ALPHA
70
62
  #define EIGEN_SUPERLU_HAS_ILU
@@ -73,567 +65,519 @@ DECL_GSSVX(z,double,std::complex<double>)
73
65
  #ifdef EIGEN_SUPERLU_HAS_ILU
74
66
 
75
67
  // similarly for the incomplete factorization using gsisx
76
- #define DECL_GSISX(PREFIX,FLOATTYPE,KEYTYPE) \
77
- extern "C" { \
78
- extern void PREFIX##gsisx(superlu_options_t *, SuperMatrix *, int *, int *, int *, \
79
- char *, FLOATTYPE *, FLOATTYPE *, SuperMatrix *, SuperMatrix *, \
80
- void *, int, SuperMatrix *, SuperMatrix *, FLOATTYPE *, FLOATTYPE *, \
81
- mem_usage_t *, SuperLUStat_t *, int *); \
82
- } \
83
- inline float SuperLU_gsisx(superlu_options_t *options, SuperMatrix *A, \
84
- int *perm_c, int *perm_r, int *etree, char *equed, \
85
- FLOATTYPE *R, FLOATTYPE *C, SuperMatrix *L, \
86
- SuperMatrix *U, void *work, int lwork, \
87
- SuperMatrix *B, SuperMatrix *X, \
88
- FLOATTYPE *recip_pivot_growth, \
89
- FLOATTYPE *rcond, \
90
- SuperLUStat_t *stats, int *info, KEYTYPE) { \
91
- mem_usage_t mem_usage; \
92
- PREFIX##gsisx(options, A, perm_c, perm_r, etree, equed, R, C, L, \
93
- U, work, lwork, B, X, recip_pivot_growth, rcond, \
94
- &mem_usage, stats, info); \
95
- return mem_usage.for_lu; /* bytes used by the factor storage */ \
68
+ #if defined(SUPERLU_MAJOR_VERSION) && (SUPERLU_MAJOR_VERSION >= 5)
69
+ #define DECL_GSISX(PREFIX, FLOATTYPE, KEYTYPE) \
70
+ extern "C" { \
71
+ extern void PREFIX##gsisx(superlu_options_t *, SuperMatrix *, int *, int *, int *, char *, FLOATTYPE *, FLOATTYPE *, \
72
+ SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *, SuperMatrix *, FLOATTYPE *, \
73
+ FLOATTYPE *, GlobalLU_t *, mem_usage_t *, SuperLUStat_t *, int *); \
74
+ } \
75
+ inline float SuperLU_gsisx(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, int *etree, \
76
+ char *equed, FLOATTYPE *R, FLOATTYPE *C, SuperMatrix *L, SuperMatrix *U, void *work, \
77
+ int lwork, SuperMatrix *B, SuperMatrix *X, FLOATTYPE *recip_pivot_growth, \
78
+ FLOATTYPE *rcond, SuperLUStat_t *stats, int *info, KEYTYPE) { \
79
+ mem_usage_t mem_usage; \
80
+ GlobalLU_t gLU; \
81
+ PREFIX##gsisx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work, lwork, B, X, recip_pivot_growth, rcond, \
82
+ &gLU, &mem_usage, stats, info); \
83
+ return mem_usage.for_lu; /* bytes used by the factor storage */ \
84
+ }
85
+ #else // version < 5.0
86
+ #define DECL_GSISX(PREFIX, FLOATTYPE, KEYTYPE) \
87
+ extern "C" { \
88
+ extern void PREFIX##gsisx(superlu_options_t *, SuperMatrix *, int *, int *, int *, char *, FLOATTYPE *, FLOATTYPE *, \
89
+ SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *, SuperMatrix *, FLOATTYPE *, \
90
+ FLOATTYPE *, mem_usage_t *, SuperLUStat_t *, int *); \
91
+ } \
92
+ inline float SuperLU_gsisx(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, int *etree, \
93
+ char *equed, FLOATTYPE *R, FLOATTYPE *C, SuperMatrix *L, SuperMatrix *U, void *work, \
94
+ int lwork, SuperMatrix *B, SuperMatrix *X, FLOATTYPE *recip_pivot_growth, \
95
+ FLOATTYPE *rcond, SuperLUStat_t *stats, int *info, KEYTYPE) { \
96
+ mem_usage_t mem_usage; \
97
+ PREFIX##gsisx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work, lwork, B, X, recip_pivot_growth, rcond, \
98
+ &mem_usage, stats, info); \
99
+ return mem_usage.for_lu; /* bytes used by the factor storage */ \
96
100
  }
101
+ #endif
97
102
 
98
- DECL_GSISX(s,float,float)
99
- DECL_GSISX(c,float,std::complex<float>)
100
- DECL_GSISX(d,double,double)
101
- DECL_GSISX(z,double,std::complex<double>)
103
+ DECL_GSISX(s, float, float)
104
+ DECL_GSISX(c, float, std::complex<float>)
105
+ DECL_GSISX(d, double, double)
106
+ DECL_GSISX(z, double, std::complex<double>)
102
107
 
103
108
  #endif
104
109
 
105
- template<typename MatrixType>
110
+ template <typename MatrixType>
106
111
  struct SluMatrixMapHelper;
107
112
 
108
113
  /** \internal
109
- *
110
- * A wrapper class for SuperLU matrices. It supports only compressed sparse matrices
111
- * and dense matrices. Supernodal and other fancy format are not supported by this wrapper.
112
- *
113
- * This wrapper class mainly aims to avoids the need of dynamic allocation of the storage structure.
114
- */
115
- struct SluMatrix : SuperMatrix
116
- {
117
- SluMatrix()
118
- {
119
- Store = &storage;
120
- }
121
-
122
- SluMatrix(const SluMatrix& other)
123
- : SuperMatrix(other)
124
- {
114
+ *
115
+ * A wrapper class for SuperLU matrices. It supports only compressed sparse matrices
116
+ * and dense matrices. Supernodal and other fancy format are not supported by this wrapper.
117
+ *
118
+ * This wrapper class mainly aims to avoids the need of dynamic allocation of the storage structure.
119
+ */
120
+ struct SluMatrix : SuperMatrix {
121
+ SluMatrix() { Store = &storage; }
122
+
123
+ SluMatrix(const SluMatrix &other) : SuperMatrix(other) {
125
124
  Store = &storage;
126
125
  storage = other.storage;
127
126
  }
128
127
 
129
- SluMatrix& operator=(const SluMatrix& other)
130
- {
131
- SuperMatrix::operator=(static_cast<const SuperMatrix&>(other));
128
+ SluMatrix &operator=(const SluMatrix &other) {
129
+ SuperMatrix::operator=(static_cast<const SuperMatrix &>(other));
132
130
  Store = &storage;
133
131
  storage = other.storage;
134
132
  return *this;
135
133
  }
136
134
 
137
- struct
138
- {
139
- union {int nnz;int lda;};
135
+ struct {
136
+ union {
137
+ int nnz;
138
+ int lda;
139
+ };
140
140
  void *values;
141
141
  int *innerInd;
142
142
  int *outerInd;
143
143
  } storage;
144
144
 
145
- void setStorageType(Stype_t t)
146
- {
145
+ void setStorageType(Stype_t t) {
147
146
  Stype = t;
148
- if (t==SLU_NC || t==SLU_NR || t==SLU_DN)
147
+ if (t == SLU_NC || t == SLU_NR || t == SLU_DN)
149
148
  Store = &storage;
150
- else
151
- {
149
+ else {
152
150
  eigen_assert(false && "storage type not supported");
153
151
  Store = 0;
154
152
  }
155
153
  }
156
154
 
157
- template<typename Scalar>
158
- void setScalarType()
159
- {
160
- if (internal::is_same<Scalar,float>::value)
155
+ template <typename Scalar>
156
+ void setScalarType() {
157
+ if (internal::is_same<Scalar, float>::value)
161
158
  Dtype = SLU_S;
162
- else if (internal::is_same<Scalar,double>::value)
159
+ else if (internal::is_same<Scalar, double>::value)
163
160
  Dtype = SLU_D;
164
- else if (internal::is_same<Scalar,std::complex<float> >::value)
161
+ else if (internal::is_same<Scalar, std::complex<float> >::value)
165
162
  Dtype = SLU_C;
166
- else if (internal::is_same<Scalar,std::complex<double> >::value)
163
+ else if (internal::is_same<Scalar, std::complex<double> >::value)
167
164
  Dtype = SLU_Z;
168
- else
169
- {
165
+ else {
170
166
  eigen_assert(false && "Scalar type not supported by SuperLU");
171
167
  }
172
168
  }
173
169
 
174
- template<typename MatrixType>
175
- static SluMatrix Map(MatrixBase<MatrixType>& _mat)
176
- {
177
- MatrixType& mat(_mat.derived());
178
- eigen_assert( ((MatrixType::Flags&RowMajorBit)!=RowMajorBit) && "row-major dense matrices are not supported by SuperLU");
170
+ template <typename MatrixType>
171
+ static SluMatrix Map(MatrixBase<MatrixType> &_mat) {
172
+ MatrixType &mat(_mat.derived());
173
+ eigen_assert(((MatrixType::Flags & RowMajorBit) != RowMajorBit) &&
174
+ "row-major dense matrices are not supported by SuperLU");
179
175
  SluMatrix res;
180
176
  res.setStorageType(SLU_DN);
181
177
  res.setScalarType<typename MatrixType::Scalar>();
182
- res.Mtype = SLU_GE;
178
+ res.Mtype = SLU_GE;
183
179
 
184
- res.nrow = internal::convert_index<int>(mat.rows());
185
- res.ncol = internal::convert_index<int>(mat.cols());
180
+ res.nrow = internal::convert_index<int>(mat.rows());
181
+ res.ncol = internal::convert_index<int>(mat.cols());
186
182
 
187
- res.storage.lda = internal::convert_index<int>(MatrixType::IsVectorAtCompileTime ? mat.size() : mat.outerStride());
188
- res.storage.values = (void*)(mat.data());
183
+ res.storage.lda = internal::convert_index<int>(MatrixType::IsVectorAtCompileTime ? mat.size() : mat.outerStride());
184
+ res.storage.values = (void *)(mat.data());
189
185
  return res;
190
186
  }
191
187
 
192
- template<typename MatrixType>
193
- static SluMatrix Map(SparseMatrixBase<MatrixType>& a_mat)
194
- {
188
+ template <typename MatrixType>
189
+ static SluMatrix Map(SparseMatrixBase<MatrixType> &a_mat) {
195
190
  MatrixType &mat(a_mat.derived());
196
191
  SluMatrix res;
197
- if ((MatrixType::Flags&RowMajorBit)==RowMajorBit)
198
- {
192
+ if ((MatrixType::Flags & RowMajorBit) == RowMajorBit) {
199
193
  res.setStorageType(SLU_NR);
200
- res.nrow = internal::convert_index<int>(mat.cols());
201
- res.ncol = internal::convert_index<int>(mat.rows());
202
- }
203
- else
204
- {
194
+ res.nrow = internal::convert_index<int>(mat.cols());
195
+ res.ncol = internal::convert_index<int>(mat.rows());
196
+ } else {
205
197
  res.setStorageType(SLU_NC);
206
- res.nrow = internal::convert_index<int>(mat.rows());
207
- res.ncol = internal::convert_index<int>(mat.cols());
198
+ res.nrow = internal::convert_index<int>(mat.rows());
199
+ res.ncol = internal::convert_index<int>(mat.cols());
208
200
  }
209
201
 
210
- res.Mtype = SLU_GE;
202
+ res.Mtype = SLU_GE;
211
203
 
212
- res.storage.nnz = internal::convert_index<int>(mat.nonZeros());
213
- res.storage.values = mat.valuePtr();
214
- res.storage.innerInd = mat.innerIndexPtr();
215
- res.storage.outerInd = mat.outerIndexPtr();
204
+ res.storage.nnz = internal::convert_index<int>(mat.nonZeros());
205
+ res.storage.values = mat.valuePtr();
206
+ res.storage.innerInd = mat.innerIndexPtr();
207
+ res.storage.outerInd = mat.outerIndexPtr();
216
208
 
217
209
  res.setScalarType<typename MatrixType::Scalar>();
218
210
 
219
211
  // FIXME the following is not very accurate
220
- if (int(MatrixType::Flags) & int(Upper))
221
- res.Mtype = SLU_TRU;
222
- if (int(MatrixType::Flags) & int(Lower))
223
- res.Mtype = SLU_TRL;
212
+ if (int(MatrixType::Flags) & int(Upper)) res.Mtype = SLU_TRU;
213
+ if (int(MatrixType::Flags) & int(Lower)) res.Mtype = SLU_TRL;
224
214
 
225
- eigen_assert(((int(MatrixType::Flags) & int(SelfAdjoint))==0) && "SelfAdjoint matrix shape not supported by SuperLU");
215
+ eigen_assert(((int(MatrixType::Flags) & int(SelfAdjoint)) == 0) &&
216
+ "SelfAdjoint matrix shape not supported by SuperLU");
226
217
 
227
218
  return res;
228
219
  }
229
220
  };
230
221
 
231
- template<typename Scalar, int Rows, int Cols, int Options, int MRows, int MCols>
232
- struct SluMatrixMapHelper<Matrix<Scalar,Rows,Cols,Options,MRows,MCols> >
233
- {
234
- typedef Matrix<Scalar,Rows,Cols,Options,MRows,MCols> MatrixType;
235
- static void run(MatrixType& mat, SluMatrix& res)
236
- {
237
- eigen_assert( ((Options&RowMajor)!=RowMajor) && "row-major dense matrices is not supported by SuperLU");
222
+ template <typename Scalar, int Rows, int Cols, int Options, int MRows, int MCols>
223
+ struct SluMatrixMapHelper<Matrix<Scalar, Rows, Cols, Options, MRows, MCols> > {
224
+ typedef Matrix<Scalar, Rows, Cols, Options, MRows, MCols> MatrixType;
225
+ static void run(MatrixType &mat, SluMatrix &res) {
226
+ eigen_assert(((Options & RowMajor) != RowMajor) && "row-major dense matrices is not supported by SuperLU");
238
227
  res.setStorageType(SLU_DN);
239
228
  res.setScalarType<Scalar>();
240
- res.Mtype = SLU_GE;
229
+ res.Mtype = SLU_GE;
241
230
 
242
- res.nrow = mat.rows();
243
- res.ncol = mat.cols();
231
+ res.nrow = mat.rows();
232
+ res.ncol = mat.cols();
244
233
 
245
- res.storage.lda = mat.outerStride();
246
- res.storage.values = mat.data();
234
+ res.storage.lda = mat.outerStride();
235
+ res.storage.values = mat.data();
247
236
  }
248
237
  };
249
238
 
250
- template<typename Derived>
251
- struct SluMatrixMapHelper<SparseMatrixBase<Derived> >
252
- {
239
+ template <typename Derived>
240
+ struct SluMatrixMapHelper<SparseMatrixBase<Derived> > {
253
241
  typedef Derived MatrixType;
254
- static void run(MatrixType& mat, SluMatrix& res)
255
- {
256
- if ((MatrixType::Flags&RowMajorBit)==RowMajorBit)
257
- {
242
+ static void run(MatrixType &mat, SluMatrix &res) {
243
+ if ((MatrixType::Flags & RowMajorBit) == RowMajorBit) {
258
244
  res.setStorageType(SLU_NR);
259
- res.nrow = mat.cols();
260
- res.ncol = mat.rows();
261
- }
262
- else
263
- {
245
+ res.nrow = mat.cols();
246
+ res.ncol = mat.rows();
247
+ } else {
264
248
  res.setStorageType(SLU_NC);
265
- res.nrow = mat.rows();
266
- res.ncol = mat.cols();
249
+ res.nrow = mat.rows();
250
+ res.ncol = mat.cols();
267
251
  }
268
252
 
269
- res.Mtype = SLU_GE;
253
+ res.Mtype = SLU_GE;
270
254
 
271
- res.storage.nnz = mat.nonZeros();
272
- res.storage.values = mat.valuePtr();
273
- res.storage.innerInd = mat.innerIndexPtr();
274
- res.storage.outerInd = mat.outerIndexPtr();
255
+ res.storage.nnz = mat.nonZeros();
256
+ res.storage.values = mat.valuePtr();
257
+ res.storage.innerInd = mat.innerIndexPtr();
258
+ res.storage.outerInd = mat.outerIndexPtr();
275
259
 
276
260
  res.setScalarType<typename MatrixType::Scalar>();
277
261
 
278
262
  // FIXME the following is not very accurate
279
- if (MatrixType::Flags & Upper)
280
- res.Mtype = SLU_TRU;
281
- if (MatrixType::Flags & Lower)
282
- res.Mtype = SLU_TRL;
263
+ if (MatrixType::Flags & Upper) res.Mtype = SLU_TRU;
264
+ if (MatrixType::Flags & Lower) res.Mtype = SLU_TRL;
283
265
 
284
- eigen_assert(((MatrixType::Flags & SelfAdjoint)==0) && "SelfAdjoint matrix shape not supported by SuperLU");
266
+ eigen_assert(((MatrixType::Flags & SelfAdjoint) == 0) && "SelfAdjoint matrix shape not supported by SuperLU");
285
267
  }
286
268
  };
287
269
 
288
270
  namespace internal {
289
271
 
290
- template<typename MatrixType>
291
- SluMatrix asSluMatrix(MatrixType& mat)
292
- {
272
+ template <typename MatrixType>
273
+ SluMatrix asSluMatrix(MatrixType &mat) {
293
274
  return SluMatrix::Map(mat);
294
275
  }
295
276
 
296
277
  /** View a Super LU matrix as an Eigen expression */
297
- template<typename Scalar, int Flags, typename Index>
298
- MappedSparseMatrix<Scalar,Flags,Index> map_superlu(SluMatrix& sluMat)
299
- {
300
- eigen_assert(((Flags&RowMajor)==RowMajor && sluMat.Stype == SLU_NR)
301
- || ((Flags&ColMajor)==ColMajor && sluMat.Stype == SLU_NC));
278
+ template <typename Scalar, int Flags, typename Index>
279
+ Map<SparseMatrix<Scalar, Flags, Index> > map_superlu(SluMatrix &sluMat) {
280
+ eigen_assert(((Flags & RowMajor) == RowMajor && sluMat.Stype == SLU_NR) ||
281
+ ((Flags & ColMajor) == ColMajor && sluMat.Stype == SLU_NC));
302
282
 
303
- Index outerSize = (Flags&RowMajor)==RowMajor ? sluMat.ncol : sluMat.nrow;
283
+ Index outerSize = (Flags & RowMajor) == RowMajor ? sluMat.ncol : sluMat.nrow;
304
284
 
305
- return MappedSparseMatrix<Scalar,Flags,Index>(
306
- sluMat.nrow, sluMat.ncol, sluMat.storage.outerInd[outerSize],
307
- sluMat.storage.outerInd, sluMat.storage.innerInd, reinterpret_cast<Scalar*>(sluMat.storage.values) );
285
+ return Map<SparseMatrix<Scalar, Flags, Index> >(sluMat.nrow, sluMat.ncol, sluMat.storage.outerInd[outerSize],
286
+ sluMat.storage.outerInd, sluMat.storage.innerInd,
287
+ reinterpret_cast<Scalar *>(sluMat.storage.values));
308
288
  }
309
289
 
310
- } // end namespace internal
290
+ } // end namespace internal
311
291
 
312
292
  /** \ingroup SuperLUSupport_Module
313
- * \class SuperLUBase
314
- * \brief The base class for the direct and incomplete LU factorization of SuperLU
315
- */
316
- template<typename _MatrixType, typename Derived>
317
- class SuperLUBase : public SparseSolverBase<Derived>
318
- {
319
- protected:
320
- typedef SparseSolverBase<Derived> Base;
321
- using Base::derived;
322
- using Base::m_isInitialized;
323
- public:
324
- typedef _MatrixType MatrixType;
325
- typedef typename MatrixType::Scalar Scalar;
326
- typedef typename MatrixType::RealScalar RealScalar;
327
- typedef typename MatrixType::StorageIndex StorageIndex;
328
- typedef Matrix<Scalar,Dynamic,1> Vector;
329
- typedef Matrix<int, 1, MatrixType::ColsAtCompileTime> IntRowVectorType;
330
- typedef Matrix<int, MatrixType::RowsAtCompileTime, 1> IntColVectorType;
331
- typedef Map<PermutationMatrix<Dynamic,Dynamic,int> > PermutationMap;
332
- typedef SparseMatrix<Scalar> LUMatrixType;
333
- enum {
334
- ColsAtCompileTime = MatrixType::ColsAtCompileTime,
335
- MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
336
- };
293
+ * \class SuperLUBase
294
+ * \brief The base class for the direct and incomplete LU factorization of SuperLU
295
+ */
296
+ template <typename MatrixType_, typename Derived>
297
+ class SuperLUBase : public SparseSolverBase<Derived> {
298
+ protected:
299
+ typedef SparseSolverBase<Derived> Base;
300
+ using Base::derived;
301
+ using Base::m_isInitialized;
302
+
303
+ public:
304
+ typedef MatrixType_ MatrixType;
305
+ typedef typename MatrixType::Scalar Scalar;
306
+ typedef typename MatrixType::RealScalar RealScalar;
307
+ typedef typename MatrixType::StorageIndex StorageIndex;
308
+ typedef Matrix<Scalar, Dynamic, 1> Vector;
309
+ typedef Matrix<int, 1, MatrixType::ColsAtCompileTime> IntRowVectorType;
310
+ typedef Matrix<int, MatrixType::RowsAtCompileTime, 1> IntColVectorType;
311
+ typedef Map<PermutationMatrix<Dynamic, Dynamic, int> > PermutationMap;
312
+ typedef SparseMatrix<Scalar> LUMatrixType;
313
+ enum { ColsAtCompileTime = MatrixType::ColsAtCompileTime, MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime };
314
+
315
+ public:
316
+ SuperLUBase() {}
317
+
318
+ ~SuperLUBase() { clearFactors(); }
319
+
320
+ inline Index rows() const { return m_matrix.rows(); }
321
+ inline Index cols() const { return m_matrix.cols(); }
322
+
323
+ /** \returns a reference to the Super LU option object to configure the Super LU algorithms. */
324
+ inline superlu_options_t &options() { return m_sluOptions; }
325
+
326
+ /** \brief Reports whether previous computation was successful.
327
+ *
328
+ * \returns \c Success if computation was successful,
329
+ * \c NumericalIssue if the matrix.appears to be negative.
330
+ */
331
+ ComputationInfo info() const {
332
+ eigen_assert(m_isInitialized && "Decomposition is not initialized.");
333
+ return m_info;
334
+ }
337
335
 
338
- public:
336
+ /** Computes the sparse Cholesky decomposition of \a matrix */
337
+ void compute(const MatrixType &matrix) {
338
+ derived().analyzePattern(matrix);
339
+ derived().factorize(matrix);
340
+ }
339
341
 
340
- SuperLUBase() {}
342
+ /** Performs a symbolic decomposition on the sparsity of \a matrix.
343
+ *
344
+ * This function is particularly useful when solving for several problems having the same structure.
345
+ *
346
+ * \sa factorize()
347
+ */
348
+ void analyzePattern(const MatrixType & /*matrix*/) {
349
+ m_isInitialized = true;
350
+ m_info = Success;
351
+ m_analysisIsOk = true;
352
+ m_factorizationIsOk = false;
353
+ }
341
354
 
342
- ~SuperLUBase()
343
- {
344
- clearFactors();
345
- }
346
-
347
- inline Index rows() const { return m_matrix.rows(); }
348
- inline Index cols() const { return m_matrix.cols(); }
349
-
350
- /** \returns a reference to the Super LU option object to configure the Super LU algorithms. */
351
- inline superlu_options_t& options() { return m_sluOptions; }
352
-
353
- /** \brief Reports whether previous computation was successful.
354
- *
355
- * \returns \c Success if computation was successful,
356
- * \c NumericalIssue if the matrix.appears to be negative.
357
- */
358
- ComputationInfo info() const
359
- {
360
- eigen_assert(m_isInitialized && "Decomposition is not initialized.");
361
- return m_info;
362
- }
355
+ template <typename Stream>
356
+ void dumpMemory(Stream & /*s*/) {}
363
357
 
364
- /** Computes the sparse Cholesky decomposition of \a matrix */
365
- void compute(const MatrixType& matrix)
366
- {
367
- derived().analyzePattern(matrix);
368
- derived().factorize(matrix);
369
- }
358
+ protected:
359
+ void initFactorization(const MatrixType &a) {
360
+ set_default_options(&this->m_sluOptions);
370
361
 
371
- /** Performs a symbolic decomposition on the sparcity of \a matrix.
372
- *
373
- * This function is particularly useful when solving for several problems having the same structure.
374
- *
375
- * \sa factorize()
376
- */
377
- void analyzePattern(const MatrixType& /*matrix*/)
378
- {
379
- m_isInitialized = true;
380
- m_info = Success;
381
- m_analysisIsOk = true;
382
- m_factorizationIsOk = false;
383
- }
384
-
385
- template<typename Stream>
386
- void dumpMemory(Stream& /*s*/)
387
- {}
388
-
389
- protected:
390
-
391
- void initFactorization(const MatrixType& a)
392
- {
393
- set_default_options(&this->m_sluOptions);
394
-
395
- const Index size = a.rows();
396
- m_matrix = a;
397
-
398
- m_sluA = internal::asSluMatrix(m_matrix);
399
- clearFactors();
400
-
401
- m_p.resize(size);
402
- m_q.resize(size);
403
- m_sluRscale.resize(size);
404
- m_sluCscale.resize(size);
405
- m_sluEtree.resize(size);
406
-
407
- // set empty B and X
408
- m_sluB.setStorageType(SLU_DN);
409
- m_sluB.setScalarType<Scalar>();
410
- m_sluB.Mtype = SLU_GE;
411
- m_sluB.storage.values = 0;
412
- m_sluB.nrow = 0;
413
- m_sluB.ncol = 0;
414
- m_sluB.storage.lda = internal::convert_index<int>(size);
415
- m_sluX = m_sluB;
416
-
417
- m_extractedDataAreDirty = true;
418
- }
419
-
420
- void init()
421
- {
422
- m_info = InvalidInput;
423
- m_isInitialized = false;
424
- m_sluL.Store = 0;
425
- m_sluU.Store = 0;
426
- }
427
-
428
- void extractData() const;
362
+ const Index size = a.rows();
363
+ m_matrix = a;
429
364
 
430
- void clearFactors()
431
- {
432
- if(m_sluL.Store)
433
- Destroy_SuperNode_Matrix(&m_sluL);
434
- if(m_sluU.Store)
435
- Destroy_CompCol_Matrix(&m_sluU);
365
+ m_sluA = internal::asSluMatrix(m_matrix);
366
+ clearFactors();
436
367
 
437
- m_sluL.Store = 0;
438
- m_sluU.Store = 0;
368
+ m_p.resize(size);
369
+ m_q.resize(size);
370
+ m_sluRscale.resize(size);
371
+ m_sluCscale.resize(size);
372
+ m_sluEtree.resize(size);
439
373
 
440
- memset(&m_sluL,0,sizeof m_sluL);
441
- memset(&m_sluU,0,sizeof m_sluU);
442
- }
374
+ // set empty B and X
375
+ m_sluB.setStorageType(SLU_DN);
376
+ m_sluB.setScalarType<Scalar>();
377
+ m_sluB.Mtype = SLU_GE;
378
+ m_sluB.storage.values = 0;
379
+ m_sluB.nrow = 0;
380
+ m_sluB.ncol = 0;
381
+ m_sluB.storage.lda = internal::convert_index<int>(size);
382
+ m_sluX = m_sluB;
443
383
 
444
- // cached data to reduce reallocation, etc.
445
- mutable LUMatrixType m_l;
446
- mutable LUMatrixType m_u;
447
- mutable IntColVectorType m_p;
448
- mutable IntRowVectorType m_q;
449
-
450
- mutable LUMatrixType m_matrix; // copy of the factorized matrix
451
- mutable SluMatrix m_sluA;
452
- mutable SuperMatrix m_sluL, m_sluU;
453
- mutable SluMatrix m_sluB, m_sluX;
454
- mutable SuperLUStat_t m_sluStat;
455
- mutable superlu_options_t m_sluOptions;
456
- mutable std::vector<int> m_sluEtree;
457
- mutable Matrix<RealScalar,Dynamic,1> m_sluRscale, m_sluCscale;
458
- mutable Matrix<RealScalar,Dynamic,1> m_sluFerr, m_sluBerr;
459
- mutable char m_sluEqued;
460
-
461
- mutable ComputationInfo m_info;
462
- int m_factorizationIsOk;
463
- int m_analysisIsOk;
464
- mutable bool m_extractedDataAreDirty;
465
-
466
- private:
467
- SuperLUBase(SuperLUBase& ) { }
468
- };
384
+ m_extractedDataAreDirty = true;
385
+ }
386
+
387
+ void init() {
388
+ m_info = InvalidInput;
389
+ m_isInitialized = false;
390
+ m_sluL.Store = 0;
391
+ m_sluU.Store = 0;
392
+ }
393
+
394
+ void extractData() const;
395
+
396
+ void clearFactors() {
397
+ if (m_sluL.Store) Destroy_SuperNode_Matrix(&m_sluL);
398
+ if (m_sluU.Store) Destroy_CompCol_Matrix(&m_sluU);
399
+
400
+ m_sluL.Store = 0;
401
+ m_sluU.Store = 0;
402
+
403
+ memset(&m_sluL, 0, sizeof m_sluL);
404
+ memset(&m_sluU, 0, sizeof m_sluU);
405
+ }
469
406
 
407
+ // cached data to reduce reallocation, etc.
408
+ mutable LUMatrixType m_l;
409
+ mutable LUMatrixType m_u;
410
+ mutable IntColVectorType m_p;
411
+ mutable IntRowVectorType m_q;
412
+
413
+ mutable LUMatrixType m_matrix; // copy of the factorized matrix
414
+ mutable SluMatrix m_sluA;
415
+ mutable SuperMatrix m_sluL, m_sluU;
416
+ mutable SluMatrix m_sluB, m_sluX;
417
+ mutable SuperLUStat_t m_sluStat;
418
+ mutable superlu_options_t m_sluOptions;
419
+ mutable std::vector<int> m_sluEtree;
420
+ mutable Matrix<RealScalar, Dynamic, 1> m_sluRscale, m_sluCscale;
421
+ mutable Matrix<RealScalar, Dynamic, 1> m_sluFerr, m_sluBerr;
422
+ mutable char m_sluEqued;
423
+
424
+ mutable ComputationInfo m_info;
425
+ int m_factorizationIsOk;
426
+ int m_analysisIsOk;
427
+ mutable bool m_extractedDataAreDirty;
428
+
429
+ private:
430
+ SuperLUBase(SuperLUBase &) {}
431
+ };
470
432
 
471
433
  /** \ingroup SuperLUSupport_Module
472
- * \class SuperLU
473
- * \brief A sparse direct LU factorization and solver based on the SuperLU library
474
- *
475
- * This class allows to solve for A.X = B sparse linear problems via a direct LU factorization
476
- * using the SuperLU library. The sparse matrix A must be squared and invertible. The vectors or matrices
477
- * X and B can be either dense or sparse.
478
- *
479
- * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<>
480
- *
481
- * \warning This class is only for the 4.x versions of SuperLU. The 3.x and 5.x versions are not supported.
482
- *
483
- * \implsparsesolverconcept
484
- *
485
- * \sa \ref TutorialSparseSolverConcept, class SparseLU
486
- */
487
- template<typename _MatrixType>
488
- class SuperLU : public SuperLUBase<_MatrixType,SuperLU<_MatrixType> >
489
- {
490
- public:
491
- typedef SuperLUBase<_MatrixType,SuperLU> Base;
492
- typedef _MatrixType MatrixType;
493
- typedef typename Base::Scalar Scalar;
494
- typedef typename Base::RealScalar RealScalar;
495
- typedef typename Base::StorageIndex StorageIndex;
496
- typedef typename Base::IntRowVectorType IntRowVectorType;
497
- typedef typename Base::IntColVectorType IntColVectorType;
498
- typedef typename Base::PermutationMap PermutationMap;
499
- typedef typename Base::LUMatrixType LUMatrixType;
500
- typedef TriangularView<LUMatrixType, Lower|UnitDiag> LMatrixType;
501
- typedef TriangularView<LUMatrixType, Upper> UMatrixType;
502
-
503
- public:
504
- using Base::_solve_impl;
505
-
506
- SuperLU() : Base() { init(); }
507
-
508
- explicit SuperLU(const MatrixType& matrix) : Base()
509
- {
510
- init();
511
- Base::compute(matrix);
512
- }
434
+ * \class SuperLU
435
+ * \brief A sparse direct LU factorization and solver based on the SuperLU library
436
+ *
437
+ * This class allows to solve for A.X = B sparse linear problems via a direct LU factorization
438
+ * using the SuperLU library. The sparse matrix A must be squared and invertible. The vectors or matrices
439
+ * X and B can be either dense or sparse.
440
+ *
441
+ * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
442
+ *
443
+ * \warning This class is only for the 4.x versions of SuperLU. The 3.x and 5.x versions are not supported.
444
+ *
445
+ * \implsparsesolverconcept
446
+ *
447
+ * \sa \ref TutorialSparseSolverConcept, class SparseLU
448
+ */
449
+ template <typename MatrixType_>
450
+ class SuperLU : public SuperLUBase<MatrixType_, SuperLU<MatrixType_> > {
451
+ public:
452
+ typedef SuperLUBase<MatrixType_, SuperLU> Base;
453
+ typedef MatrixType_ MatrixType;
454
+ typedef typename Base::Scalar Scalar;
455
+ typedef typename Base::RealScalar RealScalar;
456
+ typedef typename Base::StorageIndex StorageIndex;
457
+ typedef typename Base::IntRowVectorType IntRowVectorType;
458
+ typedef typename Base::IntColVectorType IntColVectorType;
459
+ typedef typename Base::PermutationMap PermutationMap;
460
+ typedef typename Base::LUMatrixType LUMatrixType;
461
+ typedef TriangularView<LUMatrixType, Lower | UnitDiag> LMatrixType;
462
+ typedef TriangularView<LUMatrixType, Upper> UMatrixType;
463
+
464
+ public:
465
+ using Base::_solve_impl;
466
+
467
+ SuperLU() : Base() { init(); }
468
+
469
+ explicit SuperLU(const MatrixType &matrix) : Base() {
470
+ init();
471
+ Base::compute(matrix);
472
+ }
513
473
 
514
- ~SuperLU()
515
- {
516
- }
517
-
518
- /** Performs a symbolic decomposition on the sparcity of \a matrix.
519
- *
520
- * This function is particularly useful when solving for several problems having the same structure.
521
- *
522
- * \sa factorize()
523
- */
524
- void analyzePattern(const MatrixType& matrix)
525
- {
526
- m_info = InvalidInput;
527
- m_isInitialized = false;
528
- Base::analyzePattern(matrix);
529
- }
530
-
531
- /** Performs a numeric decomposition of \a matrix
532
- *
533
- * The given matrix must has the same sparcity than the matrix on which the symbolic decomposition has been performed.
534
- *
535
- * \sa analyzePattern()
536
- */
537
- void factorize(const MatrixType& matrix);
538
-
539
- /** \internal */
540
- template<typename Rhs,typename Dest>
541
- void _solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest> &dest) const;
542
-
543
- inline const LMatrixType& matrixL() const
544
- {
545
- if (m_extractedDataAreDirty) this->extractData();
546
- return m_l;
547
- }
474
+ ~SuperLU() {}
548
475
 
549
- inline const UMatrixType& matrixU() const
550
- {
551
- if (m_extractedDataAreDirty) this->extractData();
552
- return m_u;
553
- }
476
+ /** Performs a symbolic decomposition on the sparsity of \a matrix.
477
+ *
478
+ * This function is particularly useful when solving for several problems having the same structure.
479
+ *
480
+ * \sa factorize()
481
+ */
482
+ void analyzePattern(const MatrixType &matrix) {
483
+ m_info = InvalidInput;
484
+ m_isInitialized = false;
485
+ Base::analyzePattern(matrix);
486
+ }
554
487
 
555
- inline const IntColVectorType& permutationP() const
556
- {
557
- if (m_extractedDataAreDirty) this->extractData();
558
- return m_p;
559
- }
488
+ /** Performs a numeric decomposition of \a matrix
489
+ *
490
+ * The given matrix must have the same sparsity than the matrix on which the symbolic decomposition has been
491
+ * performed.
492
+ *
493
+ * \sa analyzePattern()
494
+ */
495
+ void factorize(const MatrixType &matrix);
496
+
497
+ /** \internal */
498
+ template <typename Rhs, typename Dest>
499
+ void _solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest> &dest) const;
500
+
501
+ inline const LMatrixType &matrixL() const {
502
+ if (m_extractedDataAreDirty) this->extractData();
503
+ return m_l;
504
+ }
560
505
 
561
- inline const IntRowVectorType& permutationQ() const
562
- {
563
- if (m_extractedDataAreDirty) this->extractData();
564
- return m_q;
565
- }
566
-
567
- Scalar determinant() const;
568
-
569
- protected:
570
-
571
- using Base::m_matrix;
572
- using Base::m_sluOptions;
573
- using Base::m_sluA;
574
- using Base::m_sluB;
575
- using Base::m_sluX;
576
- using Base::m_p;
577
- using Base::m_q;
578
- using Base::m_sluEtree;
579
- using Base::m_sluEqued;
580
- using Base::m_sluRscale;
581
- using Base::m_sluCscale;
582
- using Base::m_sluL;
583
- using Base::m_sluU;
584
- using Base::m_sluStat;
585
- using Base::m_sluFerr;
586
- using Base::m_sluBerr;
587
- using Base::m_l;
588
- using Base::m_u;
589
-
590
- using Base::m_analysisIsOk;
591
- using Base::m_factorizationIsOk;
592
- using Base::m_extractedDataAreDirty;
593
- using Base::m_isInitialized;
594
- using Base::m_info;
595
-
596
- void init()
597
- {
598
- Base::init();
599
-
600
- set_default_options(&this->m_sluOptions);
601
- m_sluOptions.PrintStat = NO;
602
- m_sluOptions.ConditionNumber = NO;
603
- m_sluOptions.Trans = NOTRANS;
604
- m_sluOptions.ColPerm = COLAMD;
605
- }
606
-
607
-
608
- private:
609
- SuperLU(SuperLU& ) { }
506
+ inline const UMatrixType &matrixU() const {
507
+ if (m_extractedDataAreDirty) this->extractData();
508
+ return m_u;
509
+ }
510
+
511
+ inline const IntColVectorType &permutationP() const {
512
+ if (m_extractedDataAreDirty) this->extractData();
513
+ return m_p;
514
+ }
515
+
516
+ inline const IntRowVectorType &permutationQ() const {
517
+ if (m_extractedDataAreDirty) this->extractData();
518
+ return m_q;
519
+ }
520
+
521
+ Scalar determinant() const;
522
+
523
+ protected:
524
+ using Base::m_l;
525
+ using Base::m_matrix;
526
+ using Base::m_p;
527
+ using Base::m_q;
528
+ using Base::m_sluA;
529
+ using Base::m_sluB;
530
+ using Base::m_sluBerr;
531
+ using Base::m_sluCscale;
532
+ using Base::m_sluEqued;
533
+ using Base::m_sluEtree;
534
+ using Base::m_sluFerr;
535
+ using Base::m_sluL;
536
+ using Base::m_sluOptions;
537
+ using Base::m_sluRscale;
538
+ using Base::m_sluStat;
539
+ using Base::m_sluU;
540
+ using Base::m_sluX;
541
+ using Base::m_u;
542
+
543
+ using Base::m_analysisIsOk;
544
+ using Base::m_extractedDataAreDirty;
545
+ using Base::m_factorizationIsOk;
546
+ using Base::m_info;
547
+ using Base::m_isInitialized;
548
+
549
+ void init() {
550
+ Base::init();
551
+
552
+ set_default_options(&this->m_sluOptions);
553
+ m_sluOptions.PrintStat = NO;
554
+ m_sluOptions.ConditionNumber = NO;
555
+ m_sluOptions.Trans = NOTRANS;
556
+ m_sluOptions.ColPerm = COLAMD;
557
+ }
558
+
559
+ private:
560
+ SuperLU(SuperLU &) {}
610
561
  };
611
562
 
612
- template<typename MatrixType>
613
- void SuperLU<MatrixType>::factorize(const MatrixType& a)
614
- {
563
+ template <typename MatrixType>
564
+ void SuperLU<MatrixType>::factorize(const MatrixType &a) {
615
565
  eigen_assert(m_analysisIsOk && "You must first call analyzePattern()");
616
- if(!m_analysisIsOk)
617
- {
566
+ if (!m_analysisIsOk) {
618
567
  m_info = InvalidInput;
619
568
  return;
620
569
  }
621
-
570
+
622
571
  this->initFactorization(a);
623
-
572
+
624
573
  m_sluOptions.ColPerm = COLAMD;
625
574
  int info = 0;
626
575
  RealScalar recip_pivot_growth, rcond;
627
576
  RealScalar ferr, berr;
628
577
 
629
578
  StatInit(&m_sluStat);
630
- SuperLU_gssvx(&m_sluOptions, &m_sluA, m_q.data(), m_p.data(), &m_sluEtree[0],
631
- &m_sluEqued, &m_sluRscale[0], &m_sluCscale[0],
632
- &m_sluL, &m_sluU,
633
- NULL, 0,
634
- &m_sluB, &m_sluX,
635
- &recip_pivot_growth, &rcond,
636
- &ferr, &berr,
579
+ SuperLU_gssvx(&m_sluOptions, &m_sluA, m_q.data(), m_p.data(), &m_sluEtree[0], &m_sluEqued, &m_sluRscale[0],
580
+ &m_sluCscale[0], &m_sluL, &m_sluU, NULL, 0, &m_sluB, &m_sluX, &recip_pivot_growth, &rcond, &ferr, &berr,
637
581
  &m_sluStat, &info, Scalar());
638
582
  StatFree(&m_sluStat);
639
583
 
@@ -644,55 +588,46 @@ void SuperLU<MatrixType>::factorize(const MatrixType& a)
644
588
  m_factorizationIsOk = true;
645
589
  }
646
590
 
647
- template<typename MatrixType>
648
- template<typename Rhs,typename Dest>
649
- void SuperLU<MatrixType>::_solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest>& x) const
650
- {
651
- eigen_assert(m_factorizationIsOk && "The decomposition is not in a valid state for solving, you must first call either compute() or analyzePattern()/factorize()");
591
+ template <typename MatrixType>
592
+ template <typename Rhs, typename Dest>
593
+ void SuperLU<MatrixType>::_solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest> &x) const {
594
+ eigen_assert(m_factorizationIsOk &&
595
+ "The decomposition is not in a valid state for solving, you must first call either compute() or "
596
+ "analyzePattern()/factorize()");
652
597
 
653
598
  const Index rhsCols = b.cols();
654
- eigen_assert(m_matrix.rows()==b.rows());
599
+ eigen_assert(m_matrix.rows() == b.rows());
655
600
 
656
601
  m_sluOptions.Trans = NOTRANS;
657
602
  m_sluOptions.Fact = FACTORED;
658
603
  m_sluOptions.IterRefine = NOREFINE;
659
-
660
604
 
661
605
  m_sluFerr.resize(rhsCols);
662
606
  m_sluBerr.resize(rhsCols);
663
-
664
- Ref<const Matrix<typename Rhs::Scalar,Dynamic,Dynamic,ColMajor> > b_ref(b);
665
- Ref<const Matrix<typename Dest::Scalar,Dynamic,Dynamic,ColMajor> > x_ref(x);
666
-
607
+
608
+ Ref<const Matrix<typename Rhs::Scalar, Dynamic, Dynamic, ColMajor> > b_ref(b);
609
+ Ref<const Matrix<typename Dest::Scalar, Dynamic, Dynamic, ColMajor> > x_ref(x);
610
+
667
611
  m_sluB = SluMatrix::Map(b_ref.const_cast_derived());
668
612
  m_sluX = SluMatrix::Map(x_ref.const_cast_derived());
669
-
613
+
670
614
  typename Rhs::PlainObject b_cpy;
671
- if(m_sluEqued!='N')
672
- {
615
+ if (m_sluEqued != 'N') {
673
616
  b_cpy = b;
674
- m_sluB = SluMatrix::Map(b_cpy.const_cast_derived());
617
+ m_sluB = SluMatrix::Map(b_cpy.const_cast_derived());
675
618
  }
676
619
 
677
620
  StatInit(&m_sluStat);
678
621
  int info = 0;
679
622
  RealScalar recip_pivot_growth, rcond;
680
- SuperLU_gssvx(&m_sluOptions, &m_sluA,
681
- m_q.data(), m_p.data(),
682
- &m_sluEtree[0], &m_sluEqued,
683
- &m_sluRscale[0], &m_sluCscale[0],
684
- &m_sluL, &m_sluU,
685
- NULL, 0,
686
- &m_sluB, &m_sluX,
687
- &recip_pivot_growth, &rcond,
688
- &m_sluFerr[0], &m_sluBerr[0],
689
- &m_sluStat, &info, Scalar());
623
+ SuperLU_gssvx(&m_sluOptions, &m_sluA, m_q.data(), m_p.data(), &m_sluEtree[0], &m_sluEqued, &m_sluRscale[0],
624
+ &m_sluCscale[0], &m_sluL, &m_sluU, NULL, 0, &m_sluB, &m_sluX, &recip_pivot_growth, &rcond,
625
+ &m_sluFerr[0], &m_sluBerr[0], &m_sluStat, &info, Scalar());
690
626
  StatFree(&m_sluStat);
691
-
692
- if(x.derived().data() != x_ref.data())
693
- x = x_ref;
694
-
695
- m_info = info==0 ? Success : NumericalIssue;
627
+
628
+ if (x.derived().data() != x_ref.data()) x = x_ref;
629
+
630
+ m_info = info == 0 ? Success : NumericalIssue;
696
631
  }
697
632
 
698
633
  // the code of this extractData() function has been adapted from the SuperLU's Matlab support code,
@@ -702,78 +637,70 @@ void SuperLU<MatrixType>::_solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest>
702
637
  // THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
703
638
  // EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
704
639
  //
705
- template<typename MatrixType, typename Derived>
706
- void SuperLUBase<MatrixType,Derived>::extractData() const
707
- {
708
- eigen_assert(m_factorizationIsOk && "The decomposition is not in a valid state for extracting factors, you must first call either compute() or analyzePattern()/factorize()");
709
- if (m_extractedDataAreDirty)
710
- {
711
- int upper;
712
- int fsupc, istart, nsupr;
713
- int lastl = 0, lastu = 0;
714
- SCformat *Lstore = static_cast<SCformat*>(m_sluL.Store);
715
- NCformat *Ustore = static_cast<NCformat*>(m_sluU.Store);
716
- Scalar *SNptr;
640
+ template <typename MatrixType, typename Derived>
641
+ void SuperLUBase<MatrixType, Derived>::extractData() const {
642
+ eigen_assert(m_factorizationIsOk &&
643
+ "The decomposition is not in a valid state for extracting factors, you must first call either compute() "
644
+ "or analyzePattern()/factorize()");
645
+ if (m_extractedDataAreDirty) {
646
+ int upper;
647
+ int fsupc, istart, nsupr;
648
+ int lastl = 0, lastu = 0;
649
+ SCformat *Lstore = static_cast<SCformat *>(m_sluL.Store);
650
+ NCformat *Ustore = static_cast<NCformat *>(m_sluU.Store);
651
+ Scalar *SNptr;
717
652
 
718
653
  const Index size = m_matrix.rows();
719
- m_l.resize(size,size);
654
+ m_l.resize(size, size);
720
655
  m_l.resizeNonZeros(Lstore->nnz);
721
- m_u.resize(size,size);
656
+ m_u.resize(size, size);
722
657
  m_u.resizeNonZeros(Ustore->nnz);
723
658
 
724
- int* Lcol = m_l.outerIndexPtr();
725
- int* Lrow = m_l.innerIndexPtr();
726
- Scalar* Lval = m_l.valuePtr();
659
+ int *Lcol = m_l.outerIndexPtr();
660
+ int *Lrow = m_l.innerIndexPtr();
661
+ Scalar *Lval = m_l.valuePtr();
727
662
 
728
- int* Ucol = m_u.outerIndexPtr();
729
- int* Urow = m_u.innerIndexPtr();
730
- Scalar* Uval = m_u.valuePtr();
663
+ int *Ucol = m_u.outerIndexPtr();
664
+ int *Urow = m_u.innerIndexPtr();
665
+ Scalar *Uval = m_u.valuePtr();
731
666
 
732
667
  Ucol[0] = 0;
733
668
  Ucol[0] = 0;
734
669
 
735
670
  /* for each supernode */
736
- for (int k = 0; k <= Lstore->nsuper; ++k)
737
- {
738
- fsupc = L_FST_SUPC(k);
739
- istart = L_SUB_START(fsupc);
740
- nsupr = L_SUB_START(fsupc+1) - istart;
741
- upper = 1;
671
+ for (int k = 0; k <= Lstore->nsuper; ++k) {
672
+ fsupc = L_FST_SUPC(k);
673
+ istart = L_SUB_START(fsupc);
674
+ nsupr = L_SUB_START(fsupc + 1) - istart;
675
+ upper = 1;
742
676
 
743
677
  /* for each column in the supernode */
744
- for (int j = fsupc; j < L_FST_SUPC(k+1); ++j)
745
- {
746
- SNptr = &((Scalar*)Lstore->nzval)[L_NZ_START(j)];
678
+ for (int j = fsupc; j < L_FST_SUPC(k + 1); ++j) {
679
+ SNptr = &((Scalar *)Lstore->nzval)[L_NZ_START(j)];
747
680
 
748
681
  /* Extract U */
749
- for (int i = U_NZ_START(j); i < U_NZ_START(j+1); ++i)
750
- {
751
- Uval[lastu] = ((Scalar*)Ustore->nzval)[i];
682
+ for (int i = U_NZ_START(j); i < U_NZ_START(j + 1); ++i) {
683
+ Uval[lastu] = ((Scalar *)Ustore->nzval)[i];
752
684
  /* Matlab doesn't like explicit zero. */
753
- if (Uval[lastu] != 0.0)
754
- Urow[lastu++] = U_SUB(i);
685
+ if (Uval[lastu] != 0.0) Urow[lastu++] = U_SUB(i);
755
686
  }
756
- for (int i = 0; i < upper; ++i)
757
- {
687
+ for (int i = 0; i < upper; ++i) {
758
688
  /* upper triangle in the supernode */
759
689
  Uval[lastu] = SNptr[i];
760
690
  /* Matlab doesn't like explicit zero. */
761
- if (Uval[lastu] != 0.0)
762
- Urow[lastu++] = L_SUB(istart+i);
691
+ if (Uval[lastu] != 0.0) Urow[lastu++] = L_SUB(istart + i);
763
692
  }
764
- Ucol[j+1] = lastu;
693
+ Ucol[j + 1] = lastu;
765
694
 
766
695
  /* Extract L */
767
696
  Lval[lastl] = 1.0; /* unit diagonal */
768
697
  Lrow[lastl++] = L_SUB(istart + upper - 1);
769
- for (int i = upper; i < nsupr; ++i)
770
- {
698
+ for (int i = upper; i < nsupr; ++i) {
771
699
  Lval[lastl] = SNptr[i];
772
700
  /* Matlab doesn't like explicit zero. */
773
- if (Lval[lastl] != 0.0)
774
- Lrow[lastl++] = L_SUB(istart+i);
701
+ if (Lval[lastl] != 0.0) Lrow[lastl++] = L_SUB(istart + i);
775
702
  }
776
- Lcol[j+1] = lastl;
703
+ Lcol[j + 1] = lastl;
777
704
 
778
705
  ++upper;
779
706
  } /* for j ... */
@@ -788,29 +715,26 @@ void SuperLUBase<MatrixType,Derived>::extractData() const
788
715
  }
789
716
  }
790
717
 
791
- template<typename MatrixType>
792
- typename SuperLU<MatrixType>::Scalar SuperLU<MatrixType>::determinant() const
793
- {
794
- eigen_assert(m_factorizationIsOk && "The decomposition is not in a valid state for computing the determinant, you must first call either compute() or analyzePattern()/factorize()");
795
-
796
- if (m_extractedDataAreDirty)
797
- this->extractData();
718
+ template <typename MatrixType>
719
+ typename SuperLU<MatrixType>::Scalar SuperLU<MatrixType>::determinant() const {
720
+ eigen_assert(m_factorizationIsOk &&
721
+ "The decomposition is not in a valid state for computing the determinant, you must first call either "
722
+ "compute() or analyzePattern()/factorize()");
723
+
724
+ if (m_extractedDataAreDirty) this->extractData();
798
725
 
799
726
  Scalar det = Scalar(1);
800
- for (int j=0; j<m_u.cols(); ++j)
801
- {
802
- if (m_u.outerIndexPtr()[j+1]-m_u.outerIndexPtr()[j] > 0)
803
- {
804
- int lastId = m_u.outerIndexPtr()[j+1]-1;
805
- eigen_assert(m_u.innerIndexPtr()[lastId]<=j);
806
- if (m_u.innerIndexPtr()[lastId]==j)
807
- det *= m_u.valuePtr()[lastId];
727
+ for (int j = 0; j < m_u.cols(); ++j) {
728
+ if (m_u.outerIndexPtr()[j + 1] - m_u.outerIndexPtr()[j] > 0) {
729
+ int lastId = m_u.outerIndexPtr()[j + 1] - 1;
730
+ eigen_assert(m_u.innerIndexPtr()[lastId] <= j);
731
+ if (m_u.innerIndexPtr()[lastId] == j) det *= m_u.valuePtr()[lastId];
808
732
  }
809
733
  }
810
- if(PermutationMap(m_p.data(),m_p.size()).determinant()*PermutationMap(m_q.data(),m_q.size()).determinant()<0)
734
+ if (PermutationMap(m_p.data(), m_p.size()).determinant() * PermutationMap(m_q.data(), m_q.size()).determinant() < 0)
811
735
  det = -det;
812
- if(m_sluEqued!='N')
813
- return det/m_sluRscale.prod()/m_sluCscale.prod();
736
+ if (m_sluEqued != 'N')
737
+ return det / m_sluRscale.prod() / m_sluCscale.prod();
814
738
  else
815
739
  return det;
816
740
  }
@@ -822,143 +746,130 @@ typename SuperLU<MatrixType>::Scalar SuperLU<MatrixType>::determinant() const
822
746
  #ifdef EIGEN_SUPERLU_HAS_ILU
823
747
 
824
748
  /** \ingroup SuperLUSupport_Module
825
- * \class SuperILU
826
- * \brief A sparse direct \b incomplete LU factorization and solver based on the SuperLU library
827
- *
828
- * This class allows to solve for an approximate solution of A.X = B sparse linear problems via an incomplete LU factorization
829
- * using the SuperLU library. This class is aimed to be used as a preconditioner of the iterative linear solvers.
830
- *
831
- * \warning This class is only for the 4.x versions of SuperLU. The 3.x and 5.x versions are not supported.
832
- *
833
- * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<>
834
- *
835
- * \implsparsesolverconcept
836
- *
837
- * \sa \ref TutorialSparseSolverConcept, class IncompleteLUT, class ConjugateGradient, class BiCGSTAB
838
- */
839
-
840
- template<typename _MatrixType>
841
- class SuperILU : public SuperLUBase<_MatrixType,SuperILU<_MatrixType> >
842
- {
843
- public:
844
- typedef SuperLUBase<_MatrixType,SuperILU> Base;
845
- typedef _MatrixType MatrixType;
846
- typedef typename Base::Scalar Scalar;
847
- typedef typename Base::RealScalar RealScalar;
848
-
849
- public:
850
- using Base::_solve_impl;
851
-
852
- SuperILU() : Base() { init(); }
853
-
854
- SuperILU(const MatrixType& matrix) : Base()
855
- {
856
- init();
857
- Base::compute(matrix);
858
- }
749
+ * \class SuperILU
750
+ * \brief A sparse direct \b incomplete LU factorization and solver based on the SuperLU library
751
+ *
752
+ * This class allows to solve for an approximate solution of A.X = B sparse linear problems via an incomplete LU
753
+ * factorization using the SuperLU library. This class is aimed to be used as a preconditioner of the iterative linear
754
+ * solvers.
755
+ *
756
+ * \warning This class is only for the 4.x versions of SuperLU. The 3.x and 5.x versions are not supported.
757
+ *
758
+ * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
759
+ *
760
+ * \implsparsesolverconcept
761
+ *
762
+ * \sa \ref TutorialSparseSolverConcept, class IncompleteLUT, class ConjugateGradient, class BiCGSTAB
763
+ */
764
+
765
+ template <typename MatrixType_>
766
+ class SuperILU : public SuperLUBase<MatrixType_, SuperILU<MatrixType_> > {
767
+ public:
768
+ typedef SuperLUBase<MatrixType_, SuperILU> Base;
769
+ typedef MatrixType_ MatrixType;
770
+ typedef typename Base::Scalar Scalar;
771
+ typedef typename Base::RealScalar RealScalar;
772
+
773
+ public:
774
+ using Base::_solve_impl;
775
+
776
+ SuperILU() : Base() { init(); }
777
+
778
+ SuperILU(const MatrixType &matrix) : Base() {
779
+ init();
780
+ Base::compute(matrix);
781
+ }
859
782
 
860
- ~SuperILU()
861
- {
862
- }
863
-
864
- /** Performs a symbolic decomposition on the sparcity of \a matrix.
865
- *
866
- * This function is particularly useful when solving for several problems having the same structure.
867
- *
868
- * \sa factorize()
869
- */
870
- void analyzePattern(const MatrixType& matrix)
871
- {
872
- Base::analyzePattern(matrix);
873
- }
874
-
875
- /** Performs a numeric decomposition of \a matrix
876
- *
877
- * The given matrix must has the same sparcity than the matrix on which the symbolic decomposition has been performed.
878
- *
879
- * \sa analyzePattern()
880
- */
881
- void factorize(const MatrixType& matrix);
882
-
883
- #ifndef EIGEN_PARSED_BY_DOXYGEN
884
- /** \internal */
885
- template<typename Rhs,typename Dest>
886
- void _solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest> &dest) const;
887
- #endif // EIGEN_PARSED_BY_DOXYGEN
888
-
889
- protected:
890
-
891
- using Base::m_matrix;
892
- using Base::m_sluOptions;
893
- using Base::m_sluA;
894
- using Base::m_sluB;
895
- using Base::m_sluX;
896
- using Base::m_p;
897
- using Base::m_q;
898
- using Base::m_sluEtree;
899
- using Base::m_sluEqued;
900
- using Base::m_sluRscale;
901
- using Base::m_sluCscale;
902
- using Base::m_sluL;
903
- using Base::m_sluU;
904
- using Base::m_sluStat;
905
- using Base::m_sluFerr;
906
- using Base::m_sluBerr;
907
- using Base::m_l;
908
- using Base::m_u;
909
-
910
- using Base::m_analysisIsOk;
911
- using Base::m_factorizationIsOk;
912
- using Base::m_extractedDataAreDirty;
913
- using Base::m_isInitialized;
914
- using Base::m_info;
915
-
916
- void init()
917
- {
918
- Base::init();
919
-
920
- ilu_set_default_options(&m_sluOptions);
921
- m_sluOptions.PrintStat = NO;
922
- m_sluOptions.ConditionNumber = NO;
923
- m_sluOptions.Trans = NOTRANS;
924
- m_sluOptions.ColPerm = MMD_AT_PLUS_A;
925
-
926
- // no attempt to preserve column sum
927
- m_sluOptions.ILU_MILU = SILU;
928
- // only basic ILU(k) support -- no direct control over memory consumption
929
- // better to use ILU_DropRule = DROP_BASIC | DROP_AREA
930
- // and set ILU_FillFactor to max memory growth
931
- m_sluOptions.ILU_DropRule = DROP_BASIC;
932
- m_sluOptions.ILU_DropTol = NumTraits<Scalar>::dummy_precision()*10;
933
- }
934
-
935
- private:
936
- SuperILU(SuperILU& ) { }
783
+ ~SuperILU() {}
784
+
785
+ /** Performs a symbolic decomposition on the sparsity of \a matrix.
786
+ *
787
+ * This function is particularly useful when solving for several problems having the same structure.
788
+ *
789
+ * \sa factorize()
790
+ */
791
+ void analyzePattern(const MatrixType &matrix) { Base::analyzePattern(matrix); }
792
+
793
+ /** Performs a numeric decomposition of \a matrix
794
+ *
795
+ * The given matrix must have the same sparsity than the matrix on which the symbolic decomposition has been
796
+ * performed.
797
+ *
798
+ * \sa analyzePattern()
799
+ */
800
+ void factorize(const MatrixType &matrix);
801
+
802
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
803
+ /** \internal */
804
+ template <typename Rhs, typename Dest>
805
+ void _solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest> &dest) const;
806
+ #endif // EIGEN_PARSED_BY_DOXYGEN
807
+
808
+ protected:
809
+ using Base::m_l;
810
+ using Base::m_matrix;
811
+ using Base::m_p;
812
+ using Base::m_q;
813
+ using Base::m_sluA;
814
+ using Base::m_sluB;
815
+ using Base::m_sluBerr;
816
+ using Base::m_sluCscale;
817
+ using Base::m_sluEqued;
818
+ using Base::m_sluEtree;
819
+ using Base::m_sluFerr;
820
+ using Base::m_sluL;
821
+ using Base::m_sluOptions;
822
+ using Base::m_sluRscale;
823
+ using Base::m_sluStat;
824
+ using Base::m_sluU;
825
+ using Base::m_sluX;
826
+ using Base::m_u;
827
+
828
+ using Base::m_analysisIsOk;
829
+ using Base::m_extractedDataAreDirty;
830
+ using Base::m_factorizationIsOk;
831
+ using Base::m_info;
832
+ using Base::m_isInitialized;
833
+
834
+ void init() {
835
+ Base::init();
836
+
837
+ ilu_set_default_options(&m_sluOptions);
838
+ m_sluOptions.PrintStat = NO;
839
+ m_sluOptions.ConditionNumber = NO;
840
+ m_sluOptions.Trans = NOTRANS;
841
+ m_sluOptions.ColPerm = MMD_AT_PLUS_A;
842
+
843
+ // no attempt to preserve column sum
844
+ m_sluOptions.ILU_MILU = SILU;
845
+ // only basic ILU(k) support -- no direct control over memory consumption
846
+ // better to use ILU_DropRule = DROP_BASIC | DROP_AREA
847
+ // and set ILU_FillFactor to max memory growth
848
+ m_sluOptions.ILU_DropRule = DROP_BASIC;
849
+ m_sluOptions.ILU_DropTol = NumTraits<Scalar>::dummy_precision() * 10;
850
+ }
851
+
852
+ private:
853
+ SuperILU(SuperILU &) {}
937
854
  };
938
855
 
939
- template<typename MatrixType>
940
- void SuperILU<MatrixType>::factorize(const MatrixType& a)
941
- {
856
+ template <typename MatrixType>
857
+ void SuperILU<MatrixType>::factorize(const MatrixType &a) {
942
858
  eigen_assert(m_analysisIsOk && "You must first call analyzePattern()");
943
- if(!m_analysisIsOk)
944
- {
859
+ if (!m_analysisIsOk) {
945
860
  m_info = InvalidInput;
946
861
  return;
947
862
  }
948
-
863
+
949
864
  this->initFactorization(a);
950
865
 
951
866
  int info = 0;
952
867
  RealScalar recip_pivot_growth, rcond;
953
868
 
954
869
  StatInit(&m_sluStat);
955
- SuperLU_gsisx(&m_sluOptions, &m_sluA, m_q.data(), m_p.data(), &m_sluEtree[0],
956
- &m_sluEqued, &m_sluRscale[0], &m_sluCscale[0],
957
- &m_sluL, &m_sluU,
958
- NULL, 0,
959
- &m_sluB, &m_sluX,
960
- &recip_pivot_growth, &rcond,
961
- &m_sluStat, &info, Scalar());
870
+ SuperLU_gsisx(&m_sluOptions, &m_sluA, m_q.data(), m_p.data(), &m_sluEtree[0], &m_sluEqued, &m_sluRscale[0],
871
+ &m_sluCscale[0], &m_sluL, &m_sluU, NULL, 0, &m_sluB, &m_sluX, &recip_pivot_growth, &rcond, &m_sluStat,
872
+ &info, Scalar());
962
873
  StatFree(&m_sluStat);
963
874
 
964
875
  // FIXME how to better check for errors ???
@@ -967,14 +878,15 @@ void SuperILU<MatrixType>::factorize(const MatrixType& a)
967
878
  }
968
879
 
969
880
  #ifndef EIGEN_PARSED_BY_DOXYGEN
970
- template<typename MatrixType>
971
- template<typename Rhs,typename Dest>
972
- void SuperILU<MatrixType>::_solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest>& x) const
973
- {
974
- eigen_assert(m_factorizationIsOk && "The decomposition is not in a valid state for solving, you must first call either compute() or analyzePattern()/factorize()");
881
+ template <typename MatrixType>
882
+ template <typename Rhs, typename Dest>
883
+ void SuperILU<MatrixType>::_solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest> &x) const {
884
+ eigen_assert(m_factorizationIsOk &&
885
+ "The decomposition is not in a valid state for solving, you must first call either compute() or "
886
+ "analyzePattern()/factorize()");
975
887
 
976
888
  const int rhsCols = b.cols();
977
- eigen_assert(m_matrix.rows()==b.rows());
889
+ eigen_assert(m_matrix.rows() == b.rows());
978
890
 
979
891
  m_sluOptions.Trans = NOTRANS;
980
892
  m_sluOptions.Fact = FACTORED;
@@ -982,44 +894,36 @@ void SuperILU<MatrixType>::_solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest
982
894
 
983
895
  m_sluFerr.resize(rhsCols);
984
896
  m_sluBerr.resize(rhsCols);
985
-
986
- Ref<const Matrix<typename Rhs::Scalar,Dynamic,Dynamic,ColMajor> > b_ref(b);
987
- Ref<const Matrix<typename Dest::Scalar,Dynamic,Dynamic,ColMajor> > x_ref(x);
988
-
897
+
898
+ Ref<const Matrix<typename Rhs::Scalar, Dynamic, Dynamic, ColMajor> > b_ref(b);
899
+ Ref<const Matrix<typename Dest::Scalar, Dynamic, Dynamic, ColMajor> > x_ref(x);
900
+
989
901
  m_sluB = SluMatrix::Map(b_ref.const_cast_derived());
990
902
  m_sluX = SluMatrix::Map(x_ref.const_cast_derived());
991
903
 
992
904
  typename Rhs::PlainObject b_cpy;
993
- if(m_sluEqued!='N')
994
- {
905
+ if (m_sluEqued != 'N') {
995
906
  b_cpy = b;
996
- m_sluB = SluMatrix::Map(b_cpy.const_cast_derived());
907
+ m_sluB = SluMatrix::Map(b_cpy.const_cast_derived());
997
908
  }
998
-
909
+
999
910
  int info = 0;
1000
911
  RealScalar recip_pivot_growth, rcond;
1001
912
 
1002
913
  StatInit(&m_sluStat);
1003
- SuperLU_gsisx(&m_sluOptions, &m_sluA,
1004
- m_q.data(), m_p.data(),
1005
- &m_sluEtree[0], &m_sluEqued,
1006
- &m_sluRscale[0], &m_sluCscale[0],
1007
- &m_sluL, &m_sluU,
1008
- NULL, 0,
1009
- &m_sluB, &m_sluX,
1010
- &recip_pivot_growth, &rcond,
1011
- &m_sluStat, &info, Scalar());
914
+ SuperLU_gsisx(&m_sluOptions, &m_sluA, m_q.data(), m_p.data(), &m_sluEtree[0], &m_sluEqued, &m_sluRscale[0],
915
+ &m_sluCscale[0], &m_sluL, &m_sluU, NULL, 0, &m_sluB, &m_sluX, &recip_pivot_growth, &rcond, &m_sluStat,
916
+ &info, Scalar());
1012
917
  StatFree(&m_sluStat);
1013
-
1014
- if(x.derived().data() != x_ref.data())
1015
- x = x_ref;
1016
918
 
1017
- m_info = info==0 ? Success : NumericalIssue;
919
+ if (x.derived().data() != x_ref.data()) x = x_ref;
920
+
921
+ m_info = info == 0 ? Success : NumericalIssue;
1018
922
  }
1019
923
  #endif
1020
924
 
1021
925
  #endif
1022
926
 
1023
- } // end namespace Eigen
927
+ } // end namespace Eigen
1024
928
 
1025
- #endif // EIGEN_SUPERLUSUPPORT_H
929
+ #endif // EIGEN_SUPERLUSUPPORT_H