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,295 @@
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
+ * Self adjoint matrix * matrix product functionality based on ?SYMM/?HEMM.
30
+ ********************************************************************************
31
+ */
32
+
33
+ #ifndef EIGEN_SELFADJOINT_MATRIX_MATRIX_MKL_H
34
+ #define EIGEN_SELFADJOINT_MATRIX_MATRIX_MKL_H
35
+
36
+ namespace Eigen {
37
+
38
+ namespace internal {
39
+
40
+
41
+ /* Optimized selfadjoint matrix * matrix (?SYMM/?HEMM) product */
42
+
43
+ #define EIGEN_MKL_SYMM_L(EIGTYPE, MKLTYPE, EIGPREFIX, MKLPREFIX) \
44
+ template <typename Index, \
45
+ int LhsStorageOrder, bool ConjugateLhs, \
46
+ int RhsStorageOrder, bool ConjugateRhs> \
47
+ struct product_selfadjoint_matrix<EIGTYPE,Index,LhsStorageOrder,true,ConjugateLhs,RhsStorageOrder,false,ConjugateRhs,ColMajor> \
48
+ {\
49
+ \
50
+ static void run( \
51
+ Index rows, Index cols, \
52
+ const EIGTYPE* _lhs, Index lhsStride, \
53
+ const EIGTYPE* _rhs, Index rhsStride, \
54
+ EIGTYPE* res, Index resStride, \
55
+ EIGTYPE alpha) \
56
+ { \
57
+ char side='L', uplo='L'; \
58
+ MKL_INT m, n, lda, ldb, ldc; \
59
+ const EIGTYPE *a, *b; \
60
+ MKLTYPE alpha_, beta_; \
61
+ MatrixX##EIGPREFIX b_tmp; \
62
+ EIGTYPE myone(1);\
63
+ \
64
+ /* Set transpose options */ \
65
+ /* Set m, n, k */ \
66
+ m = (MKL_INT)rows; \
67
+ n = (MKL_INT)cols; \
68
+ \
69
+ /* Set alpha_ & beta_ */ \
70
+ assign_scalar_eig2mkl(alpha_, alpha); \
71
+ assign_scalar_eig2mkl(beta_, myone); \
72
+ \
73
+ /* Set lda, ldb, ldc */ \
74
+ lda = (MKL_INT)lhsStride; \
75
+ ldb = (MKL_INT)rhsStride; \
76
+ ldc = (MKL_INT)resStride; \
77
+ \
78
+ /* Set a, b, c */ \
79
+ if (LhsStorageOrder==RowMajor) uplo='U'; \
80
+ a = _lhs; \
81
+ \
82
+ if (RhsStorageOrder==RowMajor) { \
83
+ Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > rhs(_rhs,n,m,OuterStride<>(rhsStride)); \
84
+ b_tmp = rhs.adjoint(); \
85
+ b = b_tmp.data(); \
86
+ ldb = b_tmp.outerStride(); \
87
+ } else b = _rhs; \
88
+ \
89
+ MKLPREFIX##symm(&side, &uplo, &m, &n, &alpha_, (const MKLTYPE*)a, &lda, (const MKLTYPE*)b, &ldb, &beta_, (MKLTYPE*)res, &ldc); \
90
+ \
91
+ } \
92
+ };
93
+
94
+
95
+ #define EIGEN_MKL_HEMM_L(EIGTYPE, MKLTYPE, EIGPREFIX, MKLPREFIX) \
96
+ template <typename Index, \
97
+ int LhsStorageOrder, bool ConjugateLhs, \
98
+ int RhsStorageOrder, bool ConjugateRhs> \
99
+ struct product_selfadjoint_matrix<EIGTYPE,Index,LhsStorageOrder,true,ConjugateLhs,RhsStorageOrder,false,ConjugateRhs,ColMajor> \
100
+ {\
101
+ static void run( \
102
+ Index rows, Index cols, \
103
+ const EIGTYPE* _lhs, Index lhsStride, \
104
+ const EIGTYPE* _rhs, Index rhsStride, \
105
+ EIGTYPE* res, Index resStride, \
106
+ EIGTYPE alpha) \
107
+ { \
108
+ char side='L', uplo='L'; \
109
+ MKL_INT m, n, lda, ldb, ldc; \
110
+ const EIGTYPE *a, *b; \
111
+ MKLTYPE alpha_, beta_; \
112
+ MatrixX##EIGPREFIX b_tmp; \
113
+ Matrix<EIGTYPE, Dynamic, Dynamic, LhsStorageOrder> a_tmp; \
114
+ EIGTYPE myone(1); \
115
+ \
116
+ /* Set transpose options */ \
117
+ /* Set m, n, k */ \
118
+ m = (MKL_INT)rows; \
119
+ n = (MKL_INT)cols; \
120
+ \
121
+ /* Set alpha_ & beta_ */ \
122
+ assign_scalar_eig2mkl(alpha_, alpha); \
123
+ assign_scalar_eig2mkl(beta_, myone); \
124
+ \
125
+ /* Set lda, ldb, ldc */ \
126
+ lda = (MKL_INT)lhsStride; \
127
+ ldb = (MKL_INT)rhsStride; \
128
+ ldc = (MKL_INT)resStride; \
129
+ \
130
+ /* Set a, b, c */ \
131
+ if (((LhsStorageOrder==ColMajor) && ConjugateLhs) || ((LhsStorageOrder==RowMajor) && (!ConjugateLhs))) { \
132
+ Map<const Matrix<EIGTYPE, Dynamic, Dynamic, LhsStorageOrder>, 0, OuterStride<> > lhs(_lhs,m,m,OuterStride<>(lhsStride)); \
133
+ a_tmp = lhs.conjugate(); \
134
+ a = a_tmp.data(); \
135
+ lda = a_tmp.outerStride(); \
136
+ } else a = _lhs; \
137
+ if (LhsStorageOrder==RowMajor) uplo='U'; \
138
+ \
139
+ if (RhsStorageOrder==ColMajor && (!ConjugateRhs)) { \
140
+ b = _rhs; } \
141
+ else { \
142
+ if (RhsStorageOrder==ColMajor && ConjugateRhs) { \
143
+ Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > rhs(_rhs,m,n,OuterStride<>(rhsStride)); \
144
+ b_tmp = rhs.conjugate(); \
145
+ } else \
146
+ if (ConjugateRhs) { \
147
+ Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > rhs(_rhs,n,m,OuterStride<>(rhsStride)); \
148
+ b_tmp = rhs.adjoint(); \
149
+ } else { \
150
+ Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > rhs(_rhs,n,m,OuterStride<>(rhsStride)); \
151
+ b_tmp = rhs.transpose(); \
152
+ } \
153
+ b = b_tmp.data(); \
154
+ ldb = b_tmp.outerStride(); \
155
+ } \
156
+ \
157
+ MKLPREFIX##hemm(&side, &uplo, &m, &n, &alpha_, (const MKLTYPE*)a, &lda, (const MKLTYPE*)b, &ldb, &beta_, (MKLTYPE*)res, &ldc); \
158
+ \
159
+ } \
160
+ };
161
+
162
+ EIGEN_MKL_SYMM_L(double, double, d, d)
163
+ EIGEN_MKL_SYMM_L(float, float, f, s)
164
+ EIGEN_MKL_HEMM_L(dcomplex, MKL_Complex16, cd, z)
165
+ EIGEN_MKL_HEMM_L(scomplex, MKL_Complex8, cf, c)
166
+
167
+
168
+ /* Optimized matrix * selfadjoint matrix (?SYMM/?HEMM) product */
169
+
170
+ #define EIGEN_MKL_SYMM_R(EIGTYPE, MKLTYPE, EIGPREFIX, MKLPREFIX) \
171
+ template <typename Index, \
172
+ int LhsStorageOrder, bool ConjugateLhs, \
173
+ int RhsStorageOrder, bool ConjugateRhs> \
174
+ struct product_selfadjoint_matrix<EIGTYPE,Index,LhsStorageOrder,false,ConjugateLhs,RhsStorageOrder,true,ConjugateRhs,ColMajor> \
175
+ {\
176
+ \
177
+ static void run( \
178
+ Index rows, Index cols, \
179
+ const EIGTYPE* _lhs, Index lhsStride, \
180
+ const EIGTYPE* _rhs, Index rhsStride, \
181
+ EIGTYPE* res, Index resStride, \
182
+ EIGTYPE alpha) \
183
+ { \
184
+ char side='R', uplo='L'; \
185
+ MKL_INT m, n, lda, ldb, ldc; \
186
+ const EIGTYPE *a, *b; \
187
+ MKLTYPE alpha_, beta_; \
188
+ MatrixX##EIGPREFIX b_tmp; \
189
+ EIGTYPE myone(1);\
190
+ \
191
+ /* Set m, n, k */ \
192
+ m = (MKL_INT)rows; \
193
+ n = (MKL_INT)cols; \
194
+ \
195
+ /* Set alpha_ & beta_ */ \
196
+ assign_scalar_eig2mkl(alpha_, alpha); \
197
+ assign_scalar_eig2mkl(beta_, myone); \
198
+ \
199
+ /* Set lda, ldb, ldc */ \
200
+ lda = (MKL_INT)rhsStride; \
201
+ ldb = (MKL_INT)lhsStride; \
202
+ ldc = (MKL_INT)resStride; \
203
+ \
204
+ /* Set a, b, c */ \
205
+ if (RhsStorageOrder==RowMajor) uplo='U'; \
206
+ a = _rhs; \
207
+ \
208
+ if (LhsStorageOrder==RowMajor) { \
209
+ Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > lhs(_lhs,n,m,OuterStride<>(rhsStride)); \
210
+ b_tmp = lhs.adjoint(); \
211
+ b = b_tmp.data(); \
212
+ ldb = b_tmp.outerStride(); \
213
+ } else b = _lhs; \
214
+ \
215
+ MKLPREFIX##symm(&side, &uplo, &m, &n, &alpha_, (const MKLTYPE*)a, &lda, (const MKLTYPE*)b, &ldb, &beta_, (MKLTYPE*)res, &ldc); \
216
+ \
217
+ } \
218
+ };
219
+
220
+
221
+ #define EIGEN_MKL_HEMM_R(EIGTYPE, MKLTYPE, EIGPREFIX, MKLPREFIX) \
222
+ template <typename Index, \
223
+ int LhsStorageOrder, bool ConjugateLhs, \
224
+ int RhsStorageOrder, bool ConjugateRhs> \
225
+ struct product_selfadjoint_matrix<EIGTYPE,Index,LhsStorageOrder,false,ConjugateLhs,RhsStorageOrder,true,ConjugateRhs,ColMajor> \
226
+ {\
227
+ static void run( \
228
+ Index rows, Index cols, \
229
+ const EIGTYPE* _lhs, Index lhsStride, \
230
+ const EIGTYPE* _rhs, Index rhsStride, \
231
+ EIGTYPE* res, Index resStride, \
232
+ EIGTYPE alpha) \
233
+ { \
234
+ char side='R', uplo='L'; \
235
+ MKL_INT m, n, lda, ldb, ldc; \
236
+ const EIGTYPE *a, *b; \
237
+ MKLTYPE alpha_, beta_; \
238
+ MatrixX##EIGPREFIX b_tmp; \
239
+ Matrix<EIGTYPE, Dynamic, Dynamic, RhsStorageOrder> a_tmp; \
240
+ EIGTYPE myone(1); \
241
+ \
242
+ /* Set m, n, k */ \
243
+ m = (MKL_INT)rows; \
244
+ n = (MKL_INT)cols; \
245
+ \
246
+ /* Set alpha_ & beta_ */ \
247
+ assign_scalar_eig2mkl(alpha_, alpha); \
248
+ assign_scalar_eig2mkl(beta_, myone); \
249
+ \
250
+ /* Set lda, ldb, ldc */ \
251
+ lda = (MKL_INT)rhsStride; \
252
+ ldb = (MKL_INT)lhsStride; \
253
+ ldc = (MKL_INT)resStride; \
254
+ \
255
+ /* Set a, b, c */ \
256
+ if (((RhsStorageOrder==ColMajor) && ConjugateRhs) || ((RhsStorageOrder==RowMajor) && (!ConjugateRhs))) { \
257
+ Map<const Matrix<EIGTYPE, Dynamic, Dynamic, RhsStorageOrder>, 0, OuterStride<> > rhs(_rhs,n,n,OuterStride<>(rhsStride)); \
258
+ a_tmp = rhs.conjugate(); \
259
+ a = a_tmp.data(); \
260
+ lda = a_tmp.outerStride(); \
261
+ } else a = _rhs; \
262
+ if (RhsStorageOrder==RowMajor) uplo='U'; \
263
+ \
264
+ if (LhsStorageOrder==ColMajor && (!ConjugateLhs)) { \
265
+ b = _lhs; } \
266
+ else { \
267
+ if (LhsStorageOrder==ColMajor && ConjugateLhs) { \
268
+ Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > lhs(_lhs,m,n,OuterStride<>(lhsStride)); \
269
+ b_tmp = lhs.conjugate(); \
270
+ } else \
271
+ if (ConjugateLhs) { \
272
+ Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > lhs(_lhs,n,m,OuterStride<>(lhsStride)); \
273
+ b_tmp = lhs.adjoint(); \
274
+ } else { \
275
+ Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > lhs(_lhs,n,m,OuterStride<>(lhsStride)); \
276
+ b_tmp = lhs.transpose(); \
277
+ } \
278
+ b = b_tmp.data(); \
279
+ ldb = b_tmp.outerStride(); \
280
+ } \
281
+ \
282
+ MKLPREFIX##hemm(&side, &uplo, &m, &n, &alpha_, (const MKLTYPE*)a, &lda, (const MKLTYPE*)b, &ldb, &beta_, (MKLTYPE*)res, &ldc); \
283
+ } \
284
+ };
285
+
286
+ EIGEN_MKL_SYMM_R(double, double, d, d)
287
+ EIGEN_MKL_SYMM_R(float, float, f, s)
288
+ EIGEN_MKL_HEMM_R(dcomplex, MKL_Complex16, cd, z)
289
+ EIGEN_MKL_HEMM_R(scomplex, MKL_Complex8, cf, c)
290
+
291
+ } // end namespace internal
292
+
293
+ } // end namespace Eigen
294
+
295
+ #endif // EIGEN_SELFADJOINT_MATRIX_MATRIX_MKL_H
@@ -0,0 +1,281 @@
1
+ // This file is part of Eigen, a lightweight C++ template library
2
+ // for linear algebra.
3
+ //
4
+ // Copyright (C) 2008-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_VECTOR_H
11
+ #define EIGEN_SELFADJOINT_MATRIX_VECTOR_H
12
+
13
+ namespace Eigen {
14
+
15
+ namespace internal {
16
+
17
+ /* Optimized selfadjoint matrix * vector product:
18
+ * This algorithm processes 2 columns at onces that allows to both reduce
19
+ * the number of load/stores of the result by a factor 2 and to reduce
20
+ * the instruction dependency.
21
+ */
22
+
23
+ template<typename Scalar, typename Index, int StorageOrder, int UpLo, bool ConjugateLhs, bool ConjugateRhs, int Version=Specialized>
24
+ struct selfadjoint_matrix_vector_product;
25
+
26
+ template<typename Scalar, typename Index, int StorageOrder, int UpLo, bool ConjugateLhs, bool ConjugateRhs, int Version>
27
+ struct selfadjoint_matrix_vector_product
28
+
29
+ {
30
+ static EIGEN_DONT_INLINE void run(
31
+ Index size,
32
+ const Scalar* lhs, Index lhsStride,
33
+ const Scalar* _rhs, Index rhsIncr,
34
+ Scalar* res,
35
+ Scalar alpha);
36
+ };
37
+
38
+ template<typename Scalar, typename Index, int StorageOrder, int UpLo, bool ConjugateLhs, bool ConjugateRhs, int Version>
39
+ EIGEN_DONT_INLINE void selfadjoint_matrix_vector_product<Scalar,Index,StorageOrder,UpLo,ConjugateLhs,ConjugateRhs,Version>::run(
40
+ Index size,
41
+ const Scalar* lhs, Index lhsStride,
42
+ const Scalar* _rhs, Index rhsIncr,
43
+ Scalar* res,
44
+ Scalar alpha)
45
+ {
46
+ typedef typename packet_traits<Scalar>::type Packet;
47
+ const Index PacketSize = sizeof(Packet)/sizeof(Scalar);
48
+
49
+ enum {
50
+ IsRowMajor = StorageOrder==RowMajor ? 1 : 0,
51
+ IsLower = UpLo == Lower ? 1 : 0,
52
+ FirstTriangular = IsRowMajor == IsLower
53
+ };
54
+
55
+ conj_helper<Scalar,Scalar,NumTraits<Scalar>::IsComplex && EIGEN_LOGICAL_XOR(ConjugateLhs, IsRowMajor), ConjugateRhs> cj0;
56
+ conj_helper<Scalar,Scalar,NumTraits<Scalar>::IsComplex && EIGEN_LOGICAL_XOR(ConjugateLhs, !IsRowMajor), ConjugateRhs> cj1;
57
+ conj_helper<Scalar,Scalar,NumTraits<Scalar>::IsComplex, ConjugateRhs> cjd;
58
+
59
+ conj_helper<Packet,Packet,NumTraits<Scalar>::IsComplex && EIGEN_LOGICAL_XOR(ConjugateLhs, IsRowMajor), ConjugateRhs> pcj0;
60
+ conj_helper<Packet,Packet,NumTraits<Scalar>::IsComplex && EIGEN_LOGICAL_XOR(ConjugateLhs, !IsRowMajor), ConjugateRhs> pcj1;
61
+
62
+ Scalar cjAlpha = ConjugateRhs ? numext::conj(alpha) : alpha;
63
+
64
+ // FIXME this copy is now handled outside product_selfadjoint_vector, so it could probably be removed.
65
+ // if the rhs is not sequentially stored in memory we copy it to a temporary buffer,
66
+ // this is because we need to extract packets
67
+ ei_declare_aligned_stack_constructed_variable(Scalar,rhs,size,rhsIncr==1 ? const_cast<Scalar*>(_rhs) : 0);
68
+ if (rhsIncr!=1)
69
+ {
70
+ const Scalar* it = _rhs;
71
+ for (Index i=0; i<size; ++i, it+=rhsIncr)
72
+ rhs[i] = *it;
73
+ }
74
+
75
+ Index bound = (std::max)(Index(0),size-8) & 0xfffffffe;
76
+ if (FirstTriangular)
77
+ bound = size - bound;
78
+
79
+ for (Index j=FirstTriangular ? bound : 0;
80
+ j<(FirstTriangular ? size : bound);j+=2)
81
+ {
82
+ const Scalar* EIGEN_RESTRICT A0 = lhs + j*lhsStride;
83
+ const Scalar* EIGEN_RESTRICT A1 = lhs + (j+1)*lhsStride;
84
+
85
+ Scalar t0 = cjAlpha * rhs[j];
86
+ Packet ptmp0 = pset1<Packet>(t0);
87
+ Scalar t1 = cjAlpha * rhs[j+1];
88
+ Packet ptmp1 = pset1<Packet>(t1);
89
+
90
+ Scalar t2(0);
91
+ Packet ptmp2 = pset1<Packet>(t2);
92
+ Scalar t3(0);
93
+ Packet ptmp3 = pset1<Packet>(t3);
94
+
95
+ size_t starti = FirstTriangular ? 0 : j+2;
96
+ size_t endi = FirstTriangular ? j : size;
97
+ size_t alignedStart = (starti) + internal::first_aligned(&res[starti], endi-starti);
98
+ size_t alignedEnd = alignedStart + ((endi-alignedStart)/(PacketSize))*(PacketSize);
99
+
100
+ // TODO make sure this product is a real * complex and that the rhs is properly conjugated if needed
101
+ res[j] += cjd.pmul(numext::real(A0[j]), t0);
102
+ res[j+1] += cjd.pmul(numext::real(A1[j+1]), t1);
103
+ if(FirstTriangular)
104
+ {
105
+ res[j] += cj0.pmul(A1[j], t1);
106
+ t3 += cj1.pmul(A1[j], rhs[j]);
107
+ }
108
+ else
109
+ {
110
+ res[j+1] += cj0.pmul(A0[j+1],t0);
111
+ t2 += cj1.pmul(A0[j+1], rhs[j+1]);
112
+ }
113
+
114
+ for (size_t i=starti; i<alignedStart; ++i)
115
+ {
116
+ res[i] += t0 * A0[i] + t1 * A1[i];
117
+ t2 += numext::conj(A0[i]) * rhs[i];
118
+ t3 += numext::conj(A1[i]) * rhs[i];
119
+ }
120
+ // Yes this an optimization for gcc 4.3 and 4.4 (=> huge speed up)
121
+ // gcc 4.2 does this optimization automatically.
122
+ const Scalar* EIGEN_RESTRICT a0It = A0 + alignedStart;
123
+ const Scalar* EIGEN_RESTRICT a1It = A1 + alignedStart;
124
+ const Scalar* EIGEN_RESTRICT rhsIt = rhs + alignedStart;
125
+ Scalar* EIGEN_RESTRICT resIt = res + alignedStart;
126
+ for (size_t i=alignedStart; i<alignedEnd; i+=PacketSize)
127
+ {
128
+ Packet A0i = ploadu<Packet>(a0It); a0It += PacketSize;
129
+ Packet A1i = ploadu<Packet>(a1It); a1It += PacketSize;
130
+ Packet Bi = ploadu<Packet>(rhsIt); rhsIt += PacketSize; // FIXME should be aligned in most cases
131
+ Packet Xi = pload <Packet>(resIt);
132
+
133
+ Xi = pcj0.pmadd(A0i,ptmp0, pcj0.pmadd(A1i,ptmp1,Xi));
134
+ ptmp2 = pcj1.pmadd(A0i, Bi, ptmp2);
135
+ ptmp3 = pcj1.pmadd(A1i, Bi, ptmp3);
136
+ pstore(resIt,Xi); resIt += PacketSize;
137
+ }
138
+ for (size_t i=alignedEnd; i<endi; i++)
139
+ {
140
+ res[i] += cj0.pmul(A0[i], t0) + cj0.pmul(A1[i],t1);
141
+ t2 += cj1.pmul(A0[i], rhs[i]);
142
+ t3 += cj1.pmul(A1[i], rhs[i]);
143
+ }
144
+
145
+ res[j] += alpha * (t2 + predux(ptmp2));
146
+ res[j+1] += alpha * (t3 + predux(ptmp3));
147
+ }
148
+ for (Index j=FirstTriangular ? 0 : bound;j<(FirstTriangular ? bound : size);j++)
149
+ {
150
+ const Scalar* EIGEN_RESTRICT A0 = lhs + j*lhsStride;
151
+
152
+ Scalar t1 = cjAlpha * rhs[j];
153
+ Scalar t2(0);
154
+ // TODO make sure this product is a real * complex and that the rhs is properly conjugated if needed
155
+ res[j] += cjd.pmul(numext::real(A0[j]), t1);
156
+ for (Index i=FirstTriangular ? 0 : j+1; i<(FirstTriangular ? j : size); i++)
157
+ {
158
+ res[i] += cj0.pmul(A0[i], t1);
159
+ t2 += cj1.pmul(A0[i], rhs[i]);
160
+ }
161
+ res[j] += alpha * t2;
162
+ }
163
+ }
164
+
165
+ } // end namespace internal
166
+
167
+ /***************************************************************************
168
+ * Wrapper to product_selfadjoint_vector
169
+ ***************************************************************************/
170
+
171
+ namespace internal {
172
+ template<typename Lhs, int LhsMode, typename Rhs>
173
+ struct traits<SelfadjointProductMatrix<Lhs,LhsMode,false,Rhs,0,true> >
174
+ : traits<ProductBase<SelfadjointProductMatrix<Lhs,LhsMode,false,Rhs,0,true>, Lhs, Rhs> >
175
+ {};
176
+ }
177
+
178
+ template<typename Lhs, int LhsMode, typename Rhs>
179
+ struct SelfadjointProductMatrix<Lhs,LhsMode,false,Rhs,0,true>
180
+ : public ProductBase<SelfadjointProductMatrix<Lhs,LhsMode,false,Rhs,0,true>, Lhs, Rhs >
181
+ {
182
+ EIGEN_PRODUCT_PUBLIC_INTERFACE(SelfadjointProductMatrix)
183
+
184
+ enum {
185
+ LhsUpLo = LhsMode&(Upper|Lower)
186
+ };
187
+
188
+ SelfadjointProductMatrix(const Lhs& lhs, const Rhs& rhs) : Base(lhs,rhs) {}
189
+
190
+ template<typename Dest> void scaleAndAddTo(Dest& dest, const Scalar& alpha) const
191
+ {
192
+ typedef typename Dest::Scalar ResScalar;
193
+ typedef typename Base::RhsScalar RhsScalar;
194
+ typedef Map<Matrix<ResScalar,Dynamic,1>, Aligned> MappedDest;
195
+
196
+ eigen_assert(dest.rows()==m_lhs.rows() && dest.cols()==m_rhs.cols());
197
+
198
+ typename internal::add_const_on_value_type<ActualLhsType>::type lhs = LhsBlasTraits::extract(m_lhs);
199
+ typename internal::add_const_on_value_type<ActualRhsType>::type rhs = RhsBlasTraits::extract(m_rhs);
200
+
201
+ Scalar actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(m_lhs)
202
+ * RhsBlasTraits::extractScalarFactor(m_rhs);
203
+
204
+ enum {
205
+ EvalToDest = (Dest::InnerStrideAtCompileTime==1),
206
+ UseRhs = (_ActualRhsType::InnerStrideAtCompileTime==1)
207
+ };
208
+
209
+ internal::gemv_static_vector_if<ResScalar,Dest::SizeAtCompileTime,Dest::MaxSizeAtCompileTime,!EvalToDest> static_dest;
210
+ internal::gemv_static_vector_if<RhsScalar,_ActualRhsType::SizeAtCompileTime,_ActualRhsType::MaxSizeAtCompileTime,!UseRhs> static_rhs;
211
+
212
+ ei_declare_aligned_stack_constructed_variable(ResScalar,actualDestPtr,dest.size(),
213
+ EvalToDest ? dest.data() : static_dest.data());
214
+
215
+ ei_declare_aligned_stack_constructed_variable(RhsScalar,actualRhsPtr,rhs.size(),
216
+ UseRhs ? const_cast<RhsScalar*>(rhs.data()) : static_rhs.data());
217
+
218
+ if(!EvalToDest)
219
+ {
220
+ #ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
221
+ int size = dest.size();
222
+ EIGEN_DENSE_STORAGE_CTOR_PLUGIN
223
+ #endif
224
+ MappedDest(actualDestPtr, dest.size()) = dest;
225
+ }
226
+
227
+ if(!UseRhs)
228
+ {
229
+ #ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
230
+ int size = rhs.size();
231
+ EIGEN_DENSE_STORAGE_CTOR_PLUGIN
232
+ #endif
233
+ Map<typename _ActualRhsType::PlainObject>(actualRhsPtr, rhs.size()) = rhs;
234
+ }
235
+
236
+
237
+ internal::selfadjoint_matrix_vector_product<Scalar, Index, (internal::traits<_ActualLhsType>::Flags&RowMajorBit) ? RowMajor : ColMajor, int(LhsUpLo), bool(LhsBlasTraits::NeedToConjugate), bool(RhsBlasTraits::NeedToConjugate)>::run
238
+ (
239
+ lhs.rows(), // size
240
+ &lhs.coeffRef(0,0), lhs.outerStride(), // lhs info
241
+ actualRhsPtr, 1, // rhs info
242
+ actualDestPtr, // result info
243
+ actualAlpha // scale factor
244
+ );
245
+
246
+ if(!EvalToDest)
247
+ dest = MappedDest(actualDestPtr, dest.size());
248
+ }
249
+ };
250
+
251
+ namespace internal {
252
+ template<typename Lhs, typename Rhs, int RhsMode>
253
+ struct traits<SelfadjointProductMatrix<Lhs,0,true,Rhs,RhsMode,false> >
254
+ : traits<ProductBase<SelfadjointProductMatrix<Lhs,0,true,Rhs,RhsMode,false>, Lhs, Rhs> >
255
+ {};
256
+ }
257
+
258
+ template<typename Lhs, typename Rhs, int RhsMode>
259
+ struct SelfadjointProductMatrix<Lhs,0,true,Rhs,RhsMode,false>
260
+ : public ProductBase<SelfadjointProductMatrix<Lhs,0,true,Rhs,RhsMode,false>, Lhs, Rhs >
261
+ {
262
+ EIGEN_PRODUCT_PUBLIC_INTERFACE(SelfadjointProductMatrix)
263
+
264
+ enum {
265
+ RhsUpLo = RhsMode&(Upper|Lower)
266
+ };
267
+
268
+ SelfadjointProductMatrix(const Lhs& lhs, const Rhs& rhs) : Base(lhs,rhs) {}
269
+
270
+ template<typename Dest> void scaleAndAddTo(Dest& dest, const Scalar& alpha) const
271
+ {
272
+ // let's simply transpose the product
273
+ Transpose<Dest> destT(dest);
274
+ SelfadjointProductMatrix<Transpose<const Rhs>, int(RhsUpLo)==Upper ? Lower : Upper, false,
275
+ Transpose<const Lhs>, 0, true>(m_rhs.transpose(), m_lhs.transpose()).scaleAndAddTo(destT, alpha);
276
+ }
277
+ };
278
+
279
+ } // end namespace Eigen
280
+
281
+ #endif // EIGEN_SELFADJOINT_MATRIX_VECTOR_H