ruby-eigen 0.0.9 → 0.0.10.pre1

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 (293) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +22 -0
  3. data/README.md +21 -0
  4. data/ext/eigen/eigen3/COPYING.BSD +26 -0
  5. data/ext/eigen/eigen3/COPYING.MPL2 +373 -0
  6. data/ext/eigen/eigen3/COPYING.README +18 -0
  7. data/ext/eigen/eigen3/Eigen/Array +11 -0
  8. data/ext/eigen/eigen3/Eigen/Cholesky +32 -0
  9. data/ext/eigen/eigen3/Eigen/CholmodSupport +45 -0
  10. data/ext/eigen/eigen3/Eigen/Core +376 -0
  11. data/ext/eigen/eigen3/Eigen/Dense +7 -0
  12. data/ext/eigen/eigen3/Eigen/Eigen +2 -0
  13. data/ext/eigen/eigen3/Eigen/Eigen2Support +95 -0
  14. data/ext/eigen/eigen3/Eigen/Eigenvalues +48 -0
  15. data/ext/eigen/eigen3/Eigen/Geometry +63 -0
  16. data/ext/eigen/eigen3/Eigen/Householder +23 -0
  17. data/ext/eigen/eigen3/Eigen/IterativeLinearSolvers +40 -0
  18. data/ext/eigen/eigen3/Eigen/Jacobi +26 -0
  19. data/ext/eigen/eigen3/Eigen/LU +41 -0
  20. data/ext/eigen/eigen3/Eigen/LeastSquares +32 -0
  21. data/ext/eigen/eigen3/Eigen/MetisSupport +28 -0
  22. data/ext/eigen/eigen3/Eigen/PaStiXSupport +46 -0
  23. data/ext/eigen/eigen3/Eigen/PardisoSupport +30 -0
  24. data/ext/eigen/eigen3/Eigen/QR +45 -0
  25. data/ext/eigen/eigen3/Eigen/QtAlignedMalloc +34 -0
  26. data/ext/eigen/eigen3/Eigen/SPQRSupport +29 -0
  27. data/ext/eigen/eigen3/Eigen/SVD +37 -0
  28. data/ext/eigen/eigen3/Eigen/Sparse +27 -0
  29. data/ext/eigen/eigen3/Eigen/SparseCore +64 -0
  30. data/ext/eigen/eigen3/Eigen/SparseLU +49 -0
  31. data/ext/eigen/eigen3/Eigen/SparseQR +33 -0
  32. data/ext/eigen/eigen3/Eigen/StdDeque +27 -0
  33. data/ext/eigen/eigen3/Eigen/StdList +26 -0
  34. data/ext/eigen/eigen3/Eigen/StdVector +27 -0
  35. data/ext/eigen/eigen3/Eigen/SuperLUSupport +59 -0
  36. data/ext/eigen/eigen3/Eigen/UmfPackSupport +36 -0
  37. data/ext/eigen/eigen3/Eigen/src/Cholesky/LDLT.h +611 -0
  38. data/ext/eigen/eigen3/Eigen/src/Cholesky/LLT.h +498 -0
  39. data/ext/eigen/eigen3/Eigen/src/Cholesky/LLT_MKL.h +102 -0
  40. data/ext/eigen/eigen3/Eigen/src/CholmodSupport/CholmodSupport.h +607 -0
  41. data/ext/eigen/eigen3/Eigen/src/Core/Array.h +323 -0
  42. data/ext/eigen/eigen3/Eigen/src/Core/ArrayBase.h +226 -0
  43. data/ext/eigen/eigen3/Eigen/src/Core/ArrayWrapper.h +264 -0
  44. data/ext/eigen/eigen3/Eigen/src/Core/Assign.h +590 -0
  45. data/ext/eigen/eigen3/Eigen/src/Core/Assign_MKL.h +224 -0
  46. data/ext/eigen/eigen3/Eigen/src/Core/BandMatrix.h +334 -0
  47. data/ext/eigen/eigen3/Eigen/src/Core/Block.h +406 -0
  48. data/ext/eigen/eigen3/Eigen/src/Core/BooleanRedux.h +154 -0
  49. data/ext/eigen/eigen3/Eigen/src/Core/CommaInitializer.h +154 -0
  50. data/ext/eigen/eigen3/Eigen/src/Core/CoreIterators.h +61 -0
  51. data/ext/eigen/eigen3/Eigen/src/Core/CwiseBinaryOp.h +230 -0
  52. data/ext/eigen/eigen3/Eigen/src/Core/CwiseNullaryOp.h +864 -0
  53. data/ext/eigen/eigen3/Eigen/src/Core/CwiseUnaryOp.h +126 -0
  54. data/ext/eigen/eigen3/Eigen/src/Core/CwiseUnaryView.h +139 -0
  55. data/ext/eigen/eigen3/Eigen/src/Core/DenseBase.h +521 -0
  56. data/ext/eigen/eigen3/Eigen/src/Core/DenseCoeffsBase.h +754 -0
  57. data/ext/eigen/eigen3/Eigen/src/Core/DenseStorage.h +434 -0
  58. data/ext/eigen/eigen3/Eigen/src/Core/Diagonal.h +237 -0
  59. data/ext/eigen/eigen3/Eigen/src/Core/DiagonalMatrix.h +313 -0
  60. data/ext/eigen/eigen3/Eigen/src/Core/DiagonalProduct.h +131 -0
  61. data/ext/eigen/eigen3/Eigen/src/Core/Dot.h +263 -0
  62. data/ext/eigen/eigen3/Eigen/src/Core/EigenBase.h +131 -0
  63. data/ext/eigen/eigen3/Eigen/src/Core/Flagged.h +140 -0
  64. data/ext/eigen/eigen3/Eigen/src/Core/ForceAlignedAccess.h +146 -0
  65. data/ext/eigen/eigen3/Eigen/src/Core/Functors.h +1026 -0
  66. data/ext/eigen/eigen3/Eigen/src/Core/Fuzzy.h +150 -0
  67. data/ext/eigen/eigen3/Eigen/src/Core/GeneralProduct.h +635 -0
  68. data/ext/eigen/eigen3/Eigen/src/Core/GenericPacketMath.h +350 -0
  69. data/ext/eigen/eigen3/Eigen/src/Core/GlobalFunctions.h +92 -0
  70. data/ext/eigen/eigen3/Eigen/src/Core/IO.h +250 -0
  71. data/ext/eigen/eigen3/Eigen/src/Core/Map.h +192 -0
  72. data/ext/eigen/eigen3/Eigen/src/Core/MapBase.h +247 -0
  73. data/ext/eigen/eigen3/Eigen/src/Core/MathFunctions.h +768 -0
  74. data/ext/eigen/eigen3/Eigen/src/Core/Matrix.h +420 -0
  75. data/ext/eigen/eigen3/Eigen/src/Core/MatrixBase.h +563 -0
  76. data/ext/eigen/eigen3/Eigen/src/Core/NestByValue.h +111 -0
  77. data/ext/eigen/eigen3/Eigen/src/Core/NoAlias.h +134 -0
  78. data/ext/eigen/eigen3/Eigen/src/Core/NumTraits.h +150 -0
  79. data/ext/eigen/eigen3/Eigen/src/Core/PermutationMatrix.h +721 -0
  80. data/ext/eigen/eigen3/Eigen/src/Core/PlainObjectBase.h +822 -0
  81. data/ext/eigen/eigen3/Eigen/src/Core/ProductBase.h +290 -0
  82. data/ext/eigen/eigen3/Eigen/src/Core/Random.h +152 -0
  83. data/ext/eigen/eigen3/Eigen/src/Core/Redux.h +409 -0
  84. data/ext/eigen/eigen3/Eigen/src/Core/Ref.h +278 -0
  85. data/ext/eigen/eigen3/Eigen/src/Core/Replicate.h +177 -0
  86. data/ext/eigen/eigen3/Eigen/src/Core/ReturnByValue.h +99 -0
  87. data/ext/eigen/eigen3/Eigen/src/Core/Reverse.h +224 -0
  88. data/ext/eigen/eigen3/Eigen/src/Core/Select.h +162 -0
  89. data/ext/eigen/eigen3/Eigen/src/Core/SelfAdjointView.h +314 -0
  90. data/ext/eigen/eigen3/Eigen/src/Core/SelfCwiseBinaryOp.h +191 -0
  91. data/ext/eigen/eigen3/Eigen/src/Core/SolveTriangular.h +260 -0
  92. data/ext/eigen/eigen3/Eigen/src/Core/StableNorm.h +203 -0
  93. data/ext/eigen/eigen3/Eigen/src/Core/Stride.h +108 -0
  94. data/ext/eigen/eigen3/Eigen/src/Core/Swap.h +126 -0
  95. data/ext/eigen/eigen3/Eigen/src/Core/Transpose.h +419 -0
  96. data/ext/eigen/eigen3/Eigen/src/Core/Transpositions.h +436 -0
  97. data/ext/eigen/eigen3/Eigen/src/Core/TriangularMatrix.h +839 -0
  98. data/ext/eigen/eigen3/Eigen/src/Core/VectorBlock.h +95 -0
  99. data/ext/eigen/eigen3/Eigen/src/Core/VectorwiseOp.h +642 -0
  100. data/ext/eigen/eigen3/Eigen/src/Core/Visitor.h +237 -0
  101. data/ext/eigen/eigen3/Eigen/src/Core/arch/AltiVec/Complex.h +217 -0
  102. data/ext/eigen/eigen3/Eigen/src/Core/arch/AltiVec/PacketMath.h +501 -0
  103. data/ext/eigen/eigen3/Eigen/src/Core/arch/Default/Settings.h +49 -0
  104. data/ext/eigen/eigen3/Eigen/src/Core/arch/NEON/Complex.h +253 -0
  105. data/ext/eigen/eigen3/Eigen/src/Core/arch/NEON/PacketMath.h +420 -0
  106. data/ext/eigen/eigen3/Eigen/src/Core/arch/SSE/Complex.h +442 -0
  107. data/ext/eigen/eigen3/Eigen/src/Core/arch/SSE/MathFunctions.h +475 -0
  108. data/ext/eigen/eigen3/Eigen/src/Core/arch/SSE/PacketMath.h +649 -0
  109. data/ext/eigen/eigen3/Eigen/src/Core/products/CoeffBasedProduct.h +476 -0
  110. data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralBlockPanelKernel.h +1341 -0
  111. data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixMatrix.h +427 -0
  112. data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +278 -0
  113. data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_MKL.h +146 -0
  114. data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixMatrix_MKL.h +118 -0
  115. data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixVector.h +566 -0
  116. data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixVector_MKL.h +131 -0
  117. data/ext/eigen/eigen3/Eigen/src/Core/products/Parallelizer.h +162 -0
  118. data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +436 -0
  119. data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointMatrixMatrix_MKL.h +295 -0
  120. data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointMatrixVector.h +281 -0
  121. data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointMatrixVector_MKL.h +114 -0
  122. data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointProduct.h +123 -0
  123. data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointRank2Update.h +93 -0
  124. data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularMatrixMatrix.h +427 -0
  125. data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularMatrixMatrix_MKL.h +309 -0
  126. data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularMatrixVector.h +348 -0
  127. data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularMatrixVector_MKL.h +247 -0
  128. data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularSolverMatrix.h +332 -0
  129. data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h +155 -0
  130. data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularSolverVector.h +139 -0
  131. data/ext/eigen/eigen3/Eigen/src/Core/util/BlasUtil.h +264 -0
  132. data/ext/eigen/eigen3/Eigen/src/Core/util/Constants.h +451 -0
  133. data/ext/eigen/eigen3/Eigen/src/Core/util/DisableStupidWarnings.h +40 -0
  134. data/ext/eigen/eigen3/Eigen/src/Core/util/ForwardDeclarations.h +302 -0
  135. data/ext/eigen/eigen3/Eigen/src/Core/util/MKL_support.h +158 -0
  136. data/ext/eigen/eigen3/Eigen/src/Core/util/Macros.h +451 -0
  137. data/ext/eigen/eigen3/Eigen/src/Core/util/Memory.h +977 -0
  138. data/ext/eigen/eigen3/Eigen/src/Core/util/Meta.h +243 -0
  139. data/ext/eigen/eigen3/Eigen/src/Core/util/NonMPL2.h +3 -0
  140. data/ext/eigen/eigen3/Eigen/src/Core/util/ReenableStupidWarnings.h +14 -0
  141. data/ext/eigen/eigen3/Eigen/src/Core/util/StaticAssert.h +208 -0
  142. data/ext/eigen/eigen3/Eigen/src/Core/util/XprHelper.h +469 -0
  143. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Block.h +126 -0
  144. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Cwise.h +192 -0
  145. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/CwiseOperators.h +298 -0
  146. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/AlignedBox.h +159 -0
  147. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/All.h +115 -0
  148. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/AngleAxis.h +214 -0
  149. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Hyperplane.h +254 -0
  150. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/ParametrizedLine.h +141 -0
  151. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Quaternion.h +495 -0
  152. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Rotation2D.h +145 -0
  153. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/RotationBase.h +123 -0
  154. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Scaling.h +167 -0
  155. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Transform.h +786 -0
  156. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Translation.h +184 -0
  157. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/LU.h +120 -0
  158. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Lazy.h +71 -0
  159. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/LeastSquares.h +169 -0
  160. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Macros.h +20 -0
  161. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/MathFunctions.h +57 -0
  162. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Memory.h +45 -0
  163. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Meta.h +75 -0
  164. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Minor.h +117 -0
  165. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/QR.h +67 -0
  166. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/SVD.h +637 -0
  167. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/TriangularSolver.h +42 -0
  168. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/VectorBlock.h +94 -0
  169. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/ComplexEigenSolver.h +341 -0
  170. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/ComplexSchur.h +456 -0
  171. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/ComplexSchur_MKL.h +94 -0
  172. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/EigenSolver.h +607 -0
  173. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +350 -0
  174. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +227 -0
  175. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/HessenbergDecomposition.h +373 -0
  176. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +160 -0
  177. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/RealQZ.h +624 -0
  178. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/RealSchur.h +525 -0
  179. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/RealSchur_MKL.h +83 -0
  180. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +801 -0
  181. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_MKL.h +92 -0
  182. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/Tridiagonalization.h +557 -0
  183. data/ext/eigen/eigen3/Eigen/src/Geometry/AlignedBox.h +392 -0
  184. data/ext/eigen/eigen3/Eigen/src/Geometry/AngleAxis.h +233 -0
  185. data/ext/eigen/eigen3/Eigen/src/Geometry/EulerAngles.h +104 -0
  186. data/ext/eigen/eigen3/Eigen/src/Geometry/Homogeneous.h +307 -0
  187. data/ext/eigen/eigen3/Eigen/src/Geometry/Hyperplane.h +280 -0
  188. data/ext/eigen/eigen3/Eigen/src/Geometry/OrthoMethods.h +218 -0
  189. data/ext/eigen/eigen3/Eigen/src/Geometry/ParametrizedLine.h +195 -0
  190. data/ext/eigen/eigen3/Eigen/src/Geometry/Quaternion.h +776 -0
  191. data/ext/eigen/eigen3/Eigen/src/Geometry/Rotation2D.h +160 -0
  192. data/ext/eigen/eigen3/Eigen/src/Geometry/RotationBase.h +206 -0
  193. data/ext/eigen/eigen3/Eigen/src/Geometry/Scaling.h +166 -0
  194. data/ext/eigen/eigen3/Eigen/src/Geometry/Transform.h +1455 -0
  195. data/ext/eigen/eigen3/Eigen/src/Geometry/Translation.h +206 -0
  196. data/ext/eigen/eigen3/Eigen/src/Geometry/Umeyama.h +177 -0
  197. data/ext/eigen/eigen3/Eigen/src/Geometry/arch/Geometry_SSE.h +115 -0
  198. data/ext/eigen/eigen3/Eigen/src/Householder/BlockHouseholder.h +68 -0
  199. data/ext/eigen/eigen3/Eigen/src/Householder/Householder.h +171 -0
  200. data/ext/eigen/eigen3/Eigen/src/Householder/HouseholderSequence.h +441 -0
  201. data/ext/eigen/eigen3/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +149 -0
  202. data/ext/eigen/eigen3/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +263 -0
  203. data/ext/eigen/eigen3/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +256 -0
  204. data/ext/eigen/eigen3/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +282 -0
  205. data/ext/eigen/eigen3/Eigen/src/Jacobi/Jacobi.h +433 -0
  206. data/ext/eigen/eigen3/Eigen/src/LU/Determinant.h +101 -0
  207. data/ext/eigen/eigen3/Eigen/src/LU/FullPivLU.h +751 -0
  208. data/ext/eigen/eigen3/Eigen/src/LU/Inverse.h +400 -0
  209. data/ext/eigen/eigen3/Eigen/src/LU/PartialPivLU.h +509 -0
  210. data/ext/eigen/eigen3/Eigen/src/LU/PartialPivLU_MKL.h +85 -0
  211. data/ext/eigen/eigen3/Eigen/src/LU/arch/Inverse_SSE.h +329 -0
  212. data/ext/eigen/eigen3/Eigen/src/MetisSupport/MetisSupport.h +137 -0
  213. data/ext/eigen/eigen3/Eigen/src/OrderingMethods/Amd.h +444 -0
  214. data/ext/eigen/eigen3/Eigen/src/OrderingMethods/Eigen_Colamd.h +1850 -0
  215. data/ext/eigen/eigen3/Eigen/src/PaStiXSupport/PaStiXSupport.h +721 -0
  216. data/ext/eigen/eigen3/Eigen/src/PardisoSupport/PardisoSupport.h +592 -0
  217. data/ext/eigen/eigen3/Eigen/src/QR/ColPivHouseholderQR.h +580 -0
  218. data/ext/eigen/eigen3/Eigen/src/QR/ColPivHouseholderQR_MKL.h +99 -0
  219. data/ext/eigen/eigen3/Eigen/src/QR/FullPivHouseholderQR.h +622 -0
  220. data/ext/eigen/eigen3/Eigen/src/QR/HouseholderQR.h +388 -0
  221. data/ext/eigen/eigen3/Eigen/src/QR/HouseholderQR_MKL.h +71 -0
  222. data/ext/eigen/eigen3/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +338 -0
  223. data/ext/eigen/eigen3/Eigen/src/SVD/JacobiSVD.h +976 -0
  224. data/ext/eigen/eigen3/Eigen/src/SVD/JacobiSVD_MKL.h +92 -0
  225. data/ext/eigen/eigen3/Eigen/src/SVD/UpperBidiagonalization.h +148 -0
  226. data/ext/eigen/eigen3/Eigen/src/SparseCholesky/SimplicialCholesky.h +671 -0
  227. data/ext/eigen/eigen3/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +199 -0
  228. data/ext/eigen/eigen3/Eigen/src/SparseCore/AmbiVector.h +373 -0
  229. data/ext/eigen/eigen3/Eigen/src/SparseCore/CompressedStorage.h +233 -0
  230. data/ext/eigen/eigen3/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +245 -0
  231. data/ext/eigen/eigen3/Eigen/src/SparseCore/MappedSparseMatrix.h +181 -0
  232. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseBlock.h +537 -0
  233. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseColEtree.h +206 -0
  234. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +325 -0
  235. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +163 -0
  236. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseDenseProduct.h +311 -0
  237. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseDiagonalProduct.h +196 -0
  238. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseDot.h +101 -0
  239. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseFuzzy.h +26 -0
  240. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseMatrix.h +1262 -0
  241. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseMatrixBase.h +461 -0
  242. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparsePermutation.h +148 -0
  243. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseProduct.h +188 -0
  244. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseRedux.h +45 -0
  245. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseSelfAdjointView.h +507 -0
  246. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +150 -0
  247. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseTranspose.h +63 -0
  248. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseTriangularView.h +179 -0
  249. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseUtil.h +172 -0
  250. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseVector.h +448 -0
  251. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseView.h +99 -0
  252. data/ext/eigen/eigen3/Eigen/src/SparseCore/TriangularSolver.h +334 -0
  253. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU.h +806 -0
  254. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLUImpl.h +66 -0
  255. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_Memory.h +227 -0
  256. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_Structs.h +111 -0
  257. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +298 -0
  258. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_Utils.h +80 -0
  259. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_column_bmod.h +180 -0
  260. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_column_dfs.h +177 -0
  261. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +106 -0
  262. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +279 -0
  263. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +127 -0
  264. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +130 -0
  265. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_panel_bmod.h +223 -0
  266. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_panel_dfs.h +258 -0
  267. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_pivotL.h +137 -0
  268. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_pruneL.h +135 -0
  269. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_relax_snode.h +83 -0
  270. data/ext/eigen/eigen3/Eigen/src/SparseQR/SparseQR.h +714 -0
  271. data/ext/eigen/eigen3/Eigen/src/StlSupport/StdDeque.h +134 -0
  272. data/ext/eigen/eigen3/Eigen/src/StlSupport/StdList.h +114 -0
  273. data/ext/eigen/eigen3/Eigen/src/StlSupport/StdVector.h +126 -0
  274. data/ext/eigen/eigen3/Eigen/src/StlSupport/details.h +84 -0
  275. data/ext/eigen/eigen3/Eigen/src/SuperLUSupport/SuperLUSupport.h +1026 -0
  276. data/ext/eigen/eigen3/Eigen/src/UmfPackSupport/UmfPackSupport.h +474 -0
  277. data/ext/eigen/eigen3/Eigen/src/misc/Image.h +84 -0
  278. data/ext/eigen/eigen3/Eigen/src/misc/Kernel.h +81 -0
  279. data/ext/eigen/eigen3/Eigen/src/misc/Solve.h +76 -0
  280. data/ext/eigen/eigen3/Eigen/src/misc/SparseSolve.h +128 -0
  281. data/ext/eigen/eigen3/Eigen/src/misc/blas.h +658 -0
  282. data/ext/eigen/eigen3/Eigen/src/plugins/ArrayCwiseBinaryOps.h +253 -0
  283. data/ext/eigen/eigen3/Eigen/src/plugins/ArrayCwiseUnaryOps.h +187 -0
  284. data/ext/eigen/eigen3/Eigen/src/plugins/BlockMethods.h +935 -0
  285. data/ext/eigen/eigen3/Eigen/src/plugins/CommonCwiseBinaryOps.h +46 -0
  286. data/ext/eigen/eigen3/Eigen/src/plugins/CommonCwiseUnaryOps.h +172 -0
  287. data/ext/eigen/eigen3/Eigen/src/plugins/MatrixCwiseBinaryOps.h +143 -0
  288. data/ext/eigen/eigen3/Eigen/src/plugins/MatrixCwiseUnaryOps.h +52 -0
  289. data/ext/eigen/eigen3/signature_of_eigen3_matrix_library +1 -0
  290. data/ext/eigen/eigen_wrap.cxx +19420 -10396
  291. data/ext/eigen/extconf.rb +37 -2
  292. data/lib/eigen.rb +146 -3
  293. metadata +294 -7
@@ -0,0 +1,721 @@
1
+ // This file is part of Eigen, a lightweight C++ template library
2
+ // for linear algebra.
3
+ //
4
+ // Copyright (C) 2012 Désiré Nuentsa-Wakam <desire.nuentsa_wakam@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/.
9
+
10
+ #ifndef EIGEN_PASTIXSUPPORT_H
11
+ #define EIGEN_PASTIXSUPPORT_H
12
+
13
+ namespace Eigen {
14
+
15
+ /** \ingroup PaStiXSupport_Module
16
+ * \brief Interface to the PaStix solver
17
+ *
18
+ * This class is used to solve the linear systems A.X = B via the PaStix library.
19
+ * The matrix can be either real or complex, symmetric or not.
20
+ *
21
+ * \sa TutorialSparseDirectSolvers
22
+ */
23
+ template<typename _MatrixType, bool IsStrSym = false> class PastixLU;
24
+ template<typename _MatrixType, int Options> class PastixLLT;
25
+ template<typename _MatrixType, int Options> class PastixLDLT;
26
+
27
+ namespace internal
28
+ {
29
+
30
+ template<class Pastix> struct pastix_traits;
31
+
32
+ template<typename _MatrixType>
33
+ struct pastix_traits< PastixLU<_MatrixType> >
34
+ {
35
+ typedef _MatrixType MatrixType;
36
+ typedef typename _MatrixType::Scalar Scalar;
37
+ typedef typename _MatrixType::RealScalar RealScalar;
38
+ typedef typename _MatrixType::Index Index;
39
+ };
40
+
41
+ template<typename _MatrixType, int Options>
42
+ struct pastix_traits< PastixLLT<_MatrixType,Options> >
43
+ {
44
+ typedef _MatrixType MatrixType;
45
+ typedef typename _MatrixType::Scalar Scalar;
46
+ typedef typename _MatrixType::RealScalar RealScalar;
47
+ typedef typename _MatrixType::Index Index;
48
+ };
49
+
50
+ template<typename _MatrixType, int Options>
51
+ struct pastix_traits< PastixLDLT<_MatrixType,Options> >
52
+ {
53
+ typedef _MatrixType MatrixType;
54
+ typedef typename _MatrixType::Scalar Scalar;
55
+ typedef typename _MatrixType::RealScalar RealScalar;
56
+ typedef typename _MatrixType::Index Index;
57
+ };
58
+
59
+ void eigen_pastix(pastix_data_t **pastix_data, int pastix_comm, int n, int *ptr, int *idx, float *vals, int *perm, int * invp, float *x, int nbrhs, int *iparm, double *dparm)
60
+ {
61
+ if (n == 0) { ptr = NULL; idx = NULL; vals = NULL; }
62
+ if (nbrhs == 0) {x = NULL; nbrhs=1;}
63
+ s_pastix(pastix_data, pastix_comm, n, ptr, idx, vals, perm, invp, x, nbrhs, iparm, dparm);
64
+ }
65
+
66
+ void eigen_pastix(pastix_data_t **pastix_data, int pastix_comm, int n, int *ptr, int *idx, double *vals, int *perm, int * invp, double *x, int nbrhs, int *iparm, double *dparm)
67
+ {
68
+ if (n == 0) { ptr = NULL; idx = NULL; vals = NULL; }
69
+ if (nbrhs == 0) {x = NULL; nbrhs=1;}
70
+ d_pastix(pastix_data, pastix_comm, n, ptr, idx, vals, perm, invp, x, nbrhs, iparm, dparm);
71
+ }
72
+
73
+ void eigen_pastix(pastix_data_t **pastix_data, int pastix_comm, int n, int *ptr, int *idx, std::complex<float> *vals, int *perm, int * invp, std::complex<float> *x, int nbrhs, int *iparm, double *dparm)
74
+ {
75
+ if (n == 0) { ptr = NULL; idx = NULL; vals = NULL; }
76
+ if (nbrhs == 0) {x = NULL; nbrhs=1;}
77
+ c_pastix(pastix_data, pastix_comm, n, ptr, idx, reinterpret_cast<COMPLEX*>(vals), perm, invp, reinterpret_cast<COMPLEX*>(x), nbrhs, iparm, dparm);
78
+ }
79
+
80
+ void eigen_pastix(pastix_data_t **pastix_data, int pastix_comm, int n, int *ptr, int *idx, std::complex<double> *vals, int *perm, int * invp, std::complex<double> *x, int nbrhs, int *iparm, double *dparm)
81
+ {
82
+ if (n == 0) { ptr = NULL; idx = NULL; vals = NULL; }
83
+ if (nbrhs == 0) {x = NULL; nbrhs=1;}
84
+ z_pastix(pastix_data, pastix_comm, n, ptr, idx, reinterpret_cast<DCOMPLEX*>(vals), perm, invp, reinterpret_cast<DCOMPLEX*>(x), nbrhs, iparm, dparm);
85
+ }
86
+
87
+ // Convert the matrix to Fortran-style Numbering
88
+ template <typename MatrixType>
89
+ void c_to_fortran_numbering (MatrixType& mat)
90
+ {
91
+ if ( !(mat.outerIndexPtr()[0]) )
92
+ {
93
+ int i;
94
+ for(i = 0; i <= mat.rows(); ++i)
95
+ ++mat.outerIndexPtr()[i];
96
+ for(i = 0; i < mat.nonZeros(); ++i)
97
+ ++mat.innerIndexPtr()[i];
98
+ }
99
+ }
100
+
101
+ // Convert to C-style Numbering
102
+ template <typename MatrixType>
103
+ void fortran_to_c_numbering (MatrixType& mat)
104
+ {
105
+ // Check the Numbering
106
+ if ( mat.outerIndexPtr()[0] == 1 )
107
+ { // Convert to C-style numbering
108
+ int i;
109
+ for(i = 0; i <= mat.rows(); ++i)
110
+ --mat.outerIndexPtr()[i];
111
+ for(i = 0; i < mat.nonZeros(); ++i)
112
+ --mat.innerIndexPtr()[i];
113
+ }
114
+ }
115
+ }
116
+
117
+ // This is the base class to interface with PaStiX functions.
118
+ // Users should not used this class directly.
119
+ template <class Derived>
120
+ class PastixBase : internal::noncopyable
121
+ {
122
+ public:
123
+ typedef typename internal::pastix_traits<Derived>::MatrixType _MatrixType;
124
+ typedef _MatrixType MatrixType;
125
+ typedef typename MatrixType::Scalar Scalar;
126
+ typedef typename MatrixType::RealScalar RealScalar;
127
+ typedef typename MatrixType::Index Index;
128
+ typedef Matrix<Scalar,Dynamic,1> Vector;
129
+ typedef SparseMatrix<Scalar, ColMajor> ColSpMatrix;
130
+
131
+ public:
132
+
133
+ PastixBase() : m_initisOk(false), m_analysisIsOk(false), m_factorizationIsOk(false), m_isInitialized(false), m_pastixdata(0), m_size(0)
134
+ {
135
+ init();
136
+ }
137
+
138
+ ~PastixBase()
139
+ {
140
+ clean();
141
+ }
142
+
143
+ /** \returns the solution x of \f$ A x = b \f$ using the current decomposition of A.
144
+ *
145
+ * \sa compute()
146
+ */
147
+ template<typename Rhs>
148
+ inline const internal::solve_retval<PastixBase, Rhs>
149
+ solve(const MatrixBase<Rhs>& b) const
150
+ {
151
+ eigen_assert(m_isInitialized && "Pastix solver is not initialized.");
152
+ eigen_assert(rows()==b.rows()
153
+ && "PastixBase::solve(): invalid number of rows of the right hand side matrix b");
154
+ return internal::solve_retval<PastixBase, Rhs>(*this, b.derived());
155
+ }
156
+
157
+ template<typename Rhs,typename Dest>
158
+ bool _solve (const MatrixBase<Rhs> &b, MatrixBase<Dest> &x) const;
159
+
160
+ Derived& derived()
161
+ {
162
+ return *static_cast<Derived*>(this);
163
+ }
164
+ const Derived& derived() const
165
+ {
166
+ return *static_cast<const Derived*>(this);
167
+ }
168
+
169
+ /** Returns a reference to the integer vector IPARM of PaStiX parameters
170
+ * to modify the default parameters.
171
+ * The statistics related to the different phases of factorization and solve are saved here as well
172
+ * \sa analyzePattern() factorize()
173
+ */
174
+ Array<Index,IPARM_SIZE,1>& iparm()
175
+ {
176
+ return m_iparm;
177
+ }
178
+
179
+ /** Return a reference to a particular index parameter of the IPARM vector
180
+ * \sa iparm()
181
+ */
182
+
183
+ int& iparm(int idxparam)
184
+ {
185
+ return m_iparm(idxparam);
186
+ }
187
+
188
+ /** Returns a reference to the double vector DPARM of PaStiX parameters
189
+ * The statistics related to the different phases of factorization and solve are saved here as well
190
+ * \sa analyzePattern() factorize()
191
+ */
192
+ Array<RealScalar,IPARM_SIZE,1>& dparm()
193
+ {
194
+ return m_dparm;
195
+ }
196
+
197
+
198
+ /** Return a reference to a particular index parameter of the DPARM vector
199
+ * \sa dparm()
200
+ */
201
+ double& dparm(int idxparam)
202
+ {
203
+ return m_dparm(idxparam);
204
+ }
205
+
206
+ inline Index cols() const { return m_size; }
207
+ inline Index rows() const { return m_size; }
208
+
209
+ /** \brief Reports whether previous computation was successful.
210
+ *
211
+ * \returns \c Success if computation was succesful,
212
+ * \c NumericalIssue if the PaStiX reports a problem
213
+ * \c InvalidInput if the input matrix is invalid
214
+ *
215
+ * \sa iparm()
216
+ */
217
+ ComputationInfo info() const
218
+ {
219
+ eigen_assert(m_isInitialized && "Decomposition is not initialized.");
220
+ return m_info;
221
+ }
222
+
223
+ /** \returns the solution x of \f$ A x = b \f$ using the current decomposition of A.
224
+ *
225
+ * \sa compute()
226
+ */
227
+ template<typename Rhs>
228
+ inline const internal::sparse_solve_retval<PastixBase, Rhs>
229
+ solve(const SparseMatrixBase<Rhs>& b) const
230
+ {
231
+ eigen_assert(m_isInitialized && "Pastix LU, LLT or LDLT is not initialized.");
232
+ eigen_assert(rows()==b.rows()
233
+ && "PastixBase::solve(): invalid number of rows of the right hand side matrix b");
234
+ return internal::sparse_solve_retval<PastixBase, Rhs>(*this, b.derived());
235
+ }
236
+
237
+ protected:
238
+
239
+ // Initialize the Pastix data structure, check the matrix
240
+ void init();
241
+
242
+ // Compute the ordering and the symbolic factorization
243
+ void analyzePattern(ColSpMatrix& mat);
244
+
245
+ // Compute the numerical factorization
246
+ void factorize(ColSpMatrix& mat);
247
+
248
+ // Free all the data allocated by Pastix
249
+ void clean()
250
+ {
251
+ eigen_assert(m_initisOk && "The Pastix structure should be allocated first");
252
+ m_iparm(IPARM_START_TASK) = API_TASK_CLEAN;
253
+ m_iparm(IPARM_END_TASK) = API_TASK_CLEAN;
254
+ internal::eigen_pastix(&m_pastixdata, MPI_COMM_WORLD, 0, 0, 0, (Scalar*)0,
255
+ m_perm.data(), m_invp.data(), 0, 0, m_iparm.data(), m_dparm.data());
256
+ }
257
+
258
+ void compute(ColSpMatrix& mat);
259
+
260
+ int m_initisOk;
261
+ int m_analysisIsOk;
262
+ int m_factorizationIsOk;
263
+ bool m_isInitialized;
264
+ mutable ComputationInfo m_info;
265
+ mutable pastix_data_t *m_pastixdata; // Data structure for pastix
266
+ mutable int m_comm; // The MPI communicator identifier
267
+ mutable Matrix<int,IPARM_SIZE,1> m_iparm; // integer vector for the input parameters
268
+ mutable Matrix<double,DPARM_SIZE,1> m_dparm; // Scalar vector for the input parameters
269
+ mutable Matrix<Index,Dynamic,1> m_perm; // Permutation vector
270
+ mutable Matrix<Index,Dynamic,1> m_invp; // Inverse permutation vector
271
+ mutable int m_size; // Size of the matrix
272
+ };
273
+
274
+ /** Initialize the PaStiX data structure.
275
+ *A first call to this function fills iparm and dparm with the default PaStiX parameters
276
+ * \sa iparm() dparm()
277
+ */
278
+ template <class Derived>
279
+ void PastixBase<Derived>::init()
280
+ {
281
+ m_size = 0;
282
+ m_iparm.setZero(IPARM_SIZE);
283
+ m_dparm.setZero(DPARM_SIZE);
284
+
285
+ m_iparm(IPARM_MODIFY_PARAMETER) = API_NO;
286
+ pastix(&m_pastixdata, MPI_COMM_WORLD,
287
+ 0, 0, 0, 0,
288
+ 0, 0, 0, 1, m_iparm.data(), m_dparm.data());
289
+
290
+ m_iparm[IPARM_MATRIX_VERIFICATION] = API_NO;
291
+ m_iparm[IPARM_VERBOSE] = 2;
292
+ m_iparm[IPARM_ORDERING] = API_ORDER_SCOTCH;
293
+ m_iparm[IPARM_INCOMPLETE] = API_NO;
294
+ m_iparm[IPARM_OOC_LIMIT] = 2000;
295
+ m_iparm[IPARM_RHS_MAKING] = API_RHS_B;
296
+ m_iparm(IPARM_MATRIX_VERIFICATION) = API_NO;
297
+
298
+ m_iparm(IPARM_START_TASK) = API_TASK_INIT;
299
+ m_iparm(IPARM_END_TASK) = API_TASK_INIT;
300
+ internal::eigen_pastix(&m_pastixdata, MPI_COMM_WORLD, 0, 0, 0, (Scalar*)0,
301
+ 0, 0, 0, 0, m_iparm.data(), m_dparm.data());
302
+
303
+ // Check the returned error
304
+ if(m_iparm(IPARM_ERROR_NUMBER)) {
305
+ m_info = InvalidInput;
306
+ m_initisOk = false;
307
+ }
308
+ else {
309
+ m_info = Success;
310
+ m_initisOk = true;
311
+ }
312
+ }
313
+
314
+ template <class Derived>
315
+ void PastixBase<Derived>::compute(ColSpMatrix& mat)
316
+ {
317
+ eigen_assert(mat.rows() == mat.cols() && "The input matrix should be squared");
318
+
319
+ analyzePattern(mat);
320
+ factorize(mat);
321
+
322
+ m_iparm(IPARM_MATRIX_VERIFICATION) = API_NO;
323
+ m_isInitialized = m_factorizationIsOk;
324
+ }
325
+
326
+
327
+ template <class Derived>
328
+ void PastixBase<Derived>::analyzePattern(ColSpMatrix& mat)
329
+ {
330
+ eigen_assert(m_initisOk && "The initialization of PaSTiX failed");
331
+
332
+ // clean previous calls
333
+ if(m_size>0)
334
+ clean();
335
+
336
+ m_size = mat.rows();
337
+ m_perm.resize(m_size);
338
+ m_invp.resize(m_size);
339
+
340
+ m_iparm(IPARM_START_TASK) = API_TASK_ORDERING;
341
+ m_iparm(IPARM_END_TASK) = API_TASK_ANALYSE;
342
+ internal::eigen_pastix(&m_pastixdata, MPI_COMM_WORLD, m_size, mat.outerIndexPtr(), mat.innerIndexPtr(),
343
+ mat.valuePtr(), m_perm.data(), m_invp.data(), 0, 0, m_iparm.data(), m_dparm.data());
344
+
345
+ // Check the returned error
346
+ if(m_iparm(IPARM_ERROR_NUMBER))
347
+ {
348
+ m_info = NumericalIssue;
349
+ m_analysisIsOk = false;
350
+ }
351
+ else
352
+ {
353
+ m_info = Success;
354
+ m_analysisIsOk = true;
355
+ }
356
+ }
357
+
358
+ template <class Derived>
359
+ void PastixBase<Derived>::factorize(ColSpMatrix& mat)
360
+ {
361
+ // if(&m_cpyMat != &mat) m_cpyMat = mat;
362
+ eigen_assert(m_analysisIsOk && "The analysis phase should be called before the factorization phase");
363
+ m_iparm(IPARM_START_TASK) = API_TASK_NUMFACT;
364
+ m_iparm(IPARM_END_TASK) = API_TASK_NUMFACT;
365
+ m_size = mat.rows();
366
+
367
+ internal::eigen_pastix(&m_pastixdata, MPI_COMM_WORLD, m_size, mat.outerIndexPtr(), mat.innerIndexPtr(),
368
+ mat.valuePtr(), m_perm.data(), m_invp.data(), 0, 0, m_iparm.data(), m_dparm.data());
369
+
370
+ // Check the returned error
371
+ if(m_iparm(IPARM_ERROR_NUMBER))
372
+ {
373
+ m_info = NumericalIssue;
374
+ m_factorizationIsOk = false;
375
+ m_isInitialized = false;
376
+ }
377
+ else
378
+ {
379
+ m_info = Success;
380
+ m_factorizationIsOk = true;
381
+ m_isInitialized = true;
382
+ }
383
+ }
384
+
385
+ /* Solve the system */
386
+ template<typename Base>
387
+ template<typename Rhs,typename Dest>
388
+ bool PastixBase<Base>::_solve (const MatrixBase<Rhs> &b, MatrixBase<Dest> &x) const
389
+ {
390
+ eigen_assert(m_isInitialized && "The matrix should be factorized first");
391
+ EIGEN_STATIC_ASSERT((Dest::Flags&RowMajorBit)==0,
392
+ THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES);
393
+ int rhs = 1;
394
+
395
+ x = b; /* on return, x is overwritten by the computed solution */
396
+
397
+ for (int i = 0; i < b.cols(); i++){
398
+ m_iparm[IPARM_START_TASK] = API_TASK_SOLVE;
399
+ m_iparm[IPARM_END_TASK] = API_TASK_REFINE;
400
+
401
+ internal::eigen_pastix(&m_pastixdata, MPI_COMM_WORLD, x.rows(), 0, 0, 0,
402
+ m_perm.data(), m_invp.data(), &x(0, i), rhs, m_iparm.data(), m_dparm.data());
403
+ }
404
+
405
+ // Check the returned error
406
+ m_info = m_iparm(IPARM_ERROR_NUMBER)==0 ? Success : NumericalIssue;
407
+
408
+ return m_iparm(IPARM_ERROR_NUMBER)==0;
409
+ }
410
+
411
+ /** \ingroup PaStiXSupport_Module
412
+ * \class PastixLU
413
+ * \brief Sparse direct LU solver based on PaStiX library
414
+ *
415
+ * This class is used to solve the linear systems A.X = B with a supernodal LU
416
+ * factorization in the PaStiX library. The matrix A should be squared and nonsingular
417
+ * PaStiX requires that the matrix A has a symmetric structural pattern.
418
+ * This interface can symmetrize the input matrix otherwise.
419
+ * The vectors or matrices X and B can be either dense or sparse.
420
+ *
421
+ * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<>
422
+ * \tparam IsStrSym Indicates if the input matrix has a symmetric pattern, default is false
423
+ * NOTE : Note that if the analysis and factorization phase are called separately,
424
+ * the input matrix will be symmetrized at each call, hence it is advised to
425
+ * symmetrize the matrix in a end-user program and set \p IsStrSym to true
426
+ *
427
+ * \sa \ref TutorialSparseDirectSolvers
428
+ *
429
+ */
430
+ template<typename _MatrixType, bool IsStrSym>
431
+ class PastixLU : public PastixBase< PastixLU<_MatrixType> >
432
+ {
433
+ public:
434
+ typedef _MatrixType MatrixType;
435
+ typedef PastixBase<PastixLU<MatrixType> > Base;
436
+ typedef typename Base::ColSpMatrix ColSpMatrix;
437
+ typedef typename MatrixType::Index Index;
438
+
439
+ public:
440
+ PastixLU() : Base()
441
+ {
442
+ init();
443
+ }
444
+
445
+ PastixLU(const MatrixType& matrix):Base()
446
+ {
447
+ init();
448
+ compute(matrix);
449
+ }
450
+ /** Compute the LU supernodal factorization of \p matrix.
451
+ * iparm and dparm can be used to tune the PaStiX parameters.
452
+ * see the PaStiX user's manual
453
+ * \sa analyzePattern() factorize()
454
+ */
455
+ void compute (const MatrixType& matrix)
456
+ {
457
+ m_structureIsUptodate = false;
458
+ ColSpMatrix temp;
459
+ grabMatrix(matrix, temp);
460
+ Base::compute(temp);
461
+ }
462
+ /** Compute the LU symbolic factorization of \p matrix using its sparsity pattern.
463
+ * Several ordering methods can be used at this step. See the PaStiX user's manual.
464
+ * The result of this operation can be used with successive matrices having the same pattern as \p matrix
465
+ * \sa factorize()
466
+ */
467
+ void analyzePattern(const MatrixType& matrix)
468
+ {
469
+ m_structureIsUptodate = false;
470
+ ColSpMatrix temp;
471
+ grabMatrix(matrix, temp);
472
+ Base::analyzePattern(temp);
473
+ }
474
+
475
+ /** Compute the LU supernodal factorization of \p matrix
476
+ * WARNING The matrix \p matrix should have the same structural pattern
477
+ * as the same used in the analysis phase.
478
+ * \sa analyzePattern()
479
+ */
480
+ void factorize(const MatrixType& matrix)
481
+ {
482
+ ColSpMatrix temp;
483
+ grabMatrix(matrix, temp);
484
+ Base::factorize(temp);
485
+ }
486
+ protected:
487
+
488
+ void init()
489
+ {
490
+ m_structureIsUptodate = false;
491
+ m_iparm(IPARM_SYM) = API_SYM_NO;
492
+ m_iparm(IPARM_FACTORIZATION) = API_FACT_LU;
493
+ }
494
+
495
+ void grabMatrix(const MatrixType& matrix, ColSpMatrix& out)
496
+ {
497
+ if(IsStrSym)
498
+ out = matrix;
499
+ else
500
+ {
501
+ if(!m_structureIsUptodate)
502
+ {
503
+ // update the transposed structure
504
+ m_transposedStructure = matrix.transpose();
505
+
506
+ // Set the elements of the matrix to zero
507
+ for (Index j=0; j<m_transposedStructure.outerSize(); ++j)
508
+ for(typename ColSpMatrix::InnerIterator it(m_transposedStructure, j); it; ++it)
509
+ it.valueRef() = 0.0;
510
+
511
+ m_structureIsUptodate = true;
512
+ }
513
+
514
+ out = m_transposedStructure + matrix;
515
+ }
516
+ internal::c_to_fortran_numbering(out);
517
+ }
518
+
519
+ using Base::m_iparm;
520
+ using Base::m_dparm;
521
+
522
+ ColSpMatrix m_transposedStructure;
523
+ bool m_structureIsUptodate;
524
+ };
525
+
526
+ /** \ingroup PaStiXSupport_Module
527
+ * \class PastixLLT
528
+ * \brief A sparse direct supernodal Cholesky (LLT) factorization and solver based on the PaStiX library
529
+ *
530
+ * This class is used to solve the linear systems A.X = B via a LL^T supernodal Cholesky factorization
531
+ * available in the PaStiX library. The matrix A should be symmetric and positive definite
532
+ * WARNING Selfadjoint complex matrices are not supported in the current version of PaStiX
533
+ * The vectors or matrices X and B can be either dense or sparse
534
+ *
535
+ * \tparam MatrixType the type of the sparse matrix A, it must be a SparseMatrix<>
536
+ * \tparam UpLo The part of the matrix to use : Lower or Upper. The default is Lower as required by PaStiX
537
+ *
538
+ * \sa \ref TutorialSparseDirectSolvers
539
+ */
540
+ template<typename _MatrixType, int _UpLo>
541
+ class PastixLLT : public PastixBase< PastixLLT<_MatrixType, _UpLo> >
542
+ {
543
+ public:
544
+ typedef _MatrixType MatrixType;
545
+ typedef PastixBase<PastixLLT<MatrixType, _UpLo> > Base;
546
+ typedef typename Base::ColSpMatrix ColSpMatrix;
547
+
548
+ public:
549
+ enum { UpLo = _UpLo };
550
+ PastixLLT() : Base()
551
+ {
552
+ init();
553
+ }
554
+
555
+ PastixLLT(const MatrixType& matrix):Base()
556
+ {
557
+ init();
558
+ compute(matrix);
559
+ }
560
+
561
+ /** Compute the L factor of the LL^T supernodal factorization of \p matrix
562
+ * \sa analyzePattern() factorize()
563
+ */
564
+ void compute (const MatrixType& matrix)
565
+ {
566
+ ColSpMatrix temp;
567
+ grabMatrix(matrix, temp);
568
+ Base::compute(temp);
569
+ }
570
+
571
+ /** Compute the LL^T symbolic factorization of \p matrix using its sparsity pattern
572
+ * The result of this operation can be used with successive matrices having the same pattern as \p matrix
573
+ * \sa factorize()
574
+ */
575
+ void analyzePattern(const MatrixType& matrix)
576
+ {
577
+ ColSpMatrix temp;
578
+ grabMatrix(matrix, temp);
579
+ Base::analyzePattern(temp);
580
+ }
581
+ /** Compute the LL^T supernodal numerical factorization of \p matrix
582
+ * \sa analyzePattern()
583
+ */
584
+ void factorize(const MatrixType& matrix)
585
+ {
586
+ ColSpMatrix temp;
587
+ grabMatrix(matrix, temp);
588
+ Base::factorize(temp);
589
+ }
590
+ protected:
591
+ using Base::m_iparm;
592
+
593
+ void init()
594
+ {
595
+ m_iparm(IPARM_SYM) = API_SYM_YES;
596
+ m_iparm(IPARM_FACTORIZATION) = API_FACT_LLT;
597
+ }
598
+
599
+ void grabMatrix(const MatrixType& matrix, ColSpMatrix& out)
600
+ {
601
+ // Pastix supports only lower, column-major matrices
602
+ out.template selfadjointView<Lower>() = matrix.template selfadjointView<UpLo>();
603
+ internal::c_to_fortran_numbering(out);
604
+ }
605
+ };
606
+
607
+ /** \ingroup PaStiXSupport_Module
608
+ * \class PastixLDLT
609
+ * \brief A sparse direct supernodal Cholesky (LLT) factorization and solver based on the PaStiX library
610
+ *
611
+ * This class is used to solve the linear systems A.X = B via a LDL^T supernodal Cholesky factorization
612
+ * available in the PaStiX library. The matrix A should be symmetric and positive definite
613
+ * WARNING Selfadjoint complex matrices are not supported in the current version of PaStiX
614
+ * The vectors or matrices X and B can be either dense or sparse
615
+ *
616
+ * \tparam MatrixType the type of the sparse matrix A, it must be a SparseMatrix<>
617
+ * \tparam UpLo The part of the matrix to use : Lower or Upper. The default is Lower as required by PaStiX
618
+ *
619
+ * \sa \ref TutorialSparseDirectSolvers
620
+ */
621
+ template<typename _MatrixType, int _UpLo>
622
+ class PastixLDLT : public PastixBase< PastixLDLT<_MatrixType, _UpLo> >
623
+ {
624
+ public:
625
+ typedef _MatrixType MatrixType;
626
+ typedef PastixBase<PastixLDLT<MatrixType, _UpLo> > Base;
627
+ typedef typename Base::ColSpMatrix ColSpMatrix;
628
+
629
+ public:
630
+ enum { UpLo = _UpLo };
631
+ PastixLDLT():Base()
632
+ {
633
+ init();
634
+ }
635
+
636
+ PastixLDLT(const MatrixType& matrix):Base()
637
+ {
638
+ init();
639
+ compute(matrix);
640
+ }
641
+
642
+ /** Compute the L and D factors of the LDL^T factorization of \p matrix
643
+ * \sa analyzePattern() factorize()
644
+ */
645
+ void compute (const MatrixType& matrix)
646
+ {
647
+ ColSpMatrix temp;
648
+ grabMatrix(matrix, temp);
649
+ Base::compute(temp);
650
+ }
651
+
652
+ /** Compute the LDL^T symbolic factorization of \p matrix using its sparsity pattern
653
+ * The result of this operation can be used with successive matrices having the same pattern as \p matrix
654
+ * \sa factorize()
655
+ */
656
+ void analyzePattern(const MatrixType& matrix)
657
+ {
658
+ ColSpMatrix temp;
659
+ grabMatrix(matrix, temp);
660
+ Base::analyzePattern(temp);
661
+ }
662
+ /** Compute the LDL^T supernodal numerical factorization of \p matrix
663
+ *
664
+ */
665
+ void factorize(const MatrixType& matrix)
666
+ {
667
+ ColSpMatrix temp;
668
+ grabMatrix(matrix, temp);
669
+ Base::factorize(temp);
670
+ }
671
+
672
+ protected:
673
+ using Base::m_iparm;
674
+
675
+ void init()
676
+ {
677
+ m_iparm(IPARM_SYM) = API_SYM_YES;
678
+ m_iparm(IPARM_FACTORIZATION) = API_FACT_LDLT;
679
+ }
680
+
681
+ void grabMatrix(const MatrixType& matrix, ColSpMatrix& out)
682
+ {
683
+ // Pastix supports only lower, column-major matrices
684
+ out.template selfadjointView<Lower>() = matrix.template selfadjointView<UpLo>();
685
+ internal::c_to_fortran_numbering(out);
686
+ }
687
+ };
688
+
689
+ namespace internal {
690
+
691
+ template<typename _MatrixType, typename Rhs>
692
+ struct solve_retval<PastixBase<_MatrixType>, Rhs>
693
+ : solve_retval_base<PastixBase<_MatrixType>, Rhs>
694
+ {
695
+ typedef PastixBase<_MatrixType> Dec;
696
+ EIGEN_MAKE_SOLVE_HELPERS(Dec,Rhs)
697
+
698
+ template<typename Dest> void evalTo(Dest& dst) const
699
+ {
700
+ dec()._solve(rhs(),dst);
701
+ }
702
+ };
703
+
704
+ template<typename _MatrixType, typename Rhs>
705
+ struct sparse_solve_retval<PastixBase<_MatrixType>, Rhs>
706
+ : sparse_solve_retval_base<PastixBase<_MatrixType>, Rhs>
707
+ {
708
+ typedef PastixBase<_MatrixType> Dec;
709
+ EIGEN_MAKE_SPARSE_SOLVE_HELPERS(Dec,Rhs)
710
+
711
+ template<typename Dest> void evalTo(Dest& dst) const
712
+ {
713
+ this->defaultEvalTo(dst);
714
+ }
715
+ };
716
+
717
+ } // end namespace internal
718
+
719
+ } // end namespace Eigen
720
+
721
+ #endif