@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
@@ -11,431 +11,402 @@
11
11
  #ifndef EIGEN_PARTIALLU_H
12
12
  #define EIGEN_PARTIALLU_H
13
13
 
14
+ // IWYU pragma: private
15
+ #include "./InternalHeaderCheck.h"
16
+
14
17
  namespace Eigen {
15
18
 
16
19
  namespace internal {
17
- template<typename _MatrixType> struct traits<PartialPivLU<_MatrixType> >
18
- : traits<_MatrixType>
19
- {
20
+ template <typename MatrixType_, typename PermutationIndex_>
21
+ struct traits<PartialPivLU<MatrixType_, PermutationIndex_> > : traits<MatrixType_> {
20
22
  typedef MatrixXpr XprKind;
21
23
  typedef SolverStorage StorageKind;
22
- typedef int StorageIndex;
23
- typedef traits<_MatrixType> BaseTraits;
24
- enum {
25
- Flags = BaseTraits::Flags & RowMajorBit,
26
- CoeffReadCost = Dynamic
27
- };
24
+ typedef PermutationIndex_ StorageIndex;
25
+ typedef traits<MatrixType_> BaseTraits;
26
+ enum { Flags = BaseTraits::Flags & RowMajorBit, CoeffReadCost = Dynamic };
28
27
  };
29
28
 
30
- template<typename T,typename Derived>
29
+ template <typename T, typename Derived>
31
30
  struct enable_if_ref;
32
31
  // {
33
32
  // typedef Derived type;
34
33
  // };
35
34
 
36
- template<typename T,typename Derived>
37
- struct enable_if_ref<Ref<T>,Derived> {
35
+ template <typename T, typename Derived>
36
+ struct enable_if_ref<Ref<T>, Derived> {
38
37
  typedef Derived type;
39
38
  };
40
39
 
41
- } // end namespace internal
40
+ } // end namespace internal
42
41
 
43
42
  /** \ingroup LU_Module
44
- *
45
- * \class PartialPivLU
46
- *
47
- * \brief LU decomposition of a matrix with partial pivoting, and related features
48
- *
49
- * \tparam _MatrixType the type of the matrix of which we are computing the LU decomposition
50
- *
51
- * This class represents a LU decomposition of a \b square \b invertible matrix, with partial pivoting: the matrix A
52
- * is decomposed as A = PLU where L is unit-lower-triangular, U is upper-triangular, and P
53
- * is a permutation matrix.
54
- *
55
- * Typically, partial pivoting LU decomposition is only considered numerically stable for square invertible
56
- * matrices. Thus LAPACK's dgesv and dgesvx require the matrix to be square and invertible. The present class
57
- * does the same. It will assert that the matrix is square, but it won't (actually it can't) check that the
58
- * matrix is invertible: it is your task to check that you only use this decomposition on invertible matrices.
59
- *
60
- * The guaranteed safe alternative, working for all matrices, is the full pivoting LU decomposition, provided
61
- * by class FullPivLU.
62
- *
63
- * This is \b not a rank-revealing LU decomposition. Many features are intentionally absent from this class,
64
- * such as rank computation. If you need these features, use class FullPivLU.
65
- *
66
- * This LU decomposition is suitable to invert invertible matrices. It is what MatrixBase::inverse() uses
67
- * in the general case.
68
- * On the other hand, it is \b not suitable to determine whether a given matrix is invertible.
69
- *
70
- * The data of the LU decomposition can be directly accessed through the methods matrixLU(), permutationP().
71
- *
72
- * This class supports the \link InplaceDecomposition inplace decomposition \endlink mechanism.
73
- *
74
- * \sa MatrixBase::partialPivLu(), MatrixBase::determinant(), MatrixBase::inverse(), MatrixBase::computeInverse(), class FullPivLU
75
- */
76
- template<typename _MatrixType> class PartialPivLU
77
- : public SolverBase<PartialPivLU<_MatrixType> >
78
- {
79
- public:
80
-
81
- typedef _MatrixType MatrixType;
82
- typedef SolverBase<PartialPivLU> Base;
83
- friend class SolverBase<PartialPivLU>;
84
-
85
- EIGEN_GENERIC_PUBLIC_INTERFACE(PartialPivLU)
86
- enum {
87
- MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
88
- MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
89
- };
90
- typedef PermutationMatrix<RowsAtCompileTime, MaxRowsAtCompileTime> PermutationType;
91
- typedef Transpositions<RowsAtCompileTime, MaxRowsAtCompileTime> TranspositionType;
92
- typedef typename MatrixType::PlainObject PlainObject;
93
-
94
- /**
95
- * \brief Default Constructor.
96
- *
97
- * The default constructor is useful in cases in which the user intends to
98
- * perform decompositions via PartialPivLU::compute(const MatrixType&).
99
- */
100
- PartialPivLU();
101
-
102
- /** \brief Default Constructor with memory preallocation
103
- *
104
- * Like the default constructor but with preallocation of the internal data
105
- * according to the specified problem \a size.
106
- * \sa PartialPivLU()
107
- */
108
- explicit PartialPivLU(Index size);
109
-
110
- /** Constructor.
111
- *
112
- * \param matrix the matrix of which to compute the LU decomposition.
113
- *
114
- * \warning The matrix should have full rank (e.g. if it's square, it should be invertible).
115
- * If you need to deal with non-full rank, use class FullPivLU instead.
116
- */
117
- template<typename InputType>
118
- explicit PartialPivLU(const EigenBase<InputType>& matrix);
119
-
120
- /** Constructor for \link InplaceDecomposition inplace decomposition \endlink
121
- *
122
- * \param matrix the matrix of which to compute the LU decomposition.
123
- *
124
- * \warning The matrix should have full rank (e.g. if it's square, it should be invertible).
125
- * If you need to deal with non-full rank, use class FullPivLU instead.
126
- */
127
- template<typename InputType>
128
- explicit PartialPivLU(EigenBase<InputType>& matrix);
129
-
130
- template<typename InputType>
131
- PartialPivLU& compute(const EigenBase<InputType>& matrix) {
132
- m_lu = matrix.derived();
133
- compute();
134
- return *this;
135
- }
43
+ *
44
+ * \class PartialPivLU
45
+ *
46
+ * \brief LU decomposition of a matrix with partial pivoting, and related features
47
+ *
48
+ * \tparam MatrixType_ the type of the matrix of which we are computing the LU decomposition
49
+ *
50
+ * This class represents a LU decomposition of a \b square \b invertible matrix, with partial pivoting: the matrix A
51
+ * is decomposed as A = PLU where L is unit-lower-triangular, U is upper-triangular, and P
52
+ * is a permutation matrix.
53
+ *
54
+ * Typically, partial pivoting LU decomposition is only considered numerically stable for square invertible
55
+ * matrices. Thus LAPACK's dgesv and dgesvx require the matrix to be square and invertible. The present class
56
+ * does the same. It will assert that the matrix is square, but it won't (actually it can't) check that the
57
+ * matrix is invertible: it is your task to check that you only use this decomposition on invertible matrices.
58
+ *
59
+ * The guaranteed safe alternative, working for all matrices, is the full pivoting LU decomposition, provided
60
+ * by class FullPivLU.
61
+ *
62
+ * This is \b not a rank-revealing LU decomposition. Many features are intentionally absent from this class,
63
+ * such as rank computation. If you need these features, use class FullPivLU.
64
+ *
65
+ * This LU decomposition is suitable to invert invertible matrices. It is what MatrixBase::inverse() uses
66
+ * in the general case.
67
+ * On the other hand, it is \b not suitable to determine whether a given matrix is invertible.
68
+ *
69
+ * The data of the LU decomposition can be directly accessed through the methods matrixLU(), permutationP().
70
+ *
71
+ * This class supports the \link InplaceDecomposition inplace decomposition \endlink mechanism.
72
+ *
73
+ * \sa MatrixBase::partialPivLu(), MatrixBase::determinant(), MatrixBase::inverse(), MatrixBase::computeInverse(), class
74
+ * FullPivLU
75
+ */
76
+ template <typename MatrixType_, typename PermutationIndex_>
77
+ class PartialPivLU : public SolverBase<PartialPivLU<MatrixType_, PermutationIndex_> > {
78
+ public:
79
+ typedef MatrixType_ MatrixType;
80
+ typedef SolverBase<PartialPivLU> Base;
81
+ friend class SolverBase<PartialPivLU>;
82
+
83
+ EIGEN_GENERIC_PUBLIC_INTERFACE(PartialPivLU)
84
+ enum {
85
+ MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
86
+ MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
87
+ };
88
+ using PermutationIndex = PermutationIndex_;
89
+ typedef PermutationMatrix<RowsAtCompileTime, MaxRowsAtCompileTime, PermutationIndex> PermutationType;
90
+ typedef Transpositions<RowsAtCompileTime, MaxRowsAtCompileTime, PermutationIndex> TranspositionType;
91
+ typedef typename MatrixType::PlainObject PlainObject;
92
+
93
+ /** \brief Reports whether the LU factorization was successful.
94
+ *
95
+ * \note This function always returns \c Success. It is provided for compatibility
96
+ * with other factorization routines.
97
+ * \returns \c Success
98
+ */
99
+ ComputationInfo info() const {
100
+ eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
101
+ return Success;
102
+ }
136
103
 
137
- /** \returns the LU decomposition matrix: the upper-triangular part is U, the
138
- * unit-lower-triangular part is L (at least for square matrices; in the non-square
139
- * case, special care is needed, see the documentation of class FullPivLU).
140
- *
141
- * \sa matrixL(), matrixU()
142
- */
143
- inline const MatrixType& matrixLU() const
144
- {
145
- eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
146
- return m_lu;
147
- }
104
+ /**
105
+ * \brief Default Constructor.
106
+ *
107
+ * The default constructor is useful in cases in which the user intends to
108
+ * perform decompositions via PartialPivLU::compute(const MatrixType&).
109
+ */
110
+ PartialPivLU();
111
+
112
+ /** \brief Default Constructor with memory preallocation
113
+ *
114
+ * Like the default constructor but with preallocation of the internal data
115
+ * according to the specified problem \a size.
116
+ * \sa PartialPivLU()
117
+ */
118
+ explicit PartialPivLU(Index size);
119
+
120
+ /** Constructor.
121
+ *
122
+ * \param matrix the matrix of which to compute the LU decomposition.
123
+ *
124
+ * \warning The matrix should have full rank (e.g. if it's square, it should be invertible).
125
+ * If you need to deal with non-full rank, use class FullPivLU instead.
126
+ */
127
+ template <typename InputType>
128
+ explicit PartialPivLU(const EigenBase<InputType>& matrix);
129
+
130
+ /** Constructor for \link InplaceDecomposition inplace decomposition \endlink
131
+ *
132
+ * \param matrix the matrix of which to compute the LU decomposition.
133
+ *
134
+ * \warning The matrix should have full rank (e.g. if it's square, it should be invertible).
135
+ * If you need to deal with non-full rank, use class FullPivLU instead.
136
+ */
137
+ template <typename InputType>
138
+ explicit PartialPivLU(EigenBase<InputType>& matrix);
139
+
140
+ template <typename InputType>
141
+ PartialPivLU& compute(const EigenBase<InputType>& matrix) {
142
+ m_lu = matrix.derived();
143
+ compute();
144
+ return *this;
145
+ }
148
146
 
149
- /** \returns the permutation matrix P.
150
- */
151
- inline const PermutationType& permutationP() const
152
- {
153
- eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
154
- return m_p;
155
- }
147
+ /** \returns the LU decomposition matrix: the upper-triangular part is U, the
148
+ * unit-lower-triangular part is L (at least for square matrices; in the non-square
149
+ * case, special care is needed, see the documentation of class FullPivLU).
150
+ *
151
+ * \sa matrixL(), matrixU()
152
+ */
153
+ inline const MatrixType& matrixLU() const {
154
+ eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
155
+ return m_lu;
156
+ }
156
157
 
157
- #ifdef EIGEN_PARSED_BY_DOXYGEN
158
- /** This method returns the solution x to the equation Ax=b, where A is the matrix of which
159
- * *this is the LU decomposition.
160
- *
161
- * \param b the right-hand-side of the equation to solve. Can be a vector or a matrix,
162
- * the only requirement in order for the equation to make sense is that
163
- * b.rows()==A.rows(), where A is the matrix of which *this is the LU decomposition.
164
- *
165
- * \returns the solution.
166
- *
167
- * Example: \include PartialPivLU_solve.cpp
168
- * Output: \verbinclude PartialPivLU_solve.out
169
- *
170
- * Since this PartialPivLU class assumes anyway that the matrix A is invertible, the solution
171
- * theoretically exists and is unique regardless of b.
172
- *
173
- * \sa TriangularView::solve(), inverse(), computeInverse()
174
- */
175
- template<typename Rhs>
176
- inline const Solve<PartialPivLU, Rhs>
177
- solve(const MatrixBase<Rhs>& b) const;
178
- #endif
179
-
180
- /** \returns an estimate of the reciprocal condition number of the matrix of which \c *this is
181
- the LU decomposition.
182
- */
183
- inline RealScalar rcond() const
184
- {
185
- eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
186
- return internal::rcond_estimate_helper(m_l1_norm, *this);
187
- }
158
+ /** \returns the permutation matrix P.
159
+ */
160
+ inline const PermutationType& permutationP() const {
161
+ eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
162
+ return m_p;
163
+ }
188
164
 
189
- /** \returns the inverse of the matrix of which *this is the LU decomposition.
190
- *
191
- * \warning The matrix being decomposed here is assumed to be invertible. If you need to check for
192
- * invertibility, use class FullPivLU instead.
193
- *
194
- * \sa MatrixBase::inverse(), LU::inverse()
195
- */
196
- inline const Inverse<PartialPivLU> inverse() const
197
- {
198
- eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
199
- return Inverse<PartialPivLU>(*this);
200
- }
165
+ #ifdef EIGEN_PARSED_BY_DOXYGEN
166
+ /** This method returns the solution x to the equation Ax=b, where A is the matrix of which
167
+ * *this is the LU decomposition.
168
+ *
169
+ * \param b the right-hand-side of the equation to solve. Can be a vector or a matrix,
170
+ * the only requirement in order for the equation to make sense is that
171
+ * b.rows()==A.rows(), where A is the matrix of which *this is the LU decomposition.
172
+ *
173
+ * \returns the solution.
174
+ *
175
+ * Example: \include PartialPivLU_solve.cpp
176
+ * Output: \verbinclude PartialPivLU_solve.out
177
+ *
178
+ * Since this PartialPivLU class assumes anyway that the matrix A is invertible, the solution
179
+ * theoretically exists and is unique regardless of b.
180
+ *
181
+ * \sa TriangularView::solve(), inverse(), computeInverse()
182
+ */
183
+ template <typename Rhs>
184
+ inline const Solve<PartialPivLU, Rhs> solve(const MatrixBase<Rhs>& b) const;
185
+ #endif
186
+
187
+ /** \returns an estimate of the reciprocal condition number of the matrix of which \c *this is
188
+ the LU decomposition.
189
+ */
190
+ inline RealScalar rcond() const {
191
+ eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
192
+ return internal::rcond_estimate_helper(m_l1_norm, *this);
193
+ }
201
194
 
202
- /** \returns the determinant of the matrix of which
203
- * *this is the LU decomposition. It has only linear complexity
204
- * (that is, O(n) where n is the dimension of the square matrix)
205
- * as the LU decomposition has already been computed.
206
- *
207
- * \note For fixed-size matrices of size up to 4, MatrixBase::determinant() offers
208
- * optimized paths.
209
- *
210
- * \warning a determinant can be very big or small, so for matrices
211
- * of large enough dimension, there is a risk of overflow/underflow.
212
- *
213
- * \sa MatrixBase::determinant()
214
- */
215
- Scalar determinant() const;
216
-
217
- MatrixType reconstructedMatrix() const;
218
-
219
- EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_lu.rows(); }
220
- EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_lu.cols(); }
221
-
222
- #ifndef EIGEN_PARSED_BY_DOXYGEN
223
- template<typename RhsType, typename DstType>
224
- EIGEN_DEVICE_FUNC
225
- void _solve_impl(const RhsType &rhs, DstType &dst) const {
226
- /* The decomposition PA = LU can be rewritten as A = P^{-1} L U.
227
- * So we proceed as follows:
228
- * Step 1: compute c = Pb.
229
- * Step 2: replace c by the solution x to Lx = c.
230
- * Step 3: replace c by the solution x to Ux = c.
231
- */
232
-
233
- // Step 1
234
- dst = permutationP() * rhs;
235
-
236
- // Step 2
237
- m_lu.template triangularView<UnitLower>().solveInPlace(dst);
238
-
239
- // Step 3
240
- m_lu.template triangularView<Upper>().solveInPlace(dst);
241
- }
195
+ /** \returns the inverse of the matrix of which *this is the LU decomposition.
196
+ *
197
+ * \warning The matrix being decomposed here is assumed to be invertible. If you need to check for
198
+ * invertibility, use class FullPivLU instead.
199
+ *
200
+ * \sa MatrixBase::inverse(), LU::inverse()
201
+ */
202
+ inline const Inverse<PartialPivLU> inverse() const {
203
+ eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
204
+ return Inverse<PartialPivLU>(*this);
205
+ }
242
206
 
243
- template<bool Conjugate, typename RhsType, typename DstType>
244
- EIGEN_DEVICE_FUNC
245
- void _solve_impl_transposed(const RhsType &rhs, DstType &dst) const {
246
- /* The decomposition PA = LU can be rewritten as A^T = U^T L^T P.
247
- * So we proceed as follows:
248
- * Step 1: compute c as the solution to L^T c = b
249
- * Step 2: replace c by the solution x to U^T x = c.
250
- * Step 3: update c = P^-1 c.
251
- */
252
-
253
- eigen_assert(rhs.rows() == m_lu.cols());
254
-
255
- // Step 1
256
- dst = m_lu.template triangularView<Upper>().transpose()
257
- .template conjugateIf<Conjugate>().solve(rhs);
258
- // Step 2
259
- m_lu.template triangularView<UnitLower>().transpose()
260
- .template conjugateIf<Conjugate>().solveInPlace(dst);
261
- // Step 3
262
- dst = permutationP().transpose() * dst;
263
- }
264
- #endif
207
+ /** \returns the determinant of the matrix of which
208
+ * *this is the LU decomposition. It has only linear complexity
209
+ * (that is, O(n) where n is the dimension of the square matrix)
210
+ * as the LU decomposition has already been computed.
211
+ *
212
+ * \note For fixed-size matrices of size up to 4, MatrixBase::determinant() offers
213
+ * optimized paths.
214
+ *
215
+ * \warning a determinant can be very big or small, so for matrices
216
+ * of large enough dimension, there is a risk of overflow/underflow.
217
+ *
218
+ * \sa MatrixBase::determinant()
219
+ */
220
+ Scalar determinant() const;
221
+
222
+ MatrixType reconstructedMatrix() const;
223
+
224
+ constexpr Index rows() const noexcept { return m_lu.rows(); }
225
+ constexpr Index cols() const noexcept { return m_lu.cols(); }
226
+
227
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
228
+ template <typename RhsType, typename DstType>
229
+ EIGEN_DEVICE_FUNC void _solve_impl(const RhsType& rhs, DstType& dst) const {
230
+ /* The decomposition PA = LU can be rewritten as A = P^{-1} L U.
231
+ * So we proceed as follows:
232
+ * Step 1: compute c = Pb.
233
+ * Step 2: replace c by the solution x to Lx = c.
234
+ * Step 3: replace c by the solution x to Ux = c.
235
+ */
236
+
237
+ // Step 1
238
+ dst = permutationP() * rhs;
239
+
240
+ // Step 2
241
+ m_lu.template triangularView<UnitLower>().solveInPlace(dst);
242
+
243
+ // Step 3
244
+ m_lu.template triangularView<Upper>().solveInPlace(dst);
245
+ }
265
246
 
266
- protected:
247
+ template <bool Conjugate, typename RhsType, typename DstType>
248
+ EIGEN_DEVICE_FUNC void _solve_impl_transposed(const RhsType& rhs, DstType& dst) const {
249
+ /* The decomposition PA = LU can be rewritten as A^T = U^T L^T P.
250
+ * So we proceed as follows:
251
+ * Step 1: compute c as the solution to L^T c = b
252
+ * Step 2: replace c by the solution x to U^T x = c.
253
+ * Step 3: update c = P^-1 c.
254
+ */
255
+
256
+ eigen_assert(rhs.rows() == m_lu.cols());
257
+
258
+ // Step 1
259
+ dst = m_lu.template triangularView<Upper>().transpose().template conjugateIf<Conjugate>().solve(rhs);
260
+ // Step 2
261
+ m_lu.template triangularView<UnitLower>().transpose().template conjugateIf<Conjugate>().solveInPlace(dst);
262
+ // Step 3
263
+ dst = permutationP().transpose() * dst;
264
+ }
265
+ #endif
267
266
 
268
- static void check_template_parameters()
269
- {
270
- EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar);
271
- }
267
+ protected:
268
+ EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar)
272
269
 
273
- void compute();
270
+ void compute();
274
271
 
275
- MatrixType m_lu;
276
- PermutationType m_p;
277
- TranspositionType m_rowsTranspositions;
278
- RealScalar m_l1_norm;
279
- signed char m_det_p;
280
- bool m_isInitialized;
272
+ MatrixType m_lu;
273
+ PermutationType m_p;
274
+ TranspositionType m_rowsTranspositions;
275
+ RealScalar m_l1_norm;
276
+ signed char m_det_p;
277
+ bool m_isInitialized;
281
278
  };
282
279
 
283
- template<typename MatrixType>
284
- PartialPivLU<MatrixType>::PartialPivLU()
285
- : m_lu(),
286
- m_p(),
287
- m_rowsTranspositions(),
288
- m_l1_norm(0),
289
- m_det_p(0),
290
- m_isInitialized(false)
291
- {
292
- }
293
-
294
- template<typename MatrixType>
295
- PartialPivLU<MatrixType>::PartialPivLU(Index size)
296
- : m_lu(size, size),
297
- m_p(size),
298
- m_rowsTranspositions(size),
299
- m_l1_norm(0),
300
- m_det_p(0),
301
- m_isInitialized(false)
302
- {
303
- }
304
-
305
- template<typename MatrixType>
306
- template<typename InputType>
307
- PartialPivLU<MatrixType>::PartialPivLU(const EigenBase<InputType>& matrix)
308
- : m_lu(matrix.rows(),matrix.cols()),
309
- m_p(matrix.rows()),
310
- m_rowsTranspositions(matrix.rows()),
311
- m_l1_norm(0),
312
- m_det_p(0),
313
- m_isInitialized(false)
314
- {
280
+ template <typename MatrixType, typename PermutationIndex>
281
+ PartialPivLU<MatrixType, PermutationIndex>::PartialPivLU()
282
+ : m_lu(), m_p(), m_rowsTranspositions(), m_l1_norm(0), m_det_p(0), m_isInitialized(false) {}
283
+
284
+ template <typename MatrixType, typename PermutationIndex>
285
+ PartialPivLU<MatrixType, PermutationIndex>::PartialPivLU(Index size)
286
+ : m_lu(size, size), m_p(size), m_rowsTranspositions(size), m_l1_norm(0), m_det_p(0), m_isInitialized(false) {}
287
+
288
+ template <typename MatrixType, typename PermutationIndex>
289
+ template <typename InputType>
290
+ PartialPivLU<MatrixType, PermutationIndex>::PartialPivLU(const EigenBase<InputType>& matrix)
291
+ : m_lu(matrix.rows(), matrix.cols()),
292
+ m_p(matrix.rows()),
293
+ m_rowsTranspositions(matrix.rows()),
294
+ m_l1_norm(0),
295
+ m_det_p(0),
296
+ m_isInitialized(false) {
315
297
  compute(matrix.derived());
316
298
  }
317
299
 
318
- template<typename MatrixType>
319
- template<typename InputType>
320
- PartialPivLU<MatrixType>::PartialPivLU(EigenBase<InputType>& matrix)
321
- : m_lu(matrix.derived()),
322
- m_p(matrix.rows()),
323
- m_rowsTranspositions(matrix.rows()),
324
- m_l1_norm(0),
325
- m_det_p(0),
326
- m_isInitialized(false)
327
- {
300
+ template <typename MatrixType, typename PermutationIndex>
301
+ template <typename InputType>
302
+ PartialPivLU<MatrixType, PermutationIndex>::PartialPivLU(EigenBase<InputType>& matrix)
303
+ : m_lu(matrix.derived()),
304
+ m_p(matrix.rows()),
305
+ m_rowsTranspositions(matrix.rows()),
306
+ m_l1_norm(0),
307
+ m_det_p(0),
308
+ m_isInitialized(false) {
328
309
  compute();
329
310
  }
330
311
 
331
312
  namespace internal {
332
313
 
333
314
  /** \internal This is the blocked version of fullpivlu_unblocked() */
334
- template<typename Scalar, int StorageOrder, typename PivIndex, int SizeAtCompileTime=Dynamic>
335
- struct partial_lu_impl
336
- {
337
- static const int UnBlockedBound = 16;
338
- static const bool UnBlockedAtCompileTime = SizeAtCompileTime!=Dynamic && SizeAtCompileTime<=UnBlockedBound;
339
- static const int ActualSizeAtCompileTime = UnBlockedAtCompileTime ? SizeAtCompileTime : Dynamic;
315
+ template <typename Scalar, int StorageOrder, typename PivIndex, int SizeAtCompileTime = Dynamic>
316
+ struct partial_lu_impl {
317
+ static constexpr int UnBlockedBound = 16;
318
+ static constexpr bool UnBlockedAtCompileTime = SizeAtCompileTime != Dynamic && SizeAtCompileTime <= UnBlockedBound;
319
+ static constexpr int ActualSizeAtCompileTime = UnBlockedAtCompileTime ? SizeAtCompileTime : Dynamic;
340
320
  // Remaining rows and columns at compile-time:
341
- static const int RRows = SizeAtCompileTime==2 ? 1 : Dynamic;
342
- static const int RCols = SizeAtCompileTime==2 ? 1 : Dynamic;
321
+ static constexpr int RRows = SizeAtCompileTime == 2 ? 1 : Dynamic;
322
+ static constexpr int RCols = SizeAtCompileTime == 2 ? 1 : Dynamic;
343
323
  typedef Matrix<Scalar, ActualSizeAtCompileTime, ActualSizeAtCompileTime, StorageOrder> MatrixType;
344
324
  typedef Ref<MatrixType> MatrixTypeRef;
345
325
  typedef Ref<Matrix<Scalar, Dynamic, Dynamic, StorageOrder> > BlockType;
346
326
  typedef typename MatrixType::RealScalar RealScalar;
347
327
 
348
328
  /** \internal performs the LU decomposition in-place of the matrix \a lu
349
- * using an unblocked algorithm.
350
- *
351
- * In addition, this function returns the row transpositions in the
352
- * vector \a row_transpositions which must have a size equal to the number
353
- * of columns of the matrix \a lu, and an integer \a nb_transpositions
354
- * which returns the actual number of transpositions.
355
- *
356
- * \returns The index of the first pivot which is exactly zero if any, or a negative number otherwise.
357
- */
358
- static Index unblocked_lu(MatrixTypeRef& lu, PivIndex* row_transpositions, PivIndex& nb_transpositions)
359
- {
329
+ * using an unblocked algorithm.
330
+ *
331
+ * In addition, this function returns the row transpositions in the
332
+ * vector \a row_transpositions which must have a size equal to the number
333
+ * of columns of the matrix \a lu, and an integer \a nb_transpositions
334
+ * which returns the actual number of transpositions.
335
+ *
336
+ * \returns The index of the first pivot which is exactly zero if any, or a negative number otherwise.
337
+ */
338
+ static Index unblocked_lu(MatrixTypeRef& lu, PivIndex* row_transpositions, PivIndex& nb_transpositions) {
360
339
  typedef scalar_score_coeff_op<Scalar> Scoring;
361
340
  typedef typename Scoring::result_type Score;
362
341
  const Index rows = lu.rows();
363
342
  const Index cols = lu.cols();
364
- const Index size = (std::min)(rows,cols);
343
+ const Index size = (std::min)(rows, cols);
365
344
  // For small compile-time matrices it is worth processing the last row separately:
366
345
  // speedup: +100% for 2x2, +10% for others.
367
- const Index endk = UnBlockedAtCompileTime ? size-1 : size;
346
+ const Index endk = UnBlockedAtCompileTime ? size - 1 : size;
368
347
  nb_transpositions = 0;
369
348
  Index first_zero_pivot = -1;
370
- for(Index k = 0; k < endk; ++k)
371
- {
372
- int rrows = internal::convert_index<int>(rows-k-1);
373
- int rcols = internal::convert_index<int>(cols-k-1);
349
+ for (Index k = 0; k < endk; ++k) {
350
+ int rrows = internal::convert_index<int>(rows - k - 1);
351
+ int rcols = internal::convert_index<int>(cols - k - 1);
374
352
 
375
353
  Index row_of_biggest_in_col;
376
- Score biggest_in_corner
377
- = lu.col(k).tail(rows-k).unaryExpr(Scoring()).maxCoeff(&row_of_biggest_in_col);
354
+ Score biggest_in_corner = lu.col(k).tail(rows - k).unaryExpr(Scoring()).maxCoeff(&row_of_biggest_in_col);
378
355
  row_of_biggest_in_col += k;
379
356
 
380
357
  row_transpositions[k] = PivIndex(row_of_biggest_in_col);
381
358
 
382
- if(biggest_in_corner != Score(0))
383
- {
384
- if(k != row_of_biggest_in_col)
385
- {
359
+ if (!numext::is_exactly_zero(biggest_in_corner)) {
360
+ if (k != row_of_biggest_in_col) {
386
361
  lu.row(k).swap(lu.row(row_of_biggest_in_col));
387
362
  ++nb_transpositions;
388
363
  }
389
364
 
390
- lu.col(k).tail(fix<RRows>(rrows)) /= lu.coeff(k,k);
391
- }
392
- else if(first_zero_pivot==-1)
393
- {
365
+ lu.col(k).tail(fix<RRows>(rrows)) /= lu.coeff(k, k);
366
+ } else if (first_zero_pivot == -1) {
394
367
  // the pivot is exactly zero, we record the index of the first pivot which is exactly 0,
395
368
  // and continue the factorization such we still have A = PLU
396
369
  first_zero_pivot = k;
397
370
  }
398
371
 
399
- if(k<rows-1)
400
- lu.bottomRightCorner(fix<RRows>(rrows),fix<RCols>(rcols)).noalias() -= lu.col(k).tail(fix<RRows>(rrows)) * lu.row(k).tail(fix<RCols>(rcols));
372
+ if (k < rows - 1)
373
+ lu.bottomRightCorner(fix<RRows>(rrows), fix<RCols>(rcols)).noalias() -=
374
+ lu.col(k).tail(fix<RRows>(rrows)) * lu.row(k).tail(fix<RCols>(rcols));
401
375
  }
402
376
 
403
377
  // special handling of the last entry
404
- if(UnBlockedAtCompileTime)
405
- {
378
+ if (UnBlockedAtCompileTime) {
406
379
  Index k = endk;
407
380
  row_transpositions[k] = PivIndex(k);
408
- if (Scoring()(lu(k, k)) == Score(0) && first_zero_pivot == -1)
409
- first_zero_pivot = k;
381
+ if (numext::is_exactly_zero(Scoring()(lu(k, k))) && first_zero_pivot == -1) first_zero_pivot = k;
410
382
  }
411
383
 
412
384
  return first_zero_pivot;
413
385
  }
414
386
 
415
387
  /** \internal performs the LU decomposition in-place of the matrix represented
416
- * by the variables \a rows, \a cols, \a lu_data, and \a lu_stride using a
417
- * recursive, blocked algorithm.
418
- *
419
- * In addition, this function returns the row transpositions in the
420
- * vector \a row_transpositions which must have a size equal to the number
421
- * of columns of the matrix \a lu, and an integer \a nb_transpositions
422
- * which returns the actual number of transpositions.
423
- *
424
- * \returns The index of the first pivot which is exactly zero if any, or a negative number otherwise.
425
- *
426
- * \note This very low level interface using pointers, etc. is to:
427
- * 1 - reduce the number of instantiations to the strict minimum
428
- * 2 - avoid infinite recursion of the instantiations with Block<Block<Block<...> > >
429
- */
430
- static Index blocked_lu(Index rows, Index cols, Scalar* lu_data, Index luStride, PivIndex* row_transpositions, PivIndex& nb_transpositions, Index maxBlockSize=256)
431
- {
432
- MatrixTypeRef lu = MatrixType::Map(lu_data,rows, cols, OuterStride<>(luStride));
433
-
434
- const Index size = (std::min)(rows,cols);
388
+ * by the variables \a rows, \a cols, \a lu_data, and \a lu_stride using a
389
+ * recursive, blocked algorithm.
390
+ *
391
+ * In addition, this function returns the row transpositions in the
392
+ * vector \a row_transpositions which must have a size equal to the number
393
+ * of columns of the matrix \a lu, and an integer \a nb_transpositions
394
+ * which returns the actual number of transpositions.
395
+ *
396
+ * \returns The index of the first pivot which is exactly zero if any, or a negative number otherwise.
397
+ *
398
+ * \note This very low level interface using pointers, etc. is to:
399
+ * 1 - reduce the number of instantiations to the strict minimum
400
+ * 2 - avoid infinite recursion of the instantiations with Block<Block<Block<...> > >
401
+ */
402
+ static Index blocked_lu(Index rows, Index cols, Scalar* lu_data, Index luStride, PivIndex* row_transpositions,
403
+ PivIndex& nb_transpositions, Index maxBlockSize = 256) {
404
+ MatrixTypeRef lu = MatrixType::Map(lu_data, rows, cols, OuterStride<>(luStride));
405
+
406
+ const Index size = (std::min)(rows, cols);
435
407
 
436
408
  // if the matrix is too small, no blocking:
437
- if(UnBlockedAtCompileTime || size<=UnBlockedBound)
438
- {
409
+ if (UnBlockedAtCompileTime || size <= UnBlockedBound) {
439
410
  return unblocked_lu(lu, row_transpositions, nb_transpositions);
440
411
  }
441
412
 
@@ -443,51 +414,46 @@ struct partial_lu_impl
443
414
  // of the matrix so that there is enough sub blocks:
444
415
  Index blockSize;
445
416
  {
446
- blockSize = size/8;
447
- blockSize = (blockSize/16)*16;
448
- blockSize = (std::min)((std::max)(blockSize,Index(8)), maxBlockSize);
417
+ blockSize = size / 8;
418
+ blockSize = (blockSize / 16) * 16;
419
+ blockSize = (std::min)((std::max)(blockSize, Index(8)), maxBlockSize);
449
420
  }
450
421
 
451
422
  nb_transpositions = 0;
452
423
  Index first_zero_pivot = -1;
453
- for(Index k = 0; k < size; k+=blockSize)
454
- {
455
- Index bs = (std::min)(size-k,blockSize); // actual size of the block
456
- Index trows = rows - k - bs; // trailing rows
457
- Index tsize = size - k - bs; // trailing size
424
+ for (Index k = 0; k < size; k += blockSize) {
425
+ Index bs = (std::min)(size - k, blockSize); // actual size of the block
426
+ Index trows = rows - k - bs; // trailing rows
427
+ Index tsize = size - k - bs; // trailing size
458
428
 
459
429
  // partition the matrix:
460
430
  // A00 | A01 | A02
461
431
  // lu = A_0 | A_1 | A_2 = A10 | A11 | A12
462
432
  // A20 | A21 | A22
463
- BlockType A_0 = lu.block(0,0,rows,k);
464
- BlockType A_2 = lu.block(0,k+bs,rows,tsize);
465
- BlockType A11 = lu.block(k,k,bs,bs);
466
- BlockType A12 = lu.block(k,k+bs,bs,tsize);
467
- BlockType A21 = lu.block(k+bs,k,trows,bs);
468
- BlockType A22 = lu.block(k+bs,k+bs,trows,tsize);
433
+ BlockType A_0 = lu.block(0, 0, rows, k);
434
+ BlockType A_2 = lu.block(0, k + bs, rows, tsize);
435
+ BlockType A11 = lu.block(k, k, bs, bs);
436
+ BlockType A12 = lu.block(k, k + bs, bs, tsize);
437
+ BlockType A21 = lu.block(k + bs, k, trows, bs);
438
+ BlockType A22 = lu.block(k + bs, k + bs, trows, tsize);
469
439
 
470
440
  PivIndex nb_transpositions_in_panel;
471
441
  // recursively call the blocked LU algorithm on [A11^T A21^T]^T
472
442
  // with a very small blocking size:
473
- Index ret = blocked_lu(trows+bs, bs, &lu.coeffRef(k,k), luStride,
474
- row_transpositions+k, nb_transpositions_in_panel, 16);
475
- if(ret>=0 && first_zero_pivot==-1)
476
- first_zero_pivot = k+ret;
443
+ Index ret = blocked_lu(trows + bs, bs, &lu.coeffRef(k, k), luStride, row_transpositions + k,
444
+ nb_transpositions_in_panel, 16);
445
+ if (ret >= 0 && first_zero_pivot == -1) first_zero_pivot = k + ret;
477
446
 
478
447
  nb_transpositions += nb_transpositions_in_panel;
479
448
  // update permutations and apply them to A_0
480
- for(Index i=k; i<k+bs; ++i)
481
- {
449
+ for (Index i = k; i < k + bs; ++i) {
482
450
  Index piv = (row_transpositions[i] += internal::convert_index<PivIndex>(k));
483
451
  A_0.row(i).swap(A_0.row(piv));
484
452
  }
485
453
 
486
- if(trows)
487
- {
454
+ if (trows) {
488
455
  // apply permutations to A_2
489
- for(Index i=k;i<k+bs; ++i)
490
- A_2.row(i).swap(A_2.row(row_transpositions[i]));
456
+ for (Index i = k; i < k + bs; ++i) A_2.row(i).swap(A_2.row(row_transpositions[i]));
491
457
 
492
458
  // A12 = A11^-1 A12
493
459
  A11.template triangularView<UnitLower>().solveInPlace(A12);
@@ -500,36 +466,33 @@ struct partial_lu_impl
500
466
  };
501
467
 
502
468
  /** \internal performs the LU decomposition with partial pivoting in-place.
503
- */
504
- template<typename MatrixType, typename TranspositionType>
505
- void partial_lu_inplace(MatrixType& lu, TranspositionType& row_transpositions, typename TranspositionType::StorageIndex& nb_transpositions)
506
- {
469
+ */
470
+ template <typename MatrixType, typename TranspositionType>
471
+ void partial_lu_inplace(MatrixType& lu, TranspositionType& row_transpositions,
472
+ typename TranspositionType::StorageIndex& nb_transpositions) {
507
473
  // Special-case of zero matrix.
508
474
  if (lu.rows() == 0 || lu.cols() == 0) {
509
475
  nb_transpositions = 0;
510
476
  return;
511
477
  }
512
478
  eigen_assert(lu.cols() == row_transpositions.size());
513
- eigen_assert(row_transpositions.size() < 2 || (&row_transpositions.coeffRef(1)-&row_transpositions.coeffRef(0)) == 1);
514
-
515
- partial_lu_impl
516
- < typename MatrixType::Scalar, MatrixType::Flags&RowMajorBit?RowMajor:ColMajor,
517
- typename TranspositionType::StorageIndex,
518
- EIGEN_SIZE_MIN_PREFER_FIXED(MatrixType::RowsAtCompileTime,MatrixType::ColsAtCompileTime)>
519
- ::blocked_lu(lu.rows(), lu.cols(), &lu.coeffRef(0,0), lu.outerStride(), &row_transpositions.coeffRef(0), nb_transpositions);
479
+ eigen_assert(row_transpositions.size() < 2 ||
480
+ (&row_transpositions.coeffRef(1) - &row_transpositions.coeffRef(0)) == 1);
481
+
482
+ partial_lu_impl<typename MatrixType::Scalar, MatrixType::Flags & RowMajorBit ? RowMajor : ColMajor,
483
+ typename TranspositionType::StorageIndex,
484
+ internal::min_size_prefer_fixed(MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime)>::
485
+ blocked_lu(lu.rows(), lu.cols(), &lu.coeffRef(0, 0), lu.outerStride(), &row_transpositions.coeffRef(0),
486
+ nb_transpositions);
520
487
  }
521
488
 
522
- } // end namespace internal
523
-
524
- template<typename MatrixType>
525
- void PartialPivLU<MatrixType>::compute()
526
- {
527
- check_template_parameters();
489
+ } // end namespace internal
528
490
 
529
- // the row permutation is stored as int indices, so just to be sure:
530
- eigen_assert(m_lu.rows()<NumTraits<int>::highest());
491
+ template <typename MatrixType, typename PermutationIndex>
492
+ void PartialPivLU<MatrixType, PermutationIndex>::compute() {
493
+ eigen_assert(m_lu.rows() < NumTraits<PermutationIndex>::highest());
531
494
 
532
- if(m_lu.cols()>0)
495
+ if (m_lu.cols() > 0)
533
496
  m_l1_norm = m_lu.cwiseAbs().colwise().sum().maxCoeff();
534
497
  else
535
498
  m_l1_norm = RealScalar(0);
@@ -541,16 +504,16 @@ void PartialPivLU<MatrixType>::compute()
541
504
 
542
505
  typename TranspositionType::StorageIndex nb_transpositions;
543
506
  internal::partial_lu_inplace(m_lu, m_rowsTranspositions, nb_transpositions);
544
- m_det_p = (nb_transpositions%2) ? -1 : 1;
507
+ m_det_p = (nb_transpositions % 2) ? -1 : 1;
545
508
 
546
509
  m_p = m_rowsTranspositions;
547
510
 
548
511
  m_isInitialized = true;
549
512
  }
550
513
 
551
- template<typename MatrixType>
552
- typename PartialPivLU<MatrixType>::Scalar PartialPivLU<MatrixType>::determinant() const
553
- {
514
+ template <typename MatrixType, typename PermutationIndex>
515
+ typename PartialPivLU<MatrixType, PermutationIndex>::Scalar PartialPivLU<MatrixType, PermutationIndex>::determinant()
516
+ const {
554
517
  eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
555
518
  return Scalar(m_det_p) * m_lu.diagonal().prod();
556
519
  }
@@ -558,13 +521,11 @@ typename PartialPivLU<MatrixType>::Scalar PartialPivLU<MatrixType>::determinant(
558
521
  /** \returns the matrix represented by the decomposition,
559
522
  * i.e., it returns the product: P^{-1} L U.
560
523
  * This function is provided for debug purpose. */
561
- template<typename MatrixType>
562
- MatrixType PartialPivLU<MatrixType>::reconstructedMatrix() const
563
- {
524
+ template <typename MatrixType, typename PermutationIndex>
525
+ MatrixType PartialPivLU<MatrixType, PermutationIndex>::reconstructedMatrix() const {
564
526
  eigen_assert(m_isInitialized && "LU is not initialized.");
565
527
  // LU
566
- MatrixType res = m_lu.template triangularView<UnitLower>().toDenseMatrix()
567
- * m_lu.template triangularView<Upper>();
528
+ MatrixType res = m_lu.template triangularView<UnitLower>().toDenseMatrix() * m_lu.template triangularView<Upper>();
568
529
 
569
530
  // P^{-1}(LU)
570
531
  res = m_p.inverse() * res;
@@ -577,48 +538,49 @@ MatrixType PartialPivLU<MatrixType>::reconstructedMatrix() const
577
538
  namespace internal {
578
539
 
579
540
  /***** Implementation of inverse() *****************************************************/
580
- template<typename DstXprType, typename MatrixType>
581
- struct Assignment<DstXprType, Inverse<PartialPivLU<MatrixType> >, internal::assign_op<typename DstXprType::Scalar,typename PartialPivLU<MatrixType>::Scalar>, Dense2Dense>
582
- {
583
- typedef PartialPivLU<MatrixType> LuType;
541
+ template <typename DstXprType, typename MatrixType, typename PermutationIndex>
542
+ struct Assignment<
543
+ DstXprType, Inverse<PartialPivLU<MatrixType, PermutationIndex> >,
544
+ internal::assign_op<typename DstXprType::Scalar, typename PartialPivLU<MatrixType, PermutationIndex>::Scalar>,
545
+ Dense2Dense> {
546
+ typedef PartialPivLU<MatrixType, PermutationIndex> LuType;
584
547
  typedef Inverse<LuType> SrcXprType;
585
- static void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op<typename DstXprType::Scalar,typename LuType::Scalar> &)
586
- {
548
+ static void run(DstXprType& dst, const SrcXprType& src,
549
+ const internal::assign_op<typename DstXprType::Scalar, typename LuType::Scalar>&) {
587
550
  dst = src.nestedExpression().solve(MatrixType::Identity(src.rows(), src.cols()));
588
551
  }
589
552
  };
590
- } // end namespace internal
553
+ } // end namespace internal
591
554
 
592
555
  /******** MatrixBase methods *******/
593
556
 
594
557
  /** \lu_module
595
- *
596
- * \return the partial-pivoting LU decomposition of \c *this.
597
- *
598
- * \sa class PartialPivLU
599
- */
600
- template<typename Derived>
601
- inline const PartialPivLU<typename MatrixBase<Derived>::PlainObject>
602
- MatrixBase<Derived>::partialPivLu() const
603
- {
604
- return PartialPivLU<PlainObject>(eval());
558
+ *
559
+ * \return the partial-pivoting LU decomposition of \c *this.
560
+ *
561
+ * \sa class PartialPivLU
562
+ */
563
+ template <typename Derived>
564
+ template <typename PermutationIndex>
565
+ inline const PartialPivLU<typename MatrixBase<Derived>::PlainObject, PermutationIndex>
566
+ MatrixBase<Derived>::partialPivLu() const {
567
+ return PartialPivLU<PlainObject, PermutationIndex>(eval());
605
568
  }
606
569
 
607
570
  /** \lu_module
608
- *
609
- * Synonym of partialPivLu().
610
- *
611
- * \return the partial-pivoting LU decomposition of \c *this.
612
- *
613
- * \sa class PartialPivLU
614
- */
615
- template<typename Derived>
616
- inline const PartialPivLU<typename MatrixBase<Derived>::PlainObject>
617
- MatrixBase<Derived>::lu() const
618
- {
619
- return PartialPivLU<PlainObject>(eval());
571
+ *
572
+ * Synonym of partialPivLu().
573
+ *
574
+ * \return the partial-pivoting LU decomposition of \c *this.
575
+ *
576
+ * \sa class PartialPivLU
577
+ */
578
+ template <typename Derived>
579
+ template <typename PermutationIndex>
580
+ inline const PartialPivLU<typename MatrixBase<Derived>::PlainObject, PermutationIndex> MatrixBase<Derived>::lu() const {
581
+ return PartialPivLU<PlainObject, PermutationIndex>(eval());
620
582
  }
621
583
 
622
- } // end namespace Eigen
584
+ } // end namespace Eigen
623
585
 
624
- #endif // EIGEN_PARTIALLU_H
586
+ #endif // EIGEN_PARTIALLU_H