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,131 @@
1
+ /*
2
+ Copyright (c) 2011, Intel Corporation. All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without modification,
5
+ are permitted provided that the following conditions are met:
6
+
7
+ * Redistributions of source code must retain the above copyright notice, this
8
+ list of conditions and the following disclaimer.
9
+ * Redistributions in binary form must reproduce the above copyright notice,
10
+ this list of conditions and the following disclaimer in the documentation
11
+ and/or other materials provided with the distribution.
12
+ * Neither the name of Intel Corporation nor the names of its contributors may
13
+ be used to endorse or promote products derived from this software without
14
+ specific prior written permission.
15
+
16
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
20
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
23
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
+
27
+ ********************************************************************************
28
+ * Content : Eigen bindings to Intel(R) MKL
29
+ * General matrix-vector product functionality based on ?GEMV.
30
+ ********************************************************************************
31
+ */
32
+
33
+ #ifndef EIGEN_GENERAL_MATRIX_VECTOR_MKL_H
34
+ #define EIGEN_GENERAL_MATRIX_VECTOR_MKL_H
35
+
36
+ namespace Eigen {
37
+
38
+ namespace internal {
39
+
40
+ /**********************************************************************
41
+ * This file implements general matrix-vector multiplication using BLAS
42
+ * gemv function via partial specialization of
43
+ * general_matrix_vector_product::run(..) method for float, double,
44
+ * std::complex<float> and std::complex<double> types
45
+ **********************************************************************/
46
+
47
+ // gemv specialization
48
+
49
+ template<typename Index, typename LhsScalar, int LhsStorageOrder, bool ConjugateLhs, typename RhsScalar, bool ConjugateRhs>
50
+ struct general_matrix_vector_product_gemv :
51
+ general_matrix_vector_product<Index,LhsScalar,LhsStorageOrder,ConjugateLhs,RhsScalar,ConjugateRhs,BuiltIn> {};
52
+
53
+ #define EIGEN_MKL_GEMV_SPECIALIZE(Scalar) \
54
+ template<typename Index, bool ConjugateLhs, bool ConjugateRhs> \
55
+ struct general_matrix_vector_product<Index,Scalar,ColMajor,ConjugateLhs,Scalar,ConjugateRhs,Specialized> { \
56
+ static void run( \
57
+ Index rows, Index cols, \
58
+ const Scalar* lhs, Index lhsStride, \
59
+ const Scalar* rhs, Index rhsIncr, \
60
+ Scalar* res, Index resIncr, Scalar alpha) \
61
+ { \
62
+ if (ConjugateLhs) { \
63
+ general_matrix_vector_product<Index,Scalar,ColMajor,ConjugateLhs,Scalar,ConjugateRhs,BuiltIn>::run( \
64
+ rows, cols, lhs, lhsStride, rhs, rhsIncr, res, resIncr, alpha); \
65
+ } else { \
66
+ general_matrix_vector_product_gemv<Index,Scalar,ColMajor,ConjugateLhs,Scalar,ConjugateRhs>::run( \
67
+ rows, cols, lhs, lhsStride, rhs, rhsIncr, res, resIncr, alpha); \
68
+ } \
69
+ } \
70
+ }; \
71
+ template<typename Index, bool ConjugateLhs, bool ConjugateRhs> \
72
+ struct general_matrix_vector_product<Index,Scalar,RowMajor,ConjugateLhs,Scalar,ConjugateRhs,Specialized> { \
73
+ static void run( \
74
+ Index rows, Index cols, \
75
+ const Scalar* lhs, Index lhsStride, \
76
+ const Scalar* rhs, Index rhsIncr, \
77
+ Scalar* res, Index resIncr, Scalar alpha) \
78
+ { \
79
+ general_matrix_vector_product_gemv<Index,Scalar,RowMajor,ConjugateLhs,Scalar,ConjugateRhs>::run( \
80
+ rows, cols, lhs, lhsStride, rhs, rhsIncr, res, resIncr, alpha); \
81
+ } \
82
+ }; \
83
+
84
+ EIGEN_MKL_GEMV_SPECIALIZE(double)
85
+ EIGEN_MKL_GEMV_SPECIALIZE(float)
86
+ EIGEN_MKL_GEMV_SPECIALIZE(dcomplex)
87
+ EIGEN_MKL_GEMV_SPECIALIZE(scomplex)
88
+
89
+ #define EIGEN_MKL_GEMV_SPECIALIZATION(EIGTYPE,MKLTYPE,MKLPREFIX) \
90
+ template<typename Index, int LhsStorageOrder, bool ConjugateLhs, bool ConjugateRhs> \
91
+ struct general_matrix_vector_product_gemv<Index,EIGTYPE,LhsStorageOrder,ConjugateLhs,EIGTYPE,ConjugateRhs> \
92
+ { \
93
+ typedef Matrix<EIGTYPE,Dynamic,1,ColMajor> GEMVVector;\
94
+ \
95
+ static void run( \
96
+ Index rows, Index cols, \
97
+ const EIGTYPE* lhs, Index lhsStride, \
98
+ const EIGTYPE* rhs, Index rhsIncr, \
99
+ EIGTYPE* res, Index resIncr, EIGTYPE alpha) \
100
+ { \
101
+ MKL_INT m=rows, n=cols, lda=lhsStride, incx=rhsIncr, incy=resIncr; \
102
+ MKLTYPE alpha_, beta_; \
103
+ const EIGTYPE *x_ptr, myone(1); \
104
+ char trans=(LhsStorageOrder==ColMajor) ? 'N' : (ConjugateLhs) ? 'C' : 'T'; \
105
+ if (LhsStorageOrder==RowMajor) { \
106
+ m=cols; \
107
+ n=rows; \
108
+ }\
109
+ assign_scalar_eig2mkl(alpha_, alpha); \
110
+ assign_scalar_eig2mkl(beta_, myone); \
111
+ GEMVVector x_tmp; \
112
+ if (ConjugateRhs) { \
113
+ Map<const GEMVVector, 0, InnerStride<> > map_x(rhs,cols,1,InnerStride<>(incx)); \
114
+ x_tmp=map_x.conjugate(); \
115
+ x_ptr=x_tmp.data(); \
116
+ incx=1; \
117
+ } else x_ptr=rhs; \
118
+ MKLPREFIX##gemv(&trans, &m, &n, &alpha_, (const MKLTYPE*)lhs, &lda, (const MKLTYPE*)x_ptr, &incx, &beta_, (MKLTYPE*)res, &incy); \
119
+ }\
120
+ };
121
+
122
+ EIGEN_MKL_GEMV_SPECIALIZATION(double, double, d)
123
+ EIGEN_MKL_GEMV_SPECIALIZATION(float, float, s)
124
+ EIGEN_MKL_GEMV_SPECIALIZATION(dcomplex, MKL_Complex16, z)
125
+ EIGEN_MKL_GEMV_SPECIALIZATION(scomplex, MKL_Complex8, c)
126
+
127
+ } // end namespase internal
128
+
129
+ } // end namespace Eigen
130
+
131
+ #endif // EIGEN_GENERAL_MATRIX_VECTOR_MKL_H
@@ -0,0 +1,162 @@
1
+ // This file is part of Eigen, a lightweight C++ template library
2
+ // for linear algebra.
3
+ //
4
+ // Copyright (C) 2010 Gael Guennebaud <gael.guennebaud@inria.fr>
5
+ //
6
+ // This Source Code Form is subject to the terms of the Mozilla
7
+ // Public License v. 2.0. If a copy of the MPL was not distributed
8
+ // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
+
10
+ #ifndef EIGEN_PARALLELIZER_H
11
+ #define EIGEN_PARALLELIZER_H
12
+
13
+ namespace Eigen {
14
+
15
+ namespace internal {
16
+
17
+ /** \internal */
18
+ inline void manage_multi_threading(Action action, int* v)
19
+ {
20
+ static EIGEN_UNUSED int m_maxThreads = -1;
21
+
22
+ if(action==SetAction)
23
+ {
24
+ eigen_internal_assert(v!=0);
25
+ m_maxThreads = *v;
26
+ }
27
+ else if(action==GetAction)
28
+ {
29
+ eigen_internal_assert(v!=0);
30
+ #ifdef EIGEN_HAS_OPENMP
31
+ if(m_maxThreads>0)
32
+ *v = m_maxThreads;
33
+ else
34
+ *v = omp_get_max_threads();
35
+ #else
36
+ *v = 1;
37
+ #endif
38
+ }
39
+ else
40
+ {
41
+ eigen_internal_assert(false);
42
+ }
43
+ }
44
+
45
+ }
46
+
47
+ /** Must be call first when calling Eigen from multiple threads */
48
+ inline void initParallel()
49
+ {
50
+ int nbt;
51
+ internal::manage_multi_threading(GetAction, &nbt);
52
+ std::ptrdiff_t l1, l2;
53
+ internal::manage_caching_sizes(GetAction, &l1, &l2);
54
+ }
55
+
56
+ /** \returns the max number of threads reserved for Eigen
57
+ * \sa setNbThreads */
58
+ inline int nbThreads()
59
+ {
60
+ int ret;
61
+ internal::manage_multi_threading(GetAction, &ret);
62
+ return ret;
63
+ }
64
+
65
+ /** Sets the max number of threads reserved for Eigen
66
+ * \sa nbThreads */
67
+ inline void setNbThreads(int v)
68
+ {
69
+ internal::manage_multi_threading(SetAction, &v);
70
+ }
71
+
72
+ namespace internal {
73
+
74
+ template<typename Index> struct GemmParallelInfo
75
+ {
76
+ GemmParallelInfo() : sync(-1), users(0), rhs_start(0), rhs_length(0) {}
77
+
78
+ int volatile sync;
79
+ int volatile users;
80
+
81
+ Index rhs_start;
82
+ Index rhs_length;
83
+ };
84
+
85
+ template<bool Condition, typename Functor, typename Index>
86
+ void parallelize_gemm(const Functor& func, Index rows, Index cols, bool transpose)
87
+ {
88
+ // TODO when EIGEN_USE_BLAS is defined,
89
+ // we should still enable OMP for other scalar types
90
+ #if !(defined (EIGEN_HAS_OPENMP)) || defined (EIGEN_USE_BLAS)
91
+ // FIXME the transpose variable is only needed to properly split
92
+ // the matrix product when multithreading is enabled. This is a temporary
93
+ // fix to support row-major destination matrices. This whole
94
+ // parallelizer mechanism has to be redisigned anyway.
95
+ EIGEN_UNUSED_VARIABLE(transpose);
96
+ func(0,rows, 0,cols);
97
+ #else
98
+
99
+ // Dynamically check whether we should enable or disable OpenMP.
100
+ // The conditions are:
101
+ // - the max number of threads we can create is greater than 1
102
+ // - we are not already in a parallel code
103
+ // - the sizes are large enough
104
+
105
+ // 1- are we already in a parallel session?
106
+ // FIXME omp_get_num_threads()>1 only works for openmp, what if the user does not use openmp?
107
+ if((!Condition) || (omp_get_num_threads()>1))
108
+ return func(0,rows, 0,cols);
109
+
110
+ Index size = transpose ? cols : rows;
111
+
112
+ // 2- compute the maximal number of threads from the size of the product:
113
+ // FIXME this has to be fine tuned
114
+ Index max_threads = std::max<Index>(1,size / 32);
115
+
116
+ // 3 - compute the number of threads we are going to use
117
+ Index threads = std::min<Index>(nbThreads(), max_threads);
118
+
119
+ if(threads==1)
120
+ return func(0,rows, 0,cols);
121
+
122
+ Eigen::initParallel();
123
+ func.initParallelSession();
124
+
125
+ if(transpose)
126
+ std::swap(rows,cols);
127
+
128
+ GemmParallelInfo<Index>* info = new GemmParallelInfo<Index>[threads];
129
+
130
+ #pragma omp parallel num_threads(threads)
131
+ {
132
+ Index i = omp_get_thread_num();
133
+ // Note that the actual number of threads might be lower than the number of request ones.
134
+ Index actual_threads = omp_get_num_threads();
135
+
136
+ Index blockCols = (cols / actual_threads) & ~Index(0x3);
137
+ Index blockRows = (rows / actual_threads) & ~Index(0x7);
138
+
139
+ Index r0 = i*blockRows;
140
+ Index actualBlockRows = (i+1==actual_threads) ? rows-r0 : blockRows;
141
+
142
+ Index c0 = i*blockCols;
143
+ Index actualBlockCols = (i+1==actual_threads) ? cols-c0 : blockCols;
144
+
145
+ info[i].rhs_start = c0;
146
+ info[i].rhs_length = actualBlockCols;
147
+
148
+ if(transpose)
149
+ func(0, cols, r0, actualBlockRows, info);
150
+ else
151
+ func(r0, actualBlockRows, 0,cols, info);
152
+ }
153
+
154
+ delete[] info;
155
+ #endif
156
+ }
157
+
158
+ } // end namespace internal
159
+
160
+ } // end namespace Eigen
161
+
162
+ #endif // EIGEN_PARALLELIZER_H
@@ -0,0 +1,436 @@
1
+ // This file is part of Eigen, a lightweight C++ template library
2
+ // for linear algebra.
3
+ //
4
+ // Copyright (C) 2009 Gael Guennebaud <gael.guennebaud@inria.fr>
5
+ //
6
+ // This Source Code Form is subject to the terms of the Mozilla
7
+ // Public License v. 2.0. If a copy of the MPL was not distributed
8
+ // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
+
10
+ #ifndef EIGEN_SELFADJOINT_MATRIX_MATRIX_H
11
+ #define EIGEN_SELFADJOINT_MATRIX_MATRIX_H
12
+
13
+ namespace Eigen {
14
+
15
+ namespace internal {
16
+
17
+ // pack a selfadjoint block diagonal for use with the gebp_kernel
18
+ template<typename Scalar, typename Index, int Pack1, int Pack2, int StorageOrder>
19
+ struct symm_pack_lhs
20
+ {
21
+ template<int BlockRows> inline
22
+ void pack(Scalar* blockA, const const_blas_data_mapper<Scalar,Index,StorageOrder>& lhs, Index cols, Index i, Index& count)
23
+ {
24
+ // normal copy
25
+ for(Index k=0; k<i; k++)
26
+ for(Index w=0; w<BlockRows; w++)
27
+ blockA[count++] = lhs(i+w,k); // normal
28
+ // symmetric copy
29
+ Index h = 0;
30
+ for(Index k=i; k<i+BlockRows; k++)
31
+ {
32
+ for(Index w=0; w<h; w++)
33
+ blockA[count++] = numext::conj(lhs(k, i+w)); // transposed
34
+
35
+ blockA[count++] = numext::real(lhs(k,k)); // real (diagonal)
36
+
37
+ for(Index w=h+1; w<BlockRows; w++)
38
+ blockA[count++] = lhs(i+w, k); // normal
39
+ ++h;
40
+ }
41
+ // transposed copy
42
+ for(Index k=i+BlockRows; k<cols; k++)
43
+ for(Index w=0; w<BlockRows; w++)
44
+ blockA[count++] = numext::conj(lhs(k, i+w)); // transposed
45
+ }
46
+ void operator()(Scalar* blockA, const Scalar* _lhs, Index lhsStride, Index cols, Index rows)
47
+ {
48
+ const_blas_data_mapper<Scalar,Index,StorageOrder> lhs(_lhs,lhsStride);
49
+ Index count = 0;
50
+ Index peeled_mc = (rows/Pack1)*Pack1;
51
+ for(Index i=0; i<peeled_mc; i+=Pack1)
52
+ {
53
+ pack<Pack1>(blockA, lhs, cols, i, count);
54
+ }
55
+
56
+ if(rows-peeled_mc>=Pack2)
57
+ {
58
+ pack<Pack2>(blockA, lhs, cols, peeled_mc, count);
59
+ peeled_mc += Pack2;
60
+ }
61
+
62
+ // do the same with mr==1
63
+ for(Index i=peeled_mc; i<rows; i++)
64
+ {
65
+ for(Index k=0; k<i; k++)
66
+ blockA[count++] = lhs(i, k); // normal
67
+
68
+ blockA[count++] = numext::real(lhs(i, i)); // real (diagonal)
69
+
70
+ for(Index k=i+1; k<cols; k++)
71
+ blockA[count++] = numext::conj(lhs(k, i)); // transposed
72
+ }
73
+ }
74
+ };
75
+
76
+ template<typename Scalar, typename Index, int nr, int StorageOrder>
77
+ struct symm_pack_rhs
78
+ {
79
+ enum { PacketSize = packet_traits<Scalar>::size };
80
+ void operator()(Scalar* blockB, const Scalar* _rhs, Index rhsStride, Index rows, Index cols, Index k2)
81
+ {
82
+ Index end_k = k2 + rows;
83
+ Index count = 0;
84
+ const_blas_data_mapper<Scalar,Index,StorageOrder> rhs(_rhs,rhsStride);
85
+ Index packet_cols = (cols/nr)*nr;
86
+
87
+ // first part: normal case
88
+ for(Index j2=0; j2<k2; j2+=nr)
89
+ {
90
+ for(Index k=k2; k<end_k; k++)
91
+ {
92
+ blockB[count+0] = rhs(k,j2+0);
93
+ blockB[count+1] = rhs(k,j2+1);
94
+ if (nr==4)
95
+ {
96
+ blockB[count+2] = rhs(k,j2+2);
97
+ blockB[count+3] = rhs(k,j2+3);
98
+ }
99
+ count += nr;
100
+ }
101
+ }
102
+
103
+ // second part: diagonal block
104
+ for(Index j2=k2; j2<(std::min)(k2+rows,packet_cols); j2+=nr)
105
+ {
106
+ // again we can split vertically in three different parts (transpose, symmetric, normal)
107
+ // transpose
108
+ for(Index k=k2; k<j2; k++)
109
+ {
110
+ blockB[count+0] = numext::conj(rhs(j2+0,k));
111
+ blockB[count+1] = numext::conj(rhs(j2+1,k));
112
+ if (nr==4)
113
+ {
114
+ blockB[count+2] = numext::conj(rhs(j2+2,k));
115
+ blockB[count+3] = numext::conj(rhs(j2+3,k));
116
+ }
117
+ count += nr;
118
+ }
119
+ // symmetric
120
+ Index h = 0;
121
+ for(Index k=j2; k<j2+nr; k++)
122
+ {
123
+ // normal
124
+ for (Index w=0 ; w<h; ++w)
125
+ blockB[count+w] = rhs(k,j2+w);
126
+
127
+ blockB[count+h] = numext::real(rhs(k,k));
128
+
129
+ // transpose
130
+ for (Index w=h+1 ; w<nr; ++w)
131
+ blockB[count+w] = numext::conj(rhs(j2+w,k));
132
+ count += nr;
133
+ ++h;
134
+ }
135
+ // normal
136
+ for(Index k=j2+nr; k<end_k; k++)
137
+ {
138
+ blockB[count+0] = rhs(k,j2+0);
139
+ blockB[count+1] = rhs(k,j2+1);
140
+ if (nr==4)
141
+ {
142
+ blockB[count+2] = rhs(k,j2+2);
143
+ blockB[count+3] = rhs(k,j2+3);
144
+ }
145
+ count += nr;
146
+ }
147
+ }
148
+
149
+ // third part: transposed
150
+ for(Index j2=k2+rows; j2<packet_cols; j2+=nr)
151
+ {
152
+ for(Index k=k2; k<end_k; k++)
153
+ {
154
+ blockB[count+0] = numext::conj(rhs(j2+0,k));
155
+ blockB[count+1] = numext::conj(rhs(j2+1,k));
156
+ if (nr==4)
157
+ {
158
+ blockB[count+2] = numext::conj(rhs(j2+2,k));
159
+ blockB[count+3] = numext::conj(rhs(j2+3,k));
160
+ }
161
+ count += nr;
162
+ }
163
+ }
164
+
165
+ // copy the remaining columns one at a time (=> the same with nr==1)
166
+ for(Index j2=packet_cols; j2<cols; ++j2)
167
+ {
168
+ // transpose
169
+ Index half = (std::min)(end_k,j2);
170
+ for(Index k=k2; k<half; k++)
171
+ {
172
+ blockB[count] = numext::conj(rhs(j2,k));
173
+ count += 1;
174
+ }
175
+
176
+ if(half==j2 && half<k2+rows)
177
+ {
178
+ blockB[count] = numext::real(rhs(j2,j2));
179
+ count += 1;
180
+ }
181
+ else
182
+ half--;
183
+
184
+ // normal
185
+ for(Index k=half+1; k<k2+rows; k++)
186
+ {
187
+ blockB[count] = rhs(k,j2);
188
+ count += 1;
189
+ }
190
+ }
191
+ }
192
+ };
193
+
194
+ /* Optimized selfadjoint matrix * matrix (_SYMM) product built on top of
195
+ * the general matrix matrix product.
196
+ */
197
+ template <typename Scalar, typename Index,
198
+ int LhsStorageOrder, bool LhsSelfAdjoint, bool ConjugateLhs,
199
+ int RhsStorageOrder, bool RhsSelfAdjoint, bool ConjugateRhs,
200
+ int ResStorageOrder>
201
+ struct product_selfadjoint_matrix;
202
+
203
+ template <typename Scalar, typename Index,
204
+ int LhsStorageOrder, bool LhsSelfAdjoint, bool ConjugateLhs,
205
+ int RhsStorageOrder, bool RhsSelfAdjoint, bool ConjugateRhs>
206
+ struct product_selfadjoint_matrix<Scalar,Index,LhsStorageOrder,LhsSelfAdjoint,ConjugateLhs, RhsStorageOrder,RhsSelfAdjoint,ConjugateRhs,RowMajor>
207
+ {
208
+
209
+ static EIGEN_STRONG_INLINE void run(
210
+ Index rows, Index cols,
211
+ const Scalar* lhs, Index lhsStride,
212
+ const Scalar* rhs, Index rhsStride,
213
+ Scalar* res, Index resStride,
214
+ const Scalar& alpha)
215
+ {
216
+ product_selfadjoint_matrix<Scalar, Index,
217
+ EIGEN_LOGICAL_XOR(RhsSelfAdjoint,RhsStorageOrder==RowMajor) ? ColMajor : RowMajor,
218
+ RhsSelfAdjoint, NumTraits<Scalar>::IsComplex && EIGEN_LOGICAL_XOR(RhsSelfAdjoint,ConjugateRhs),
219
+ EIGEN_LOGICAL_XOR(LhsSelfAdjoint,LhsStorageOrder==RowMajor) ? ColMajor : RowMajor,
220
+ LhsSelfAdjoint, NumTraits<Scalar>::IsComplex && EIGEN_LOGICAL_XOR(LhsSelfAdjoint,ConjugateLhs),
221
+ ColMajor>
222
+ ::run(cols, rows, rhs, rhsStride, lhs, lhsStride, res, resStride, alpha);
223
+ }
224
+ };
225
+
226
+ template <typename Scalar, typename Index,
227
+ int LhsStorageOrder, bool ConjugateLhs,
228
+ int RhsStorageOrder, bool ConjugateRhs>
229
+ struct product_selfadjoint_matrix<Scalar,Index,LhsStorageOrder,true,ConjugateLhs, RhsStorageOrder,false,ConjugateRhs,ColMajor>
230
+ {
231
+
232
+ static EIGEN_DONT_INLINE void run(
233
+ Index rows, Index cols,
234
+ const Scalar* _lhs, Index lhsStride,
235
+ const Scalar* _rhs, Index rhsStride,
236
+ Scalar* res, Index resStride,
237
+ const Scalar& alpha);
238
+ };
239
+
240
+ template <typename Scalar, typename Index,
241
+ int LhsStorageOrder, bool ConjugateLhs,
242
+ int RhsStorageOrder, bool ConjugateRhs>
243
+ EIGEN_DONT_INLINE void product_selfadjoint_matrix<Scalar,Index,LhsStorageOrder,true,ConjugateLhs, RhsStorageOrder,false,ConjugateRhs,ColMajor>::run(
244
+ Index rows, Index cols,
245
+ const Scalar* _lhs, Index lhsStride,
246
+ const Scalar* _rhs, Index rhsStride,
247
+ Scalar* res, Index resStride,
248
+ const Scalar& alpha)
249
+ {
250
+ Index size = rows;
251
+
252
+ const_blas_data_mapper<Scalar, Index, LhsStorageOrder> lhs(_lhs,lhsStride);
253
+ const_blas_data_mapper<Scalar, Index, RhsStorageOrder> rhs(_rhs,rhsStride);
254
+
255
+ typedef gebp_traits<Scalar,Scalar> Traits;
256
+
257
+ Index kc = size; // cache block size along the K direction
258
+ Index mc = rows; // cache block size along the M direction
259
+ Index nc = cols; // cache block size along the N direction
260
+ computeProductBlockingSizes<Scalar,Scalar>(kc, mc, nc);
261
+ // kc must smaller than mc
262
+ kc = (std::min)(kc,mc);
263
+
264
+ std::size_t sizeW = kc*Traits::WorkSpaceFactor;
265
+ std::size_t sizeB = sizeW + kc*cols;
266
+ ei_declare_aligned_stack_constructed_variable(Scalar, blockA, kc*mc, 0);
267
+ ei_declare_aligned_stack_constructed_variable(Scalar, allocatedBlockB, sizeB, 0);
268
+ Scalar* blockB = allocatedBlockB + sizeW;
269
+
270
+ gebp_kernel<Scalar, Scalar, Index, Traits::mr, Traits::nr, ConjugateLhs, ConjugateRhs> gebp_kernel;
271
+ symm_pack_lhs<Scalar, Index, Traits::mr, Traits::LhsProgress, LhsStorageOrder> pack_lhs;
272
+ gemm_pack_rhs<Scalar, Index, Traits::nr,RhsStorageOrder> pack_rhs;
273
+ gemm_pack_lhs<Scalar, Index, Traits::mr, Traits::LhsProgress, LhsStorageOrder==RowMajor?ColMajor:RowMajor, true> pack_lhs_transposed;
274
+
275
+ for(Index k2=0; k2<size; k2+=kc)
276
+ {
277
+ const Index actual_kc = (std::min)(k2+kc,size)-k2;
278
+
279
+ // we have selected one row panel of rhs and one column panel of lhs
280
+ // pack rhs's panel into a sequential chunk of memory
281
+ // and expand each coeff to a constant packet for further reuse
282
+ pack_rhs(blockB, &rhs(k2,0), rhsStride, actual_kc, cols);
283
+
284
+ // the select lhs's panel has to be split in three different parts:
285
+ // 1 - the transposed panel above the diagonal block => transposed packed copy
286
+ // 2 - the diagonal block => special packed copy
287
+ // 3 - the panel below the diagonal block => generic packed copy
288
+ for(Index i2=0; i2<k2; i2+=mc)
289
+ {
290
+ const Index actual_mc = (std::min)(i2+mc,k2)-i2;
291
+ // transposed packed copy
292
+ pack_lhs_transposed(blockA, &lhs(k2, i2), lhsStride, actual_kc, actual_mc);
293
+
294
+ gebp_kernel(res+i2, resStride, blockA, blockB, actual_mc, actual_kc, cols, alpha);
295
+ }
296
+ // the block diagonal
297
+ {
298
+ const Index actual_mc = (std::min)(k2+kc,size)-k2;
299
+ // symmetric packed copy
300
+ pack_lhs(blockA, &lhs(k2,k2), lhsStride, actual_kc, actual_mc);
301
+
302
+ gebp_kernel(res+k2, resStride, blockA, blockB, actual_mc, actual_kc, cols, alpha);
303
+ }
304
+
305
+ for(Index i2=k2+kc; i2<size; i2+=mc)
306
+ {
307
+ const Index actual_mc = (std::min)(i2+mc,size)-i2;
308
+ gemm_pack_lhs<Scalar, Index, Traits::mr, Traits::LhsProgress, LhsStorageOrder,false>()
309
+ (blockA, &lhs(i2, k2), lhsStride, actual_kc, actual_mc);
310
+
311
+ gebp_kernel(res+i2, resStride, blockA, blockB, actual_mc, actual_kc, cols, alpha);
312
+ }
313
+ }
314
+ }
315
+
316
+ // matrix * selfadjoint product
317
+ template <typename Scalar, typename Index,
318
+ int LhsStorageOrder, bool ConjugateLhs,
319
+ int RhsStorageOrder, bool ConjugateRhs>
320
+ struct product_selfadjoint_matrix<Scalar,Index,LhsStorageOrder,false,ConjugateLhs, RhsStorageOrder,true,ConjugateRhs,ColMajor>
321
+ {
322
+
323
+ static EIGEN_DONT_INLINE void run(
324
+ Index rows, Index cols,
325
+ const Scalar* _lhs, Index lhsStride,
326
+ const Scalar* _rhs, Index rhsStride,
327
+ Scalar* res, Index resStride,
328
+ const Scalar& alpha);
329
+ };
330
+
331
+ template <typename Scalar, typename Index,
332
+ int LhsStorageOrder, bool ConjugateLhs,
333
+ int RhsStorageOrder, bool ConjugateRhs>
334
+ EIGEN_DONT_INLINE void product_selfadjoint_matrix<Scalar,Index,LhsStorageOrder,false,ConjugateLhs, RhsStorageOrder,true,ConjugateRhs,ColMajor>::run(
335
+ Index rows, Index cols,
336
+ const Scalar* _lhs, Index lhsStride,
337
+ const Scalar* _rhs, Index rhsStride,
338
+ Scalar* res, Index resStride,
339
+ const Scalar& alpha)
340
+ {
341
+ Index size = cols;
342
+
343
+ const_blas_data_mapper<Scalar, Index, LhsStorageOrder> lhs(_lhs,lhsStride);
344
+
345
+ typedef gebp_traits<Scalar,Scalar> Traits;
346
+
347
+ Index kc = size; // cache block size along the K direction
348
+ Index mc = rows; // cache block size along the M direction
349
+ Index nc = cols; // cache block size along the N direction
350
+ computeProductBlockingSizes<Scalar,Scalar>(kc, mc, nc);
351
+ std::size_t sizeW = kc*Traits::WorkSpaceFactor;
352
+ std::size_t sizeB = sizeW + kc*cols;
353
+ ei_declare_aligned_stack_constructed_variable(Scalar, blockA, kc*mc, 0);
354
+ ei_declare_aligned_stack_constructed_variable(Scalar, allocatedBlockB, sizeB, 0);
355
+ Scalar* blockB = allocatedBlockB + sizeW;
356
+
357
+ gebp_kernel<Scalar, Scalar, Index, Traits::mr, Traits::nr, ConjugateLhs, ConjugateRhs> gebp_kernel;
358
+ gemm_pack_lhs<Scalar, Index, Traits::mr, Traits::LhsProgress, LhsStorageOrder> pack_lhs;
359
+ symm_pack_rhs<Scalar, Index, Traits::nr,RhsStorageOrder> pack_rhs;
360
+
361
+ for(Index k2=0; k2<size; k2+=kc)
362
+ {
363
+ const Index actual_kc = (std::min)(k2+kc,size)-k2;
364
+
365
+ pack_rhs(blockB, _rhs, rhsStride, actual_kc, cols, k2);
366
+
367
+ // => GEPP
368
+ for(Index i2=0; i2<rows; i2+=mc)
369
+ {
370
+ const Index actual_mc = (std::min)(i2+mc,rows)-i2;
371
+ pack_lhs(blockA, &lhs(i2, k2), lhsStride, actual_kc, actual_mc);
372
+
373
+ gebp_kernel(res+i2, resStride, blockA, blockB, actual_mc, actual_kc, cols, alpha);
374
+ }
375
+ }
376
+ }
377
+
378
+ } // end namespace internal
379
+
380
+ /***************************************************************************
381
+ * Wrapper to product_selfadjoint_matrix
382
+ ***************************************************************************/
383
+
384
+ namespace internal {
385
+ template<typename Lhs, int LhsMode, typename Rhs, int RhsMode>
386
+ struct traits<SelfadjointProductMatrix<Lhs,LhsMode,false,Rhs,RhsMode,false> >
387
+ : traits<ProductBase<SelfadjointProductMatrix<Lhs,LhsMode,false,Rhs,RhsMode,false>, Lhs, Rhs> >
388
+ {};
389
+ }
390
+
391
+ template<typename Lhs, int LhsMode, typename Rhs, int RhsMode>
392
+ struct SelfadjointProductMatrix<Lhs,LhsMode,false,Rhs,RhsMode,false>
393
+ : public ProductBase<SelfadjointProductMatrix<Lhs,LhsMode,false,Rhs,RhsMode,false>, Lhs, Rhs >
394
+ {
395
+ EIGEN_PRODUCT_PUBLIC_INTERFACE(SelfadjointProductMatrix)
396
+
397
+ SelfadjointProductMatrix(const Lhs& lhs, const Rhs& rhs) : Base(lhs,rhs) {}
398
+
399
+ enum {
400
+ LhsIsUpper = (LhsMode&(Upper|Lower))==Upper,
401
+ LhsIsSelfAdjoint = (LhsMode&SelfAdjoint)==SelfAdjoint,
402
+ RhsIsUpper = (RhsMode&(Upper|Lower))==Upper,
403
+ RhsIsSelfAdjoint = (RhsMode&SelfAdjoint)==SelfAdjoint
404
+ };
405
+
406
+ template<typename Dest> void scaleAndAddTo(Dest& dst, const Scalar& alpha) const
407
+ {
408
+ eigen_assert(dst.rows()==m_lhs.rows() && dst.cols()==m_rhs.cols());
409
+
410
+ typename internal::add_const_on_value_type<ActualLhsType>::type lhs = LhsBlasTraits::extract(m_lhs);
411
+ typename internal::add_const_on_value_type<ActualRhsType>::type rhs = RhsBlasTraits::extract(m_rhs);
412
+
413
+ Scalar actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(m_lhs)
414
+ * RhsBlasTraits::extractScalarFactor(m_rhs);
415
+
416
+ internal::product_selfadjoint_matrix<Scalar, Index,
417
+ EIGEN_LOGICAL_XOR(LhsIsUpper,
418
+ internal::traits<Lhs>::Flags &RowMajorBit) ? RowMajor : ColMajor, LhsIsSelfAdjoint,
419
+ NumTraits<Scalar>::IsComplex && EIGEN_LOGICAL_XOR(LhsIsUpper,bool(LhsBlasTraits::NeedToConjugate)),
420
+ EIGEN_LOGICAL_XOR(RhsIsUpper,
421
+ internal::traits<Rhs>::Flags &RowMajorBit) ? RowMajor : ColMajor, RhsIsSelfAdjoint,
422
+ NumTraits<Scalar>::IsComplex && EIGEN_LOGICAL_XOR(RhsIsUpper,bool(RhsBlasTraits::NeedToConjugate)),
423
+ internal::traits<Dest>::Flags&RowMajorBit ? RowMajor : ColMajor>
424
+ ::run(
425
+ lhs.rows(), rhs.cols(), // sizes
426
+ &lhs.coeffRef(0,0), lhs.outerStride(), // lhs info
427
+ &rhs.coeffRef(0,0), rhs.outerStride(), // rhs info
428
+ &dst.coeffRef(0,0), dst.outerStride(), // result info
429
+ actualAlpha // alpha
430
+ );
431
+ }
432
+ };
433
+
434
+ } // end namespace Eigen
435
+
436
+ #endif // EIGEN_SELFADJOINT_MATRIX_MATRIX_H