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,309 @@
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
+ * Triangular matrix * matrix product functionality based on ?TRMM.
30
+ ********************************************************************************
31
+ */
32
+
33
+ #ifndef EIGEN_TRIANGULAR_MATRIX_MATRIX_MKL_H
34
+ #define EIGEN_TRIANGULAR_MATRIX_MATRIX_MKL_H
35
+
36
+ namespace Eigen {
37
+
38
+ namespace internal {
39
+
40
+
41
+ template <typename Scalar, typename Index,
42
+ int Mode, bool LhsIsTriangular,
43
+ int LhsStorageOrder, bool ConjugateLhs,
44
+ int RhsStorageOrder, bool ConjugateRhs,
45
+ int ResStorageOrder>
46
+ struct product_triangular_matrix_matrix_trmm :
47
+ product_triangular_matrix_matrix<Scalar,Index,Mode,
48
+ LhsIsTriangular,LhsStorageOrder,ConjugateLhs,
49
+ RhsStorageOrder, ConjugateRhs, ResStorageOrder, BuiltIn> {};
50
+
51
+
52
+ // try to go to BLAS specialization
53
+ #define EIGEN_MKL_TRMM_SPECIALIZE(Scalar, LhsIsTriangular) \
54
+ template <typename Index, int Mode, \
55
+ int LhsStorageOrder, bool ConjugateLhs, \
56
+ int RhsStorageOrder, bool ConjugateRhs> \
57
+ struct product_triangular_matrix_matrix<Scalar,Index, Mode, LhsIsTriangular, \
58
+ LhsStorageOrder,ConjugateLhs, RhsStorageOrder,ConjugateRhs,ColMajor,Specialized> { \
59
+ static inline void run(Index _rows, Index _cols, Index _depth, const Scalar* _lhs, Index lhsStride,\
60
+ const Scalar* _rhs, Index rhsStride, Scalar* res, Index resStride, Scalar alpha, level3_blocking<Scalar,Scalar>& blocking) { \
61
+ product_triangular_matrix_matrix_trmm<Scalar,Index,Mode, \
62
+ LhsIsTriangular,LhsStorageOrder,ConjugateLhs, \
63
+ RhsStorageOrder, ConjugateRhs, ColMajor>::run( \
64
+ _rows, _cols, _depth, _lhs, lhsStride, _rhs, rhsStride, res, resStride, alpha, blocking); \
65
+ } \
66
+ };
67
+
68
+ EIGEN_MKL_TRMM_SPECIALIZE(double, true)
69
+ EIGEN_MKL_TRMM_SPECIALIZE(double, false)
70
+ EIGEN_MKL_TRMM_SPECIALIZE(dcomplex, true)
71
+ EIGEN_MKL_TRMM_SPECIALIZE(dcomplex, false)
72
+ EIGEN_MKL_TRMM_SPECIALIZE(float, true)
73
+ EIGEN_MKL_TRMM_SPECIALIZE(float, false)
74
+ EIGEN_MKL_TRMM_SPECIALIZE(scomplex, true)
75
+ EIGEN_MKL_TRMM_SPECIALIZE(scomplex, false)
76
+
77
+ // implements col-major += alpha * op(triangular) * op(general)
78
+ #define EIGEN_MKL_TRMM_L(EIGTYPE, MKLTYPE, EIGPREFIX, MKLPREFIX) \
79
+ template <typename Index, int Mode, \
80
+ int LhsStorageOrder, bool ConjugateLhs, \
81
+ int RhsStorageOrder, bool ConjugateRhs> \
82
+ struct product_triangular_matrix_matrix_trmm<EIGTYPE,Index,Mode,true, \
83
+ LhsStorageOrder,ConjugateLhs,RhsStorageOrder,ConjugateRhs,ColMajor> \
84
+ { \
85
+ enum { \
86
+ IsLower = (Mode&Lower) == Lower, \
87
+ SetDiag = (Mode&(ZeroDiag|UnitDiag)) ? 0 : 1, \
88
+ IsUnitDiag = (Mode&UnitDiag) ? 1 : 0, \
89
+ IsZeroDiag = (Mode&ZeroDiag) ? 1 : 0, \
90
+ LowUp = IsLower ? Lower : Upper, \
91
+ conjA = ((LhsStorageOrder==ColMajor) && ConjugateLhs) ? 1 : 0 \
92
+ }; \
93
+ \
94
+ static void run( \
95
+ Index _rows, Index _cols, Index _depth, \
96
+ const EIGTYPE* _lhs, Index lhsStride, \
97
+ const EIGTYPE* _rhs, Index rhsStride, \
98
+ EIGTYPE* res, Index resStride, \
99
+ EIGTYPE alpha, level3_blocking<EIGTYPE,EIGTYPE>& blocking) \
100
+ { \
101
+ Index diagSize = (std::min)(_rows,_depth); \
102
+ Index rows = IsLower ? _rows : diagSize; \
103
+ Index depth = IsLower ? diagSize : _depth; \
104
+ Index cols = _cols; \
105
+ \
106
+ typedef Matrix<EIGTYPE, Dynamic, Dynamic, LhsStorageOrder> MatrixLhs; \
107
+ typedef Matrix<EIGTYPE, Dynamic, Dynamic, RhsStorageOrder> MatrixRhs; \
108
+ \
109
+ /* Non-square case - doesn't fit to MKL ?TRMM. Fall to default triangular product or call MKL ?GEMM*/ \
110
+ if (rows != depth) { \
111
+ \
112
+ int nthr = mkl_domain_get_max_threads(EIGEN_MKL_DOMAIN_BLAS); \
113
+ \
114
+ if (((nthr==1) && (((std::max)(rows,depth)-diagSize)/(double)diagSize < 0.5))) { \
115
+ /* Most likely no benefit to call TRMM or GEMM from MKL*/ \
116
+ product_triangular_matrix_matrix<EIGTYPE,Index,Mode,true, \
117
+ LhsStorageOrder,ConjugateLhs, RhsStorageOrder, ConjugateRhs, ColMajor, BuiltIn>::run( \
118
+ _rows, _cols, _depth, _lhs, lhsStride, _rhs, rhsStride, res, resStride, alpha, blocking); \
119
+ /*std::cout << "TRMM_L: A is not square! Go to Eigen TRMM implementation!\n";*/ \
120
+ } else { \
121
+ /* Make sense to call GEMM */ \
122
+ Map<const MatrixLhs, 0, OuterStride<> > lhsMap(_lhs,rows,depth,OuterStride<>(lhsStride)); \
123
+ MatrixLhs aa_tmp=lhsMap.template triangularView<Mode>(); \
124
+ MKL_INT aStride = aa_tmp.outerStride(); \
125
+ gemm_blocking_space<ColMajor,EIGTYPE,EIGTYPE,Dynamic,Dynamic,Dynamic> gemm_blocking(_rows,_cols,_depth); \
126
+ general_matrix_matrix_product<Index,EIGTYPE,LhsStorageOrder,ConjugateLhs,EIGTYPE,RhsStorageOrder,ConjugateRhs,ColMajor>::run( \
127
+ rows, cols, depth, aa_tmp.data(), aStride, _rhs, rhsStride, res, resStride, alpha, gemm_blocking, 0); \
128
+ \
129
+ /*std::cout << "TRMM_L: A is not square! Go to MKL GEMM implementation! " << nthr<<" \n";*/ \
130
+ } \
131
+ return; \
132
+ } \
133
+ char side = 'L', transa, uplo, diag = 'N'; \
134
+ EIGTYPE *b; \
135
+ const EIGTYPE *a; \
136
+ MKL_INT m, n, lda, ldb; \
137
+ MKLTYPE alpha_; \
138
+ \
139
+ /* Set alpha_*/ \
140
+ assign_scalar_eig2mkl<MKLTYPE, EIGTYPE>(alpha_, alpha); \
141
+ \
142
+ /* Set m, n */ \
143
+ m = (MKL_INT)diagSize; \
144
+ n = (MKL_INT)cols; \
145
+ \
146
+ /* Set trans */ \
147
+ transa = (LhsStorageOrder==RowMajor) ? ((ConjugateLhs) ? 'C' : 'T') : 'N'; \
148
+ \
149
+ /* Set b, ldb */ \
150
+ Map<const MatrixRhs, 0, OuterStride<> > rhs(_rhs,depth,cols,OuterStride<>(rhsStride)); \
151
+ MatrixX##EIGPREFIX b_tmp; \
152
+ \
153
+ if (ConjugateRhs) b_tmp = rhs.conjugate(); else b_tmp = rhs; \
154
+ b = b_tmp.data(); \
155
+ ldb = b_tmp.outerStride(); \
156
+ \
157
+ /* Set uplo */ \
158
+ uplo = IsLower ? 'L' : 'U'; \
159
+ if (LhsStorageOrder==RowMajor) uplo = (uplo == 'L') ? 'U' : 'L'; \
160
+ /* Set a, lda */ \
161
+ Map<const MatrixLhs, 0, OuterStride<> > lhs(_lhs,rows,depth,OuterStride<>(lhsStride)); \
162
+ MatrixLhs a_tmp; \
163
+ \
164
+ if ((conjA!=0) || (SetDiag==0)) { \
165
+ if (conjA) a_tmp = lhs.conjugate(); else a_tmp = lhs; \
166
+ if (IsZeroDiag) \
167
+ a_tmp.diagonal().setZero(); \
168
+ else if (IsUnitDiag) \
169
+ a_tmp.diagonal().setOnes();\
170
+ a = a_tmp.data(); \
171
+ lda = a_tmp.outerStride(); \
172
+ } else { \
173
+ a = _lhs; \
174
+ lda = lhsStride; \
175
+ } \
176
+ /*std::cout << "TRMM_L: A is square! Go to MKL TRMM implementation! \n";*/ \
177
+ /* call ?trmm*/ \
178
+ MKLPREFIX##trmm(&side, &uplo, &transa, &diag, &m, &n, &alpha_, (const MKLTYPE*)a, &lda, (MKLTYPE*)b, &ldb); \
179
+ \
180
+ /* Add op(a_triangular)*b into res*/ \
181
+ Map<MatrixX##EIGPREFIX, 0, OuterStride<> > res_tmp(res,rows,cols,OuterStride<>(resStride)); \
182
+ res_tmp=res_tmp+b_tmp; \
183
+ } \
184
+ };
185
+
186
+ EIGEN_MKL_TRMM_L(double, double, d, d)
187
+ EIGEN_MKL_TRMM_L(dcomplex, MKL_Complex16, cd, z)
188
+ EIGEN_MKL_TRMM_L(float, float, f, s)
189
+ EIGEN_MKL_TRMM_L(scomplex, MKL_Complex8, cf, c)
190
+
191
+ // implements col-major += alpha * op(general) * op(triangular)
192
+ #define EIGEN_MKL_TRMM_R(EIGTYPE, MKLTYPE, EIGPREFIX, MKLPREFIX) \
193
+ template <typename Index, int Mode, \
194
+ int LhsStorageOrder, bool ConjugateLhs, \
195
+ int RhsStorageOrder, bool ConjugateRhs> \
196
+ struct product_triangular_matrix_matrix_trmm<EIGTYPE,Index,Mode,false, \
197
+ LhsStorageOrder,ConjugateLhs,RhsStorageOrder,ConjugateRhs,ColMajor> \
198
+ { \
199
+ enum { \
200
+ IsLower = (Mode&Lower) == Lower, \
201
+ SetDiag = (Mode&(ZeroDiag|UnitDiag)) ? 0 : 1, \
202
+ IsUnitDiag = (Mode&UnitDiag) ? 1 : 0, \
203
+ IsZeroDiag = (Mode&ZeroDiag) ? 1 : 0, \
204
+ LowUp = IsLower ? Lower : Upper, \
205
+ conjA = ((RhsStorageOrder==ColMajor) && ConjugateRhs) ? 1 : 0 \
206
+ }; \
207
+ \
208
+ static void run( \
209
+ Index _rows, Index _cols, Index _depth, \
210
+ const EIGTYPE* _lhs, Index lhsStride, \
211
+ const EIGTYPE* _rhs, Index rhsStride, \
212
+ EIGTYPE* res, Index resStride, \
213
+ EIGTYPE alpha, level3_blocking<EIGTYPE,EIGTYPE>& blocking) \
214
+ { \
215
+ Index diagSize = (std::min)(_cols,_depth); \
216
+ Index rows = _rows; \
217
+ Index depth = IsLower ? _depth : diagSize; \
218
+ Index cols = IsLower ? diagSize : _cols; \
219
+ \
220
+ typedef Matrix<EIGTYPE, Dynamic, Dynamic, LhsStorageOrder> MatrixLhs; \
221
+ typedef Matrix<EIGTYPE, Dynamic, Dynamic, RhsStorageOrder> MatrixRhs; \
222
+ \
223
+ /* Non-square case - doesn't fit to MKL ?TRMM. Fall to default triangular product or call MKL ?GEMM*/ \
224
+ if (cols != depth) { \
225
+ \
226
+ int nthr = mkl_domain_get_max_threads(EIGEN_MKL_DOMAIN_BLAS); \
227
+ \
228
+ if ((nthr==1) && (((std::max)(cols,depth)-diagSize)/(double)diagSize < 0.5)) { \
229
+ /* Most likely no benefit to call TRMM or GEMM from MKL*/ \
230
+ product_triangular_matrix_matrix<EIGTYPE,Index,Mode,false, \
231
+ LhsStorageOrder,ConjugateLhs, RhsStorageOrder, ConjugateRhs, ColMajor, BuiltIn>::run( \
232
+ _rows, _cols, _depth, _lhs, lhsStride, _rhs, rhsStride, res, resStride, alpha, blocking); \
233
+ /*std::cout << "TRMM_R: A is not square! Go to Eigen TRMM implementation!\n";*/ \
234
+ } else { \
235
+ /* Make sense to call GEMM */ \
236
+ Map<const MatrixRhs, 0, OuterStride<> > rhsMap(_rhs,depth,cols, OuterStride<>(rhsStride)); \
237
+ MatrixRhs aa_tmp=rhsMap.template triangularView<Mode>(); \
238
+ MKL_INT aStride = aa_tmp.outerStride(); \
239
+ gemm_blocking_space<ColMajor,EIGTYPE,EIGTYPE,Dynamic,Dynamic,Dynamic> gemm_blocking(_rows,_cols,_depth); \
240
+ general_matrix_matrix_product<Index,EIGTYPE,LhsStorageOrder,ConjugateLhs,EIGTYPE,RhsStorageOrder,ConjugateRhs,ColMajor>::run( \
241
+ rows, cols, depth, _lhs, lhsStride, aa_tmp.data(), aStride, res, resStride, alpha, gemm_blocking, 0); \
242
+ \
243
+ /*std::cout << "TRMM_R: A is not square! Go to MKL GEMM implementation! " << nthr<<" \n";*/ \
244
+ } \
245
+ return; \
246
+ } \
247
+ char side = 'R', transa, uplo, diag = 'N'; \
248
+ EIGTYPE *b; \
249
+ const EIGTYPE *a; \
250
+ MKL_INT m, n, lda, ldb; \
251
+ MKLTYPE alpha_; \
252
+ \
253
+ /* Set alpha_*/ \
254
+ assign_scalar_eig2mkl<MKLTYPE, EIGTYPE>(alpha_, alpha); \
255
+ \
256
+ /* Set m, n */ \
257
+ m = (MKL_INT)rows; \
258
+ n = (MKL_INT)diagSize; \
259
+ \
260
+ /* Set trans */ \
261
+ transa = (RhsStorageOrder==RowMajor) ? ((ConjugateRhs) ? 'C' : 'T') : 'N'; \
262
+ \
263
+ /* Set b, ldb */ \
264
+ Map<const MatrixLhs, 0, OuterStride<> > lhs(_lhs,rows,depth,OuterStride<>(lhsStride)); \
265
+ MatrixX##EIGPREFIX b_tmp; \
266
+ \
267
+ if (ConjugateLhs) b_tmp = lhs.conjugate(); else b_tmp = lhs; \
268
+ b = b_tmp.data(); \
269
+ ldb = b_tmp.outerStride(); \
270
+ \
271
+ /* Set uplo */ \
272
+ uplo = IsLower ? 'L' : 'U'; \
273
+ if (RhsStorageOrder==RowMajor) uplo = (uplo == 'L') ? 'U' : 'L'; \
274
+ /* Set a, lda */ \
275
+ Map<const MatrixRhs, 0, OuterStride<> > rhs(_rhs,depth,cols, OuterStride<>(rhsStride)); \
276
+ MatrixRhs a_tmp; \
277
+ \
278
+ if ((conjA!=0) || (SetDiag==0)) { \
279
+ if (conjA) a_tmp = rhs.conjugate(); else a_tmp = rhs; \
280
+ if (IsZeroDiag) \
281
+ a_tmp.diagonal().setZero(); \
282
+ else if (IsUnitDiag) \
283
+ a_tmp.diagonal().setOnes();\
284
+ a = a_tmp.data(); \
285
+ lda = a_tmp.outerStride(); \
286
+ } else { \
287
+ a = _rhs; \
288
+ lda = rhsStride; \
289
+ } \
290
+ /*std::cout << "TRMM_R: A is square! Go to MKL TRMM implementation! \n";*/ \
291
+ /* call ?trmm*/ \
292
+ MKLPREFIX##trmm(&side, &uplo, &transa, &diag, &m, &n, &alpha_, (const MKLTYPE*)a, &lda, (MKLTYPE*)b, &ldb); \
293
+ \
294
+ /* Add op(a_triangular)*b into res*/ \
295
+ Map<MatrixX##EIGPREFIX, 0, OuterStride<> > res_tmp(res,rows,cols,OuterStride<>(resStride)); \
296
+ res_tmp=res_tmp+b_tmp; \
297
+ } \
298
+ };
299
+
300
+ EIGEN_MKL_TRMM_R(double, double, d, d)
301
+ EIGEN_MKL_TRMM_R(dcomplex, MKL_Complex16, cd, z)
302
+ EIGEN_MKL_TRMM_R(float, float, f, s)
303
+ EIGEN_MKL_TRMM_R(scomplex, MKL_Complex8, cf, c)
304
+
305
+ } // end namespace internal
306
+
307
+ } // end namespace Eigen
308
+
309
+ #endif // EIGEN_TRIANGULAR_MATRIX_MATRIX_MKL_H
@@ -0,0 +1,348 @@
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_TRIANGULARMATRIXVECTOR_H
11
+ #define EIGEN_TRIANGULARMATRIXVECTOR_H
12
+
13
+ namespace Eigen {
14
+
15
+ namespace internal {
16
+
17
+ template<typename Index, int Mode, typename LhsScalar, bool ConjLhs, typename RhsScalar, bool ConjRhs, int StorageOrder, int Version=Specialized>
18
+ struct triangular_matrix_vector_product;
19
+
20
+ template<typename Index, int Mode, typename LhsScalar, bool ConjLhs, typename RhsScalar, bool ConjRhs, int Version>
21
+ struct triangular_matrix_vector_product<Index,Mode,LhsScalar,ConjLhs,RhsScalar,ConjRhs,ColMajor,Version>
22
+ {
23
+ typedef typename scalar_product_traits<LhsScalar, RhsScalar>::ReturnType ResScalar;
24
+ enum {
25
+ IsLower = ((Mode&Lower)==Lower),
26
+ HasUnitDiag = (Mode & UnitDiag)==UnitDiag,
27
+ HasZeroDiag = (Mode & ZeroDiag)==ZeroDiag
28
+ };
29
+ static EIGEN_DONT_INLINE void run(Index _rows, Index _cols, const LhsScalar* _lhs, Index lhsStride,
30
+ const RhsScalar* _rhs, Index rhsIncr, ResScalar* _res, Index resIncr, const ResScalar& alpha);
31
+ };
32
+
33
+ template<typename Index, int Mode, typename LhsScalar, bool ConjLhs, typename RhsScalar, bool ConjRhs, int Version>
34
+ EIGEN_DONT_INLINE void triangular_matrix_vector_product<Index,Mode,LhsScalar,ConjLhs,RhsScalar,ConjRhs,ColMajor,Version>
35
+ ::run(Index _rows, Index _cols, const LhsScalar* _lhs, Index lhsStride,
36
+ const RhsScalar* _rhs, Index rhsIncr, ResScalar* _res, Index resIncr, const ResScalar& alpha)
37
+ {
38
+ static const Index PanelWidth = EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH;
39
+ Index size = (std::min)(_rows,_cols);
40
+ Index rows = IsLower ? _rows : (std::min)(_rows,_cols);
41
+ Index cols = IsLower ? (std::min)(_rows,_cols) : _cols;
42
+
43
+ typedef Map<const Matrix<LhsScalar,Dynamic,Dynamic,ColMajor>, 0, OuterStride<> > LhsMap;
44
+ const LhsMap lhs(_lhs,rows,cols,OuterStride<>(lhsStride));
45
+ typename conj_expr_if<ConjLhs,LhsMap>::type cjLhs(lhs);
46
+
47
+ typedef Map<const Matrix<RhsScalar,Dynamic,1>, 0, InnerStride<> > RhsMap;
48
+ const RhsMap rhs(_rhs,cols,InnerStride<>(rhsIncr));
49
+ typename conj_expr_if<ConjRhs,RhsMap>::type cjRhs(rhs);
50
+
51
+ typedef Map<Matrix<ResScalar,Dynamic,1> > ResMap;
52
+ ResMap res(_res,rows);
53
+
54
+ for (Index pi=0; pi<size; pi+=PanelWidth)
55
+ {
56
+ Index actualPanelWidth = (std::min)(PanelWidth, size-pi);
57
+ for (Index k=0; k<actualPanelWidth; ++k)
58
+ {
59
+ Index i = pi + k;
60
+ Index s = IsLower ? ((HasUnitDiag||HasZeroDiag) ? i+1 : i ) : pi;
61
+ Index r = IsLower ? actualPanelWidth-k : k+1;
62
+ if ((!(HasUnitDiag||HasZeroDiag)) || (--r)>0)
63
+ res.segment(s,r) += (alpha * cjRhs.coeff(i)) * cjLhs.col(i).segment(s,r);
64
+ if (HasUnitDiag)
65
+ res.coeffRef(i) += alpha * cjRhs.coeff(i);
66
+ }
67
+ Index r = IsLower ? rows - pi - actualPanelWidth : pi;
68
+ if (r>0)
69
+ {
70
+ Index s = IsLower ? pi+actualPanelWidth : 0;
71
+ general_matrix_vector_product<Index,LhsScalar,ColMajor,ConjLhs,RhsScalar,ConjRhs,BuiltIn>::run(
72
+ r, actualPanelWidth,
73
+ &lhs.coeffRef(s,pi), lhsStride,
74
+ &rhs.coeffRef(pi), rhsIncr,
75
+ &res.coeffRef(s), resIncr, alpha);
76
+ }
77
+ }
78
+ if((!IsLower) && cols>size)
79
+ {
80
+ general_matrix_vector_product<Index,LhsScalar,ColMajor,ConjLhs,RhsScalar,ConjRhs>::run(
81
+ rows, cols-size,
82
+ &lhs.coeffRef(0,size), lhsStride,
83
+ &rhs.coeffRef(size), rhsIncr,
84
+ _res, resIncr, alpha);
85
+ }
86
+ }
87
+
88
+ template<typename Index, int Mode, typename LhsScalar, bool ConjLhs, typename RhsScalar, bool ConjRhs,int Version>
89
+ struct triangular_matrix_vector_product<Index,Mode,LhsScalar,ConjLhs,RhsScalar,ConjRhs,RowMajor,Version>
90
+ {
91
+ typedef typename scalar_product_traits<LhsScalar, RhsScalar>::ReturnType ResScalar;
92
+ enum {
93
+ IsLower = ((Mode&Lower)==Lower),
94
+ HasUnitDiag = (Mode & UnitDiag)==UnitDiag,
95
+ HasZeroDiag = (Mode & ZeroDiag)==ZeroDiag
96
+ };
97
+ static EIGEN_DONT_INLINE void run(Index _rows, Index _cols, const LhsScalar* _lhs, Index lhsStride,
98
+ const RhsScalar* _rhs, Index rhsIncr, ResScalar* _res, Index resIncr, const ResScalar& alpha);
99
+ };
100
+
101
+ template<typename Index, int Mode, typename LhsScalar, bool ConjLhs, typename RhsScalar, bool ConjRhs,int Version>
102
+ EIGEN_DONT_INLINE void triangular_matrix_vector_product<Index,Mode,LhsScalar,ConjLhs,RhsScalar,ConjRhs,RowMajor,Version>
103
+ ::run(Index _rows, Index _cols, const LhsScalar* _lhs, Index lhsStride,
104
+ const RhsScalar* _rhs, Index rhsIncr, ResScalar* _res, Index resIncr, const ResScalar& alpha)
105
+ {
106
+ static const Index PanelWidth = EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH;
107
+ Index diagSize = (std::min)(_rows,_cols);
108
+ Index rows = IsLower ? _rows : diagSize;
109
+ Index cols = IsLower ? diagSize : _cols;
110
+
111
+ typedef Map<const Matrix<LhsScalar,Dynamic,Dynamic,RowMajor>, 0, OuterStride<> > LhsMap;
112
+ const LhsMap lhs(_lhs,rows,cols,OuterStride<>(lhsStride));
113
+ typename conj_expr_if<ConjLhs,LhsMap>::type cjLhs(lhs);
114
+
115
+ typedef Map<const Matrix<RhsScalar,Dynamic,1> > RhsMap;
116
+ const RhsMap rhs(_rhs,cols);
117
+ typename conj_expr_if<ConjRhs,RhsMap>::type cjRhs(rhs);
118
+
119
+ typedef Map<Matrix<ResScalar,Dynamic,1>, 0, InnerStride<> > ResMap;
120
+ ResMap res(_res,rows,InnerStride<>(resIncr));
121
+
122
+ for (Index pi=0; pi<diagSize; pi+=PanelWidth)
123
+ {
124
+ Index actualPanelWidth = (std::min)(PanelWidth, diagSize-pi);
125
+ for (Index k=0; k<actualPanelWidth; ++k)
126
+ {
127
+ Index i = pi + k;
128
+ Index s = IsLower ? pi : ((HasUnitDiag||HasZeroDiag) ? i+1 : i);
129
+ Index r = IsLower ? k+1 : actualPanelWidth-k;
130
+ if ((!(HasUnitDiag||HasZeroDiag)) || (--r)>0)
131
+ res.coeffRef(i) += alpha * (cjLhs.row(i).segment(s,r).cwiseProduct(cjRhs.segment(s,r).transpose())).sum();
132
+ if (HasUnitDiag)
133
+ res.coeffRef(i) += alpha * cjRhs.coeff(i);
134
+ }
135
+ Index r = IsLower ? pi : cols - pi - actualPanelWidth;
136
+ if (r>0)
137
+ {
138
+ Index s = IsLower ? 0 : pi + actualPanelWidth;
139
+ general_matrix_vector_product<Index,LhsScalar,RowMajor,ConjLhs,RhsScalar,ConjRhs,BuiltIn>::run(
140
+ actualPanelWidth, r,
141
+ &lhs.coeffRef(pi,s), lhsStride,
142
+ &rhs.coeffRef(s), rhsIncr,
143
+ &res.coeffRef(pi), resIncr, alpha);
144
+ }
145
+ }
146
+ if(IsLower && rows>diagSize)
147
+ {
148
+ general_matrix_vector_product<Index,LhsScalar,RowMajor,ConjLhs,RhsScalar,ConjRhs>::run(
149
+ rows-diagSize, cols,
150
+ &lhs.coeffRef(diagSize,0), lhsStride,
151
+ &rhs.coeffRef(0), rhsIncr,
152
+ &res.coeffRef(diagSize), resIncr, alpha);
153
+ }
154
+ }
155
+
156
+ /***************************************************************************
157
+ * Wrapper to product_triangular_vector
158
+ ***************************************************************************/
159
+
160
+ template<int Mode, bool LhsIsTriangular, typename Lhs, typename Rhs>
161
+ struct traits<TriangularProduct<Mode,LhsIsTriangular,Lhs,false,Rhs,true> >
162
+ : traits<ProductBase<TriangularProduct<Mode,LhsIsTriangular,Lhs,false,Rhs,true>, Lhs, Rhs> >
163
+ {};
164
+
165
+ template<int Mode, bool LhsIsTriangular, typename Lhs, typename Rhs>
166
+ struct traits<TriangularProduct<Mode,LhsIsTriangular,Lhs,true,Rhs,false> >
167
+ : traits<ProductBase<TriangularProduct<Mode,LhsIsTriangular,Lhs,true,Rhs,false>, Lhs, Rhs> >
168
+ {};
169
+
170
+
171
+ template<int StorageOrder>
172
+ struct trmv_selector;
173
+
174
+ } // end namespace internal
175
+
176
+ template<int Mode, typename Lhs, typename Rhs>
177
+ struct TriangularProduct<Mode,true,Lhs,false,Rhs,true>
178
+ : public ProductBase<TriangularProduct<Mode,true,Lhs,false,Rhs,true>, Lhs, Rhs >
179
+ {
180
+ EIGEN_PRODUCT_PUBLIC_INTERFACE(TriangularProduct)
181
+
182
+ TriangularProduct(const Lhs& lhs, const Rhs& rhs) : Base(lhs,rhs) {}
183
+
184
+ template<typename Dest> void scaleAndAddTo(Dest& dst, const Scalar& alpha) const
185
+ {
186
+ eigen_assert(dst.rows()==m_lhs.rows() && dst.cols()==m_rhs.cols());
187
+
188
+ internal::trmv_selector<(int(internal::traits<Lhs>::Flags)&RowMajorBit) ? RowMajor : ColMajor>::run(*this, dst, alpha);
189
+ }
190
+ };
191
+
192
+ template<int Mode, typename Lhs, typename Rhs>
193
+ struct TriangularProduct<Mode,false,Lhs,true,Rhs,false>
194
+ : public ProductBase<TriangularProduct<Mode,false,Lhs,true,Rhs,false>, Lhs, Rhs >
195
+ {
196
+ EIGEN_PRODUCT_PUBLIC_INTERFACE(TriangularProduct)
197
+
198
+ TriangularProduct(const Lhs& lhs, const Rhs& rhs) : Base(lhs,rhs) {}
199
+
200
+ template<typename Dest> void scaleAndAddTo(Dest& dst, const Scalar& alpha) const
201
+ {
202
+ eigen_assert(dst.rows()==m_lhs.rows() && dst.cols()==m_rhs.cols());
203
+
204
+ typedef TriangularProduct<(Mode & (UnitDiag|ZeroDiag)) | ((Mode & Lower) ? Upper : Lower),true,Transpose<const Rhs>,false,Transpose<const Lhs>,true> TriangularProductTranspose;
205
+ Transpose<Dest> dstT(dst);
206
+ internal::trmv_selector<(int(internal::traits<Rhs>::Flags)&RowMajorBit) ? ColMajor : RowMajor>::run(
207
+ TriangularProductTranspose(m_rhs.transpose(),m_lhs.transpose()), dstT, alpha);
208
+ }
209
+ };
210
+
211
+ namespace internal {
212
+
213
+ // TODO: find a way to factorize this piece of code with gemv_selector since the logic is exactly the same.
214
+
215
+ template<> struct trmv_selector<ColMajor>
216
+ {
217
+ template<int Mode, typename Lhs, typename Rhs, typename Dest>
218
+ static void run(const TriangularProduct<Mode,true,Lhs,false,Rhs,true>& prod, Dest& dest, const typename TriangularProduct<Mode,true,Lhs,false,Rhs,true>::Scalar& alpha)
219
+ {
220
+ typedef TriangularProduct<Mode,true,Lhs,false,Rhs,true> ProductType;
221
+ typedef typename ProductType::Index Index;
222
+ typedef typename ProductType::LhsScalar LhsScalar;
223
+ typedef typename ProductType::RhsScalar RhsScalar;
224
+ typedef typename ProductType::Scalar ResScalar;
225
+ typedef typename ProductType::RealScalar RealScalar;
226
+ typedef typename ProductType::ActualLhsType ActualLhsType;
227
+ typedef typename ProductType::ActualRhsType ActualRhsType;
228
+ typedef typename ProductType::LhsBlasTraits LhsBlasTraits;
229
+ typedef typename ProductType::RhsBlasTraits RhsBlasTraits;
230
+ typedef Map<Matrix<ResScalar,Dynamic,1>, Aligned> MappedDest;
231
+
232
+ typename internal::add_const_on_value_type<ActualLhsType>::type actualLhs = LhsBlasTraits::extract(prod.lhs());
233
+ typename internal::add_const_on_value_type<ActualRhsType>::type actualRhs = RhsBlasTraits::extract(prod.rhs());
234
+
235
+ ResScalar actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(prod.lhs())
236
+ * RhsBlasTraits::extractScalarFactor(prod.rhs());
237
+
238
+ enum {
239
+ // FIXME find a way to allow an inner stride on the result if packet_traits<Scalar>::size==1
240
+ // on, the other hand it is good for the cache to pack the vector anyways...
241
+ EvalToDestAtCompileTime = Dest::InnerStrideAtCompileTime==1,
242
+ ComplexByReal = (NumTraits<LhsScalar>::IsComplex) && (!NumTraits<RhsScalar>::IsComplex),
243
+ MightCannotUseDest = (Dest::InnerStrideAtCompileTime!=1) || ComplexByReal
244
+ };
245
+
246
+ gemv_static_vector_if<ResScalar,Dest::SizeAtCompileTime,Dest::MaxSizeAtCompileTime,MightCannotUseDest> static_dest;
247
+
248
+ bool alphaIsCompatible = (!ComplexByReal) || (numext::imag(actualAlpha)==RealScalar(0));
249
+ bool evalToDest = EvalToDestAtCompileTime && alphaIsCompatible;
250
+
251
+ RhsScalar compatibleAlpha = get_factor<ResScalar,RhsScalar>::run(actualAlpha);
252
+
253
+ ei_declare_aligned_stack_constructed_variable(ResScalar,actualDestPtr,dest.size(),
254
+ evalToDest ? dest.data() : static_dest.data());
255
+
256
+ if(!evalToDest)
257
+ {
258
+ #ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
259
+ Index size = dest.size();
260
+ EIGEN_DENSE_STORAGE_CTOR_PLUGIN
261
+ #endif
262
+ if(!alphaIsCompatible)
263
+ {
264
+ MappedDest(actualDestPtr, dest.size()).setZero();
265
+ compatibleAlpha = RhsScalar(1);
266
+ }
267
+ else
268
+ MappedDest(actualDestPtr, dest.size()) = dest;
269
+ }
270
+
271
+ internal::triangular_matrix_vector_product
272
+ <Index,Mode,
273
+ LhsScalar, LhsBlasTraits::NeedToConjugate,
274
+ RhsScalar, RhsBlasTraits::NeedToConjugate,
275
+ ColMajor>
276
+ ::run(actualLhs.rows(),actualLhs.cols(),
277
+ actualLhs.data(),actualLhs.outerStride(),
278
+ actualRhs.data(),actualRhs.innerStride(),
279
+ actualDestPtr,1,compatibleAlpha);
280
+
281
+ if (!evalToDest)
282
+ {
283
+ if(!alphaIsCompatible)
284
+ dest += actualAlpha * MappedDest(actualDestPtr, dest.size());
285
+ else
286
+ dest = MappedDest(actualDestPtr, dest.size());
287
+ }
288
+ }
289
+ };
290
+
291
+ template<> struct trmv_selector<RowMajor>
292
+ {
293
+ template<int Mode, typename Lhs, typename Rhs, typename Dest>
294
+ static void run(const TriangularProduct<Mode,true,Lhs,false,Rhs,true>& prod, Dest& dest, const typename TriangularProduct<Mode,true,Lhs,false,Rhs,true>::Scalar& alpha)
295
+ {
296
+ typedef TriangularProduct<Mode,true,Lhs,false,Rhs,true> ProductType;
297
+ typedef typename ProductType::LhsScalar LhsScalar;
298
+ typedef typename ProductType::RhsScalar RhsScalar;
299
+ typedef typename ProductType::Scalar ResScalar;
300
+ typedef typename ProductType::Index Index;
301
+ typedef typename ProductType::ActualLhsType ActualLhsType;
302
+ typedef typename ProductType::ActualRhsType ActualRhsType;
303
+ typedef typename ProductType::_ActualRhsType _ActualRhsType;
304
+ typedef typename ProductType::LhsBlasTraits LhsBlasTraits;
305
+ typedef typename ProductType::RhsBlasTraits RhsBlasTraits;
306
+
307
+ typename add_const<ActualLhsType>::type actualLhs = LhsBlasTraits::extract(prod.lhs());
308
+ typename add_const<ActualRhsType>::type actualRhs = RhsBlasTraits::extract(prod.rhs());
309
+
310
+ ResScalar actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(prod.lhs())
311
+ * RhsBlasTraits::extractScalarFactor(prod.rhs());
312
+
313
+ enum {
314
+ DirectlyUseRhs = _ActualRhsType::InnerStrideAtCompileTime==1
315
+ };
316
+
317
+ gemv_static_vector_if<RhsScalar,_ActualRhsType::SizeAtCompileTime,_ActualRhsType::MaxSizeAtCompileTime,!DirectlyUseRhs> static_rhs;
318
+
319
+ ei_declare_aligned_stack_constructed_variable(RhsScalar,actualRhsPtr,actualRhs.size(),
320
+ DirectlyUseRhs ? const_cast<RhsScalar*>(actualRhs.data()) : static_rhs.data());
321
+
322
+ if(!DirectlyUseRhs)
323
+ {
324
+ #ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
325
+ int size = actualRhs.size();
326
+ EIGEN_DENSE_STORAGE_CTOR_PLUGIN
327
+ #endif
328
+ Map<typename _ActualRhsType::PlainObject>(actualRhsPtr, actualRhs.size()) = actualRhs;
329
+ }
330
+
331
+ internal::triangular_matrix_vector_product
332
+ <Index,Mode,
333
+ LhsScalar, LhsBlasTraits::NeedToConjugate,
334
+ RhsScalar, RhsBlasTraits::NeedToConjugate,
335
+ RowMajor>
336
+ ::run(actualLhs.rows(),actualLhs.cols(),
337
+ actualLhs.data(),actualLhs.outerStride(),
338
+ actualRhsPtr,1,
339
+ dest.data(),dest.innerStride(),
340
+ actualAlpha);
341
+ }
342
+ };
343
+
344
+ } // end namespace internal
345
+
346
+ } // end namespace Eigen
347
+
348
+ #endif // EIGEN_TRIANGULARMATRIXVECTOR_H