ruby-eigen 0.0.9 → 0.0.10.pre1

Sign up to get free protection for your applications and to get access to all the features.
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,66 @@
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
+ #ifndef SPARSELU_IMPL_H
10
+ #define SPARSELU_IMPL_H
11
+
12
+ namespace Eigen {
13
+ namespace internal {
14
+
15
+ /** \ingroup SparseLU_Module
16
+ * \class SparseLUImpl
17
+ * Base class for sparseLU
18
+ */
19
+ template <typename Scalar, typename Index>
20
+ class SparseLUImpl
21
+ {
22
+ public:
23
+ typedef Matrix<Scalar,Dynamic,1> ScalarVector;
24
+ typedef Matrix<Scalar,Dynamic,Dynamic,ColMajor> ScalarMatrix;
25
+ typedef Map<ScalarMatrix, 0, OuterStride<> > MappedMatrixBlock;
26
+ typedef Matrix<Index,Dynamic,1> IndexVector;
27
+ typedef typename ScalarVector::RealScalar RealScalar;
28
+ typedef Ref<Matrix<Scalar,Dynamic,1> > BlockScalarVector;
29
+ typedef Ref<Matrix<Index,Dynamic,1> > BlockIndexVector;
30
+ typedef LU_GlobalLU_t<IndexVector, ScalarVector> GlobalLU_t;
31
+ typedef SparseMatrix<Scalar,ColMajor,Index> MatrixType;
32
+
33
+ protected:
34
+ template <typename VectorType>
35
+ Index expand(VectorType& vec, Index& length, Index nbElts, Index keep_prev, Index& num_expansions);
36
+ Index memInit(Index m, Index n, Index annz, Index lwork, Index fillratio, Index panel_size, GlobalLU_t& glu);
37
+ template <typename VectorType>
38
+ Index memXpand(VectorType& vec, Index& maxlen, Index nbElts, MemType memtype, Index& num_expansions);
39
+ void heap_relax_snode (const Index n, IndexVector& et, const Index relax_columns, IndexVector& descendants, IndexVector& relax_end);
40
+ void relax_snode (const Index n, IndexVector& et, const Index relax_columns, IndexVector& descendants, IndexVector& relax_end);
41
+ Index snode_dfs(const Index jcol, const Index kcol,const MatrixType& mat, IndexVector& xprune, IndexVector& marker, GlobalLU_t& glu);
42
+ Index snode_bmod (const Index jcol, const Index fsupc, ScalarVector& dense, GlobalLU_t& glu);
43
+ Index pivotL(const Index jcol, const RealScalar& diagpivotthresh, IndexVector& perm_r, IndexVector& iperm_c, Index& pivrow, GlobalLU_t& glu);
44
+ template <typename Traits>
45
+ void dfs_kernel(const Index jj, IndexVector& perm_r,
46
+ Index& nseg, IndexVector& panel_lsub, IndexVector& segrep,
47
+ Ref<IndexVector> repfnz_col, IndexVector& xprune, Ref<IndexVector> marker, IndexVector& parent,
48
+ IndexVector& xplore, GlobalLU_t& glu, Index& nextl_col, Index krow, Traits& traits);
49
+ void panel_dfs(const Index m, const Index w, const Index jcol, MatrixType& A, IndexVector& perm_r, Index& nseg, ScalarVector& dense, IndexVector& panel_lsub, IndexVector& segrep, IndexVector& repfnz, IndexVector& xprune, IndexVector& marker, IndexVector& parent, IndexVector& xplore, GlobalLU_t& glu);
50
+
51
+ void panel_bmod(const Index m, const Index w, const Index jcol, const Index nseg, ScalarVector& dense, ScalarVector& tempv, IndexVector& segrep, IndexVector& repfnz, GlobalLU_t& glu);
52
+ Index column_dfs(const Index m, const Index jcol, IndexVector& perm_r, Index maxsuper, Index& nseg, BlockIndexVector lsub_col, IndexVector& segrep, BlockIndexVector repfnz, IndexVector& xprune, IndexVector& marker, IndexVector& parent, IndexVector& xplore, GlobalLU_t& glu);
53
+ Index column_bmod(const Index jcol, const Index nseg, BlockScalarVector dense, ScalarVector& tempv, BlockIndexVector segrep, BlockIndexVector repfnz, Index fpanelc, GlobalLU_t& glu);
54
+ Index copy_to_ucol(const Index jcol, const Index nseg, IndexVector& segrep, BlockIndexVector repfnz ,IndexVector& perm_r, BlockScalarVector dense, GlobalLU_t& glu);
55
+ void pruneL(const Index jcol, const IndexVector& perm_r, const Index pivrow, const Index nseg, const IndexVector& segrep, BlockIndexVector repfnz, IndexVector& xprune, GlobalLU_t& glu);
56
+ void countnz(const Index n, Index& nnzL, Index& nnzU, GlobalLU_t& glu);
57
+ void fixupL(const Index n, const IndexVector& perm_r, GlobalLU_t& glu);
58
+
59
+ template<typename , typename >
60
+ friend struct column_dfs_traits;
61
+ };
62
+
63
+ } // end namespace internal
64
+ } // namespace Eigen
65
+
66
+ #endif
@@ -0,0 +1,227 @@
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
+ /*
11
+
12
+ * NOTE: This file is the modified version of [s,d,c,z]memory.c files in SuperLU
13
+
14
+ * -- SuperLU routine (version 3.1) --
15
+ * Univ. of California Berkeley, Xerox Palo Alto Research Center,
16
+ * and Lawrence Berkeley National Lab.
17
+ * August 1, 2008
18
+ *
19
+ * Copyright (c) 1994 by Xerox Corporation. All rights reserved.
20
+ *
21
+ * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
22
+ * EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
23
+ *
24
+ * Permission is hereby granted to use or copy this program for any
25
+ * purpose, provided the above notices are retained on all copies.
26
+ * Permission to modify the code and to distribute modified code is
27
+ * granted, provided the above notices are retained, and a notice that
28
+ * the code was modified is included with the above copyright notice.
29
+ */
30
+
31
+ #ifndef EIGEN_SPARSELU_MEMORY
32
+ #define EIGEN_SPARSELU_MEMORY
33
+
34
+ namespace Eigen {
35
+ namespace internal {
36
+
37
+ enum { LUNoMarker = 3 };
38
+ enum {emptyIdxLU = -1};
39
+ template<typename Index>
40
+ inline Index LUnumTempV(Index& m, Index& w, Index& t, Index& b)
41
+ {
42
+ return (std::max)(m, (t+b)*w);
43
+ }
44
+
45
+ template< typename Scalar, typename Index>
46
+ inline Index LUTempSpace(Index&m, Index& w)
47
+ {
48
+ return (2*w + 4 + LUNoMarker) * m * sizeof(Index) + (w + 1) * m * sizeof(Scalar);
49
+ }
50
+
51
+
52
+
53
+
54
+ /**
55
+ * Expand the existing storage to accomodate more fill-ins
56
+ * \param vec Valid pointer to the vector to allocate or expand
57
+ * \param[in,out] length At input, contain the current length of the vector that is to be increased. At output, length of the newly allocated vector
58
+ * \param[in] nbElts Current number of elements in the factors
59
+ * \param keep_prev 1: use length and do not expand the vector; 0: compute new_len and expand
60
+ * \param[in,out] num_expansions Number of times the memory has been expanded
61
+ */
62
+ template <typename Scalar, typename Index>
63
+ template <typename VectorType>
64
+ Index SparseLUImpl<Scalar,Index>::expand(VectorType& vec, Index& length, Index nbElts, Index keep_prev, Index& num_expansions)
65
+ {
66
+
67
+ float alpha = 1.5; // Ratio of the memory increase
68
+ Index new_len; // New size of the allocated memory
69
+
70
+ if(num_expansions == 0 || keep_prev)
71
+ new_len = length ; // First time allocate requested
72
+ else
73
+ new_len = (std::max)(length+1,Index(alpha * length));
74
+
75
+ VectorType old_vec; // Temporary vector to hold the previous values
76
+ if (nbElts > 0 )
77
+ old_vec = vec.segment(0,nbElts);
78
+
79
+ //Allocate or expand the current vector
80
+ #ifdef EIGEN_EXCEPTIONS
81
+ try
82
+ #endif
83
+ {
84
+ vec.resize(new_len);
85
+ }
86
+ #ifdef EIGEN_EXCEPTIONS
87
+ catch(std::bad_alloc& )
88
+ #else
89
+ if(!vec.size())
90
+ #endif
91
+ {
92
+ if (!num_expansions)
93
+ {
94
+ // First time to allocate from LUMemInit()
95
+ // Let LUMemInit() deals with it.
96
+ return -1;
97
+ }
98
+ if (keep_prev)
99
+ {
100
+ // In this case, the memory length should not not be reduced
101
+ return new_len;
102
+ }
103
+ else
104
+ {
105
+ // Reduce the size and increase again
106
+ Index tries = 0; // Number of attempts
107
+ do
108
+ {
109
+ alpha = (alpha + 1)/2;
110
+ new_len = (std::max)(length+1,Index(alpha * length));
111
+ #ifdef EIGEN_EXCEPTIONS
112
+ try
113
+ #endif
114
+ {
115
+ vec.resize(new_len);
116
+ }
117
+ #ifdef EIGEN_EXCEPTIONS
118
+ catch(std::bad_alloc& )
119
+ #else
120
+ if (!vec.size())
121
+ #endif
122
+ {
123
+ tries += 1;
124
+ if ( tries > 10) return new_len;
125
+ }
126
+ } while (!vec.size());
127
+ }
128
+ }
129
+ //Copy the previous values to the newly allocated space
130
+ if (nbElts > 0)
131
+ vec.segment(0, nbElts) = old_vec;
132
+
133
+
134
+ length = new_len;
135
+ if(num_expansions) ++num_expansions;
136
+ return 0;
137
+ }
138
+
139
+ /**
140
+ * \brief Allocate various working space for the numerical factorization phase.
141
+ * \param m number of rows of the input matrix
142
+ * \param n number of columns
143
+ * \param annz number of initial nonzeros in the matrix
144
+ * \param lwork if lwork=-1, this routine returns an estimated size of the required memory
145
+ * \param glu persistent data to facilitate multiple factors : will be deleted later ??
146
+ * \param fillratio estimated ratio of fill in the factors
147
+ * \param panel_size Size of a panel
148
+ * \return an estimated size of the required memory if lwork = -1; otherwise, return the size of actually allocated memory when allocation failed, and 0 on success
149
+ * \note Unlike SuperLU, this routine does not support successive factorization with the same pattern and the same row permutation
150
+ */
151
+ template <typename Scalar, typename Index>
152
+ Index SparseLUImpl<Scalar,Index>::memInit(Index m, Index n, Index annz, Index lwork, Index fillratio, Index panel_size, GlobalLU_t& glu)
153
+ {
154
+ Index& num_expansions = glu.num_expansions; //No memory expansions so far
155
+ num_expansions = 0;
156
+ glu.nzumax = glu.nzlumax = (std::min)(fillratio * (annz+1) / n, m) * n; // estimated number of nonzeros in U
157
+ glu.nzlmax = (std::max)(Index(4), fillratio) * (annz+1) / 4; // estimated nnz in L factor
158
+ // Return the estimated size to the user if necessary
159
+ Index tempSpace;
160
+ tempSpace = (2*panel_size + 4 + LUNoMarker) * m * sizeof(Index) + (panel_size + 1) * m * sizeof(Scalar);
161
+ if (lwork == emptyIdxLU)
162
+ {
163
+ Index estimated_size;
164
+ estimated_size = (5 * n + 5) * sizeof(Index) + tempSpace
165
+ + (glu.nzlmax + glu.nzumax) * sizeof(Index) + (glu.nzlumax+glu.nzumax) * sizeof(Scalar) + n;
166
+ return estimated_size;
167
+ }
168
+
169
+ // Setup the required space
170
+
171
+ // First allocate Integer pointers for L\U factors
172
+ glu.xsup.resize(n+1);
173
+ glu.supno.resize(n+1);
174
+ glu.xlsub.resize(n+1);
175
+ glu.xlusup.resize(n+1);
176
+ glu.xusub.resize(n+1);
177
+
178
+ // Reserve memory for L/U factors
179
+ do
180
+ {
181
+ if( (expand<ScalarVector>(glu.lusup, glu.nzlumax, 0, 0, num_expansions)<0)
182
+ || (expand<ScalarVector>(glu.ucol, glu.nzumax, 0, 0, num_expansions)<0)
183
+ || (expand<IndexVector> (glu.lsub, glu.nzlmax, 0, 0, num_expansions)<0)
184
+ || (expand<IndexVector> (glu.usub, glu.nzumax, 0, 1, num_expansions)<0) )
185
+ {
186
+ //Reduce the estimated size and retry
187
+ glu.nzlumax /= 2;
188
+ glu.nzumax /= 2;
189
+ glu.nzlmax /= 2;
190
+ if (glu.nzlumax < annz ) return glu.nzlumax;
191
+ }
192
+ } while (!glu.lusup.size() || !glu.ucol.size() || !glu.lsub.size() || !glu.usub.size());
193
+
194
+ ++num_expansions;
195
+ return 0;
196
+
197
+ } // end LuMemInit
198
+
199
+ /**
200
+ * \brief Expand the existing storage
201
+ * \param vec vector to expand
202
+ * \param[in,out] maxlen On input, previous size of vec (Number of elements to copy ). on output, new size
203
+ * \param nbElts current number of elements in the vector.
204
+ * \param memtype Type of the element to expand
205
+ * \param num_expansions Number of expansions
206
+ * \return 0 on success, > 0 size of the memory allocated so far
207
+ */
208
+ template <typename Scalar, typename Index>
209
+ template <typename VectorType>
210
+ Index SparseLUImpl<Scalar,Index>::memXpand(VectorType& vec, Index& maxlen, Index nbElts, MemType memtype, Index& num_expansions)
211
+ {
212
+ Index failed_size;
213
+ if (memtype == USUB)
214
+ failed_size = this->expand<VectorType>(vec, maxlen, nbElts, 1, num_expansions);
215
+ else
216
+ failed_size = this->expand<VectorType>(vec, maxlen, nbElts, 0, num_expansions);
217
+
218
+ if (failed_size)
219
+ return failed_size;
220
+
221
+ return 0 ;
222
+ }
223
+
224
+ } // end namespace internal
225
+
226
+ } // end namespace Eigen
227
+ #endif // EIGEN_SPARSELU_MEMORY
@@ -0,0 +1,111 @@
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
+ /*
11
+ * NOTE: This file comes from a partly modified version of files slu_[s,d,c,z]defs.h
12
+ * -- SuperLU routine (version 4.1) --
13
+ * Univ. of California Berkeley, Xerox Palo Alto Research Center,
14
+ * and Lawrence Berkeley National Lab.
15
+ * November, 2010
16
+ *
17
+ * Global data structures used in LU factorization -
18
+ *
19
+ * nsuper: #supernodes = nsuper + 1, numbered [0, nsuper].
20
+ * (xsup,supno): supno[i] is the supernode no to which i belongs;
21
+ * xsup(s) points to the beginning of the s-th supernode.
22
+ * e.g. supno 0 1 2 2 3 3 3 4 4 4 4 4 (n=12)
23
+ * xsup 0 1 2 4 7 12
24
+ * Note: dfs will be performed on supernode rep. relative to the new
25
+ * row pivoting ordering
26
+ *
27
+ * (xlsub,lsub): lsub[*] contains the compressed subscript of
28
+ * rectangular supernodes; xlsub[j] points to the starting
29
+ * location of the j-th column in lsub[*]. Note that xlsub
30
+ * is indexed by column.
31
+ * Storage: original row subscripts
32
+ *
33
+ * During the course of sparse LU factorization, we also use
34
+ * (xlsub,lsub) for the purpose of symmetric pruning. For each
35
+ * supernode {s,s+1,...,t=s+r} with first column s and last
36
+ * column t, the subscript set
37
+ * lsub[j], j=xlsub[s], .., xlsub[s+1]-1
38
+ * is the structure of column s (i.e. structure of this supernode).
39
+ * It is used for the storage of numerical values.
40
+ * Furthermore,
41
+ * lsub[j], j=xlsub[t], .., xlsub[t+1]-1
42
+ * is the structure of the last column t of this supernode.
43
+ * It is for the purpose of symmetric pruning. Therefore, the
44
+ * structural subscripts can be rearranged without making physical
45
+ * interchanges among the numerical values.
46
+ *
47
+ * However, if the supernode has only one column, then we
48
+ * only keep one set of subscripts. For any subscript interchange
49
+ * performed, similar interchange must be done on the numerical
50
+ * values.
51
+ *
52
+ * The last column structures (for pruning) will be removed
53
+ * after the numercial LU factorization phase.
54
+ *
55
+ * (xlusup,lusup): lusup[*] contains the numerical values of the
56
+ * rectangular supernodes; xlusup[j] points to the starting
57
+ * location of the j-th column in storage vector lusup[*]
58
+ * Note: xlusup is indexed by column.
59
+ * Each rectangular supernode is stored by column-major
60
+ * scheme, consistent with Fortran 2-dim array storage.
61
+ *
62
+ * (xusub,ucol,usub): ucol[*] stores the numerical values of
63
+ * U-columns outside the rectangular supernodes. The row
64
+ * subscript of nonzero ucol[k] is stored in usub[k].
65
+ * xusub[i] points to the starting location of column i in ucol.
66
+ * Storage: new row subscripts; that is subscripts of PA.
67
+ */
68
+
69
+ #ifndef EIGEN_LU_STRUCTS
70
+ #define EIGEN_LU_STRUCTS
71
+ namespace Eigen {
72
+ namespace internal {
73
+
74
+ typedef enum {LUSUP, UCOL, LSUB, USUB, LLVL, ULVL} MemType;
75
+
76
+ template <typename IndexVector, typename ScalarVector>
77
+ struct LU_GlobalLU_t {
78
+ typedef typename IndexVector::Scalar Index;
79
+ IndexVector xsup; //First supernode column ... xsup(s) points to the beginning of the s-th supernode
80
+ IndexVector supno; // Supernode number corresponding to this column (column to supernode mapping)
81
+ ScalarVector lusup; // nonzero values of L ordered by columns
82
+ IndexVector lsub; // Compressed row indices of L rectangular supernodes.
83
+ IndexVector xlusup; // pointers to the beginning of each column in lusup
84
+ IndexVector xlsub; // pointers to the beginning of each column in lsub
85
+ Index nzlmax; // Current max size of lsub
86
+ Index nzlumax; // Current max size of lusup
87
+ ScalarVector ucol; // nonzero values of U ordered by columns
88
+ IndexVector usub; // row indices of U columns in ucol
89
+ IndexVector xusub; // Pointers to the beginning of each column of U in ucol
90
+ Index nzumax; // Current max size of ucol
91
+ Index n; // Number of columns in the matrix
92
+ Index num_expansions;
93
+ };
94
+
95
+ // Values to set for performance
96
+ template <typename Index>
97
+ struct perfvalues {
98
+ Index panel_size; // a panel consists of at most <panel_size> consecutive columns
99
+ Index relax; // To control degree of relaxing supernodes. If the number of nodes (columns)
100
+ // in a subtree of the elimination tree is less than relax, this subtree is considered
101
+ // as one supernode regardless of the row structures of those columns
102
+ Index maxsuper; // The maximum size for a supernode in complete LU
103
+ Index rowblk; // The minimum row dimension for 2-D blocking to be used;
104
+ Index colblk; // The minimum column dimension for 2-D blocking to be used;
105
+ Index fillfactor; // The estimated fills factors for L and U, compared with A
106
+ };
107
+
108
+ } // end namespace internal
109
+
110
+ } // end namespace Eigen
111
+ #endif // EIGEN_LU_STRUCTS
@@ -0,0 +1,298 @@
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
+ // Copyright (C) 2012 Gael Guennebaud <gael.guennebaud@inria.fr>
6
+ //
7
+ // This Source Code Form is subject to the terms of the Mozilla
8
+ // Public License v. 2.0. If a copy of the MPL was not distributed
9
+ // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10
+
11
+ #ifndef EIGEN_SPARSELU_SUPERNODAL_MATRIX_H
12
+ #define EIGEN_SPARSELU_SUPERNODAL_MATRIX_H
13
+
14
+ namespace Eigen {
15
+ namespace internal {
16
+
17
+ /** \ingroup SparseLU_Module
18
+ * \brief a class to manipulate the L supernodal factor from the SparseLU factorization
19
+ *
20
+ * This class contain the data to easily store
21
+ * and manipulate the supernodes during the factorization and solution phase of Sparse LU.
22
+ * Only the lower triangular matrix has supernodes.
23
+ *
24
+ * NOTE : This class corresponds to the SCformat structure in SuperLU
25
+ *
26
+ */
27
+ /* TODO
28
+ * InnerIterator as for sparsematrix
29
+ * SuperInnerIterator to iterate through all supernodes
30
+ * Function for triangular solve
31
+ */
32
+ template <typename _Scalar, typename _Index>
33
+ class MappedSuperNodalMatrix
34
+ {
35
+ public:
36
+ typedef _Scalar Scalar;
37
+ typedef _Index Index;
38
+ typedef Matrix<Index,Dynamic,1> IndexVector;
39
+ typedef Matrix<Scalar,Dynamic,1> ScalarVector;
40
+ public:
41
+ MappedSuperNodalMatrix()
42
+ {
43
+
44
+ }
45
+ MappedSuperNodalMatrix(Index m, Index n, ScalarVector& nzval, IndexVector& nzval_colptr, IndexVector& rowind,
46
+ IndexVector& rowind_colptr, IndexVector& col_to_sup, IndexVector& sup_to_col )
47
+ {
48
+ setInfos(m, n, nzval, nzval_colptr, rowind, rowind_colptr, col_to_sup, sup_to_col);
49
+ }
50
+
51
+ ~MappedSuperNodalMatrix()
52
+ {
53
+
54
+ }
55
+ /**
56
+ * Set appropriate pointers for the lower triangular supernodal matrix
57
+ * These infos are available at the end of the numerical factorization
58
+ * FIXME This class will be modified such that it can be use in the course
59
+ * of the factorization.
60
+ */
61
+ void setInfos(Index m, Index n, ScalarVector& nzval, IndexVector& nzval_colptr, IndexVector& rowind,
62
+ IndexVector& rowind_colptr, IndexVector& col_to_sup, IndexVector& sup_to_col )
63
+ {
64
+ m_row = m;
65
+ m_col = n;
66
+ m_nzval = nzval.data();
67
+ m_nzval_colptr = nzval_colptr.data();
68
+ m_rowind = rowind.data();
69
+ m_rowind_colptr = rowind_colptr.data();
70
+ m_nsuper = col_to_sup(n);
71
+ m_col_to_sup = col_to_sup.data();
72
+ m_sup_to_col = sup_to_col.data();
73
+ }
74
+
75
+ /**
76
+ * Number of rows
77
+ */
78
+ Index rows() { return m_row; }
79
+
80
+ /**
81
+ * Number of columns
82
+ */
83
+ Index cols() { return m_col; }
84
+
85
+ /**
86
+ * Return the array of nonzero values packed by column
87
+ *
88
+ * The size is nnz
89
+ */
90
+ Scalar* valuePtr() { return m_nzval; }
91
+
92
+ const Scalar* valuePtr() const
93
+ {
94
+ return m_nzval;
95
+ }
96
+ /**
97
+ * Return the pointers to the beginning of each column in \ref valuePtr()
98
+ */
99
+ Index* colIndexPtr()
100
+ {
101
+ return m_nzval_colptr;
102
+ }
103
+
104
+ const Index* colIndexPtr() const
105
+ {
106
+ return m_nzval_colptr;
107
+ }
108
+
109
+ /**
110
+ * Return the array of compressed row indices of all supernodes
111
+ */
112
+ Index* rowIndex() { return m_rowind; }
113
+
114
+ const Index* rowIndex() const
115
+ {
116
+ return m_rowind;
117
+ }
118
+
119
+ /**
120
+ * Return the location in \em rowvaluePtr() which starts each column
121
+ */
122
+ Index* rowIndexPtr() { return m_rowind_colptr; }
123
+
124
+ const Index* rowIndexPtr() const
125
+ {
126
+ return m_rowind_colptr;
127
+ }
128
+
129
+ /**
130
+ * Return the array of column-to-supernode mapping
131
+ */
132
+ Index* colToSup() { return m_col_to_sup; }
133
+
134
+ const Index* colToSup() const
135
+ {
136
+ return m_col_to_sup;
137
+ }
138
+ /**
139
+ * Return the array of supernode-to-column mapping
140
+ */
141
+ Index* supToCol() { return m_sup_to_col; }
142
+
143
+ const Index* supToCol() const
144
+ {
145
+ return m_sup_to_col;
146
+ }
147
+
148
+ /**
149
+ * Return the number of supernodes
150
+ */
151
+ Index nsuper() const
152
+ {
153
+ return m_nsuper;
154
+ }
155
+
156
+ class InnerIterator;
157
+ template<typename Dest>
158
+ void solveInPlace( MatrixBase<Dest>&X) const;
159
+
160
+
161
+
162
+
163
+ protected:
164
+ Index m_row; // Number of rows
165
+ Index m_col; // Number of columns
166
+ Index m_nsuper; // Number of supernodes
167
+ Scalar* m_nzval; //array of nonzero values packed by column
168
+ Index* m_nzval_colptr; //nzval_colptr[j] Stores the location in nzval[] which starts column j
169
+ Index* m_rowind; // Array of compressed row indices of rectangular supernodes
170
+ Index* m_rowind_colptr; //rowind_colptr[j] stores the location in rowind[] which starts column j
171
+ Index* m_col_to_sup; // col_to_sup[j] is the supernode number to which column j belongs
172
+ Index* m_sup_to_col; //sup_to_col[s] points to the starting column of the s-th supernode
173
+
174
+ private :
175
+ };
176
+
177
+ /**
178
+ * \brief InnerIterator class to iterate over nonzero values of the current column in the supernodal matrix L
179
+ *
180
+ */
181
+ template<typename Scalar, typename Index>
182
+ class MappedSuperNodalMatrix<Scalar,Index>::InnerIterator
183
+ {
184
+ public:
185
+ InnerIterator(const MappedSuperNodalMatrix& mat, Index outer)
186
+ : m_matrix(mat),
187
+ m_outer(outer),
188
+ m_supno(mat.colToSup()[outer]),
189
+ m_idval(mat.colIndexPtr()[outer]),
190
+ m_startidval(m_idval),
191
+ m_endidval(mat.colIndexPtr()[outer+1]),
192
+ m_idrow(mat.rowIndexPtr()[mat.supToCol()[mat.colToSup()[outer]]]),
193
+ m_endidrow(mat.rowIndexPtr()[mat.supToCol()[mat.colToSup()[outer]]+1])
194
+ {}
195
+ inline InnerIterator& operator++()
196
+ {
197
+ m_idval++;
198
+ m_idrow++;
199
+ return *this;
200
+ }
201
+ inline Scalar value() const { return m_matrix.valuePtr()[m_idval]; }
202
+
203
+ inline Scalar& valueRef() { return const_cast<Scalar&>(m_matrix.valuePtr()[m_idval]); }
204
+
205
+ inline Index index() const { return m_matrix.rowIndex()[m_idrow]; }
206
+ inline Index row() const { return index(); }
207
+ inline Index col() const { return m_outer; }
208
+
209
+ inline Index supIndex() const { return m_supno; }
210
+
211
+ inline operator bool() const
212
+ {
213
+ return ( (m_idval < m_endidval) && (m_idval >= m_startidval)
214
+ && (m_idrow < m_endidrow) );
215
+ }
216
+
217
+ protected:
218
+ const MappedSuperNodalMatrix& m_matrix; // Supernodal lower triangular matrix
219
+ const Index m_outer; // Current column
220
+ const Index m_supno; // Current SuperNode number
221
+ Index m_idval; // Index to browse the values in the current column
222
+ const Index m_startidval; // Start of the column value
223
+ const Index m_endidval; // End of the column value
224
+ Index m_idrow; // Index to browse the row indices
225
+ Index m_endidrow; // End index of row indices of the current column
226
+ };
227
+
228
+ /**
229
+ * \brief Solve with the supernode triangular matrix
230
+ *
231
+ */
232
+ template<typename Scalar, typename Index>
233
+ template<typename Dest>
234
+ void MappedSuperNodalMatrix<Scalar,Index>::solveInPlace( MatrixBase<Dest>&X) const
235
+ {
236
+ Index n = X.rows();
237
+ Index nrhs = X.cols();
238
+ const Scalar * Lval = valuePtr(); // Nonzero values
239
+ Matrix<Scalar,Dynamic,Dynamic, ColMajor> work(n, nrhs); // working vector
240
+ work.setZero();
241
+ for (Index k = 0; k <= nsuper(); k ++)
242
+ {
243
+ Index fsupc = supToCol()[k]; // First column of the current supernode
244
+ Index istart = rowIndexPtr()[fsupc]; // Pointer index to the subscript of the current column
245
+ Index nsupr = rowIndexPtr()[fsupc+1] - istart; // Number of rows in the current supernode
246
+ Index nsupc = supToCol()[k+1] - fsupc; // Number of columns in the current supernode
247
+ Index nrow = nsupr - nsupc; // Number of rows in the non-diagonal part of the supernode
248
+ Index irow; //Current index row
249
+
250
+ if (nsupc == 1 )
251
+ {
252
+ for (Index j = 0; j < nrhs; j++)
253
+ {
254
+ InnerIterator it(*this, fsupc);
255
+ ++it; // Skip the diagonal element
256
+ for (; it; ++it)
257
+ {
258
+ irow = it.row();
259
+ X(irow, j) -= X(fsupc, j) * it.value();
260
+ }
261
+ }
262
+ }
263
+ else
264
+ {
265
+ // The supernode has more than one column
266
+ Index luptr = colIndexPtr()[fsupc];
267
+ Index lda = colIndexPtr()[fsupc+1] - luptr;
268
+
269
+ // Triangular solve
270
+ Map<const Matrix<Scalar,Dynamic,Dynamic, ColMajor>, 0, OuterStride<> > A( &(Lval[luptr]), nsupc, nsupc, OuterStride<>(lda) );
271
+ Map< Matrix<Scalar,Dynamic,Dynamic, ColMajor>, 0, OuterStride<> > U (&(X(fsupc,0)), nsupc, nrhs, OuterStride<>(n) );
272
+ U = A.template triangularView<UnitLower>().solve(U);
273
+
274
+ // Matrix-vector product
275
+ new (&A) Map<const Matrix<Scalar,Dynamic,Dynamic, ColMajor>, 0, OuterStride<> > ( &(Lval[luptr+nsupc]), nrow, nsupc, OuterStride<>(lda) );
276
+ work.block(0, 0, nrow, nrhs) = A * U;
277
+
278
+ //Begin Scatter
279
+ for (Index j = 0; j < nrhs; j++)
280
+ {
281
+ Index iptr = istart + nsupc;
282
+ for (Index i = 0; i < nrow; i++)
283
+ {
284
+ irow = rowIndex()[iptr];
285
+ X(irow, j) -= work(i, j); // Scatter operation
286
+ work(i, j) = Scalar(0);
287
+ iptr++;
288
+ }
289
+ }
290
+ }
291
+ }
292
+ }
293
+
294
+ } // end namespace internal
295
+
296
+ } // end namespace Eigen
297
+
298
+ #endif // EIGEN_SPARSELU_MATRIX_H