ruby-eigen 0.0.9 → 0.0.10.pre1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (293) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +22 -0
  3. data/README.md +21 -0
  4. data/ext/eigen/eigen3/COPYING.BSD +26 -0
  5. data/ext/eigen/eigen3/COPYING.MPL2 +373 -0
  6. data/ext/eigen/eigen3/COPYING.README +18 -0
  7. data/ext/eigen/eigen3/Eigen/Array +11 -0
  8. data/ext/eigen/eigen3/Eigen/Cholesky +32 -0
  9. data/ext/eigen/eigen3/Eigen/CholmodSupport +45 -0
  10. data/ext/eigen/eigen3/Eigen/Core +376 -0
  11. data/ext/eigen/eigen3/Eigen/Dense +7 -0
  12. data/ext/eigen/eigen3/Eigen/Eigen +2 -0
  13. data/ext/eigen/eigen3/Eigen/Eigen2Support +95 -0
  14. data/ext/eigen/eigen3/Eigen/Eigenvalues +48 -0
  15. data/ext/eigen/eigen3/Eigen/Geometry +63 -0
  16. data/ext/eigen/eigen3/Eigen/Householder +23 -0
  17. data/ext/eigen/eigen3/Eigen/IterativeLinearSolvers +40 -0
  18. data/ext/eigen/eigen3/Eigen/Jacobi +26 -0
  19. data/ext/eigen/eigen3/Eigen/LU +41 -0
  20. data/ext/eigen/eigen3/Eigen/LeastSquares +32 -0
  21. data/ext/eigen/eigen3/Eigen/MetisSupport +28 -0
  22. data/ext/eigen/eigen3/Eigen/PaStiXSupport +46 -0
  23. data/ext/eigen/eigen3/Eigen/PardisoSupport +30 -0
  24. data/ext/eigen/eigen3/Eigen/QR +45 -0
  25. data/ext/eigen/eigen3/Eigen/QtAlignedMalloc +34 -0
  26. data/ext/eigen/eigen3/Eigen/SPQRSupport +29 -0
  27. data/ext/eigen/eigen3/Eigen/SVD +37 -0
  28. data/ext/eigen/eigen3/Eigen/Sparse +27 -0
  29. data/ext/eigen/eigen3/Eigen/SparseCore +64 -0
  30. data/ext/eigen/eigen3/Eigen/SparseLU +49 -0
  31. data/ext/eigen/eigen3/Eigen/SparseQR +33 -0
  32. data/ext/eigen/eigen3/Eigen/StdDeque +27 -0
  33. data/ext/eigen/eigen3/Eigen/StdList +26 -0
  34. data/ext/eigen/eigen3/Eigen/StdVector +27 -0
  35. data/ext/eigen/eigen3/Eigen/SuperLUSupport +59 -0
  36. data/ext/eigen/eigen3/Eigen/UmfPackSupport +36 -0
  37. data/ext/eigen/eigen3/Eigen/src/Cholesky/LDLT.h +611 -0
  38. data/ext/eigen/eigen3/Eigen/src/Cholesky/LLT.h +498 -0
  39. data/ext/eigen/eigen3/Eigen/src/Cholesky/LLT_MKL.h +102 -0
  40. data/ext/eigen/eigen3/Eigen/src/CholmodSupport/CholmodSupport.h +607 -0
  41. data/ext/eigen/eigen3/Eigen/src/Core/Array.h +323 -0
  42. data/ext/eigen/eigen3/Eigen/src/Core/ArrayBase.h +226 -0
  43. data/ext/eigen/eigen3/Eigen/src/Core/ArrayWrapper.h +264 -0
  44. data/ext/eigen/eigen3/Eigen/src/Core/Assign.h +590 -0
  45. data/ext/eigen/eigen3/Eigen/src/Core/Assign_MKL.h +224 -0
  46. data/ext/eigen/eigen3/Eigen/src/Core/BandMatrix.h +334 -0
  47. data/ext/eigen/eigen3/Eigen/src/Core/Block.h +406 -0
  48. data/ext/eigen/eigen3/Eigen/src/Core/BooleanRedux.h +154 -0
  49. data/ext/eigen/eigen3/Eigen/src/Core/CommaInitializer.h +154 -0
  50. data/ext/eigen/eigen3/Eigen/src/Core/CoreIterators.h +61 -0
  51. data/ext/eigen/eigen3/Eigen/src/Core/CwiseBinaryOp.h +230 -0
  52. data/ext/eigen/eigen3/Eigen/src/Core/CwiseNullaryOp.h +864 -0
  53. data/ext/eigen/eigen3/Eigen/src/Core/CwiseUnaryOp.h +126 -0
  54. data/ext/eigen/eigen3/Eigen/src/Core/CwiseUnaryView.h +139 -0
  55. data/ext/eigen/eigen3/Eigen/src/Core/DenseBase.h +521 -0
  56. data/ext/eigen/eigen3/Eigen/src/Core/DenseCoeffsBase.h +754 -0
  57. data/ext/eigen/eigen3/Eigen/src/Core/DenseStorage.h +434 -0
  58. data/ext/eigen/eigen3/Eigen/src/Core/Diagonal.h +237 -0
  59. data/ext/eigen/eigen3/Eigen/src/Core/DiagonalMatrix.h +313 -0
  60. data/ext/eigen/eigen3/Eigen/src/Core/DiagonalProduct.h +131 -0
  61. data/ext/eigen/eigen3/Eigen/src/Core/Dot.h +263 -0
  62. data/ext/eigen/eigen3/Eigen/src/Core/EigenBase.h +131 -0
  63. data/ext/eigen/eigen3/Eigen/src/Core/Flagged.h +140 -0
  64. data/ext/eigen/eigen3/Eigen/src/Core/ForceAlignedAccess.h +146 -0
  65. data/ext/eigen/eigen3/Eigen/src/Core/Functors.h +1026 -0
  66. data/ext/eigen/eigen3/Eigen/src/Core/Fuzzy.h +150 -0
  67. data/ext/eigen/eigen3/Eigen/src/Core/GeneralProduct.h +635 -0
  68. data/ext/eigen/eigen3/Eigen/src/Core/GenericPacketMath.h +350 -0
  69. data/ext/eigen/eigen3/Eigen/src/Core/GlobalFunctions.h +92 -0
  70. data/ext/eigen/eigen3/Eigen/src/Core/IO.h +250 -0
  71. data/ext/eigen/eigen3/Eigen/src/Core/Map.h +192 -0
  72. data/ext/eigen/eigen3/Eigen/src/Core/MapBase.h +247 -0
  73. data/ext/eigen/eigen3/Eigen/src/Core/MathFunctions.h +768 -0
  74. data/ext/eigen/eigen3/Eigen/src/Core/Matrix.h +420 -0
  75. data/ext/eigen/eigen3/Eigen/src/Core/MatrixBase.h +563 -0
  76. data/ext/eigen/eigen3/Eigen/src/Core/NestByValue.h +111 -0
  77. data/ext/eigen/eigen3/Eigen/src/Core/NoAlias.h +134 -0
  78. data/ext/eigen/eigen3/Eigen/src/Core/NumTraits.h +150 -0
  79. data/ext/eigen/eigen3/Eigen/src/Core/PermutationMatrix.h +721 -0
  80. data/ext/eigen/eigen3/Eigen/src/Core/PlainObjectBase.h +822 -0
  81. data/ext/eigen/eigen3/Eigen/src/Core/ProductBase.h +290 -0
  82. data/ext/eigen/eigen3/Eigen/src/Core/Random.h +152 -0
  83. data/ext/eigen/eigen3/Eigen/src/Core/Redux.h +409 -0
  84. data/ext/eigen/eigen3/Eigen/src/Core/Ref.h +278 -0
  85. data/ext/eigen/eigen3/Eigen/src/Core/Replicate.h +177 -0
  86. data/ext/eigen/eigen3/Eigen/src/Core/ReturnByValue.h +99 -0
  87. data/ext/eigen/eigen3/Eigen/src/Core/Reverse.h +224 -0
  88. data/ext/eigen/eigen3/Eigen/src/Core/Select.h +162 -0
  89. data/ext/eigen/eigen3/Eigen/src/Core/SelfAdjointView.h +314 -0
  90. data/ext/eigen/eigen3/Eigen/src/Core/SelfCwiseBinaryOp.h +191 -0
  91. data/ext/eigen/eigen3/Eigen/src/Core/SolveTriangular.h +260 -0
  92. data/ext/eigen/eigen3/Eigen/src/Core/StableNorm.h +203 -0
  93. data/ext/eigen/eigen3/Eigen/src/Core/Stride.h +108 -0
  94. data/ext/eigen/eigen3/Eigen/src/Core/Swap.h +126 -0
  95. data/ext/eigen/eigen3/Eigen/src/Core/Transpose.h +419 -0
  96. data/ext/eigen/eigen3/Eigen/src/Core/Transpositions.h +436 -0
  97. data/ext/eigen/eigen3/Eigen/src/Core/TriangularMatrix.h +839 -0
  98. data/ext/eigen/eigen3/Eigen/src/Core/VectorBlock.h +95 -0
  99. data/ext/eigen/eigen3/Eigen/src/Core/VectorwiseOp.h +642 -0
  100. data/ext/eigen/eigen3/Eigen/src/Core/Visitor.h +237 -0
  101. data/ext/eigen/eigen3/Eigen/src/Core/arch/AltiVec/Complex.h +217 -0
  102. data/ext/eigen/eigen3/Eigen/src/Core/arch/AltiVec/PacketMath.h +501 -0
  103. data/ext/eigen/eigen3/Eigen/src/Core/arch/Default/Settings.h +49 -0
  104. data/ext/eigen/eigen3/Eigen/src/Core/arch/NEON/Complex.h +253 -0
  105. data/ext/eigen/eigen3/Eigen/src/Core/arch/NEON/PacketMath.h +420 -0
  106. data/ext/eigen/eigen3/Eigen/src/Core/arch/SSE/Complex.h +442 -0
  107. data/ext/eigen/eigen3/Eigen/src/Core/arch/SSE/MathFunctions.h +475 -0
  108. data/ext/eigen/eigen3/Eigen/src/Core/arch/SSE/PacketMath.h +649 -0
  109. data/ext/eigen/eigen3/Eigen/src/Core/products/CoeffBasedProduct.h +476 -0
  110. data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralBlockPanelKernel.h +1341 -0
  111. data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixMatrix.h +427 -0
  112. data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +278 -0
  113. data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_MKL.h +146 -0
  114. data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixMatrix_MKL.h +118 -0
  115. data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixVector.h +566 -0
  116. data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixVector_MKL.h +131 -0
  117. data/ext/eigen/eigen3/Eigen/src/Core/products/Parallelizer.h +162 -0
  118. data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +436 -0
  119. data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointMatrixMatrix_MKL.h +295 -0
  120. data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointMatrixVector.h +281 -0
  121. data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointMatrixVector_MKL.h +114 -0
  122. data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointProduct.h +123 -0
  123. data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointRank2Update.h +93 -0
  124. data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularMatrixMatrix.h +427 -0
  125. data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularMatrixMatrix_MKL.h +309 -0
  126. data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularMatrixVector.h +348 -0
  127. data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularMatrixVector_MKL.h +247 -0
  128. data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularSolverMatrix.h +332 -0
  129. data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h +155 -0
  130. data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularSolverVector.h +139 -0
  131. data/ext/eigen/eigen3/Eigen/src/Core/util/BlasUtil.h +264 -0
  132. data/ext/eigen/eigen3/Eigen/src/Core/util/Constants.h +451 -0
  133. data/ext/eigen/eigen3/Eigen/src/Core/util/DisableStupidWarnings.h +40 -0
  134. data/ext/eigen/eigen3/Eigen/src/Core/util/ForwardDeclarations.h +302 -0
  135. data/ext/eigen/eigen3/Eigen/src/Core/util/MKL_support.h +158 -0
  136. data/ext/eigen/eigen3/Eigen/src/Core/util/Macros.h +451 -0
  137. data/ext/eigen/eigen3/Eigen/src/Core/util/Memory.h +977 -0
  138. data/ext/eigen/eigen3/Eigen/src/Core/util/Meta.h +243 -0
  139. data/ext/eigen/eigen3/Eigen/src/Core/util/NonMPL2.h +3 -0
  140. data/ext/eigen/eigen3/Eigen/src/Core/util/ReenableStupidWarnings.h +14 -0
  141. data/ext/eigen/eigen3/Eigen/src/Core/util/StaticAssert.h +208 -0
  142. data/ext/eigen/eigen3/Eigen/src/Core/util/XprHelper.h +469 -0
  143. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Block.h +126 -0
  144. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Cwise.h +192 -0
  145. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/CwiseOperators.h +298 -0
  146. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/AlignedBox.h +159 -0
  147. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/All.h +115 -0
  148. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/AngleAxis.h +214 -0
  149. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Hyperplane.h +254 -0
  150. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/ParametrizedLine.h +141 -0
  151. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Quaternion.h +495 -0
  152. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Rotation2D.h +145 -0
  153. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/RotationBase.h +123 -0
  154. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Scaling.h +167 -0
  155. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Transform.h +786 -0
  156. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Translation.h +184 -0
  157. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/LU.h +120 -0
  158. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Lazy.h +71 -0
  159. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/LeastSquares.h +169 -0
  160. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Macros.h +20 -0
  161. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/MathFunctions.h +57 -0
  162. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Memory.h +45 -0
  163. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Meta.h +75 -0
  164. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Minor.h +117 -0
  165. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/QR.h +67 -0
  166. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/SVD.h +637 -0
  167. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/TriangularSolver.h +42 -0
  168. data/ext/eigen/eigen3/Eigen/src/Eigen2Support/VectorBlock.h +94 -0
  169. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/ComplexEigenSolver.h +341 -0
  170. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/ComplexSchur.h +456 -0
  171. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/ComplexSchur_MKL.h +94 -0
  172. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/EigenSolver.h +607 -0
  173. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +350 -0
  174. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +227 -0
  175. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/HessenbergDecomposition.h +373 -0
  176. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +160 -0
  177. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/RealQZ.h +624 -0
  178. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/RealSchur.h +525 -0
  179. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/RealSchur_MKL.h +83 -0
  180. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +801 -0
  181. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_MKL.h +92 -0
  182. data/ext/eigen/eigen3/Eigen/src/Eigenvalues/Tridiagonalization.h +557 -0
  183. data/ext/eigen/eigen3/Eigen/src/Geometry/AlignedBox.h +392 -0
  184. data/ext/eigen/eigen3/Eigen/src/Geometry/AngleAxis.h +233 -0
  185. data/ext/eigen/eigen3/Eigen/src/Geometry/EulerAngles.h +104 -0
  186. data/ext/eigen/eigen3/Eigen/src/Geometry/Homogeneous.h +307 -0
  187. data/ext/eigen/eigen3/Eigen/src/Geometry/Hyperplane.h +280 -0
  188. data/ext/eigen/eigen3/Eigen/src/Geometry/OrthoMethods.h +218 -0
  189. data/ext/eigen/eigen3/Eigen/src/Geometry/ParametrizedLine.h +195 -0
  190. data/ext/eigen/eigen3/Eigen/src/Geometry/Quaternion.h +776 -0
  191. data/ext/eigen/eigen3/Eigen/src/Geometry/Rotation2D.h +160 -0
  192. data/ext/eigen/eigen3/Eigen/src/Geometry/RotationBase.h +206 -0
  193. data/ext/eigen/eigen3/Eigen/src/Geometry/Scaling.h +166 -0
  194. data/ext/eigen/eigen3/Eigen/src/Geometry/Transform.h +1455 -0
  195. data/ext/eigen/eigen3/Eigen/src/Geometry/Translation.h +206 -0
  196. data/ext/eigen/eigen3/Eigen/src/Geometry/Umeyama.h +177 -0
  197. data/ext/eigen/eigen3/Eigen/src/Geometry/arch/Geometry_SSE.h +115 -0
  198. data/ext/eigen/eigen3/Eigen/src/Householder/BlockHouseholder.h +68 -0
  199. data/ext/eigen/eigen3/Eigen/src/Householder/Householder.h +171 -0
  200. data/ext/eigen/eigen3/Eigen/src/Householder/HouseholderSequence.h +441 -0
  201. data/ext/eigen/eigen3/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +149 -0
  202. data/ext/eigen/eigen3/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +263 -0
  203. data/ext/eigen/eigen3/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +256 -0
  204. data/ext/eigen/eigen3/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +282 -0
  205. data/ext/eigen/eigen3/Eigen/src/Jacobi/Jacobi.h +433 -0
  206. data/ext/eigen/eigen3/Eigen/src/LU/Determinant.h +101 -0
  207. data/ext/eigen/eigen3/Eigen/src/LU/FullPivLU.h +751 -0
  208. data/ext/eigen/eigen3/Eigen/src/LU/Inverse.h +400 -0
  209. data/ext/eigen/eigen3/Eigen/src/LU/PartialPivLU.h +509 -0
  210. data/ext/eigen/eigen3/Eigen/src/LU/PartialPivLU_MKL.h +85 -0
  211. data/ext/eigen/eigen3/Eigen/src/LU/arch/Inverse_SSE.h +329 -0
  212. data/ext/eigen/eigen3/Eigen/src/MetisSupport/MetisSupport.h +137 -0
  213. data/ext/eigen/eigen3/Eigen/src/OrderingMethods/Amd.h +444 -0
  214. data/ext/eigen/eigen3/Eigen/src/OrderingMethods/Eigen_Colamd.h +1850 -0
  215. data/ext/eigen/eigen3/Eigen/src/PaStiXSupport/PaStiXSupport.h +721 -0
  216. data/ext/eigen/eigen3/Eigen/src/PardisoSupport/PardisoSupport.h +592 -0
  217. data/ext/eigen/eigen3/Eigen/src/QR/ColPivHouseholderQR.h +580 -0
  218. data/ext/eigen/eigen3/Eigen/src/QR/ColPivHouseholderQR_MKL.h +99 -0
  219. data/ext/eigen/eigen3/Eigen/src/QR/FullPivHouseholderQR.h +622 -0
  220. data/ext/eigen/eigen3/Eigen/src/QR/HouseholderQR.h +388 -0
  221. data/ext/eigen/eigen3/Eigen/src/QR/HouseholderQR_MKL.h +71 -0
  222. data/ext/eigen/eigen3/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +338 -0
  223. data/ext/eigen/eigen3/Eigen/src/SVD/JacobiSVD.h +976 -0
  224. data/ext/eigen/eigen3/Eigen/src/SVD/JacobiSVD_MKL.h +92 -0
  225. data/ext/eigen/eigen3/Eigen/src/SVD/UpperBidiagonalization.h +148 -0
  226. data/ext/eigen/eigen3/Eigen/src/SparseCholesky/SimplicialCholesky.h +671 -0
  227. data/ext/eigen/eigen3/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +199 -0
  228. data/ext/eigen/eigen3/Eigen/src/SparseCore/AmbiVector.h +373 -0
  229. data/ext/eigen/eigen3/Eigen/src/SparseCore/CompressedStorage.h +233 -0
  230. data/ext/eigen/eigen3/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +245 -0
  231. data/ext/eigen/eigen3/Eigen/src/SparseCore/MappedSparseMatrix.h +181 -0
  232. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseBlock.h +537 -0
  233. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseColEtree.h +206 -0
  234. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +325 -0
  235. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +163 -0
  236. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseDenseProduct.h +311 -0
  237. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseDiagonalProduct.h +196 -0
  238. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseDot.h +101 -0
  239. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseFuzzy.h +26 -0
  240. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseMatrix.h +1262 -0
  241. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseMatrixBase.h +461 -0
  242. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparsePermutation.h +148 -0
  243. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseProduct.h +188 -0
  244. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseRedux.h +45 -0
  245. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseSelfAdjointView.h +507 -0
  246. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +150 -0
  247. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseTranspose.h +63 -0
  248. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseTriangularView.h +179 -0
  249. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseUtil.h +172 -0
  250. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseVector.h +448 -0
  251. data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseView.h +99 -0
  252. data/ext/eigen/eigen3/Eigen/src/SparseCore/TriangularSolver.h +334 -0
  253. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU.h +806 -0
  254. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLUImpl.h +66 -0
  255. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_Memory.h +227 -0
  256. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_Structs.h +111 -0
  257. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +298 -0
  258. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_Utils.h +80 -0
  259. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_column_bmod.h +180 -0
  260. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_column_dfs.h +177 -0
  261. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +106 -0
  262. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +279 -0
  263. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +127 -0
  264. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +130 -0
  265. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_panel_bmod.h +223 -0
  266. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_panel_dfs.h +258 -0
  267. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_pivotL.h +137 -0
  268. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_pruneL.h +135 -0
  269. data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_relax_snode.h +83 -0
  270. data/ext/eigen/eigen3/Eigen/src/SparseQR/SparseQR.h +714 -0
  271. data/ext/eigen/eigen3/Eigen/src/StlSupport/StdDeque.h +134 -0
  272. data/ext/eigen/eigen3/Eigen/src/StlSupport/StdList.h +114 -0
  273. data/ext/eigen/eigen3/Eigen/src/StlSupport/StdVector.h +126 -0
  274. data/ext/eigen/eigen3/Eigen/src/StlSupport/details.h +84 -0
  275. data/ext/eigen/eigen3/Eigen/src/SuperLUSupport/SuperLUSupport.h +1026 -0
  276. data/ext/eigen/eigen3/Eigen/src/UmfPackSupport/UmfPackSupport.h +474 -0
  277. data/ext/eigen/eigen3/Eigen/src/misc/Image.h +84 -0
  278. data/ext/eigen/eigen3/Eigen/src/misc/Kernel.h +81 -0
  279. data/ext/eigen/eigen3/Eigen/src/misc/Solve.h +76 -0
  280. data/ext/eigen/eigen3/Eigen/src/misc/SparseSolve.h +128 -0
  281. data/ext/eigen/eigen3/Eigen/src/misc/blas.h +658 -0
  282. data/ext/eigen/eigen3/Eigen/src/plugins/ArrayCwiseBinaryOps.h +253 -0
  283. data/ext/eigen/eigen3/Eigen/src/plugins/ArrayCwiseUnaryOps.h +187 -0
  284. data/ext/eigen/eigen3/Eigen/src/plugins/BlockMethods.h +935 -0
  285. data/ext/eigen/eigen3/Eigen/src/plugins/CommonCwiseBinaryOps.h +46 -0
  286. data/ext/eigen/eigen3/Eigen/src/plugins/CommonCwiseUnaryOps.h +172 -0
  287. data/ext/eigen/eigen3/Eigen/src/plugins/MatrixCwiseBinaryOps.h +143 -0
  288. data/ext/eigen/eigen3/Eigen/src/plugins/MatrixCwiseUnaryOps.h +52 -0
  289. data/ext/eigen/eigen3/signature_of_eigen3_matrix_library +1 -0
  290. data/ext/eigen/eigen_wrap.cxx +19420 -10396
  291. data/ext/eigen/extconf.rb +37 -2
  292. data/lib/eigen.rb +146 -3
  293. metadata +294 -7
@@ -0,0 +1,155 @@
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_SOLVER_MATRIX_MKL_H
34
+ #define EIGEN_TRIANGULAR_SOLVER_MATRIX_MKL_H
35
+
36
+ namespace Eigen {
37
+
38
+ namespace internal {
39
+
40
+ // implements LeftSide op(triangular)^-1 * general
41
+ #define EIGEN_MKL_TRSM_L(EIGTYPE, MKLTYPE, MKLPREFIX) \
42
+ template <typename Index, int Mode, bool Conjugate, int TriStorageOrder> \
43
+ struct triangular_solve_matrix<EIGTYPE,Index,OnTheLeft,Mode,Conjugate,TriStorageOrder,ColMajor> \
44
+ { \
45
+ enum { \
46
+ IsLower = (Mode&Lower) == Lower, \
47
+ IsUnitDiag = (Mode&UnitDiag) ? 1 : 0, \
48
+ IsZeroDiag = (Mode&ZeroDiag) ? 1 : 0, \
49
+ conjA = ((TriStorageOrder==ColMajor) && Conjugate) ? 1 : 0 \
50
+ }; \
51
+ static void run( \
52
+ Index size, Index otherSize, \
53
+ const EIGTYPE* _tri, Index triStride, \
54
+ EIGTYPE* _other, Index otherStride, level3_blocking<EIGTYPE,EIGTYPE>& /*blocking*/) \
55
+ { \
56
+ MKL_INT m = size, n = otherSize, lda, ldb; \
57
+ char side = 'L', uplo, diag='N', transa; \
58
+ /* Set alpha_ */ \
59
+ MKLTYPE alpha; \
60
+ EIGTYPE myone(1); \
61
+ assign_scalar_eig2mkl(alpha, myone); \
62
+ ldb = otherStride;\
63
+ \
64
+ const EIGTYPE *a; \
65
+ /* Set trans */ \
66
+ transa = (TriStorageOrder==RowMajor) ? ((Conjugate) ? 'C' : 'T') : 'N'; \
67
+ /* Set uplo */ \
68
+ uplo = IsLower ? 'L' : 'U'; \
69
+ if (TriStorageOrder==RowMajor) uplo = (uplo == 'L') ? 'U' : 'L'; \
70
+ /* Set a, lda */ \
71
+ typedef Matrix<EIGTYPE, Dynamic, Dynamic, TriStorageOrder> MatrixTri; \
72
+ Map<const MatrixTri, 0, OuterStride<> > tri(_tri,size,size,OuterStride<>(triStride)); \
73
+ MatrixTri a_tmp; \
74
+ \
75
+ if (conjA) { \
76
+ a_tmp = tri.conjugate(); \
77
+ a = a_tmp.data(); \
78
+ lda = a_tmp.outerStride(); \
79
+ } else { \
80
+ a = _tri; \
81
+ lda = triStride; \
82
+ } \
83
+ if (IsUnitDiag) diag='U'; \
84
+ /* call ?trsm*/ \
85
+ MKLPREFIX##trsm(&side, &uplo, &transa, &diag, &m, &n, &alpha, (const MKLTYPE*)a, &lda, (MKLTYPE*)_other, &ldb); \
86
+ } \
87
+ };
88
+
89
+ EIGEN_MKL_TRSM_L(double, double, d)
90
+ EIGEN_MKL_TRSM_L(dcomplex, MKL_Complex16, z)
91
+ EIGEN_MKL_TRSM_L(float, float, s)
92
+ EIGEN_MKL_TRSM_L(scomplex, MKL_Complex8, c)
93
+
94
+
95
+ // implements RightSide general * op(triangular)^-1
96
+ #define EIGEN_MKL_TRSM_R(EIGTYPE, MKLTYPE, MKLPREFIX) \
97
+ template <typename Index, int Mode, bool Conjugate, int TriStorageOrder> \
98
+ struct triangular_solve_matrix<EIGTYPE,Index,OnTheRight,Mode,Conjugate,TriStorageOrder,ColMajor> \
99
+ { \
100
+ enum { \
101
+ IsLower = (Mode&Lower) == Lower, \
102
+ IsUnitDiag = (Mode&UnitDiag) ? 1 : 0, \
103
+ IsZeroDiag = (Mode&ZeroDiag) ? 1 : 0, \
104
+ conjA = ((TriStorageOrder==ColMajor) && Conjugate) ? 1 : 0 \
105
+ }; \
106
+ static void run( \
107
+ Index size, Index otherSize, \
108
+ const EIGTYPE* _tri, Index triStride, \
109
+ EIGTYPE* _other, Index otherStride, level3_blocking<EIGTYPE,EIGTYPE>& /*blocking*/) \
110
+ { \
111
+ MKL_INT m = otherSize, n = size, lda, ldb; \
112
+ char side = 'R', uplo, diag='N', transa; \
113
+ /* Set alpha_ */ \
114
+ MKLTYPE alpha; \
115
+ EIGTYPE myone(1); \
116
+ assign_scalar_eig2mkl(alpha, myone); \
117
+ ldb = otherStride;\
118
+ \
119
+ const EIGTYPE *a; \
120
+ /* Set trans */ \
121
+ transa = (TriStorageOrder==RowMajor) ? ((Conjugate) ? 'C' : 'T') : 'N'; \
122
+ /* Set uplo */ \
123
+ uplo = IsLower ? 'L' : 'U'; \
124
+ if (TriStorageOrder==RowMajor) uplo = (uplo == 'L') ? 'U' : 'L'; \
125
+ /* Set a, lda */ \
126
+ typedef Matrix<EIGTYPE, Dynamic, Dynamic, TriStorageOrder> MatrixTri; \
127
+ Map<const MatrixTri, 0, OuterStride<> > tri(_tri,size,size,OuterStride<>(triStride)); \
128
+ MatrixTri a_tmp; \
129
+ \
130
+ if (conjA) { \
131
+ a_tmp = tri.conjugate(); \
132
+ a = a_tmp.data(); \
133
+ lda = a_tmp.outerStride(); \
134
+ } else { \
135
+ a = _tri; \
136
+ lda = triStride; \
137
+ } \
138
+ if (IsUnitDiag) diag='U'; \
139
+ /* call ?trsm*/ \
140
+ MKLPREFIX##trsm(&side, &uplo, &transa, &diag, &m, &n, &alpha, (const MKLTYPE*)a, &lda, (MKLTYPE*)_other, &ldb); \
141
+ /*std::cout << "TRMS_L specialization!\n";*/ \
142
+ } \
143
+ };
144
+
145
+ EIGEN_MKL_TRSM_R(double, double, d)
146
+ EIGEN_MKL_TRSM_R(dcomplex, MKL_Complex16, z)
147
+ EIGEN_MKL_TRSM_R(float, float, s)
148
+ EIGEN_MKL_TRSM_R(scomplex, MKL_Complex8, c)
149
+
150
+
151
+ } // end namespace internal
152
+
153
+ } // end namespace Eigen
154
+
155
+ #endif // EIGEN_TRIANGULAR_SOLVER_MATRIX_MKL_H
@@ -0,0 +1,139 @@
1
+ // This file is part of Eigen, a lightweight C++ template library
2
+ // for linear algebra.
3
+ //
4
+ // Copyright (C) 2008-2010 Gael Guennebaud <gael.guennebaud@inria.fr>
5
+ //
6
+ // This Source Code Form is subject to the terms of the Mozilla
7
+ // Public License v. 2.0. If a copy of the MPL was not distributed
8
+ // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
+
10
+ #ifndef EIGEN_TRIANGULAR_SOLVER_VECTOR_H
11
+ #define EIGEN_TRIANGULAR_SOLVER_VECTOR_H
12
+
13
+ namespace Eigen {
14
+
15
+ namespace internal {
16
+
17
+ template<typename LhsScalar, typename RhsScalar, typename Index, int Mode, bool Conjugate, int StorageOrder>
18
+ struct triangular_solve_vector<LhsScalar, RhsScalar, Index, OnTheRight, Mode, Conjugate, StorageOrder>
19
+ {
20
+ static void run(Index size, const LhsScalar* _lhs, Index lhsStride, RhsScalar* rhs)
21
+ {
22
+ triangular_solve_vector<LhsScalar,RhsScalar,Index,OnTheLeft,
23
+ ((Mode&Upper)==Upper ? Lower : Upper) | (Mode&UnitDiag),
24
+ Conjugate,StorageOrder==RowMajor?ColMajor:RowMajor
25
+ >::run(size, _lhs, lhsStride, rhs);
26
+ }
27
+ };
28
+
29
+ // forward and backward substitution, row-major, rhs is a vector
30
+ template<typename LhsScalar, typename RhsScalar, typename Index, int Mode, bool Conjugate>
31
+ struct triangular_solve_vector<LhsScalar, RhsScalar, Index, OnTheLeft, Mode, Conjugate, RowMajor>
32
+ {
33
+ enum {
34
+ IsLower = ((Mode&Lower)==Lower)
35
+ };
36
+ static void run(Index size, const LhsScalar* _lhs, Index lhsStride, RhsScalar* rhs)
37
+ {
38
+ typedef Map<const Matrix<LhsScalar,Dynamic,Dynamic,RowMajor>, 0, OuterStride<> > LhsMap;
39
+ const LhsMap lhs(_lhs,size,size,OuterStride<>(lhsStride));
40
+ typename internal::conditional<
41
+ Conjugate,
42
+ const CwiseUnaryOp<typename internal::scalar_conjugate_op<LhsScalar>,LhsMap>,
43
+ const LhsMap&>
44
+ ::type cjLhs(lhs);
45
+ static const Index PanelWidth = EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH;
46
+ for(Index pi=IsLower ? 0 : size;
47
+ IsLower ? pi<size : pi>0;
48
+ IsLower ? pi+=PanelWidth : pi-=PanelWidth)
49
+ {
50
+ Index actualPanelWidth = (std::min)(IsLower ? size - pi : pi, PanelWidth);
51
+
52
+ Index r = IsLower ? pi : size - pi; // remaining size
53
+ if (r > 0)
54
+ {
55
+ // let's directly call the low level product function because:
56
+ // 1 - it is faster to compile
57
+ // 2 - it is slighlty faster at runtime
58
+ Index startRow = IsLower ? pi : pi-actualPanelWidth;
59
+ Index startCol = IsLower ? 0 : pi;
60
+
61
+ general_matrix_vector_product<Index,LhsScalar,RowMajor,Conjugate,RhsScalar,false>::run(
62
+ actualPanelWidth, r,
63
+ &lhs.coeffRef(startRow,startCol), lhsStride,
64
+ rhs + startCol, 1,
65
+ rhs + startRow, 1,
66
+ RhsScalar(-1));
67
+ }
68
+
69
+ for(Index k=0; k<actualPanelWidth; ++k)
70
+ {
71
+ Index i = IsLower ? pi+k : pi-k-1;
72
+ Index s = IsLower ? pi : i+1;
73
+ if (k>0)
74
+ rhs[i] -= (cjLhs.row(i).segment(s,k).transpose().cwiseProduct(Map<const Matrix<RhsScalar,Dynamic,1> >(rhs+s,k))).sum();
75
+
76
+ if(!(Mode & UnitDiag))
77
+ rhs[i] /= cjLhs(i,i);
78
+ }
79
+ }
80
+ }
81
+ };
82
+
83
+ // forward and backward substitution, column-major, rhs is a vector
84
+ template<typename LhsScalar, typename RhsScalar, typename Index, int Mode, bool Conjugate>
85
+ struct triangular_solve_vector<LhsScalar, RhsScalar, Index, OnTheLeft, Mode, Conjugate, ColMajor>
86
+ {
87
+ enum {
88
+ IsLower = ((Mode&Lower)==Lower)
89
+ };
90
+ static void run(Index size, const LhsScalar* _lhs, Index lhsStride, RhsScalar* rhs)
91
+ {
92
+ typedef Map<const Matrix<LhsScalar,Dynamic,Dynamic,ColMajor>, 0, OuterStride<> > LhsMap;
93
+ const LhsMap lhs(_lhs,size,size,OuterStride<>(lhsStride));
94
+ typename internal::conditional<Conjugate,
95
+ const CwiseUnaryOp<typename internal::scalar_conjugate_op<LhsScalar>,LhsMap>,
96
+ const LhsMap&
97
+ >::type cjLhs(lhs);
98
+ static const Index PanelWidth = EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH;
99
+
100
+ for(Index pi=IsLower ? 0 : size;
101
+ IsLower ? pi<size : pi>0;
102
+ IsLower ? pi+=PanelWidth : pi-=PanelWidth)
103
+ {
104
+ Index actualPanelWidth = (std::min)(IsLower ? size - pi : pi, PanelWidth);
105
+ Index startBlock = IsLower ? pi : pi-actualPanelWidth;
106
+ Index endBlock = IsLower ? pi + actualPanelWidth : 0;
107
+
108
+ for(Index k=0; k<actualPanelWidth; ++k)
109
+ {
110
+ Index i = IsLower ? pi+k : pi-k-1;
111
+ if(!(Mode & UnitDiag))
112
+ rhs[i] /= cjLhs.coeff(i,i);
113
+
114
+ Index r = actualPanelWidth - k - 1; // remaining size
115
+ Index s = IsLower ? i+1 : i-r;
116
+ if (r>0)
117
+ Map<Matrix<RhsScalar,Dynamic,1> >(rhs+s,r) -= rhs[i] * cjLhs.col(i).segment(s,r);
118
+ }
119
+ Index r = IsLower ? size - endBlock : startBlock; // remaining size
120
+ if (r > 0)
121
+ {
122
+ // let's directly call the low level product function because:
123
+ // 1 - it is faster to compile
124
+ // 2 - it is slighlty faster at runtime
125
+ general_matrix_vector_product<Index,LhsScalar,ColMajor,Conjugate,RhsScalar,false>::run(
126
+ r, actualPanelWidth,
127
+ &lhs.coeffRef(endBlock,startBlock), lhsStride,
128
+ rhs+startBlock, 1,
129
+ rhs+endBlock, 1, RhsScalar(-1));
130
+ }
131
+ }
132
+ }
133
+ };
134
+
135
+ } // end namespace internal
136
+
137
+ } // end namespace Eigen
138
+
139
+ #endif // EIGEN_TRIANGULAR_SOLVER_VECTOR_H
@@ -0,0 +1,264 @@
1
+ // This file is part of Eigen, a lightweight C++ template library
2
+ // for linear algebra.
3
+ //
4
+ // Copyright (C) 2009-2010 Gael Guennebaud <gael.guennebaud@inria.fr>
5
+ //
6
+ // This Source Code Form is subject to the terms of the Mozilla
7
+ // Public License v. 2.0. If a copy of the MPL was not distributed
8
+ // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
+
10
+ #ifndef EIGEN_BLASUTIL_H
11
+ #define EIGEN_BLASUTIL_H
12
+
13
+ // This file contains many lightweight helper classes used to
14
+ // implement and control fast level 2 and level 3 BLAS-like routines.
15
+
16
+ namespace Eigen {
17
+
18
+ namespace internal {
19
+
20
+ // forward declarations
21
+ template<typename LhsScalar, typename RhsScalar, typename Index, int mr, int nr, bool ConjugateLhs=false, bool ConjugateRhs=false>
22
+ struct gebp_kernel;
23
+
24
+ template<typename Scalar, typename Index, int nr, int StorageOrder, bool Conjugate = false, bool PanelMode=false>
25
+ struct gemm_pack_rhs;
26
+
27
+ template<typename Scalar, typename Index, int Pack1, int Pack2, int StorageOrder, bool Conjugate = false, bool PanelMode = false>
28
+ struct gemm_pack_lhs;
29
+
30
+ template<
31
+ typename Index,
32
+ typename LhsScalar, int LhsStorageOrder, bool ConjugateLhs,
33
+ typename RhsScalar, int RhsStorageOrder, bool ConjugateRhs,
34
+ int ResStorageOrder>
35
+ struct general_matrix_matrix_product;
36
+
37
+ template<typename Index, typename LhsScalar, int LhsStorageOrder, bool ConjugateLhs, typename RhsScalar, bool ConjugateRhs, int Version=Specialized>
38
+ struct general_matrix_vector_product;
39
+
40
+
41
+ template<bool Conjugate> struct conj_if;
42
+
43
+ template<> struct conj_if<true> {
44
+ template<typename T>
45
+ inline T operator()(const T& x) { return numext::conj(x); }
46
+ template<typename T>
47
+ inline T pconj(const T& x) { return internal::pconj(x); }
48
+ };
49
+
50
+ template<> struct conj_if<false> {
51
+ template<typename T>
52
+ inline const T& operator()(const T& x) { return x; }
53
+ template<typename T>
54
+ inline const T& pconj(const T& x) { return x; }
55
+ };
56
+
57
+ template<typename Scalar> struct conj_helper<Scalar,Scalar,false,false>
58
+ {
59
+ EIGEN_STRONG_INLINE Scalar pmadd(const Scalar& x, const Scalar& y, const Scalar& c) const { return internal::pmadd(x,y,c); }
60
+ EIGEN_STRONG_INLINE Scalar pmul(const Scalar& x, const Scalar& y) const { return internal::pmul(x,y); }
61
+ };
62
+
63
+ template<typename RealScalar> struct conj_helper<std::complex<RealScalar>, std::complex<RealScalar>, false,true>
64
+ {
65
+ typedef std::complex<RealScalar> Scalar;
66
+ EIGEN_STRONG_INLINE Scalar pmadd(const Scalar& x, const Scalar& y, const Scalar& c) const
67
+ { return c + pmul(x,y); }
68
+
69
+ EIGEN_STRONG_INLINE Scalar pmul(const Scalar& x, const Scalar& y) const
70
+ { return Scalar(numext::real(x)*numext::real(y) + numext::imag(x)*numext::imag(y), numext::imag(x)*numext::real(y) - numext::real(x)*numext::imag(y)); }
71
+ };
72
+
73
+ template<typename RealScalar> struct conj_helper<std::complex<RealScalar>, std::complex<RealScalar>, true,false>
74
+ {
75
+ typedef std::complex<RealScalar> Scalar;
76
+ EIGEN_STRONG_INLINE Scalar pmadd(const Scalar& x, const Scalar& y, const Scalar& c) const
77
+ { return c + pmul(x,y); }
78
+
79
+ EIGEN_STRONG_INLINE Scalar pmul(const Scalar& x, const Scalar& y) const
80
+ { return Scalar(numext::real(x)*numext::real(y) + numext::imag(x)*numext::imag(y), numext::real(x)*numext::imag(y) - numext::imag(x)*numext::real(y)); }
81
+ };
82
+
83
+ template<typename RealScalar> struct conj_helper<std::complex<RealScalar>, std::complex<RealScalar>, true,true>
84
+ {
85
+ typedef std::complex<RealScalar> Scalar;
86
+ EIGEN_STRONG_INLINE Scalar pmadd(const Scalar& x, const Scalar& y, const Scalar& c) const
87
+ { return c + pmul(x,y); }
88
+
89
+ EIGEN_STRONG_INLINE Scalar pmul(const Scalar& x, const Scalar& y) const
90
+ { return Scalar(numext::real(x)*numext::real(y) - numext::imag(x)*numext::imag(y), - numext::real(x)*numext::imag(y) - numext::imag(x)*numext::real(y)); }
91
+ };
92
+
93
+ template<typename RealScalar,bool Conj> struct conj_helper<std::complex<RealScalar>, RealScalar, Conj,false>
94
+ {
95
+ typedef std::complex<RealScalar> Scalar;
96
+ EIGEN_STRONG_INLINE Scalar pmadd(const Scalar& x, const RealScalar& y, const Scalar& c) const
97
+ { return padd(c, pmul(x,y)); }
98
+ EIGEN_STRONG_INLINE Scalar pmul(const Scalar& x, const RealScalar& y) const
99
+ { return conj_if<Conj>()(x)*y; }
100
+ };
101
+
102
+ template<typename RealScalar,bool Conj> struct conj_helper<RealScalar, std::complex<RealScalar>, false,Conj>
103
+ {
104
+ typedef std::complex<RealScalar> Scalar;
105
+ EIGEN_STRONG_INLINE Scalar pmadd(const RealScalar& x, const Scalar& y, const Scalar& c) const
106
+ { return padd(c, pmul(x,y)); }
107
+ EIGEN_STRONG_INLINE Scalar pmul(const RealScalar& x, const Scalar& y) const
108
+ { return x*conj_if<Conj>()(y); }
109
+ };
110
+
111
+ template<typename From,typename To> struct get_factor {
112
+ static EIGEN_STRONG_INLINE To run(const From& x) { return x; }
113
+ };
114
+
115
+ template<typename Scalar> struct get_factor<Scalar,typename NumTraits<Scalar>::Real> {
116
+ static EIGEN_STRONG_INLINE typename NumTraits<Scalar>::Real run(const Scalar& x) { return numext::real(x); }
117
+ };
118
+
119
+ // Lightweight helper class to access matrix coefficients.
120
+ // Yes, this is somehow redundant with Map<>, but this version is much much lighter,
121
+ // and so I hope better compilation performance (time and code quality).
122
+ template<typename Scalar, typename Index, int StorageOrder>
123
+ class blas_data_mapper
124
+ {
125
+ public:
126
+ blas_data_mapper(Scalar* data, Index stride) : m_data(data), m_stride(stride) {}
127
+ EIGEN_STRONG_INLINE Scalar& operator()(Index i, Index j)
128
+ { return m_data[StorageOrder==RowMajor ? j + i*m_stride : i + j*m_stride]; }
129
+ protected:
130
+ Scalar* EIGEN_RESTRICT m_data;
131
+ Index m_stride;
132
+ };
133
+
134
+ // lightweight helper class to access matrix coefficients (const version)
135
+ template<typename Scalar, typename Index, int StorageOrder>
136
+ class const_blas_data_mapper
137
+ {
138
+ public:
139
+ const_blas_data_mapper(const Scalar* data, Index stride) : m_data(data), m_stride(stride) {}
140
+ EIGEN_STRONG_INLINE const Scalar& operator()(Index i, Index j) const
141
+ { return m_data[StorageOrder==RowMajor ? j + i*m_stride : i + j*m_stride]; }
142
+ protected:
143
+ const Scalar* EIGEN_RESTRICT m_data;
144
+ Index m_stride;
145
+ };
146
+
147
+
148
+ /* Helper class to analyze the factors of a Product expression.
149
+ * In particular it allows to pop out operator-, scalar multiples,
150
+ * and conjugate */
151
+ template<typename XprType> struct blas_traits
152
+ {
153
+ typedef typename traits<XprType>::Scalar Scalar;
154
+ typedef const XprType& ExtractType;
155
+ typedef XprType _ExtractType;
156
+ enum {
157
+ IsComplex = NumTraits<Scalar>::IsComplex,
158
+ IsTransposed = false,
159
+ NeedToConjugate = false,
160
+ HasUsableDirectAccess = ( (int(XprType::Flags)&DirectAccessBit)
161
+ && ( bool(XprType::IsVectorAtCompileTime)
162
+ || int(inner_stride_at_compile_time<XprType>::ret) == 1)
163
+ ) ? 1 : 0
164
+ };
165
+ typedef typename conditional<bool(HasUsableDirectAccess),
166
+ ExtractType,
167
+ typename _ExtractType::PlainObject
168
+ >::type DirectLinearAccessType;
169
+ static inline ExtractType extract(const XprType& x) { return x; }
170
+ static inline const Scalar extractScalarFactor(const XprType&) { return Scalar(1); }
171
+ };
172
+
173
+ // pop conjugate
174
+ template<typename Scalar, typename NestedXpr>
175
+ struct blas_traits<CwiseUnaryOp<scalar_conjugate_op<Scalar>, NestedXpr> >
176
+ : blas_traits<NestedXpr>
177
+ {
178
+ typedef blas_traits<NestedXpr> Base;
179
+ typedef CwiseUnaryOp<scalar_conjugate_op<Scalar>, NestedXpr> XprType;
180
+ typedef typename Base::ExtractType ExtractType;
181
+
182
+ enum {
183
+ IsComplex = NumTraits<Scalar>::IsComplex,
184
+ NeedToConjugate = Base::NeedToConjugate ? 0 : IsComplex
185
+ };
186
+ static inline ExtractType extract(const XprType& x) { return Base::extract(x.nestedExpression()); }
187
+ static inline Scalar extractScalarFactor(const XprType& x) { return conj(Base::extractScalarFactor(x.nestedExpression())); }
188
+ };
189
+
190
+ // pop scalar multiple
191
+ template<typename Scalar, typename NestedXpr>
192
+ struct blas_traits<CwiseUnaryOp<scalar_multiple_op<Scalar>, NestedXpr> >
193
+ : blas_traits<NestedXpr>
194
+ {
195
+ typedef blas_traits<NestedXpr> Base;
196
+ typedef CwiseUnaryOp<scalar_multiple_op<Scalar>, NestedXpr> XprType;
197
+ typedef typename Base::ExtractType ExtractType;
198
+ static inline ExtractType extract(const XprType& x) { return Base::extract(x.nestedExpression()); }
199
+ static inline Scalar extractScalarFactor(const XprType& x)
200
+ { return x.functor().m_other * Base::extractScalarFactor(x.nestedExpression()); }
201
+ };
202
+
203
+ // pop opposite
204
+ template<typename Scalar, typename NestedXpr>
205
+ struct blas_traits<CwiseUnaryOp<scalar_opposite_op<Scalar>, NestedXpr> >
206
+ : blas_traits<NestedXpr>
207
+ {
208
+ typedef blas_traits<NestedXpr> Base;
209
+ typedef CwiseUnaryOp<scalar_opposite_op<Scalar>, NestedXpr> XprType;
210
+ typedef typename Base::ExtractType ExtractType;
211
+ static inline ExtractType extract(const XprType& x) { return Base::extract(x.nestedExpression()); }
212
+ static inline Scalar extractScalarFactor(const XprType& x)
213
+ { return - Base::extractScalarFactor(x.nestedExpression()); }
214
+ };
215
+
216
+ // pop/push transpose
217
+ template<typename NestedXpr>
218
+ struct blas_traits<Transpose<NestedXpr> >
219
+ : blas_traits<NestedXpr>
220
+ {
221
+ typedef typename NestedXpr::Scalar Scalar;
222
+ typedef blas_traits<NestedXpr> Base;
223
+ typedef Transpose<NestedXpr> XprType;
224
+ typedef Transpose<const typename Base::_ExtractType> ExtractType; // const to get rid of a compile error; anyway blas traits are only used on the RHS
225
+ typedef Transpose<const typename Base::_ExtractType> _ExtractType;
226
+ typedef typename conditional<bool(Base::HasUsableDirectAccess),
227
+ ExtractType,
228
+ typename ExtractType::PlainObject
229
+ >::type DirectLinearAccessType;
230
+ enum {
231
+ IsTransposed = Base::IsTransposed ? 0 : 1
232
+ };
233
+ static inline ExtractType extract(const XprType& x) { return Base::extract(x.nestedExpression()); }
234
+ static inline Scalar extractScalarFactor(const XprType& x) { return Base::extractScalarFactor(x.nestedExpression()); }
235
+ };
236
+
237
+ template<typename T>
238
+ struct blas_traits<const T>
239
+ : blas_traits<T>
240
+ {};
241
+
242
+ template<typename T, bool HasUsableDirectAccess=blas_traits<T>::HasUsableDirectAccess>
243
+ struct extract_data_selector {
244
+ static const typename T::Scalar* run(const T& m)
245
+ {
246
+ return blas_traits<T>::extract(m).data();
247
+ }
248
+ };
249
+
250
+ template<typename T>
251
+ struct extract_data_selector<T,false> {
252
+ static typename T::Scalar* run(const T&) { return 0; }
253
+ };
254
+
255
+ template<typename T> const typename T::Scalar* extract_data(const T& m)
256
+ {
257
+ return extract_data_selector<T>::run(m);
258
+ }
259
+
260
+ } // end namespace internal
261
+
262
+ } // end namespace Eigen
263
+
264
+ #endif // EIGEN_BLASUTIL_H