@smake/eigen 1.0.2 → 1.1.0

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 (287) hide show
  1. package/README.md +1 -1
  2. package/eigen/COPYING.APACHE +203 -0
  3. package/eigen/COPYING.BSD +26 -0
  4. package/eigen/COPYING.GPL +674 -0
  5. package/eigen/COPYING.LGPL +502 -0
  6. package/eigen/COPYING.MINPACK +51 -0
  7. package/eigen/COPYING.MPL2 +373 -0
  8. package/eigen/COPYING.README +18 -0
  9. package/eigen/Eigen/Cholesky +0 -1
  10. package/eigen/Eigen/Core +108 -266
  11. package/eigen/Eigen/Eigenvalues +0 -1
  12. package/eigen/Eigen/Geometry +3 -6
  13. package/eigen/Eigen/Householder +0 -1
  14. package/eigen/Eigen/Jacobi +0 -1
  15. package/eigen/Eigen/KLUSupport +41 -0
  16. package/eigen/Eigen/LU +2 -5
  17. package/eigen/Eigen/OrderingMethods +0 -3
  18. package/eigen/Eigen/PaStiXSupport +1 -0
  19. package/eigen/Eigen/PardisoSupport +0 -0
  20. package/eigen/Eigen/QR +0 -1
  21. package/eigen/Eigen/QtAlignedMalloc +0 -1
  22. package/eigen/Eigen/SVD +0 -1
  23. package/eigen/Eigen/Sparse +0 -2
  24. package/eigen/Eigen/SparseCholesky +0 -8
  25. package/eigen/Eigen/SparseLU +4 -0
  26. package/eigen/Eigen/src/Cholesky/LDLT.h +42 -27
  27. package/eigen/Eigen/src/Cholesky/LLT.h +39 -23
  28. package/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +90 -47
  29. package/eigen/Eigen/src/Core/ArithmeticSequence.h +413 -0
  30. package/eigen/Eigen/src/Core/Array.h +99 -11
  31. package/eigen/Eigen/src/Core/ArrayBase.h +1 -1
  32. package/eigen/Eigen/src/Core/ArrayWrapper.h +21 -21
  33. package/eigen/Eigen/src/Core/Assign.h +1 -1
  34. package/eigen/Eigen/src/Core/AssignEvaluator.h +125 -50
  35. package/eigen/Eigen/src/Core/Assign_MKL.h +10 -10
  36. package/eigen/Eigen/src/Core/BandMatrix.h +16 -16
  37. package/eigen/Eigen/src/Core/Block.h +56 -60
  38. package/eigen/Eigen/src/Core/BooleanRedux.h +29 -31
  39. package/eigen/Eigen/src/Core/CommaInitializer.h +7 -3
  40. package/eigen/Eigen/src/Core/CoreEvaluators.h +325 -272
  41. package/eigen/Eigen/src/Core/CoreIterators.h +5 -0
  42. package/eigen/Eigen/src/Core/CwiseBinaryOp.h +21 -22
  43. package/eigen/Eigen/src/Core/CwiseNullaryOp.h +153 -18
  44. package/eigen/Eigen/src/Core/CwiseUnaryOp.h +6 -6
  45. package/eigen/Eigen/src/Core/CwiseUnaryView.h +12 -10
  46. package/eigen/Eigen/src/Core/DenseBase.h +128 -39
  47. package/eigen/Eigen/src/Core/DenseCoeffsBase.h +25 -21
  48. package/eigen/Eigen/src/Core/DenseStorage.h +150 -68
  49. package/eigen/Eigen/src/Core/Diagonal.h +21 -23
  50. package/eigen/Eigen/src/Core/DiagonalMatrix.h +50 -2
  51. package/eigen/Eigen/src/Core/DiagonalProduct.h +1 -1
  52. package/eigen/Eigen/src/Core/Dot.h +10 -10
  53. package/eigen/Eigen/src/Core/EigenBase.h +10 -9
  54. package/eigen/Eigen/src/Core/ForceAlignedAccess.h +8 -4
  55. package/eigen/Eigen/src/Core/Fuzzy.h +3 -3
  56. package/eigen/Eigen/src/Core/GeneralProduct.h +20 -10
  57. package/eigen/Eigen/src/Core/GenericPacketMath.h +597 -147
  58. package/eigen/Eigen/src/Core/GlobalFunctions.h +40 -33
  59. package/eigen/Eigen/src/Core/IO.h +40 -7
  60. package/eigen/Eigen/src/Core/IndexedView.h +237 -0
  61. package/eigen/Eigen/src/Core/Inverse.h +9 -10
  62. package/eigen/Eigen/src/Core/Map.h +7 -7
  63. package/eigen/Eigen/src/Core/MapBase.h +5 -3
  64. package/eigen/Eigen/src/Core/MathFunctions.h +756 -120
  65. package/eigen/Eigen/src/Core/MathFunctionsImpl.h +118 -19
  66. package/eigen/Eigen/src/Core/Matrix.h +131 -25
  67. package/eigen/Eigen/src/Core/MatrixBase.h +19 -2
  68. package/eigen/Eigen/src/Core/NestByValue.h +25 -50
  69. package/eigen/Eigen/src/Core/NoAlias.h +4 -3
  70. package/eigen/Eigen/src/Core/NumTraits.h +107 -20
  71. package/eigen/Eigen/src/Core/PartialReduxEvaluator.h +232 -0
  72. package/eigen/Eigen/src/Core/PermutationMatrix.h +3 -3
  73. package/eigen/Eigen/src/Core/PlainObjectBase.h +145 -54
  74. package/eigen/Eigen/src/Core/Product.h +30 -25
  75. package/eigen/Eigen/src/Core/ProductEvaluators.h +183 -142
  76. package/eigen/Eigen/src/Core/Random.h +37 -1
  77. package/eigen/Eigen/src/Core/Redux.h +180 -170
  78. package/eigen/Eigen/src/Core/Ref.h +118 -21
  79. package/eigen/Eigen/src/Core/Replicate.h +8 -8
  80. package/eigen/Eigen/src/Core/Reshaped.h +454 -0
  81. package/eigen/Eigen/src/Core/ReturnByValue.h +7 -5
  82. package/eigen/Eigen/src/Core/Reverse.h +18 -12
  83. package/eigen/Eigen/src/Core/Select.h +8 -6
  84. package/eigen/Eigen/src/Core/SelfAdjointView.h +33 -20
  85. package/eigen/Eigen/src/Core/Solve.h +14 -14
  86. package/eigen/Eigen/src/Core/SolveTriangular.h +13 -13
  87. package/eigen/Eigen/src/Core/SolverBase.h +41 -3
  88. package/eigen/Eigen/src/Core/StableNorm.h +100 -70
  89. package/eigen/Eigen/src/Core/StlIterators.h +463 -0
  90. package/eigen/Eigen/src/Core/Stride.h +9 -4
  91. package/eigen/Eigen/src/Core/Swap.h +5 -4
  92. package/eigen/Eigen/src/Core/Transpose.h +86 -27
  93. package/eigen/Eigen/src/Core/Transpositions.h +26 -8
  94. package/eigen/Eigen/src/Core/TriangularMatrix.h +88 -72
  95. package/eigen/Eigen/src/Core/VectorBlock.h +5 -5
  96. package/eigen/Eigen/src/Core/VectorwiseOp.h +159 -70
  97. package/eigen/Eigen/src/Core/Visitor.h +137 -29
  98. package/eigen/Eigen/src/Core/arch/AVX/Complex.h +50 -129
  99. package/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +126 -337
  100. package/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +1092 -155
  101. package/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +65 -1
  102. package/eigen/Eigen/src/Core/arch/AVX512/Complex.h +422 -0
  103. package/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +186 -213
  104. package/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +1250 -252
  105. package/eigen/Eigen/src/Core/arch/AVX512/TypeCasting.h +89 -0
  106. package/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +152 -165
  107. package/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +19 -251
  108. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +2937 -0
  109. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +221 -0
  110. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +629 -0
  111. package/eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h +2042 -392
  112. package/eigen/Eigen/src/Core/arch/CUDA/Complex.h +235 -80
  113. package/eigen/Eigen/src/Core/arch/Default/BFloat16.h +700 -0
  114. package/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +102 -14
  115. package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +1649 -0
  116. package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +110 -0
  117. package/eigen/Eigen/src/Core/arch/Default/Half.h +942 -0
  118. package/eigen/Eigen/src/Core/arch/Default/Settings.h +1 -1
  119. package/eigen/Eigen/src/Core/arch/Default/TypeCasting.h +120 -0
  120. package/eigen/Eigen/src/Core/arch/{CUDA → GPU}/MathFunctions.h +16 -4
  121. package/eigen/Eigen/src/Core/arch/GPU/PacketMath.h +1685 -0
  122. package/eigen/Eigen/src/Core/arch/GPU/TypeCasting.h +80 -0
  123. package/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h +23 -0
  124. package/eigen/Eigen/src/Core/arch/MSA/Complex.h +648 -0
  125. package/eigen/Eigen/src/Core/arch/MSA/MathFunctions.h +387 -0
  126. package/eigen/Eigen/src/Core/arch/MSA/PacketMath.h +1233 -0
  127. package/eigen/Eigen/src/Core/arch/NEON/Complex.h +313 -219
  128. package/eigen/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +183 -0
  129. package/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +54 -70
  130. package/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +4376 -549
  131. package/eigen/Eigen/src/Core/arch/NEON/TypeCasting.h +1419 -0
  132. package/eigen/Eigen/src/Core/arch/SSE/Complex.h +59 -179
  133. package/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +65 -428
  134. package/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +893 -283
  135. package/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +65 -0
  136. package/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h +44 -0
  137. package/eigen/Eigen/src/Core/arch/SVE/PacketMath.h +752 -0
  138. package/eigen/Eigen/src/Core/arch/SVE/TypeCasting.h +49 -0
  139. package/eigen/Eigen/src/Core/arch/SYCL/InteropHeaders.h +232 -0
  140. package/eigen/Eigen/src/Core/arch/SYCL/MathFunctions.h +301 -0
  141. package/eigen/Eigen/src/Core/arch/SYCL/PacketMath.h +670 -0
  142. package/eigen/Eigen/src/Core/arch/SYCL/SyclMemoryModel.h +694 -0
  143. package/eigen/Eigen/src/Core/arch/SYCL/TypeCasting.h +85 -0
  144. package/eigen/Eigen/src/Core/arch/ZVector/Complex.h +212 -183
  145. package/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +101 -5
  146. package/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +510 -395
  147. package/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +11 -2
  148. package/eigen/Eigen/src/Core/functors/BinaryFunctors.h +112 -46
  149. package/eigen/Eigen/src/Core/functors/NullaryFunctors.h +31 -30
  150. package/eigen/Eigen/src/Core/functors/StlFunctors.h +32 -2
  151. package/eigen/Eigen/src/Core/functors/UnaryFunctors.h +354 -15
  152. package/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +1073 -585
  153. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +29 -7
  154. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +4 -4
  155. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +1 -1
  156. package/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +382 -483
  157. package/eigen/Eigen/src/Core/products/Parallelizer.h +23 -9
  158. package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +23 -6
  159. package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +8 -6
  160. package/eigen/Eigen/src/Core/products/SelfadjointProduct.h +2 -2
  161. package/eigen/Eigen/src/Core/products/SelfadjointRank2Update.h +5 -4
  162. package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix.h +3 -3
  163. package/eigen/Eigen/src/Core/products/TriangularSolverMatrix.h +5 -3
  164. package/eigen/Eigen/src/Core/products/TriangularSolverVector.h +13 -10
  165. package/eigen/Eigen/src/Core/util/BlasUtil.h +208 -124
  166. package/eigen/Eigen/src/Core/util/ConfigureVectorization.h +512 -0
  167. package/eigen/Eigen/src/Core/util/Constants.h +25 -9
  168. package/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +14 -2
  169. package/eigen/Eigen/src/Core/util/ForwardDeclarations.h +28 -4
  170. package/eigen/Eigen/src/Core/util/IndexedViewHelper.h +186 -0
  171. package/eigen/Eigen/src/Core/util/IntegralConstant.h +272 -0
  172. package/eigen/Eigen/src/Core/util/MKL_support.h +8 -1
  173. package/eigen/Eigen/src/Core/util/Macros.h +661 -250
  174. package/eigen/Eigen/src/Core/util/Memory.h +222 -52
  175. package/eigen/Eigen/src/Core/util/Meta.h +349 -105
  176. package/eigen/Eigen/src/Core/util/ReshapedHelper.h +51 -0
  177. package/eigen/Eigen/src/Core/util/StaticAssert.h +8 -5
  178. package/eigen/Eigen/src/Core/util/SymbolicIndex.h +293 -0
  179. package/eigen/Eigen/src/Core/util/XprHelper.h +48 -30
  180. package/eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h +1 -1
  181. package/eigen/Eigen/src/Eigenvalues/ComplexSchur.h +1 -1
  182. package/eigen/Eigen/src/Eigenvalues/EigenSolver.h +2 -2
  183. package/eigen/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +1 -1
  184. package/eigen/Eigen/src/Eigenvalues/HessenbergDecomposition.h +2 -2
  185. package/eigen/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +2 -2
  186. package/eigen/Eigen/src/Eigenvalues/RealQZ.h +9 -6
  187. package/eigen/Eigen/src/Eigenvalues/RealSchur.h +10 -5
  188. package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +75 -42
  189. package/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +20 -15
  190. package/eigen/Eigen/src/Geometry/AlignedBox.h +99 -5
  191. package/eigen/Eigen/src/Geometry/AngleAxis.h +4 -4
  192. package/eigen/Eigen/src/Geometry/EulerAngles.h +3 -3
  193. package/eigen/Eigen/src/Geometry/Homogeneous.h +15 -11
  194. package/eigen/Eigen/src/Geometry/Hyperplane.h +1 -1
  195. package/eigen/Eigen/src/Geometry/OrthoMethods.h +3 -2
  196. package/eigen/Eigen/src/Geometry/ParametrizedLine.h +39 -2
  197. package/eigen/Eigen/src/Geometry/Quaternion.h +52 -14
  198. package/eigen/Eigen/src/Geometry/Rotation2D.h +3 -3
  199. package/eigen/Eigen/src/Geometry/Scaling.h +22 -4
  200. package/eigen/Eigen/src/Geometry/Transform.h +86 -65
  201. package/eigen/Eigen/src/Geometry/Translation.h +6 -6
  202. package/eigen/Eigen/src/Geometry/arch/Geometry_SIMD.h +168 -0
  203. package/eigen/Eigen/src/Householder/BlockHouseholder.h +9 -2
  204. package/eigen/Eigen/src/Householder/Householder.h +8 -4
  205. package/eigen/Eigen/src/Householder/HouseholderSequence.h +123 -48
  206. package/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +15 -15
  207. package/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +7 -23
  208. package/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +5 -22
  209. package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +41 -47
  210. package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +51 -60
  211. package/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +70 -20
  212. package/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +2 -20
  213. package/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +11 -9
  214. package/eigen/Eigen/src/Jacobi/Jacobi.h +31 -10
  215. package/eigen/Eigen/src/KLUSupport/KLUSupport.h +358 -0
  216. package/eigen/Eigen/src/LU/Determinant.h +35 -19
  217. package/eigen/Eigen/src/LU/FullPivLU.h +29 -43
  218. package/eigen/Eigen/src/LU/InverseImpl.h +25 -8
  219. package/eigen/Eigen/src/LU/PartialPivLU.h +67 -57
  220. package/eigen/Eigen/src/LU/arch/InverseSize4.h +351 -0
  221. package/eigen/Eigen/src/OrderingMethods/Amd.h +7 -17
  222. package/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +297 -277
  223. package/eigen/Eigen/src/OrderingMethods/Ordering.h +6 -10
  224. package/eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h +1 -1
  225. package/eigen/Eigen/src/PardisoSupport/PardisoSupport.h +10 -9
  226. package/eigen/Eigen/src/QR/ColPivHouseholderQR.h +41 -20
  227. package/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +100 -27
  228. package/eigen/Eigen/src/QR/FullPivHouseholderQR.h +59 -22
  229. package/eigen/Eigen/src/QR/HouseholderQR.h +48 -23
  230. package/eigen/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +25 -3
  231. package/eigen/Eigen/src/SVD/BDCSVD.h +137 -48
  232. package/eigen/Eigen/src/SVD/JacobiSVD.h +22 -14
  233. package/eigen/Eigen/src/SVD/SVDBase.h +82 -21
  234. package/eigen/Eigen/src/SVD/UpperBidiagonalization.h +3 -3
  235. package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +16 -8
  236. package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +11 -36
  237. package/eigen/Eigen/src/SparseCore/CompressedStorage.h +16 -0
  238. package/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +6 -6
  239. package/eigen/Eigen/src/SparseCore/SparseAssign.h +81 -27
  240. package/eigen/Eigen/src/SparseCore/SparseBlock.h +25 -57
  241. package/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +40 -11
  242. package/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +11 -15
  243. package/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +2 -2
  244. package/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +30 -8
  245. package/eigen/Eigen/src/SparseCore/SparseMatrix.h +124 -10
  246. package/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +5 -12
  247. package/eigen/Eigen/src/SparseCore/SparseProduct.h +13 -1
  248. package/eigen/Eigen/src/SparseCore/SparseRef.h +7 -7
  249. package/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h +3 -0
  250. package/eigen/Eigen/src/SparseCore/SparseUtil.h +8 -0
  251. package/eigen/Eigen/src/SparseCore/SparseVector.h +1 -1
  252. package/eigen/Eigen/src/SparseLU/SparseLU.h +160 -10
  253. package/eigen/Eigen/src/SparseLU/SparseLU_Memory.h +1 -1
  254. package/eigen/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +76 -2
  255. package/eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h +2 -2
  256. package/eigen/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +1 -1
  257. package/eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h +1 -1
  258. package/eigen/Eigen/src/SparseQR/SparseQR.h +19 -6
  259. package/eigen/Eigen/src/StlSupport/StdDeque.h +2 -14
  260. package/eigen/Eigen/src/StlSupport/StdList.h +2 -2
  261. package/eigen/Eigen/src/StlSupport/StdVector.h +2 -2
  262. package/eigen/Eigen/src/SuperLUSupport/SuperLUSupport.h +6 -8
  263. package/eigen/Eigen/src/UmfPackSupport/UmfPackSupport.h +175 -39
  264. package/eigen/Eigen/src/misc/lapacke.h +5 -4
  265. package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.h +27 -1
  266. package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h +155 -11
  267. package/eigen/Eigen/src/plugins/BlockMethods.h +626 -242
  268. package/eigen/Eigen/src/plugins/CommonCwiseUnaryOps.h +14 -0
  269. package/eigen/Eigen/src/plugins/IndexedViewMethods.h +262 -0
  270. package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h +4 -4
  271. package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h +10 -0
  272. package/eigen/Eigen/src/plugins/ReshapedMethods.h +149 -0
  273. package/eigen/README.md +5 -0
  274. package/lib/LibEigen.d.ts +4 -0
  275. package/lib/LibEigen.js +14 -0
  276. package/lib/index.d.ts +1 -1
  277. package/lib/index.js +7 -3
  278. package/package.json +2 -10
  279. package/eigen/Eigen/CMakeLists.txt +0 -19
  280. package/eigen/Eigen/src/Core/arch/CUDA/Half.h +0 -675
  281. package/eigen/Eigen/src/Core/arch/CUDA/PacketMath.h +0 -333
  282. package/eigen/Eigen/src/Core/arch/CUDA/PacketMathHalf.h +0 -1124
  283. package/eigen/Eigen/src/Core/arch/CUDA/TypeCasting.h +0 -212
  284. package/eigen/Eigen/src/Geometry/arch/Geometry_SSE.h +0 -161
  285. package/eigen/Eigen/src/LU/arch/Inverse_SSE.h +0 -338
  286. package/lib/eigen.d.ts +0 -2
  287. package/lib/eigen.js +0 -15
@@ -112,12 +112,12 @@ public:
112
112
  ColsAtCompileTime = MatrixType::ColsAtCompileTime,
113
113
  MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
114
114
  MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime,
115
- TrOptions = RowsAtCompileTime==1 ? (MatrixType::Options & ~(RowMajor))
116
- : ColsAtCompileTime==1 ? (MatrixType::Options | RowMajor)
117
- : MatrixType::Options
115
+ Options = MatrixType::Options
118
116
  };
119
- typedef Matrix<Scalar, ColsAtCompileTime, RowsAtCompileTime, TrOptions, MaxColsAtCompileTime, MaxRowsAtCompileTime>
120
- TransposeTypeWithSameStorageOrder;
117
+
118
+ typedef typename internal::make_proper_matrix_type<
119
+ Scalar, ColsAtCompileTime, RowsAtCompileTime, Options, MaxColsAtCompileTime, MaxRowsAtCompileTime
120
+ >::type TransposeTypeWithSameStorageOrder;
121
121
 
122
122
  void allocate(const JacobiSVD<MatrixType, FullPivHouseholderQRPreconditioner>& svd)
123
123
  {
@@ -202,13 +202,12 @@ public:
202
202
  ColsAtCompileTime = MatrixType::ColsAtCompileTime,
203
203
  MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
204
204
  MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime,
205
- TrOptions = RowsAtCompileTime==1 ? (MatrixType::Options & ~(RowMajor))
206
- : ColsAtCompileTime==1 ? (MatrixType::Options | RowMajor)
207
- : MatrixType::Options
205
+ Options = MatrixType::Options
208
206
  };
209
207
 
210
- typedef Matrix<Scalar, ColsAtCompileTime, RowsAtCompileTime, TrOptions, MaxColsAtCompileTime, MaxRowsAtCompileTime>
211
- TransposeTypeWithSameStorageOrder;
208
+ typedef typename internal::make_proper_matrix_type<
209
+ Scalar, ColsAtCompileTime, RowsAtCompileTime, Options, MaxColsAtCompileTime, MaxRowsAtCompileTime
210
+ >::type TransposeTypeWithSameStorageOrder;
212
211
 
213
212
  void allocate(const JacobiSVD<MatrixType, ColPivHouseholderQRPreconditioner>& svd)
214
213
  {
@@ -303,8 +302,9 @@ public:
303
302
  Options = MatrixType::Options
304
303
  };
305
304
 
306
- typedef Matrix<Scalar, ColsAtCompileTime, RowsAtCompileTime, Options, MaxColsAtCompileTime, MaxRowsAtCompileTime>
307
- TransposeTypeWithSameStorageOrder;
305
+ typedef typename internal::make_proper_matrix_type<
306
+ Scalar, ColsAtCompileTime, RowsAtCompileTime, Options, MaxColsAtCompileTime, MaxRowsAtCompileTime
307
+ >::type TransposeTypeWithSameStorageOrder;
308
308
 
309
309
  void allocate(const JacobiSVD<MatrixType, HouseholderQRPreconditioner>& svd)
310
310
  {
@@ -425,6 +425,7 @@ struct svd_precondition_2x2_block_to_be_real<MatrixType, QRPreconditioner, true>
425
425
 
426
426
  template<typename _MatrixType, int QRPreconditioner>
427
427
  struct traits<JacobiSVD<_MatrixType,QRPreconditioner> >
428
+ : traits<_MatrixType>
428
429
  {
429
430
  typedef _MatrixType MatrixType;
430
431
  };
@@ -584,6 +585,7 @@ template<typename _MatrixType, int QRPreconditioner> class JacobiSVD
584
585
  using Base::m_matrixU;
585
586
  using Base::m_matrixV;
586
587
  using Base::m_singularValues;
588
+ using Base::m_info;
587
589
  using Base::m_isInitialized;
588
590
  using Base::m_isAllocated;
589
591
  using Base::m_usePrescribedThreshold;
@@ -610,7 +612,7 @@ template<typename _MatrixType, int QRPreconditioner> class JacobiSVD
610
612
  };
611
613
 
612
614
  template<typename MatrixType, int QRPreconditioner>
613
- void JacobiSVD<MatrixType, QRPreconditioner>::allocate(Index rows, Index cols, unsigned int computationOptions)
615
+ void JacobiSVD<MatrixType, QRPreconditioner>::allocate(Eigen::Index rows, Eigen::Index cols, unsigned int computationOptions)
614
616
  {
615
617
  eigen_assert(rows >= 0 && cols >= 0);
616
618
 
@@ -624,6 +626,7 @@ void JacobiSVD<MatrixType, QRPreconditioner>::allocate(Index rows, Index cols, u
624
626
 
625
627
  m_rows = rows;
626
628
  m_cols = cols;
629
+ m_info = Success;
627
630
  m_isInitialized = false;
628
631
  m_isAllocated = true;
629
632
  m_computationOptions = computationOptions;
@@ -673,7 +676,12 @@ JacobiSVD<MatrixType, QRPreconditioner>::compute(const MatrixType& matrix, unsig
673
676
  const RealScalar considerAsZero = (std::numeric_limits<RealScalar>::min)();
674
677
 
675
678
  // Scaling factor to reduce over/under-flows
676
- RealScalar scale = matrix.cwiseAbs().maxCoeff();
679
+ RealScalar scale = matrix.cwiseAbs().template maxCoeff<PropagateNaN>();
680
+ if (!(numext::isfinite)(scale)) {
681
+ m_isInitialized = true;
682
+ m_info = InvalidInput;
683
+ return *this;
684
+ }
677
685
  if(scale==RealScalar(0)) scale = RealScalar(1);
678
686
 
679
687
  /*** step 1. The R-SVD step: we use a QR decomposition to reduce to the case of a square matrix */
@@ -17,6 +17,18 @@
17
17
  #define EIGEN_SVDBASE_H
18
18
 
19
19
  namespace Eigen {
20
+
21
+ namespace internal {
22
+ template<typename Derived> struct traits<SVDBase<Derived> >
23
+ : traits<Derived>
24
+ {
25
+ typedef MatrixXpr XprKind;
26
+ typedef SolverStorage StorageKind;
27
+ typedef int StorageIndex;
28
+ enum { Flags = 0 };
29
+ };
30
+ }
31
+
20
32
  /** \ingroup SVD_Module
21
33
  *
22
34
  *
@@ -39,20 +51,26 @@ namespace Eigen {
39
51
  * smaller value among \a n and \a p, there are only \a m singular vectors; the remaining columns of \a U and \a V do not correspond to actual
40
52
  * singular vectors. Asking for \em thin \a U or \a V means asking for only their \a m first columns to be formed. So \a U is then a n-by-m matrix,
41
53
  * and \a V is then a p-by-m matrix. Notice that thin \a U and \a V are all you need for (least squares) solving.
54
+ *
55
+ * The status of the computation can be retrived using the \a info() method. Unless \a info() returns \a Success, the results should be not
56
+ * considered well defined.
42
57
  *
43
- * If the input matrix has inf or nan coefficients, the result of the computation is undefined, but the computation is guaranteed to
58
+ * If the input matrix has inf or nan coefficients, the result of the computation is undefined, and \a info() will return \a InvalidInput, but the computation is guaranteed to
44
59
  * terminate in finite (and reasonable) time.
45
60
  * \sa class BDCSVD, class JacobiSVD
46
61
  */
47
- template<typename Derived>
48
- class SVDBase
62
+ template<typename Derived> class SVDBase
63
+ : public SolverBase<SVDBase<Derived> >
49
64
  {
65
+ public:
66
+
67
+ template<typename Derived_>
68
+ friend struct internal::solve_assertion;
50
69
 
51
- public:
52
70
  typedef typename internal::traits<Derived>::MatrixType MatrixType;
53
71
  typedef typename MatrixType::Scalar Scalar;
54
72
  typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar;
55
- typedef typename MatrixType::StorageIndex StorageIndex;
73
+ typedef typename Eigen::internal::traits<SVDBase>::StorageIndex StorageIndex;
56
74
  typedef Eigen::Index Index; ///< \deprecated since Eigen 3.3
57
75
  enum {
58
76
  RowsAtCompileTime = MatrixType::RowsAtCompileTime,
@@ -82,7 +100,7 @@ public:
82
100
  */
83
101
  const MatrixUType& matrixU() const
84
102
  {
85
- eigen_assert(m_isInitialized && "SVD is not initialized.");
103
+ _check_compute_assertions();
86
104
  eigen_assert(computeU() && "This SVD decomposition didn't compute U. Did you ask for it?");
87
105
  return m_matrixU;
88
106
  }
@@ -98,7 +116,7 @@ public:
98
116
  */
99
117
  const MatrixVType& matrixV() const
100
118
  {
101
- eigen_assert(m_isInitialized && "SVD is not initialized.");
119
+ _check_compute_assertions();
102
120
  eigen_assert(computeV() && "This SVD decomposition didn't compute V. Did you ask for it?");
103
121
  return m_matrixV;
104
122
  }
@@ -110,14 +128,14 @@ public:
110
128
  */
111
129
  const SingularValuesType& singularValues() const
112
130
  {
113
- eigen_assert(m_isInitialized && "SVD is not initialized.");
131
+ _check_compute_assertions();
114
132
  return m_singularValues;
115
133
  }
116
134
 
117
135
  /** \returns the number of singular values that are not exactly 0 */
118
136
  Index nonzeroSingularValues() const
119
137
  {
120
- eigen_assert(m_isInitialized && "SVD is not initialized.");
138
+ _check_compute_assertions();
121
139
  return m_nonzeroSingularValues;
122
140
  }
123
141
 
@@ -130,7 +148,7 @@ public:
130
148
  inline Index rank() const
131
149
  {
132
150
  using std::abs;
133
- eigen_assert(m_isInitialized && "JacobiSVD is not initialized.");
151
+ _check_compute_assertions();
134
152
  if(m_singularValues.size()==0) return 0;
135
153
  RealScalar premultiplied_threshold = numext::maxi<RealScalar>(m_singularValues.coeff(0) * threshold(), (std::numeric_limits<RealScalar>::min)());
136
154
  Index i = m_nonzeroSingularValues-1;
@@ -194,6 +212,7 @@ public:
194
212
  inline Index rows() const { return m_rows; }
195
213
  inline Index cols() const { return m_cols; }
196
214
 
215
+ #ifdef EIGEN_PARSED_BY_DOXYGEN
197
216
  /** \returns a (least squares) solution of \f$ A x = b \f$ using the current SVD decomposition of A.
198
217
  *
199
218
  * \param b the right-hand-side of the equation to solve.
@@ -205,32 +224,55 @@ public:
205
224
  */
206
225
  template<typename Rhs>
207
226
  inline const Solve<Derived, Rhs>
208
- solve(const MatrixBase<Rhs>& b) const
227
+ solve(const MatrixBase<Rhs>& b) const;
228
+ #endif
229
+
230
+
231
+ /** \brief Reports whether previous computation was successful.
232
+ *
233
+ * \returns \c Success if computation was successful.
234
+ */
235
+ EIGEN_DEVICE_FUNC
236
+ ComputationInfo info() const
209
237
  {
210
238
  eigen_assert(m_isInitialized && "SVD is not initialized.");
211
- eigen_assert(computeU() && computeV() && "SVD::solve() requires both unitaries U and V to be computed (thin unitaries suffice).");
212
- return Solve<Derived, Rhs>(derived(), b.derived());
239
+ return m_info;
213
240
  }
214
-
241
+
215
242
  #ifndef EIGEN_PARSED_BY_DOXYGEN
216
243
  template<typename RhsType, typename DstType>
217
- EIGEN_DEVICE_FUNC
218
244
  void _solve_impl(const RhsType &rhs, DstType &dst) const;
245
+
246
+ template<bool Conjugate, typename RhsType, typename DstType>
247
+ void _solve_impl_transposed(const RhsType &rhs, DstType &dst) const;
219
248
  #endif
220
249
 
221
250
  protected:
222
-
251
+
223
252
  static void check_template_parameters()
224
253
  {
225
254
  EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar);
226
255
  }
227
-
256
+
257
+ void _check_compute_assertions() const {
258
+ eigen_assert(m_isInitialized && "SVD is not initialized.");
259
+ }
260
+
261
+ template<bool Transpose_, typename Rhs>
262
+ void _check_solve_assertion(const Rhs& b) const {
263
+ EIGEN_ONLY_USED_FOR_DEBUG(b);
264
+ _check_compute_assertions();
265
+ eigen_assert(computeU() && computeV() && "SVDBase::solve(): Both unitaries U and V are required to be computed (thin unitaries suffice).");
266
+ eigen_assert((Transpose_?cols():rows())==b.rows() && "SVDBase::solve(): invalid number of rows of the right hand side matrix b");
267
+ }
268
+
228
269
  // return true if already allocated
229
270
  bool allocate(Index rows, Index cols, unsigned int computationOptions) ;
230
271
 
231
272
  MatrixUType m_matrixU;
232
273
  MatrixVType m_matrixV;
233
274
  SingularValuesType m_singularValues;
275
+ ComputationInfo m_info;
234
276
  bool m_isInitialized, m_isAllocated, m_usePrescribedThreshold;
235
277
  bool m_computeFullU, m_computeThinU;
236
278
  bool m_computeFullV, m_computeThinV;
@@ -243,9 +285,14 @@ protected:
243
285
  * Default constructor of SVDBase
244
286
  */
245
287
  SVDBase()
246
- : m_isInitialized(false),
288
+ : m_info(Success),
289
+ m_isInitialized(false),
247
290
  m_isAllocated(false),
248
291
  m_usePrescribedThreshold(false),
292
+ m_computeFullU(false),
293
+ m_computeThinU(false),
294
+ m_computeFullV(false),
295
+ m_computeThinV(false),
249
296
  m_computationOptions(0),
250
297
  m_rows(-1), m_cols(-1), m_diagSize(0)
251
298
  {
@@ -260,17 +307,30 @@ template<typename Derived>
260
307
  template<typename RhsType, typename DstType>
261
308
  void SVDBase<Derived>::_solve_impl(const RhsType &rhs, DstType &dst) const
262
309
  {
263
- eigen_assert(rhs.rows() == rows());
264
-
265
310
  // A = U S V^*
266
311
  // So A^{-1} = V S^{-1} U^*
267
312
 
268
- Matrix<Scalar, Dynamic, RhsType::ColsAtCompileTime, 0, MatrixType::MaxRowsAtCompileTime, RhsType::MaxColsAtCompileTime> tmp;
313
+ Matrix<typename RhsType::Scalar, Dynamic, RhsType::ColsAtCompileTime, 0, MatrixType::MaxRowsAtCompileTime, RhsType::MaxColsAtCompileTime> tmp;
269
314
  Index l_rank = rank();
270
315
  tmp.noalias() = m_matrixU.leftCols(l_rank).adjoint() * rhs;
271
316
  tmp = m_singularValues.head(l_rank).asDiagonal().inverse() * tmp;
272
317
  dst = m_matrixV.leftCols(l_rank) * tmp;
273
318
  }
319
+
320
+ template<typename Derived>
321
+ template<bool Conjugate, typename RhsType, typename DstType>
322
+ void SVDBase<Derived>::_solve_impl_transposed(const RhsType &rhs, DstType &dst) const
323
+ {
324
+ // A = U S V^*
325
+ // So A^{-*} = U S^{-1} V^*
326
+ // And A^{-T} = U_conj S^{-1} V^T
327
+ Matrix<typename RhsType::Scalar, Dynamic, RhsType::ColsAtCompileTime, 0, MatrixType::MaxRowsAtCompileTime, RhsType::MaxColsAtCompileTime> tmp;
328
+ Index l_rank = rank();
329
+
330
+ tmp.noalias() = m_matrixV.leftCols(l_rank).transpose().template conjugateIf<Conjugate>() * rhs;
331
+ tmp = m_singularValues.head(l_rank).asDiagonal().inverse() * tmp;
332
+ dst = m_matrixU.template conjugateIf<!Conjugate>().leftCols(l_rank) * tmp;
333
+ }
274
334
  #endif
275
335
 
276
336
  template<typename MatrixType>
@@ -288,6 +348,7 @@ bool SVDBase<MatrixType>::allocate(Index rows, Index cols, unsigned int computat
288
348
 
289
349
  m_rows = rows;
290
350
  m_cols = cols;
351
+ m_info = Success;
291
352
  m_isInitialized = false;
292
353
  m_isAllocated = true;
293
354
  m_computationOptions = computationOptions;
@@ -127,7 +127,7 @@ void upperbidiagonalization_inplace_unblocked(MatrixType& mat,
127
127
  .makeHouseholderInPlace(mat.coeffRef(k,k+1), upper_diagonal[k]);
128
128
  // apply householder transform to remaining part of mat on the left
129
129
  mat.bottomRightCorner(remainingRows-1, remainingCols)
130
- .applyHouseholderOnTheRight(mat.row(k).tail(remainingCols-1).transpose(), mat.coeff(k,k+1), tempData);
130
+ .applyHouseholderOnTheRight(mat.row(k).tail(remainingCols-1).adjoint(), mat.coeff(k,k+1), tempData);
131
131
  }
132
132
  }
133
133
 
@@ -202,7 +202,7 @@ void upperbidiagonalization_blocked_helper(MatrixType& A,
202
202
  {
203
203
  SubColumnType y_k( Y.col(k).tail(remainingCols) );
204
204
 
205
- // let's use the begining of column k of Y as a temporary vector
205
+ // let's use the beginning of column k of Y as a temporary vector
206
206
  SubColumnType tmp( Y.col(k).head(k) );
207
207
  y_k.noalias() = A.block(k,k+1, remainingRows,remainingCols).adjoint() * v_k; // bottleneck
208
208
  tmp.noalias() = V_k1.adjoint() * v_k;
@@ -231,7 +231,7 @@ void upperbidiagonalization_blocked_helper(MatrixType& A,
231
231
  {
232
232
  SubColumnType x_k ( X.col(k).tail(remainingRows-1) );
233
233
 
234
- // let's use the begining of column k of X as a temporary vectors
234
+ // let's use the beginning of column k of X as a temporary vectors
235
235
  // note that tmp0 and tmp1 overlaps
236
236
  SubColumnType tmp0 ( X.col(k).head(k) ),
237
237
  tmp1 ( X.col(k).head(k+1) );
@@ -80,11 +80,19 @@ class SimplicialCholeskyBase : public SparseSolverBase<Derived>
80
80
 
81
81
  /** Default constructor */
82
82
  SimplicialCholeskyBase()
83
- : m_info(Success), m_shiftOffset(0), m_shiftScale(1)
83
+ : m_info(Success),
84
+ m_factorizationIsOk(false),
85
+ m_analysisIsOk(false),
86
+ m_shiftOffset(0),
87
+ m_shiftScale(1)
84
88
  {}
85
89
 
86
90
  explicit SimplicialCholeskyBase(const MatrixType& matrix)
87
- : m_info(Success), m_shiftOffset(0), m_shiftScale(1)
91
+ : m_info(Success),
92
+ m_factorizationIsOk(false),
93
+ m_analysisIsOk(false),
94
+ m_shiftOffset(0),
95
+ m_shiftScale(1)
88
96
  {
89
97
  derived().compute(matrix);
90
98
  }
@@ -101,7 +109,7 @@ class SimplicialCholeskyBase : public SparseSolverBase<Derived>
101
109
 
102
110
  /** \brief Reports whether previous computation was successful.
103
111
  *
104
- * \returns \c Success if computation was succesful,
112
+ * \returns \c Success if computation was successful,
105
113
  * \c NumericalIssue if the matrix.appears to be negative.
106
114
  */
107
115
  ComputationInfo info() const
@@ -210,7 +218,7 @@ class SimplicialCholeskyBase : public SparseSolverBase<Derived>
210
218
  CholMatrixType tmp(size,size);
211
219
  ConstCholMatrixPtr pmat;
212
220
 
213
- if(m_P.size()==0 && (UpLo&Upper)==Upper)
221
+ if(m_P.size() == 0 && (int(UpLo) & int(Upper)) == Upper)
214
222
  {
215
223
  // If there is no ordering, try to directly use the input matrix without any copy
216
224
  internal::simplicial_cholesky_grab_input<CholMatrixType,MatrixType>::run(a, pmat, tmp);
@@ -279,8 +287,8 @@ template<typename _MatrixType, int _UpLo, typename _Ordering> struct traits<Simp
279
287
  typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
280
288
  typedef TriangularView<const CholMatrixType, Eigen::Lower> MatrixL;
281
289
  typedef TriangularView<const typename CholMatrixType::AdjointReturnType, Eigen::Upper> MatrixU;
282
- static inline MatrixL getL(const MatrixType& m) { return MatrixL(m); }
283
- static inline MatrixU getU(const MatrixType& m) { return MatrixU(m.adjoint()); }
290
+ static inline MatrixL getL(const CholMatrixType& m) { return MatrixL(m); }
291
+ static inline MatrixU getU(const CholMatrixType& m) { return MatrixU(m.adjoint()); }
284
292
  };
285
293
 
286
294
  template<typename _MatrixType,int _UpLo, typename _Ordering> struct traits<SimplicialLDLT<_MatrixType,_UpLo,_Ordering> >
@@ -293,8 +301,8 @@ template<typename _MatrixType,int _UpLo, typename _Ordering> struct traits<Simpl
293
301
  typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
294
302
  typedef TriangularView<const CholMatrixType, Eigen::UnitLower> MatrixL;
295
303
  typedef TriangularView<const typename CholMatrixType::AdjointReturnType, Eigen::UnitUpper> MatrixU;
296
- static inline MatrixL getL(const MatrixType& m) { return MatrixL(m); }
297
- static inline MatrixU getU(const MatrixType& m) { return MatrixU(m.adjoint()); }
304
+ static inline MatrixL getL(const CholMatrixType& m) { return MatrixL(m); }
305
+ static inline MatrixU getU(const CholMatrixType& m) { return MatrixU(m.adjoint()); }
298
306
  };
299
307
 
300
308
  template<typename _MatrixType, int _UpLo, typename _Ordering> struct traits<SimplicialCholesky<_MatrixType,_UpLo,_Ordering> >
@@ -2,46 +2,21 @@
2
2
  // for linear algebra.
3
3
  //
4
4
  // Copyright (C) 2008-2012 Gael Guennebaud <gael.guennebaud@inria.fr>
5
+ //
6
+ // This Source Code Form is subject to the terms of the Mozilla
7
+ // Public License v. 2.0. If a copy of the MPL was not distributed
8
+ // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
9
 
6
10
  /*
7
-
8
- NOTE: thes functions vave been adapted from the LDL library:
11
+ NOTE: these functions have been adapted from the LDL library:
9
12
 
10
13
  LDL Copyright (c) 2005 by Timothy A. Davis. All Rights Reserved.
11
14
 
12
- LDL License:
13
-
14
- Your use or distribution of LDL or any modified version of
15
- LDL implies that you agree to this License.
16
-
17
- This library is free software; you can redistribute it and/or
18
- modify it under the terms of the GNU Lesser General Public
19
- License as published by the Free Software Foundation; either
20
- version 2.1 of the License, or (at your option) any later version.
21
-
22
- This library is distributed in the hope that it will be useful,
23
- but WITHOUT ANY WARRANTY; without even the implied warranty of
24
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25
- Lesser General Public License for more details.
26
-
27
- You should have received a copy of the GNU Lesser General Public
28
- License along with this library; if not, write to the Free Software
29
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
30
- USA
31
-
32
- Permission is hereby granted to use or copy this program under the
33
- terms of the GNU LGPL, provided that the Copyright, this License,
34
- and the Availability of the original version is retained on all copies.
35
- User documentation of any code that uses this code or any modified
36
- version of this code must cite the Copyright, this License, the
37
- Availability note, and "Used by permission." Permission to modify
38
- the code and to distribute modified code is granted, provided the
39
- Copyright, this License, and the Availability note are retained,
40
- and a notice that the code was modified is included.
15
+ The author of LDL, Timothy A. Davis., has executed a license with Google LLC
16
+ to permit distribution of this code and derivative works as part of Eigen under
17
+ the Mozilla Public License v. 2.0, as stated at the top of this file.
41
18
  */
42
19
 
43
- #include "../Core/util/NonMPL2.h"
44
-
45
20
  #ifndef EIGEN_SIMPLICIAL_CHOLESKY_IMPL_H
46
21
  #define EIGEN_SIMPLICIAL_CHOLESKY_IMPL_H
47
22
 
@@ -122,7 +97,7 @@ void SimplicialCholeskyBase<Derived>::factorize_preordered(const CholMatrixType&
122
97
  for(StorageIndex k = 0; k < size; ++k)
123
98
  {
124
99
  // compute nonzero pattern of kth row of L, in topological order
125
- y[k] = 0.0; // Y(0:k) is now all zero
100
+ y[k] = Scalar(0); // Y(0:k) is now all zero
126
101
  StorageIndex top = size; // stack for pattern is empty
127
102
  tags[k] = k; // mark node k as visited
128
103
  m_nonZerosPerCol[k] = 0; // count of nonzeros in column k of L
@@ -146,12 +121,12 @@ void SimplicialCholeskyBase<Derived>::factorize_preordered(const CholMatrixType&
146
121
  /* compute numerical values kth row of L (a sparse triangular solve) */
147
122
 
148
123
  RealScalar d = numext::real(y[k]) * m_shiftScale + m_shiftOffset; // get D(k,k), apply the shift function, and clear Y(k)
149
- y[k] = 0.0;
124
+ y[k] = Scalar(0);
150
125
  for(; top < size; ++top)
151
126
  {
152
127
  Index i = pattern[top]; /* pattern[top:n-1] is pattern of L(:,k) */
153
128
  Scalar yi = y[i]; /* get and clear Y(i) */
154
- y[i] = 0.0;
129
+ y[i] = Scalar(0);
155
130
 
156
131
  /* the nonzero entry L(k,i) */
157
132
  Scalar l_ki;
@@ -207,6 +207,22 @@ class CompressedStorage
207
207
  return m_values[id];
208
208
  }
209
209
 
210
+ void moveChunk(Index from, Index to, Index chunkSize)
211
+ {
212
+ eigen_internal_assert(to+chunkSize <= m_size);
213
+ if(to>from && from+chunkSize>to)
214
+ {
215
+ // move backward
216
+ internal::smart_memmove(m_values+from, m_values+from+chunkSize, m_values+to);
217
+ internal::smart_memmove(m_indices+from, m_indices+from+chunkSize, m_indices+to);
218
+ }
219
+ else
220
+ {
221
+ internal::smart_copy(m_values+from, m_values+from+chunkSize, m_values+to);
222
+ internal::smart_copy(m_indices+from, m_indices+from+chunkSize, m_indices+to);
223
+ }
224
+ }
225
+
210
226
  void prune(const Scalar& reference, const RealScalar& epsilon = NumTraits<RealScalar>::dummy_precision())
211
227
  {
212
228
  Index k = 0;
@@ -10,7 +10,7 @@
10
10
  #ifndef EIGEN_CONSERVATIVESPARSESPARSEPRODUCT_H
11
11
  #define EIGEN_CONSERVATIVESPARSESPARSEPRODUCT_H
12
12
 
13
- namespace Eigen {
13
+ namespace Eigen {
14
14
 
15
15
  namespace internal {
16
16
 
@@ -25,16 +25,16 @@ static void conservative_sparse_sparse_product_impl(const Lhs& lhs, const Rhs& r
25
25
  Index rows = lhs.innerSize();
26
26
  Index cols = rhs.outerSize();
27
27
  eigen_assert(lhs.outerSize() == rhs.innerSize());
28
-
28
+
29
29
  ei_declare_aligned_stack_constructed_variable(bool, mask, rows, 0);
30
30
  ei_declare_aligned_stack_constructed_variable(ResScalar, values, rows, 0);
31
31
  ei_declare_aligned_stack_constructed_variable(Index, indices, rows, 0);
32
-
32
+
33
33
  std::memset(mask,0,sizeof(bool)*rows);
34
34
 
35
35
  evaluator<Lhs> lhsEval(lhs);
36
36
  evaluator<Rhs> rhsEval(rhs);
37
-
37
+
38
38
  // estimate the number of non zero entries
39
39
  // given a rhs column containing Y non zeros, we assume that the respective Y columns
40
40
  // of the lhs differs in average of one non zeros, thus the number of non zeros for
@@ -141,7 +141,7 @@ struct conservative_sparse_sparse_product_selector<Lhs,Rhs,ResultType,ColMajor,C
141
141
  typedef SparseMatrix<typename ResultType::Scalar,RowMajor,typename ResultType::StorageIndex> RowMajorMatrix;
142
142
  typedef SparseMatrix<typename ResultType::Scalar,ColMajor,typename ResultType::StorageIndex> ColMajorMatrixAux;
143
143
  typedef typename sparse_eval<ColMajorMatrixAux,ResultType::RowsAtCompileTime,ResultType::ColsAtCompileTime,ColMajorMatrixAux::Flags>::type ColMajorMatrix;
144
-
144
+
145
145
  // If the result is tall and thin (in the extreme case a column vector)
146
146
  // then it is faster to sort the coefficients inplace instead of transposing twice.
147
147
  // FIXME, the following heuristic is probably not very good.
@@ -155,7 +155,7 @@ struct conservative_sparse_sparse_product_selector<Lhs,Rhs,ResultType,ColMajor,C
155
155
  else
156
156
  {
157
157
  ColMajorMatrixAux resCol(lhs.rows(),rhs.cols());
158
- // ressort to transpose to sort the entries
158
+ // resort to transpose to sort the entries
159
159
  internal::conservative_sparse_sparse_product_impl<Lhs,Rhs,ColMajorMatrixAux>(lhs, rhs, resCol, false);
160
160
  RowMajorMatrix resRow(resCol);
161
161
  res = resRow.markAsRValue();