@smake/eigen 1.0.2 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (435) hide show
  1. package/README.md +1 -1
  2. package/eigen/Eigen/AccelerateSupport +52 -0
  3. package/eigen/Eigen/Cholesky +18 -21
  4. package/eigen/Eigen/CholmodSupport +28 -28
  5. package/eigen/Eigen/Core +235 -326
  6. package/eigen/Eigen/Eigenvalues +16 -14
  7. package/eigen/Eigen/Geometry +21 -24
  8. package/eigen/Eigen/Householder +9 -8
  9. package/eigen/Eigen/IterativeLinearSolvers +8 -4
  10. package/eigen/Eigen/Jacobi +14 -14
  11. package/eigen/Eigen/KLUSupport +43 -0
  12. package/eigen/Eigen/LU +16 -20
  13. package/eigen/Eigen/MetisSupport +12 -12
  14. package/eigen/Eigen/OrderingMethods +54 -54
  15. package/eigen/Eigen/PaStiXSupport +23 -20
  16. package/eigen/Eigen/PardisoSupport +17 -14
  17. package/eigen/Eigen/QR +18 -21
  18. package/eigen/Eigen/QtAlignedMalloc +5 -13
  19. package/eigen/Eigen/SPQRSupport +21 -14
  20. package/eigen/Eigen/SVD +23 -18
  21. package/eigen/Eigen/Sparse +1 -4
  22. package/eigen/Eigen/SparseCholesky +18 -23
  23. package/eigen/Eigen/SparseCore +18 -17
  24. package/eigen/Eigen/SparseLU +12 -8
  25. package/eigen/Eigen/SparseQR +16 -14
  26. package/eigen/Eigen/StdDeque +5 -2
  27. package/eigen/Eigen/StdList +5 -2
  28. package/eigen/Eigen/StdVector +5 -2
  29. package/eigen/Eigen/SuperLUSupport +30 -24
  30. package/eigen/Eigen/ThreadPool +80 -0
  31. package/eigen/Eigen/UmfPackSupport +19 -17
  32. package/eigen/Eigen/Version +14 -0
  33. package/eigen/Eigen/src/AccelerateSupport/AccelerateSupport.h +423 -0
  34. package/eigen/Eigen/src/AccelerateSupport/InternalHeaderCheck.h +3 -0
  35. package/eigen/Eigen/src/Cholesky/InternalHeaderCheck.h +3 -0
  36. package/eigen/Eigen/src/Cholesky/LDLT.h +377 -401
  37. package/eigen/Eigen/src/Cholesky/LLT.h +332 -360
  38. package/eigen/Eigen/src/Cholesky/LLT_LAPACKE.h +81 -56
  39. package/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +620 -521
  40. package/eigen/Eigen/src/CholmodSupport/InternalHeaderCheck.h +3 -0
  41. package/eigen/Eigen/src/Core/ArithmeticSequence.h +239 -0
  42. package/eigen/Eigen/src/Core/Array.h +341 -294
  43. package/eigen/Eigen/src/Core/ArrayBase.h +190 -203
  44. package/eigen/Eigen/src/Core/ArrayWrapper.h +127 -171
  45. package/eigen/Eigen/src/Core/Assign.h +30 -40
  46. package/eigen/Eigen/src/Core/AssignEvaluator.h +711 -589
  47. package/eigen/Eigen/src/Core/Assign_MKL.h +130 -125
  48. package/eigen/Eigen/src/Core/BandMatrix.h +268 -283
  49. package/eigen/Eigen/src/Core/Block.h +375 -398
  50. package/eigen/Eigen/src/Core/CommaInitializer.h +86 -97
  51. package/eigen/Eigen/src/Core/ConditionEstimator.h +51 -53
  52. package/eigen/Eigen/src/Core/CoreEvaluators.h +1356 -1026
  53. package/eigen/Eigen/src/Core/CoreIterators.h +73 -59
  54. package/eigen/Eigen/src/Core/CwiseBinaryOp.h +114 -132
  55. package/eigen/Eigen/src/Core/CwiseNullaryOp.h +726 -617
  56. package/eigen/Eigen/src/Core/CwiseTernaryOp.h +77 -103
  57. package/eigen/Eigen/src/Core/CwiseUnaryOp.h +56 -68
  58. package/eigen/Eigen/src/Core/CwiseUnaryView.h +132 -95
  59. package/eigen/Eigen/src/Core/DenseBase.h +632 -571
  60. package/eigen/Eigen/src/Core/DenseCoeffsBase.h +511 -624
  61. package/eigen/Eigen/src/Core/DenseStorage.h +512 -509
  62. package/eigen/Eigen/src/Core/DeviceWrapper.h +153 -0
  63. package/eigen/Eigen/src/Core/Diagonal.h +169 -210
  64. package/eigen/Eigen/src/Core/DiagonalMatrix.h +351 -274
  65. package/eigen/Eigen/src/Core/DiagonalProduct.h +12 -10
  66. package/eigen/Eigen/src/Core/Dot.h +172 -222
  67. package/eigen/Eigen/src/Core/EigenBase.h +75 -85
  68. package/eigen/Eigen/src/Core/Fill.h +138 -0
  69. package/eigen/Eigen/src/Core/FindCoeff.h +464 -0
  70. package/eigen/Eigen/src/Core/ForceAlignedAccess.h +90 -109
  71. package/eigen/Eigen/src/Core/Fuzzy.h +82 -105
  72. package/eigen/Eigen/src/Core/GeneralProduct.h +327 -263
  73. package/eigen/Eigen/src/Core/GenericPacketMath.h +1472 -360
  74. package/eigen/Eigen/src/Core/GlobalFunctions.h +194 -151
  75. package/eigen/Eigen/src/Core/IO.h +147 -139
  76. package/eigen/Eigen/src/Core/IndexedView.h +321 -0
  77. package/eigen/Eigen/src/Core/InnerProduct.h +260 -0
  78. package/eigen/Eigen/src/Core/InternalHeaderCheck.h +3 -0
  79. package/eigen/Eigen/src/Core/Inverse.h +56 -66
  80. package/eigen/Eigen/src/Core/Map.h +124 -142
  81. package/eigen/Eigen/src/Core/MapBase.h +256 -281
  82. package/eigen/Eigen/src/Core/MathFunctions.h +1620 -938
  83. package/eigen/Eigen/src/Core/MathFunctionsImpl.h +233 -71
  84. package/eigen/Eigen/src/Core/Matrix.h +491 -416
  85. package/eigen/Eigen/src/Core/MatrixBase.h +468 -453
  86. package/eigen/Eigen/src/Core/NestByValue.h +66 -85
  87. package/eigen/Eigen/src/Core/NoAlias.h +79 -85
  88. package/eigen/Eigen/src/Core/NumTraits.h +235 -148
  89. package/eigen/Eigen/src/Core/PartialReduxEvaluator.h +253 -0
  90. package/eigen/Eigen/src/Core/PermutationMatrix.h +461 -511
  91. package/eigen/Eigen/src/Core/PlainObjectBase.h +871 -894
  92. package/eigen/Eigen/src/Core/Product.h +260 -139
  93. package/eigen/Eigen/src/Core/ProductEvaluators.h +863 -714
  94. package/eigen/Eigen/src/Core/Random.h +161 -136
  95. package/eigen/Eigen/src/Core/RandomImpl.h +262 -0
  96. package/eigen/Eigen/src/Core/RealView.h +250 -0
  97. package/eigen/Eigen/src/Core/Redux.h +366 -336
  98. package/eigen/Eigen/src/Core/Ref.h +308 -209
  99. package/eigen/Eigen/src/Core/Replicate.h +94 -106
  100. package/eigen/Eigen/src/Core/Reshaped.h +398 -0
  101. package/eigen/Eigen/src/Core/ReturnByValue.h +49 -55
  102. package/eigen/Eigen/src/Core/Reverse.h +136 -145
  103. package/eigen/Eigen/src/Core/Select.h +70 -140
  104. package/eigen/Eigen/src/Core/SelfAdjointView.h +262 -285
  105. package/eigen/Eigen/src/Core/SelfCwiseBinaryOp.h +23 -20
  106. package/eigen/Eigen/src/Core/SkewSymmetricMatrix3.h +382 -0
  107. package/eigen/Eigen/src/Core/Solve.h +97 -111
  108. package/eigen/Eigen/src/Core/SolveTriangular.h +131 -129
  109. package/eigen/Eigen/src/Core/SolverBase.h +138 -101
  110. package/eigen/Eigen/src/Core/StableNorm.h +156 -160
  111. package/eigen/Eigen/src/Core/StlIterators.h +619 -0
  112. package/eigen/Eigen/src/Core/Stride.h +91 -88
  113. package/eigen/Eigen/src/Core/Swap.h +70 -38
  114. package/eigen/Eigen/src/Core/Transpose.h +295 -273
  115. package/eigen/Eigen/src/Core/Transpositions.h +272 -317
  116. package/eigen/Eigen/src/Core/TriangularMatrix.h +670 -755
  117. package/eigen/Eigen/src/Core/VectorBlock.h +59 -72
  118. package/eigen/Eigen/src/Core/VectorwiseOp.h +668 -630
  119. package/eigen/Eigen/src/Core/Visitor.h +480 -216
  120. package/eigen/Eigen/src/Core/arch/AVX/Complex.h +407 -293
  121. package/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +79 -388
  122. package/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +2935 -491
  123. package/eigen/Eigen/src/Core/arch/AVX/Reductions.h +353 -0
  124. package/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +279 -22
  125. package/eigen/Eigen/src/Core/arch/AVX512/Complex.h +472 -0
  126. package/eigen/Eigen/src/Core/arch/AVX512/GemmKernel.h +1245 -0
  127. package/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +85 -333
  128. package/eigen/Eigen/src/Core/arch/AVX512/MathFunctionsFP16.h +75 -0
  129. package/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +2490 -649
  130. package/eigen/Eigen/src/Core/arch/AVX512/PacketMathFP16.h +1413 -0
  131. package/eigen/Eigen/src/Core/arch/AVX512/Reductions.h +297 -0
  132. package/eigen/Eigen/src/Core/arch/AVX512/TrsmKernel.h +1167 -0
  133. package/eigen/Eigen/src/Core/arch/AVX512/TrsmUnrolls.inc +1219 -0
  134. package/eigen/Eigen/src/Core/arch/AVX512/TypeCasting.h +277 -0
  135. package/eigen/Eigen/src/Core/arch/AVX512/TypeCastingFP16.h +130 -0
  136. package/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +521 -298
  137. package/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +39 -280
  138. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +3686 -0
  139. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +205 -0
  140. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +901 -0
  141. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMAbfloat16.h +742 -0
  142. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixVectorProduct.inc +2818 -0
  143. package/eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h +3391 -723
  144. package/eigen/Eigen/src/Core/arch/AltiVec/TypeCasting.h +153 -0
  145. package/eigen/Eigen/src/Core/arch/Default/BFloat16.h +866 -0
  146. package/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +113 -14
  147. package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +2634 -0
  148. package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +227 -0
  149. package/eigen/Eigen/src/Core/arch/Default/Half.h +1091 -0
  150. package/eigen/Eigen/src/Core/arch/Default/Settings.h +11 -13
  151. package/eigen/Eigen/src/Core/arch/GPU/Complex.h +244 -0
  152. package/eigen/Eigen/src/Core/arch/GPU/MathFunctions.h +104 -0
  153. package/eigen/Eigen/src/Core/arch/GPU/PacketMath.h +1712 -0
  154. package/eigen/Eigen/src/Core/arch/GPU/Tuple.h +268 -0
  155. package/eigen/Eigen/src/Core/arch/GPU/TypeCasting.h +77 -0
  156. package/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h +23 -0
  157. package/eigen/Eigen/src/Core/arch/HVX/PacketMath.h +1088 -0
  158. package/eigen/Eigen/src/Core/arch/LSX/Complex.h +520 -0
  159. package/eigen/Eigen/src/Core/arch/LSX/GeneralBlockPanelKernel.h +23 -0
  160. package/eigen/Eigen/src/Core/arch/LSX/MathFunctions.h +43 -0
  161. package/eigen/Eigen/src/Core/arch/LSX/PacketMath.h +2866 -0
  162. package/eigen/Eigen/src/Core/arch/LSX/TypeCasting.h +526 -0
  163. package/eigen/Eigen/src/Core/arch/MSA/Complex.h +620 -0
  164. package/eigen/Eigen/src/Core/arch/MSA/MathFunctions.h +379 -0
  165. package/eigen/Eigen/src/Core/arch/MSA/PacketMath.h +1237 -0
  166. package/eigen/Eigen/src/Core/arch/NEON/Complex.h +531 -289
  167. package/eigen/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +243 -0
  168. package/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +50 -73
  169. package/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +5915 -579
  170. package/eigen/Eigen/src/Core/arch/NEON/TypeCasting.h +1642 -0
  171. package/eigen/Eigen/src/Core/arch/NEON/UnaryFunctors.h +57 -0
  172. package/eigen/Eigen/src/Core/arch/SSE/Complex.h +366 -334
  173. package/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +40 -514
  174. package/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +2164 -675
  175. package/eigen/Eigen/src/Core/arch/SSE/Reductions.h +324 -0
  176. package/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +188 -35
  177. package/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h +48 -0
  178. package/eigen/Eigen/src/Core/arch/SVE/PacketMath.h +674 -0
  179. package/eigen/Eigen/src/Core/arch/SVE/TypeCasting.h +52 -0
  180. package/eigen/Eigen/src/Core/arch/SYCL/InteropHeaders.h +227 -0
  181. package/eigen/Eigen/src/Core/arch/SYCL/MathFunctions.h +303 -0
  182. package/eigen/Eigen/src/Core/arch/SYCL/PacketMath.h +576 -0
  183. package/eigen/Eigen/src/Core/arch/SYCL/TypeCasting.h +83 -0
  184. package/eigen/Eigen/src/Core/arch/ZVector/Complex.h +434 -261
  185. package/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +160 -53
  186. package/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +1073 -605
  187. package/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +123 -117
  188. package/eigen/Eigen/src/Core/functors/BinaryFunctors.h +594 -322
  189. package/eigen/Eigen/src/Core/functors/NullaryFunctors.h +204 -118
  190. package/eigen/Eigen/src/Core/functors/StlFunctors.h +110 -97
  191. package/eigen/Eigen/src/Core/functors/TernaryFunctors.h +34 -7
  192. package/eigen/Eigen/src/Core/functors/UnaryFunctors.h +1158 -530
  193. package/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +2329 -1333
  194. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +328 -364
  195. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +191 -178
  196. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +85 -82
  197. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +154 -73
  198. package/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +396 -542
  199. package/eigen/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +80 -77
  200. package/eigen/Eigen/src/Core/products/Parallelizer.h +208 -92
  201. package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +331 -375
  202. package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +206 -224
  203. package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +139 -146
  204. package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h +58 -61
  205. package/eigen/Eigen/src/Core/products/SelfadjointProduct.h +71 -71
  206. package/eigen/Eigen/src/Core/products/SelfadjointRank2Update.h +48 -46
  207. package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix.h +294 -369
  208. package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +246 -238
  209. package/eigen/Eigen/src/Core/products/TriangularMatrixVector.h +244 -247
  210. package/eigen/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h +212 -192
  211. package/eigen/Eigen/src/Core/products/TriangularSolverMatrix.h +328 -275
  212. package/eigen/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +108 -109
  213. package/eigen/Eigen/src/Core/products/TriangularSolverVector.h +70 -93
  214. package/eigen/Eigen/src/Core/util/Assert.h +158 -0
  215. package/eigen/Eigen/src/Core/util/BlasUtil.h +413 -290
  216. package/eigen/Eigen/src/Core/util/ConfigureVectorization.h +543 -0
  217. package/eigen/Eigen/src/Core/util/Constants.h +314 -263
  218. package/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +130 -78
  219. package/eigen/Eigen/src/Core/util/EmulateArray.h +270 -0
  220. package/eigen/Eigen/src/Core/util/ForwardDeclarations.h +450 -224
  221. package/eigen/Eigen/src/Core/util/GpuHipCudaDefines.inc +101 -0
  222. package/eigen/Eigen/src/Core/util/GpuHipCudaUndefines.inc +45 -0
  223. package/eigen/Eigen/src/Core/util/IndexedViewHelper.h +487 -0
  224. package/eigen/Eigen/src/Core/util/IntegralConstant.h +279 -0
  225. package/eigen/Eigen/src/Core/util/MKL_support.h +39 -30
  226. package/eigen/Eigen/src/Core/util/Macros.h +939 -646
  227. package/eigen/Eigen/src/Core/util/MaxSizeVector.h +139 -0
  228. package/eigen/Eigen/src/Core/util/Memory.h +1042 -650
  229. package/eigen/Eigen/src/Core/util/Meta.h +618 -426
  230. package/eigen/Eigen/src/Core/util/MoreMeta.h +638 -0
  231. package/eigen/Eigen/src/Core/util/ReenableStupidWarnings.h +32 -19
  232. package/eigen/Eigen/src/Core/util/ReshapedHelper.h +51 -0
  233. package/eigen/Eigen/src/Core/util/Serializer.h +209 -0
  234. package/eigen/Eigen/src/Core/util/StaticAssert.h +51 -164
  235. package/eigen/Eigen/src/Core/util/SymbolicIndex.h +445 -0
  236. package/eigen/Eigen/src/Core/util/XprHelper.h +793 -538
  237. package/eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h +246 -277
  238. package/eigen/Eigen/src/Eigenvalues/ComplexSchur.h +299 -319
  239. package/eigen/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h +52 -48
  240. package/eigen/Eigen/src/Eigenvalues/EigenSolver.h +413 -456
  241. package/eigen/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +309 -325
  242. package/eigen/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +157 -171
  243. package/eigen/Eigen/src/Eigenvalues/HessenbergDecomposition.h +292 -310
  244. package/eigen/Eigen/src/Eigenvalues/InternalHeaderCheck.h +3 -0
  245. package/eigen/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +91 -107
  246. package/eigen/Eigen/src/Eigenvalues/RealQZ.h +539 -606
  247. package/eigen/Eigen/src/Eigenvalues/RealSchur.h +348 -382
  248. package/eigen/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +41 -35
  249. package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +579 -600
  250. package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +47 -44
  251. package/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +434 -461
  252. package/eigen/Eigen/src/Geometry/AlignedBox.h +307 -214
  253. package/eigen/Eigen/src/Geometry/AngleAxis.h +135 -137
  254. package/eigen/Eigen/src/Geometry/EulerAngles.h +163 -74
  255. package/eigen/Eigen/src/Geometry/Homogeneous.h +289 -333
  256. package/eigen/Eigen/src/Geometry/Hyperplane.h +152 -161
  257. package/eigen/Eigen/src/Geometry/InternalHeaderCheck.h +3 -0
  258. package/eigen/Eigen/src/Geometry/OrthoMethods.h +168 -145
  259. package/eigen/Eigen/src/Geometry/ParametrizedLine.h +141 -104
  260. package/eigen/Eigen/src/Geometry/Quaternion.h +595 -497
  261. package/eigen/Eigen/src/Geometry/Rotation2D.h +110 -108
  262. package/eigen/Eigen/src/Geometry/RotationBase.h +148 -145
  263. package/eigen/Eigen/src/Geometry/Scaling.h +115 -90
  264. package/eigen/Eigen/src/Geometry/Transform.h +896 -953
  265. package/eigen/Eigen/src/Geometry/Translation.h +100 -98
  266. package/eigen/Eigen/src/Geometry/Umeyama.h +79 -84
  267. package/eigen/Eigen/src/Geometry/arch/Geometry_SIMD.h +154 -0
  268. package/eigen/Eigen/src/Householder/BlockHouseholder.h +54 -42
  269. package/eigen/Eigen/src/Householder/Householder.h +104 -122
  270. package/eigen/Eigen/src/Householder/HouseholderSequence.h +416 -382
  271. package/eigen/Eigen/src/Householder/InternalHeaderCheck.h +3 -0
  272. package/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +153 -166
  273. package/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +127 -138
  274. package/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +95 -124
  275. package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +269 -267
  276. package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +246 -259
  277. package/eigen/Eigen/src/IterativeLinearSolvers/InternalHeaderCheck.h +3 -0
  278. package/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +218 -217
  279. package/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +80 -103
  280. package/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +59 -63
  281. package/eigen/Eigen/src/Jacobi/InternalHeaderCheck.h +3 -0
  282. package/eigen/Eigen/src/Jacobi/Jacobi.h +256 -291
  283. package/eigen/Eigen/src/KLUSupport/InternalHeaderCheck.h +3 -0
  284. package/eigen/Eigen/src/KLUSupport/KLUSupport.h +339 -0
  285. package/eigen/Eigen/src/LU/Determinant.h +60 -63
  286. package/eigen/Eigen/src/LU/FullPivLU.h +561 -626
  287. package/eigen/Eigen/src/LU/InternalHeaderCheck.h +3 -0
  288. package/eigen/Eigen/src/LU/InverseImpl.h +213 -275
  289. package/eigen/Eigen/src/LU/PartialPivLU.h +407 -435
  290. package/eigen/Eigen/src/LU/PartialPivLU_LAPACKE.h +54 -40
  291. package/eigen/Eigen/src/LU/arch/InverseSize4.h +353 -0
  292. package/eigen/Eigen/src/MetisSupport/InternalHeaderCheck.h +3 -0
  293. package/eigen/Eigen/src/MetisSupport/MetisSupport.h +81 -93
  294. package/eigen/Eigen/src/OrderingMethods/Amd.h +250 -282
  295. package/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +950 -1103
  296. package/eigen/Eigen/src/OrderingMethods/InternalHeaderCheck.h +3 -0
  297. package/eigen/Eigen/src/OrderingMethods/Ordering.h +111 -122
  298. package/eigen/Eigen/src/PaStiXSupport/InternalHeaderCheck.h +3 -0
  299. package/eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h +524 -570
  300. package/eigen/Eigen/src/PardisoSupport/InternalHeaderCheck.h +3 -0
  301. package/eigen/Eigen/src/PardisoSupport/PardisoSupport.h +385 -429
  302. package/eigen/Eigen/src/QR/ColPivHouseholderQR.h +494 -473
  303. package/eigen/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +120 -56
  304. package/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +223 -137
  305. package/eigen/Eigen/src/QR/FullPivHouseholderQR.h +517 -460
  306. package/eigen/Eigen/src/QR/HouseholderQR.h +412 -278
  307. package/eigen/Eigen/src/QR/HouseholderQR_LAPACKE.h +32 -23
  308. package/eigen/Eigen/src/QR/InternalHeaderCheck.h +3 -0
  309. package/eigen/Eigen/src/SPQRSupport/InternalHeaderCheck.h +3 -0
  310. package/eigen/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +263 -261
  311. package/eigen/Eigen/src/SVD/BDCSVD.h +872 -679
  312. package/eigen/Eigen/src/SVD/BDCSVD_LAPACKE.h +174 -0
  313. package/eigen/Eigen/src/SVD/InternalHeaderCheck.h +3 -0
  314. package/eigen/Eigen/src/SVD/JacobiSVD.h +585 -543
  315. package/eigen/Eigen/src/SVD/JacobiSVD_LAPACKE.h +85 -49
  316. package/eigen/Eigen/src/SVD/SVDBase.h +281 -160
  317. package/eigen/Eigen/src/SVD/UpperBidiagonalization.h +202 -237
  318. package/eigen/Eigen/src/SparseCholesky/InternalHeaderCheck.h +3 -0
  319. package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +769 -590
  320. package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +318 -129
  321. package/eigen/Eigen/src/SparseCore/AmbiVector.h +202 -251
  322. package/eigen/Eigen/src/SparseCore/CompressedStorage.h +184 -236
  323. package/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +140 -184
  324. package/eigen/Eigen/src/SparseCore/InternalHeaderCheck.h +3 -0
  325. package/eigen/Eigen/src/SparseCore/SparseAssign.h +174 -111
  326. package/eigen/Eigen/src/SparseCore/SparseBlock.h +408 -477
  327. package/eigen/Eigen/src/SparseCore/SparseColEtree.h +100 -112
  328. package/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +531 -280
  329. package/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +559 -347
  330. package/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +100 -108
  331. package/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +185 -191
  332. package/eigen/Eigen/src/SparseCore/SparseDiagonalProduct.h +71 -71
  333. package/eigen/Eigen/src/SparseCore/SparseDot.h +49 -47
  334. package/eigen/Eigen/src/SparseCore/SparseFuzzy.h +13 -11
  335. package/eigen/Eigen/src/SparseCore/SparseMap.h +243 -253
  336. package/eigen/Eigen/src/SparseCore/SparseMatrix.h +1614 -1142
  337. package/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +403 -357
  338. package/eigen/Eigen/src/SparseCore/SparsePermutation.h +186 -115
  339. package/eigen/Eigen/src/SparseCore/SparseProduct.h +100 -91
  340. package/eigen/Eigen/src/SparseCore/SparseRedux.h +22 -24
  341. package/eigen/Eigen/src/SparseCore/SparseRef.h +268 -295
  342. package/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h +371 -414
  343. package/eigen/Eigen/src/SparseCore/SparseSolverBase.h +78 -87
  344. package/eigen/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +81 -95
  345. package/eigen/Eigen/src/SparseCore/SparseTranspose.h +62 -71
  346. package/eigen/Eigen/src/SparseCore/SparseTriangularView.h +132 -144
  347. package/eigen/Eigen/src/SparseCore/SparseUtil.h +146 -115
  348. package/eigen/Eigen/src/SparseCore/SparseVector.h +426 -372
  349. package/eigen/Eigen/src/SparseCore/SparseView.h +164 -193
  350. package/eigen/Eigen/src/SparseCore/TriangularSolver.h +129 -170
  351. package/eigen/Eigen/src/SparseLU/InternalHeaderCheck.h +3 -0
  352. package/eigen/Eigen/src/SparseLU/SparseLU.h +814 -618
  353. package/eigen/Eigen/src/SparseLU/SparseLUImpl.h +61 -48
  354. package/eigen/Eigen/src/SparseLU/SparseLU_Memory.h +102 -118
  355. package/eigen/Eigen/src/SparseLU/SparseLU_Structs.h +38 -35
  356. package/eigen/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +273 -255
  357. package/eigen/Eigen/src/SparseLU/SparseLU_Utils.h +44 -49
  358. package/eigen/Eigen/src/SparseLU/SparseLU_column_bmod.h +104 -108
  359. package/eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h +90 -101
  360. package/eigen/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +57 -58
  361. package/eigen/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +43 -55
  362. package/eigen/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +74 -71
  363. package/eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h +125 -133
  364. package/eigen/Eigen/src/SparseLU/SparseLU_panel_dfs.h +136 -159
  365. package/eigen/Eigen/src/SparseLU/SparseLU_pivotL.h +51 -52
  366. package/eigen/Eigen/src/SparseLU/SparseLU_pruneL.h +67 -73
  367. package/eigen/Eigen/src/SparseLU/SparseLU_relax_snode.h +24 -26
  368. package/eigen/Eigen/src/SparseQR/InternalHeaderCheck.h +3 -0
  369. package/eigen/Eigen/src/SparseQR/SparseQR.h +451 -490
  370. package/eigen/Eigen/src/StlSupport/StdDeque.h +28 -105
  371. package/eigen/Eigen/src/StlSupport/StdList.h +28 -84
  372. package/eigen/Eigen/src/StlSupport/StdVector.h +28 -108
  373. package/eigen/Eigen/src/StlSupport/details.h +48 -50
  374. package/eigen/Eigen/src/SuperLUSupport/InternalHeaderCheck.h +3 -0
  375. package/eigen/Eigen/src/SuperLUSupport/SuperLUSupport.h +634 -732
  376. package/eigen/Eigen/src/ThreadPool/Barrier.h +70 -0
  377. package/eigen/Eigen/src/ThreadPool/CoreThreadPoolDevice.h +336 -0
  378. package/eigen/Eigen/src/ThreadPool/EventCount.h +241 -0
  379. package/eigen/Eigen/src/ThreadPool/ForkJoin.h +140 -0
  380. package/eigen/Eigen/src/ThreadPool/InternalHeaderCheck.h +4 -0
  381. package/eigen/Eigen/src/ThreadPool/NonBlockingThreadPool.h +587 -0
  382. package/eigen/Eigen/src/ThreadPool/RunQueue.h +230 -0
  383. package/eigen/Eigen/src/ThreadPool/ThreadCancel.h +21 -0
  384. package/eigen/Eigen/src/ThreadPool/ThreadEnvironment.h +43 -0
  385. package/eigen/Eigen/src/ThreadPool/ThreadLocal.h +289 -0
  386. package/eigen/Eigen/src/ThreadPool/ThreadPoolInterface.h +50 -0
  387. package/eigen/Eigen/src/ThreadPool/ThreadYield.h +16 -0
  388. package/eigen/Eigen/src/UmfPackSupport/InternalHeaderCheck.h +3 -0
  389. package/eigen/Eigen/src/UmfPackSupport/UmfPackSupport.h +480 -380
  390. package/eigen/Eigen/src/misc/Image.h +41 -43
  391. package/eigen/Eigen/src/misc/InternalHeaderCheck.h +3 -0
  392. package/eigen/Eigen/src/misc/Kernel.h +39 -41
  393. package/eigen/Eigen/src/misc/RealSvd2x2.h +19 -21
  394. package/eigen/Eigen/src/misc/blas.h +83 -426
  395. package/eigen/Eigen/src/misc/lapacke.h +9976 -16182
  396. package/eigen/Eigen/src/misc/lapacke_helpers.h +163 -0
  397. package/eigen/Eigen/src/misc/lapacke_mangling.h +4 -5
  398. package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.inc +344 -0
  399. package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.inc +544 -0
  400. package/eigen/Eigen/src/plugins/BlockMethods.inc +1370 -0
  401. package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.inc +116 -0
  402. package/eigen/Eigen/src/plugins/CommonCwiseUnaryOps.inc +167 -0
  403. package/eigen/Eigen/src/plugins/IndexedViewMethods.inc +192 -0
  404. package/eigen/Eigen/src/plugins/InternalHeaderCheck.inc +3 -0
  405. package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.inc +331 -0
  406. package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.inc +118 -0
  407. package/eigen/Eigen/src/plugins/ReshapedMethods.inc +133 -0
  408. package/lib/LibEigen.d.ts +4 -0
  409. package/lib/LibEigen.js +14 -0
  410. package/lib/index.d.ts +1 -1
  411. package/lib/index.js +7 -3
  412. package/package.json +2 -10
  413. package/eigen/Eigen/CMakeLists.txt +0 -19
  414. package/eigen/Eigen/src/Core/BooleanRedux.h +0 -164
  415. package/eigen/Eigen/src/Core/arch/CUDA/Complex.h +0 -103
  416. package/eigen/Eigen/src/Core/arch/CUDA/Half.h +0 -675
  417. package/eigen/Eigen/src/Core/arch/CUDA/MathFunctions.h +0 -91
  418. package/eigen/Eigen/src/Core/arch/CUDA/PacketMath.h +0 -333
  419. package/eigen/Eigen/src/Core/arch/CUDA/PacketMathHalf.h +0 -1124
  420. package/eigen/Eigen/src/Core/arch/CUDA/TypeCasting.h +0 -212
  421. package/eigen/Eigen/src/Core/util/NonMPL2.h +0 -3
  422. package/eigen/Eigen/src/Geometry/arch/Geometry_SSE.h +0 -161
  423. package/eigen/Eigen/src/LU/arch/Inverse_SSE.h +0 -338
  424. package/eigen/Eigen/src/SparseCore/MappedSparseMatrix.h +0 -67
  425. package/eigen/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +0 -280
  426. package/eigen/Eigen/src/misc/lapack.h +0 -152
  427. package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.h +0 -332
  428. package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h +0 -552
  429. package/eigen/Eigen/src/plugins/BlockMethods.h +0 -1058
  430. package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.h +0 -115
  431. package/eigen/Eigen/src/plugins/CommonCwiseUnaryOps.h +0 -163
  432. package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h +0 -152
  433. package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h +0 -85
  434. package/lib/eigen.d.ts +0 -2
  435. package/lib/eigen.js +0 -15
@@ -11,428 +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 traits<_MatrixType> BaseTraits;
23
- enum {
24
- Flags = BaseTraits::Flags & RowMajorBit,
25
- CoeffReadCost = Dynamic
26
- };
24
+ typedef PermutationIndex_ StorageIndex;
25
+ typedef traits<MatrixType_> BaseTraits;
26
+ enum { Flags = BaseTraits::Flags & RowMajorBit, CoeffReadCost = Dynamic };
27
27
  };
28
28
 
29
- template<typename T,typename Derived>
29
+ template <typename T, typename Derived>
30
30
  struct enable_if_ref;
31
31
  // {
32
32
  // typedef Derived type;
33
33
  // };
34
34
 
35
- template<typename T,typename Derived>
36
- struct enable_if_ref<Ref<T>,Derived> {
35
+ template <typename T, typename Derived>
36
+ struct enable_if_ref<Ref<T>, Derived> {
37
37
  typedef Derived type;
38
38
  };
39
39
 
40
- } // end namespace internal
40
+ } // end namespace internal
41
41
 
42
42
  /** \ingroup LU_Module
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 FullPivLU
74
- */
75
- template<typename _MatrixType> class PartialPivLU
76
- : public SolverBase<PartialPivLU<_MatrixType> >
77
- {
78
- public:
79
-
80
- typedef _MatrixType MatrixType;
81
- typedef SolverBase<PartialPivLU> Base;
82
- EIGEN_GENERIC_PUBLIC_INTERFACE(PartialPivLU)
83
- // FIXME StorageIndex defined in EIGEN_GENERIC_PUBLIC_INTERFACE should be int
84
- enum {
85
- MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
86
- MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
87
- };
88
- typedef PermutationMatrix<RowsAtCompileTime, MaxRowsAtCompileTime> PermutationType;
89
- typedef Transpositions<RowsAtCompileTime, MaxRowsAtCompileTime> TranspositionType;
90
- typedef typename MatrixType::PlainObject PlainObject;
91
-
92
- /**
93
- * \brief Default Constructor.
94
- *
95
- * The default constructor is useful in cases in which the user intends to
96
- * perform decompositions via PartialPivLU::compute(const MatrixType&).
97
- */
98
- PartialPivLU();
99
-
100
- /** \brief Default Constructor with memory preallocation
101
- *
102
- * Like the default constructor but with preallocation of the internal data
103
- * according to the specified problem \a size.
104
- * \sa PartialPivLU()
105
- */
106
- explicit PartialPivLU(Index size);
107
-
108
- /** Constructor.
109
- *
110
- * \param matrix the matrix of which to compute the LU decomposition.
111
- *
112
- * \warning The matrix should have full rank (e.g. if it's square, it should be invertible).
113
- * If you need to deal with non-full rank, use class FullPivLU instead.
114
- */
115
- template<typename InputType>
116
- explicit PartialPivLU(const EigenBase<InputType>& matrix);
117
-
118
- /** Constructor for \link InplaceDecomposition inplace decomposition \endlink
119
- *
120
- * \param matrix the matrix of which to compute the LU decomposition.
121
- *
122
- * \warning The matrix should have full rank (e.g. if it's square, it should be invertible).
123
- * If you need to deal with non-full rank, use class FullPivLU instead.
124
- */
125
- template<typename InputType>
126
- explicit PartialPivLU(EigenBase<InputType>& matrix);
127
-
128
- template<typename InputType>
129
- PartialPivLU& compute(const EigenBase<InputType>& matrix) {
130
- m_lu = matrix.derived();
131
- compute();
132
- return *this;
133
- }
134
-
135
- /** \returns the LU decomposition matrix: the upper-triangular part is U, the
136
- * unit-lower-triangular part is L (at least for square matrices; in the non-square
137
- * case, special care is needed, see the documentation of class FullPivLU).
138
- *
139
- * \sa matrixL(), matrixU()
140
- */
141
- inline const MatrixType& matrixLU() const
142
- {
143
- eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
144
- return m_lu;
145
- }
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
+ }
146
103
 
147
- /** \returns the permutation matrix P.
148
- */
149
- inline const PermutationType& permutationP() const
150
- {
151
- eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
152
- return m_p;
153
- }
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
+ }
154
146
 
155
- /** This method returns the solution x to the equation Ax=b, where A is the matrix of which
156
- * *this is the LU decomposition.
157
- *
158
- * \param b the right-hand-side of the equation to solve. Can be a vector or a matrix,
159
- * the only requirement in order for the equation to make sense is that
160
- * b.rows()==A.rows(), where A is the matrix of which *this is the LU decomposition.
161
- *
162
- * \returns the solution.
163
- *
164
- * Example: \include PartialPivLU_solve.cpp
165
- * Output: \verbinclude PartialPivLU_solve.out
166
- *
167
- * Since this PartialPivLU class assumes anyway that the matrix A is invertible, the solution
168
- * theoretically exists and is unique regardless of b.
169
- *
170
- * \sa TriangularView::solve(), inverse(), computeInverse()
171
- */
172
- // FIXME this is a copy-paste of the base-class member to add the isInitialized assertion.
173
- template<typename Rhs>
174
- inline const Solve<PartialPivLU, Rhs>
175
- solve(const MatrixBase<Rhs>& b) const
176
- {
177
- eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
178
- return Solve<PartialPivLU, Rhs>(*this, b.derived());
179
- }
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
+ }
180
157
 
181
- /** \returns an estimate of the reciprocal condition number of the matrix of which \c *this is
182
- the LU decomposition.
183
- */
184
- inline RealScalar rcond() const
185
- {
186
- eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
187
- return internal::rcond_estimate_helper(m_l1_norm, *this);
188
- }
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
+ }
189
164
 
190
- /** \returns the inverse of the matrix of which *this is the LU decomposition.
191
- *
192
- * \warning The matrix being decomposed here is assumed to be invertible. If you need to check for
193
- * invertibility, use class FullPivLU instead.
194
- *
195
- * \sa MatrixBase::inverse(), LU::inverse()
196
- */
197
- inline const Inverse<PartialPivLU> inverse() const
198
- {
199
- eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
200
- return Inverse<PartialPivLU>(*this);
201
- }
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
+ }
202
194
 
203
- /** \returns the determinant of the matrix of which
204
- * *this is the LU decomposition. It has only linear complexity
205
- * (that is, O(n) where n is the dimension of the square matrix)
206
- * as the LU decomposition has already been computed.
207
- *
208
- * \note For fixed-size matrices of size up to 4, MatrixBase::determinant() offers
209
- * optimized paths.
210
- *
211
- * \warning a determinant can be very big or small, so for matrices
212
- * of large enough dimension, there is a risk of overflow/underflow.
213
- *
214
- * \sa MatrixBase::determinant()
215
- */
216
- Scalar determinant() const;
217
-
218
- MatrixType reconstructedMatrix() const;
219
-
220
- inline Index rows() const { return m_lu.rows(); }
221
- inline Index cols() const { return m_lu.cols(); }
222
-
223
- #ifndef EIGEN_PARSED_BY_DOXYGEN
224
- template<typename RhsType, typename DstType>
225
- EIGEN_DEVICE_FUNC
226
- void _solve_impl(const RhsType &rhs, DstType &dst) const {
227
- /* The decomposition PA = LU can be rewritten as A = P^{-1} L U.
228
- * So we proceed as follows:
229
- * Step 1: compute c = Pb.
230
- * Step 2: replace c by the solution x to Lx = c.
231
- * Step 3: replace c by the solution x to Ux = c.
232
- */
233
-
234
- eigen_assert(rhs.rows() == m_lu.rows());
235
-
236
- // Step 1
237
- dst = permutationP() * rhs;
238
-
239
- // Step 2
240
- m_lu.template triangularView<UnitLower>().solveInPlace(dst);
241
-
242
- // Step 3
243
- m_lu.template triangularView<Upper>().solveInPlace(dst);
244
- }
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
+ }
245
206
 
246
- template<bool Conjugate, typename RhsType, typename DstType>
247
- EIGEN_DEVICE_FUNC
248
- void _solve_impl_transposed(const RhsType &rhs, DstType &dst) const {
249
- /* The decomposition PA = LU can be rewritten as A = P^{-1} L U.
250
- * So we proceed as follows:
251
- * Step 1: compute c = Pb.
252
- * Step 2: replace c by the solution x to Lx = c.
253
- * Step 3: replace c by the solution x to Ux = c.
254
- */
255
-
256
- eigen_assert(rhs.rows() == m_lu.cols());
257
-
258
- if (Conjugate) {
259
- // Step 1
260
- dst = m_lu.template triangularView<Upper>().adjoint().solve(rhs);
261
- // Step 2
262
- m_lu.template triangularView<UnitLower>().adjoint().solveInPlace(dst);
263
- } else {
264
- // Step 1
265
- dst = m_lu.template triangularView<Upper>().transpose().solve(rhs);
266
- // Step 2
267
- m_lu.template triangularView<UnitLower>().transpose().solveInPlace(dst);
268
- }
269
- // Step 3
270
- dst = permutationP().transpose() * dst;
271
- }
272
- #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
+ }
273
246
 
274
- 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
275
266
 
276
- static void check_template_parameters()
277
- {
278
- EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar);
279
- }
267
+ protected:
268
+ EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar)
280
269
 
281
- void compute();
270
+ void compute();
282
271
 
283
- MatrixType m_lu;
284
- PermutationType m_p;
285
- TranspositionType m_rowsTranspositions;
286
- RealScalar m_l1_norm;
287
- signed char m_det_p;
288
- 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;
289
278
  };
290
279
 
291
- template<typename MatrixType>
292
- PartialPivLU<MatrixType>::PartialPivLU()
293
- : m_lu(),
294
- m_p(),
295
- m_rowsTranspositions(),
296
- m_l1_norm(0),
297
- m_det_p(0),
298
- m_isInitialized(false)
299
- {
300
- }
301
-
302
- template<typename MatrixType>
303
- PartialPivLU<MatrixType>::PartialPivLU(Index size)
304
- : m_lu(size, size),
305
- m_p(size),
306
- m_rowsTranspositions(size),
307
- m_l1_norm(0),
308
- m_det_p(0),
309
- m_isInitialized(false)
310
- {
311
- }
312
-
313
- template<typename MatrixType>
314
- template<typename InputType>
315
- PartialPivLU<MatrixType>::PartialPivLU(const EigenBase<InputType>& matrix)
316
- : m_lu(matrix.rows(),matrix.cols()),
317
- m_p(matrix.rows()),
318
- m_rowsTranspositions(matrix.rows()),
319
- m_l1_norm(0),
320
- m_det_p(0),
321
- m_isInitialized(false)
322
- {
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) {
323
297
  compute(matrix.derived());
324
298
  }
325
299
 
326
- template<typename MatrixType>
327
- template<typename InputType>
328
- PartialPivLU<MatrixType>::PartialPivLU(EigenBase<InputType>& matrix)
329
- : m_lu(matrix.derived()),
330
- m_p(matrix.rows()),
331
- m_rowsTranspositions(matrix.rows()),
332
- m_l1_norm(0),
333
- m_det_p(0),
334
- m_isInitialized(false)
335
- {
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) {
336
309
  compute();
337
310
  }
338
311
 
339
312
  namespace internal {
340
313
 
341
314
  /** \internal This is the blocked version of fullpivlu_unblocked() */
342
- template<typename Scalar, int StorageOrder, typename PivIndex>
343
- struct partial_lu_impl
344
- {
345
- // FIXME add a stride to Map, so that the following mapping becomes easier,
346
- // another option would be to create an expression being able to automatically
347
- // warp any Map, Matrix, and Block expressions as a unique type, but since that's exactly
348
- // a Map + stride, why not adding a stride to Map, and convenient ctors from a Matrix,
349
- // and Block.
350
- typedef Map<Matrix<Scalar, Dynamic, Dynamic, StorageOrder> > MapLU;
351
- typedef Block<MapLU, Dynamic, Dynamic> MatrixType;
352
- typedef Block<MatrixType,Dynamic,Dynamic> BlockType;
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;
320
+ // Remaining rows and columns at compile-time:
321
+ static constexpr int RRows = SizeAtCompileTime == 2 ? 1 : Dynamic;
322
+ static constexpr int RCols = SizeAtCompileTime == 2 ? 1 : Dynamic;
323
+ typedef Matrix<Scalar, ActualSizeAtCompileTime, ActualSizeAtCompileTime, StorageOrder> MatrixType;
324
+ typedef Ref<MatrixType> MatrixTypeRef;
325
+ typedef Ref<Matrix<Scalar, Dynamic, Dynamic, StorageOrder> > BlockType;
353
326
  typedef typename MatrixType::RealScalar RealScalar;
354
327
 
355
328
  /** \internal performs the LU decomposition in-place of the matrix \a lu
356
- * using an unblocked algorithm.
357
- *
358
- * In addition, this function returns the row transpositions in the
359
- * vector \a row_transpositions which must have a size equal to the number
360
- * of columns of the matrix \a lu, and an integer \a nb_transpositions
361
- * which returns the actual number of transpositions.
362
- *
363
- * \returns The index of the first pivot which is exactly zero if any, or a negative number otherwise.
364
- */
365
- static Index unblocked_lu(MatrixType& lu, PivIndex* row_transpositions, PivIndex& nb_transpositions)
366
- {
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) {
367
339
  typedef scalar_score_coeff_op<Scalar> Scoring;
368
340
  typedef typename Scoring::result_type Score;
369
341
  const Index rows = lu.rows();
370
342
  const Index cols = lu.cols();
371
- const Index size = (std::min)(rows,cols);
343
+ const Index size = (std::min)(rows, cols);
344
+ // For small compile-time matrices it is worth processing the last row separately:
345
+ // speedup: +100% for 2x2, +10% for others.
346
+ const Index endk = UnBlockedAtCompileTime ? size - 1 : size;
372
347
  nb_transpositions = 0;
373
348
  Index first_zero_pivot = -1;
374
- for(Index k = 0; k < size; ++k)
375
- {
376
- Index rrows = rows-k-1;
377
- Index rcols = 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);
378
352
 
379
353
  Index row_of_biggest_in_col;
380
- Score biggest_in_corner
381
- = 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);
382
355
  row_of_biggest_in_col += k;
383
356
 
384
357
  row_transpositions[k] = PivIndex(row_of_biggest_in_col);
385
358
 
386
- if(biggest_in_corner != Score(0))
387
- {
388
- if(k != row_of_biggest_in_col)
389
- {
359
+ if (!numext::is_exactly_zero(biggest_in_corner)) {
360
+ if (k != row_of_biggest_in_col) {
390
361
  lu.row(k).swap(lu.row(row_of_biggest_in_col));
391
362
  ++nb_transpositions;
392
363
  }
393
364
 
394
- // FIXME shall we introduce a safe quotient expression in cas 1/lu.coeff(k,k)
395
- // overflow but not the actual quotient?
396
- lu.col(k).tail(rrows) /= lu.coeff(k,k);
397
- }
398
- else if(first_zero_pivot==-1)
399
- {
365
+ lu.col(k).tail(fix<RRows>(rrows)) /= lu.coeff(k, k);
366
+ } else if (first_zero_pivot == -1) {
400
367
  // the pivot is exactly zero, we record the index of the first pivot which is exactly 0,
401
368
  // and continue the factorization such we still have A = PLU
402
369
  first_zero_pivot = k;
403
370
  }
404
371
 
405
- if(k<rows-1)
406
- lu.bottomRightCorner(rrows,rcols).noalias() -= lu.col(k).tail(rrows) * lu.row(k).tail(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));
375
+ }
376
+
377
+ // special handling of the last entry
378
+ if (UnBlockedAtCompileTime) {
379
+ Index k = endk;
380
+ row_transpositions[k] = PivIndex(k);
381
+ if (numext::is_exactly_zero(Scoring()(lu(k, k))) && first_zero_pivot == -1) first_zero_pivot = k;
407
382
  }
383
+
408
384
  return first_zero_pivot;
409
385
  }
410
386
 
411
387
  /** \internal performs the LU decomposition in-place of the matrix represented
412
- * by the variables \a rows, \a cols, \a lu_data, and \a lu_stride using a
413
- * recursive, blocked algorithm.
414
- *
415
- * In addition, this function returns the row transpositions in the
416
- * vector \a row_transpositions which must have a size equal to the number
417
- * of columns of the matrix \a lu, and an integer \a nb_transpositions
418
- * which returns the actual number of transpositions.
419
- *
420
- * \returns The index of the first pivot which is exactly zero if any, or a negative number otherwise.
421
- *
422
- * \note This very low level interface using pointers, etc. is to:
423
- * 1 - reduce the number of instanciations to the strict minimum
424
- * 2 - avoid infinite recursion of the instanciations with Block<Block<Block<...> > >
425
- */
426
- static Index blocked_lu(Index rows, Index cols, Scalar* lu_data, Index luStride, PivIndex* row_transpositions, PivIndex& nb_transpositions, Index maxBlockSize=256)
427
- {
428
- MapLU lu1(lu_data,StorageOrder==RowMajor?rows:luStride,StorageOrder==RowMajor?luStride:cols);
429
- MatrixType lu(lu1,0,0,rows,cols);
430
-
431
- 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);
432
407
 
433
408
  // if the matrix is too small, no blocking:
434
- if(size<=16)
435
- {
409
+ if (UnBlockedAtCompileTime || size <= UnBlockedBound) {
436
410
  return unblocked_lu(lu, row_transpositions, nb_transpositions);
437
411
  }
438
412
 
@@ -440,51 +414,46 @@ struct partial_lu_impl
440
414
  // of the matrix so that there is enough sub blocks:
441
415
  Index blockSize;
442
416
  {
443
- blockSize = size/8;
444
- blockSize = (blockSize/16)*16;
445
- 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);
446
420
  }
447
421
 
448
422
  nb_transpositions = 0;
449
423
  Index first_zero_pivot = -1;
450
- for(Index k = 0; k < size; k+=blockSize)
451
- {
452
- Index bs = (std::min)(size-k,blockSize); // actual size of the block
453
- Index trows = rows - k - bs; // trailing rows
454
- 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
455
428
 
456
429
  // partition the matrix:
457
430
  // A00 | A01 | A02
458
431
  // lu = A_0 | A_1 | A_2 = A10 | A11 | A12
459
432
  // A20 | A21 | A22
460
- BlockType A_0(lu,0,0,rows,k);
461
- BlockType A_2(lu,0,k+bs,rows,tsize);
462
- BlockType A11(lu,k,k,bs,bs);
463
- BlockType A12(lu,k,k+bs,bs,tsize);
464
- BlockType A21(lu,k+bs,k,trows,bs);
465
- BlockType A22(lu,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);
466
439
 
467
440
  PivIndex nb_transpositions_in_panel;
468
441
  // recursively call the blocked LU algorithm on [A11^T A21^T]^T
469
442
  // with a very small blocking size:
470
- Index ret = blocked_lu(trows+bs, bs, &lu.coeffRef(k,k), luStride,
471
- row_transpositions+k, nb_transpositions_in_panel, 16);
472
- if(ret>=0 && first_zero_pivot==-1)
473
- 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;
474
446
 
475
447
  nb_transpositions += nb_transpositions_in_panel;
476
448
  // update permutations and apply them to A_0
477
- for(Index i=k; i<k+bs; ++i)
478
- {
449
+ for (Index i = k; i < k + bs; ++i) {
479
450
  Index piv = (row_transpositions[i] += internal::convert_index<PivIndex>(k));
480
451
  A_0.row(i).swap(A_0.row(piv));
481
452
  }
482
453
 
483
- if(trows)
484
- {
454
+ if (trows) {
485
455
  // apply permutations to A_2
486
- for(Index i=k;i<k+bs; ++i)
487
- 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]));
488
457
 
489
458
  // A12 = A11^-1 A12
490
459
  A11.template triangularView<UnitLower>().solveInPlace(A12);
@@ -497,29 +466,33 @@ struct partial_lu_impl
497
466
  };
498
467
 
499
468
  /** \internal performs the LU decomposition with partial pivoting in-place.
500
- */
501
- template<typename MatrixType, typename TranspositionType>
502
- void partial_lu_inplace(MatrixType& lu, TranspositionType& row_transpositions, typename TranspositionType::StorageIndex& nb_transpositions)
503
- {
469
+ */
470
+ template <typename MatrixType, typename TranspositionType>
471
+ void partial_lu_inplace(MatrixType& lu, TranspositionType& row_transpositions,
472
+ typename TranspositionType::StorageIndex& nb_transpositions) {
473
+ // Special-case of zero matrix.
474
+ if (lu.rows() == 0 || lu.cols() == 0) {
475
+ nb_transpositions = 0;
476
+ return;
477
+ }
504
478
  eigen_assert(lu.cols() == row_transpositions.size());
505
- eigen_assert((&row_transpositions.coeffRef(1)-&row_transpositions.coeffRef(0)) == 1);
506
-
507
- partial_lu_impl
508
- <typename MatrixType::Scalar, MatrixType::Flags&RowMajorBit?RowMajor:ColMajor, typename TranspositionType::StorageIndex>
509
- ::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);
510
487
  }
511
488
 
512
- } // end namespace internal
513
-
514
- template<typename MatrixType>
515
- void PartialPivLU<MatrixType>::compute()
516
- {
517
- check_template_parameters();
489
+ } // end namespace internal
518
490
 
519
- // the row permutation is stored as int indices, so just to be sure:
520
- 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());
521
494
 
522
- if(m_lu.cols()>0)
495
+ if (m_lu.cols() > 0)
523
496
  m_l1_norm = m_lu.cwiseAbs().colwise().sum().maxCoeff();
524
497
  else
525
498
  m_l1_norm = RealScalar(0);
@@ -531,16 +504,16 @@ void PartialPivLU<MatrixType>::compute()
531
504
 
532
505
  typename TranspositionType::StorageIndex nb_transpositions;
533
506
  internal::partial_lu_inplace(m_lu, m_rowsTranspositions, nb_transpositions);
534
- m_det_p = (nb_transpositions%2) ? -1 : 1;
507
+ m_det_p = (nb_transpositions % 2) ? -1 : 1;
535
508
 
536
509
  m_p = m_rowsTranspositions;
537
510
 
538
511
  m_isInitialized = true;
539
512
  }
540
513
 
541
- template<typename MatrixType>
542
- typename PartialPivLU<MatrixType>::Scalar PartialPivLU<MatrixType>::determinant() const
543
- {
514
+ template <typename MatrixType, typename PermutationIndex>
515
+ typename PartialPivLU<MatrixType, PermutationIndex>::Scalar PartialPivLU<MatrixType, PermutationIndex>::determinant()
516
+ const {
544
517
  eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
545
518
  return Scalar(m_det_p) * m_lu.diagonal().prod();
546
519
  }
@@ -548,13 +521,11 @@ typename PartialPivLU<MatrixType>::Scalar PartialPivLU<MatrixType>::determinant(
548
521
  /** \returns the matrix represented by the decomposition,
549
522
  * i.e., it returns the product: P^{-1} L U.
550
523
  * This function is provided for debug purpose. */
551
- template<typename MatrixType>
552
- MatrixType PartialPivLU<MatrixType>::reconstructedMatrix() const
553
- {
524
+ template <typename MatrixType, typename PermutationIndex>
525
+ MatrixType PartialPivLU<MatrixType, PermutationIndex>::reconstructedMatrix() const {
554
526
  eigen_assert(m_isInitialized && "LU is not initialized.");
555
527
  // LU
556
- MatrixType res = m_lu.template triangularView<UnitLower>().toDenseMatrix()
557
- * m_lu.template triangularView<Upper>();
528
+ MatrixType res = m_lu.template triangularView<UnitLower>().toDenseMatrix() * m_lu.template triangularView<Upper>();
558
529
 
559
530
  // P^{-1}(LU)
560
531
  res = m_p.inverse() * res;
@@ -567,48 +538,49 @@ MatrixType PartialPivLU<MatrixType>::reconstructedMatrix() const
567
538
  namespace internal {
568
539
 
569
540
  /***** Implementation of inverse() *****************************************************/
570
- template<typename DstXprType, typename MatrixType>
571
- struct Assignment<DstXprType, Inverse<PartialPivLU<MatrixType> >, internal::assign_op<typename DstXprType::Scalar,typename PartialPivLU<MatrixType>::Scalar>, Dense2Dense>
572
- {
573
- 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;
574
547
  typedef Inverse<LuType> SrcXprType;
575
- static void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op<typename DstXprType::Scalar,typename LuType::Scalar> &)
576
- {
548
+ static void run(DstXprType& dst, const SrcXprType& src,
549
+ const internal::assign_op<typename DstXprType::Scalar, typename LuType::Scalar>&) {
577
550
  dst = src.nestedExpression().solve(MatrixType::Identity(src.rows(), src.cols()));
578
551
  }
579
552
  };
580
- } // end namespace internal
553
+ } // end namespace internal
581
554
 
582
555
  /******** MatrixBase methods *******/
583
556
 
584
557
  /** \lu_module
585
- *
586
- * \return the partial-pivoting LU decomposition of \c *this.
587
- *
588
- * \sa class PartialPivLU
589
- */
590
- template<typename Derived>
591
- inline const PartialPivLU<typename MatrixBase<Derived>::PlainObject>
592
- MatrixBase<Derived>::partialPivLu() const
593
- {
594
- 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());
595
568
  }
596
569
 
597
570
  /** \lu_module
598
- *
599
- * Synonym of partialPivLu().
600
- *
601
- * \return the partial-pivoting LU decomposition of \c *this.
602
- *
603
- * \sa class PartialPivLU
604
- */
605
- template<typename Derived>
606
- inline const PartialPivLU<typename MatrixBase<Derived>::PlainObject>
607
- MatrixBase<Derived>::lu() const
608
- {
609
- 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());
610
582
  }
611
583
 
612
- } // end namespace Eigen
584
+ } // end namespace Eigen
613
585
 
614
- #endif // EIGEN_PARTIALLU_H
586
+ #endif // EIGEN_PARTIALLU_H