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,350 @@
1
+ // This file is part of Eigen, a lightweight C++ template library
2
+ // for linear algebra.
3
+ //
4
+ // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
5
+ // Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
6
+ //
7
+ // This Source Code Form is subject to the terms of the Mozilla
8
+ // Public License v. 2.0. If a copy of the MPL was not distributed
9
+ // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10
+
11
+ #ifndef EIGEN_GENERIC_PACKET_MATH_H
12
+ #define EIGEN_GENERIC_PACKET_MATH_H
13
+
14
+ namespace Eigen {
15
+
16
+ namespace internal {
17
+
18
+ /** \internal
19
+ * \file GenericPacketMath.h
20
+ *
21
+ * Default implementation for types not supported by the vectorization.
22
+ * In practice these functions are provided to make easier the writing
23
+ * of generic vectorized code.
24
+ */
25
+
26
+ #ifndef EIGEN_DEBUG_ALIGNED_LOAD
27
+ #define EIGEN_DEBUG_ALIGNED_LOAD
28
+ #endif
29
+
30
+ #ifndef EIGEN_DEBUG_UNALIGNED_LOAD
31
+ #define EIGEN_DEBUG_UNALIGNED_LOAD
32
+ #endif
33
+
34
+ #ifndef EIGEN_DEBUG_ALIGNED_STORE
35
+ #define EIGEN_DEBUG_ALIGNED_STORE
36
+ #endif
37
+
38
+ #ifndef EIGEN_DEBUG_UNALIGNED_STORE
39
+ #define EIGEN_DEBUG_UNALIGNED_STORE
40
+ #endif
41
+
42
+ struct default_packet_traits
43
+ {
44
+ enum {
45
+ HasAdd = 1,
46
+ HasSub = 1,
47
+ HasMul = 1,
48
+ HasNegate = 1,
49
+ HasAbs = 1,
50
+ HasAbs2 = 1,
51
+ HasMin = 1,
52
+ HasMax = 1,
53
+ HasConj = 1,
54
+ HasSetLinear = 1,
55
+
56
+ HasDiv = 0,
57
+ HasSqrt = 0,
58
+ HasExp = 0,
59
+ HasLog = 0,
60
+ HasPow = 0,
61
+
62
+ HasSin = 0,
63
+ HasCos = 0,
64
+ HasTan = 0,
65
+ HasASin = 0,
66
+ HasACos = 0,
67
+ HasATan = 0
68
+ };
69
+ };
70
+
71
+ template<typename T> struct packet_traits : default_packet_traits
72
+ {
73
+ typedef T type;
74
+ enum {
75
+ Vectorizable = 0,
76
+ size = 1,
77
+ AlignedOnScalar = 0
78
+ };
79
+ enum {
80
+ HasAdd = 0,
81
+ HasSub = 0,
82
+ HasMul = 0,
83
+ HasNegate = 0,
84
+ HasAbs = 0,
85
+ HasAbs2 = 0,
86
+ HasMin = 0,
87
+ HasMax = 0,
88
+ HasConj = 0,
89
+ HasSetLinear = 0
90
+ };
91
+ };
92
+
93
+ /** \internal \returns a + b (coeff-wise) */
94
+ template<typename Packet> inline Packet
95
+ padd(const Packet& a,
96
+ const Packet& b) { return a+b; }
97
+
98
+ /** \internal \returns a - b (coeff-wise) */
99
+ template<typename Packet> inline Packet
100
+ psub(const Packet& a,
101
+ const Packet& b) { return a-b; }
102
+
103
+ /** \internal \returns -a (coeff-wise) */
104
+ template<typename Packet> inline Packet
105
+ pnegate(const Packet& a) { return -a; }
106
+
107
+ /** \internal \returns conj(a) (coeff-wise) */
108
+ template<typename Packet> inline Packet
109
+ pconj(const Packet& a) { return numext::conj(a); }
110
+
111
+ /** \internal \returns a * b (coeff-wise) */
112
+ template<typename Packet> inline Packet
113
+ pmul(const Packet& a,
114
+ const Packet& b) { return a*b; }
115
+
116
+ /** \internal \returns a / b (coeff-wise) */
117
+ template<typename Packet> inline Packet
118
+ pdiv(const Packet& a,
119
+ const Packet& b) { return a/b; }
120
+
121
+ /** \internal \returns the min of \a a and \a b (coeff-wise) */
122
+ template<typename Packet> inline Packet
123
+ pmin(const Packet& a,
124
+ const Packet& b) { using std::min; return (min)(a, b); }
125
+
126
+ /** \internal \returns the max of \a a and \a b (coeff-wise) */
127
+ template<typename Packet> inline Packet
128
+ pmax(const Packet& a,
129
+ const Packet& b) { using std::max; return (max)(a, b); }
130
+
131
+ /** \internal \returns the absolute value of \a a */
132
+ template<typename Packet> inline Packet
133
+ pabs(const Packet& a) { using std::abs; return abs(a); }
134
+
135
+ /** \internal \returns the bitwise and of \a a and \a b */
136
+ template<typename Packet> inline Packet
137
+ pand(const Packet& a, const Packet& b) { return a & b; }
138
+
139
+ /** \internal \returns the bitwise or of \a a and \a b */
140
+ template<typename Packet> inline Packet
141
+ por(const Packet& a, const Packet& b) { return a | b; }
142
+
143
+ /** \internal \returns the bitwise xor of \a a and \a b */
144
+ template<typename Packet> inline Packet
145
+ pxor(const Packet& a, const Packet& b) { return a ^ b; }
146
+
147
+ /** \internal \returns the bitwise andnot of \a a and \a b */
148
+ template<typename Packet> inline Packet
149
+ pandnot(const Packet& a, const Packet& b) { return a & (!b); }
150
+
151
+ /** \internal \returns a packet version of \a *from, from must be 16 bytes aligned */
152
+ template<typename Packet> inline Packet
153
+ pload(const typename unpacket_traits<Packet>::type* from) { return *from; }
154
+
155
+ /** \internal \returns a packet version of \a *from, (un-aligned load) */
156
+ template<typename Packet> inline Packet
157
+ ploadu(const typename unpacket_traits<Packet>::type* from) { return *from; }
158
+
159
+ /** \internal \returns a packet with elements of \a *from duplicated.
160
+ * For instance, for a packet of 8 elements, 4 scalar will be read from \a *from and
161
+ * duplicated to form: {from[0],from[0],from[1],from[1],,from[2],from[2],,from[3],from[3]}
162
+ * Currently, this function is only used for scalar * complex products.
163
+ */
164
+ template<typename Packet> inline Packet
165
+ ploaddup(const typename unpacket_traits<Packet>::type* from) { return *from; }
166
+
167
+ /** \internal \returns a packet with constant coefficients \a a, e.g.: (a,a,a,a) */
168
+ template<typename Packet> inline Packet
169
+ pset1(const typename unpacket_traits<Packet>::type& a) { return a; }
170
+
171
+ /** \internal \brief Returns a packet with coefficients (a,a+1,...,a+packet_size-1). */
172
+ template<typename Scalar> inline typename packet_traits<Scalar>::type
173
+ plset(const Scalar& a) { return a; }
174
+
175
+ /** \internal copy the packet \a from to \a *to, \a to must be 16 bytes aligned */
176
+ template<typename Scalar, typename Packet> inline void pstore(Scalar* to, const Packet& from)
177
+ { (*to) = from; }
178
+
179
+ /** \internal copy the packet \a from to \a *to, (un-aligned store) */
180
+ template<typename Scalar, typename Packet> inline void pstoreu(Scalar* to, const Packet& from)
181
+ { (*to) = from; }
182
+
183
+ /** \internal tries to do cache prefetching of \a addr */
184
+ template<typename Scalar> inline void prefetch(const Scalar* addr)
185
+ {
186
+ #if !defined(_MSC_VER)
187
+ __builtin_prefetch(addr);
188
+ #endif
189
+ }
190
+
191
+ /** \internal \returns the first element of a packet */
192
+ template<typename Packet> inline typename unpacket_traits<Packet>::type pfirst(const Packet& a)
193
+ { return a; }
194
+
195
+ /** \internal \returns a packet where the element i contains the sum of the packet of \a vec[i] */
196
+ template<typename Packet> inline Packet
197
+ preduxp(const Packet* vecs) { return vecs[0]; }
198
+
199
+ /** \internal \returns the sum of the elements of \a a*/
200
+ template<typename Packet> inline typename unpacket_traits<Packet>::type predux(const Packet& a)
201
+ { return a; }
202
+
203
+ /** \internal \returns the product of the elements of \a a*/
204
+ template<typename Packet> inline typename unpacket_traits<Packet>::type predux_mul(const Packet& a)
205
+ { return a; }
206
+
207
+ /** \internal \returns the min of the elements of \a a*/
208
+ template<typename Packet> inline typename unpacket_traits<Packet>::type predux_min(const Packet& a)
209
+ { return a; }
210
+
211
+ /** \internal \returns the max of the elements of \a a*/
212
+ template<typename Packet> inline typename unpacket_traits<Packet>::type predux_max(const Packet& a)
213
+ { return a; }
214
+
215
+ /** \internal \returns the reversed elements of \a a*/
216
+ template<typename Packet> inline Packet preverse(const Packet& a)
217
+ { return a; }
218
+
219
+
220
+ /** \internal \returns \a a with real and imaginary part flipped (for complex type only) */
221
+ template<typename Packet> inline Packet pcplxflip(const Packet& a)
222
+ {
223
+ // FIXME: uncomment the following in case we drop the internal imag and real functions.
224
+ // using std::imag;
225
+ // using std::real;
226
+ return Packet(imag(a),real(a));
227
+ }
228
+
229
+ /**************************
230
+ * Special math functions
231
+ ***************************/
232
+
233
+ /** \internal \returns the sine of \a a (coeff-wise) */
234
+ template<typename Packet> EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
235
+ Packet psin(const Packet& a) { using std::sin; return sin(a); }
236
+
237
+ /** \internal \returns the cosine of \a a (coeff-wise) */
238
+ template<typename Packet> EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
239
+ Packet pcos(const Packet& a) { using std::cos; return cos(a); }
240
+
241
+ /** \internal \returns the tan of \a a (coeff-wise) */
242
+ template<typename Packet> EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
243
+ Packet ptan(const Packet& a) { using std::tan; return tan(a); }
244
+
245
+ /** \internal \returns the arc sine of \a a (coeff-wise) */
246
+ template<typename Packet> EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
247
+ Packet pasin(const Packet& a) { using std::asin; return asin(a); }
248
+
249
+ /** \internal \returns the arc cosine of \a a (coeff-wise) */
250
+ template<typename Packet> EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
251
+ Packet pacos(const Packet& a) { using std::acos; return acos(a); }
252
+
253
+ /** \internal \returns the exp of \a a (coeff-wise) */
254
+ template<typename Packet> EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
255
+ Packet pexp(const Packet& a) { using std::exp; return exp(a); }
256
+
257
+ /** \internal \returns the log of \a a (coeff-wise) */
258
+ template<typename Packet> EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
259
+ Packet plog(const Packet& a) { using std::log; return log(a); }
260
+
261
+ /** \internal \returns the square-root of \a a (coeff-wise) */
262
+ template<typename Packet> EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
263
+ Packet psqrt(const Packet& a) { using std::sqrt; return sqrt(a); }
264
+
265
+ /***************************************************************************
266
+ * The following functions might not have to be overwritten for vectorized types
267
+ ***************************************************************************/
268
+
269
+ /** \internal copy a packet with constant coeficient \a a (e.g., [a,a,a,a]) to \a *to. \a to must be 16 bytes aligned */
270
+ // NOTE: this function must really be templated on the packet type (think about different packet types for the same scalar type)
271
+ template<typename Packet>
272
+ inline void pstore1(typename unpacket_traits<Packet>::type* to, const typename unpacket_traits<Packet>::type& a)
273
+ {
274
+ pstore(to, pset1<Packet>(a));
275
+ }
276
+
277
+ /** \internal \returns a * b + c (coeff-wise) */
278
+ template<typename Packet> inline Packet
279
+ pmadd(const Packet& a,
280
+ const Packet& b,
281
+ const Packet& c)
282
+ { return padd(pmul(a, b),c); }
283
+
284
+ /** \internal \returns a packet version of \a *from.
285
+ * If LoadMode equals #Aligned, \a from must be 16 bytes aligned */
286
+ template<typename Packet, int LoadMode>
287
+ inline Packet ploadt(const typename unpacket_traits<Packet>::type* from)
288
+ {
289
+ if(LoadMode == Aligned)
290
+ return pload<Packet>(from);
291
+ else
292
+ return ploadu<Packet>(from);
293
+ }
294
+
295
+ /** \internal copy the packet \a from to \a *to.
296
+ * If StoreMode equals #Aligned, \a to must be 16 bytes aligned */
297
+ template<typename Scalar, typename Packet, int LoadMode>
298
+ inline void pstoret(Scalar* to, const Packet& from)
299
+ {
300
+ if(LoadMode == Aligned)
301
+ pstore(to, from);
302
+ else
303
+ pstoreu(to, from);
304
+ }
305
+
306
+ /** \internal default implementation of palign() allowing partial specialization */
307
+ template<int Offset,typename PacketType>
308
+ struct palign_impl
309
+ {
310
+ // by default data are aligned, so there is nothing to be done :)
311
+ static inline void run(PacketType&, const PacketType&) {}
312
+ };
313
+
314
+ /** \internal update \a first using the concatenation of the packet_size minus \a Offset last elements
315
+ * of \a first and \a Offset first elements of \a second.
316
+ *
317
+ * This function is currently only used to optimize matrix-vector products on unligned matrices.
318
+ * It takes 2 packets that represent a contiguous memory array, and returns a packet starting
319
+ * at the position \a Offset. For instance, for packets of 4 elements, we have:
320
+ * Input:
321
+ * - first = {f0,f1,f2,f3}
322
+ * - second = {s0,s1,s2,s3}
323
+ * Output:
324
+ * - if Offset==0 then {f0,f1,f2,f3}
325
+ * - if Offset==1 then {f1,f2,f3,s0}
326
+ * - if Offset==2 then {f2,f3,s0,s1}
327
+ * - if Offset==3 then {f3,s0,s1,s3}
328
+ */
329
+ template<int Offset,typename PacketType>
330
+ inline void palign(PacketType& first, const PacketType& second)
331
+ {
332
+ palign_impl<Offset,PacketType>::run(first,second);
333
+ }
334
+
335
+ /***************************************************************************
336
+ * Fast complex products (GCC generates a function call which is very slow)
337
+ ***************************************************************************/
338
+
339
+ template<> inline std::complex<float> pmul(const std::complex<float>& a, const std::complex<float>& b)
340
+ { return std::complex<float>(real(a)*real(b) - imag(a)*imag(b), imag(a)*real(b) + real(a)*imag(b)); }
341
+
342
+ template<> inline std::complex<double> pmul(const std::complex<double>& a, const std::complex<double>& b)
343
+ { return std::complex<double>(real(a)*real(b) - imag(a)*imag(b), imag(a)*real(b) + real(a)*imag(b)); }
344
+
345
+ } // end namespace internal
346
+
347
+ } // end namespace Eigen
348
+
349
+ #endif // EIGEN_GENERIC_PACKET_MATH_H
350
+
@@ -0,0 +1,92 @@
1
+ // This file is part of Eigen, a lightweight C++ template library
2
+ // for linear algebra.
3
+ //
4
+ // Copyright (C) 2010-2012 Gael Guennebaud <gael.guennebaud@inria.fr>
5
+ // Copyright (C) 2010 Benoit Jacob <jacob.benoit.1@gmail.com>
6
+ //
7
+ // This Source Code Form is subject to the terms of the Mozilla
8
+ // Public License v. 2.0. If a copy of the MPL was not distributed
9
+ // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10
+
11
+ #ifndef EIGEN_GLOBAL_FUNCTIONS_H
12
+ #define EIGEN_GLOBAL_FUNCTIONS_H
13
+
14
+ #define EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(NAME,FUNCTOR) \
15
+ template<typename Derived> \
16
+ inline const Eigen::CwiseUnaryOp<Eigen::internal::FUNCTOR<typename Derived::Scalar>, const Derived> \
17
+ NAME(const Eigen::ArrayBase<Derived>& x) { \
18
+ return x.derived(); \
19
+ }
20
+
21
+ #define EIGEN_ARRAY_DECLARE_GLOBAL_EIGEN_UNARY(NAME,FUNCTOR) \
22
+ \
23
+ template<typename Derived> \
24
+ struct NAME##_retval<ArrayBase<Derived> > \
25
+ { \
26
+ typedef const Eigen::CwiseUnaryOp<Eigen::internal::FUNCTOR<typename Derived::Scalar>, const Derived> type; \
27
+ }; \
28
+ template<typename Derived> \
29
+ struct NAME##_impl<ArrayBase<Derived> > \
30
+ { \
31
+ static inline typename NAME##_retval<ArrayBase<Derived> >::type run(const Eigen::ArrayBase<Derived>& x) \
32
+ { \
33
+ return x.derived(); \
34
+ } \
35
+ };
36
+
37
+
38
+ namespace Eigen
39
+ {
40
+ EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(real,scalar_real_op)
41
+ EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(imag,scalar_imag_op)
42
+ EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(conj,scalar_conjugate_op)
43
+ EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(sin,scalar_sin_op)
44
+ EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(cos,scalar_cos_op)
45
+ EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(asin,scalar_asin_op)
46
+ EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(acos,scalar_acos_op)
47
+ EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(tan,scalar_tan_op)
48
+ EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(exp,scalar_exp_op)
49
+ EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(log,scalar_log_op)
50
+ EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(abs,scalar_abs_op)
51
+ EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(sqrt,scalar_sqrt_op)
52
+
53
+ template<typename Derived>
54
+ inline const Eigen::CwiseUnaryOp<Eigen::internal::scalar_pow_op<typename Derived::Scalar>, const Derived>
55
+ pow(const Eigen::ArrayBase<Derived>& x, const typename Derived::Scalar& exponent) {
56
+ return x.derived().pow(exponent);
57
+ }
58
+
59
+ template<typename Derived>
60
+ inline const Eigen::CwiseBinaryOp<Eigen::internal::scalar_binary_pow_op<typename Derived::Scalar, typename Derived::Scalar>, const Derived, const Derived>
61
+ pow(const Eigen::ArrayBase<Derived>& x, const Eigen::ArrayBase<Derived>& exponents)
62
+ {
63
+ return Eigen::CwiseBinaryOp<Eigen::internal::scalar_binary_pow_op<typename Derived::Scalar, typename Derived::Scalar>, const Derived, const Derived>(
64
+ x.derived(),
65
+ exponents.derived()
66
+ );
67
+ }
68
+
69
+ /**
70
+ * \brief Component-wise division of a scalar by array elements.
71
+ **/
72
+ template <typename Derived>
73
+ inline const Eigen::CwiseUnaryOp<Eigen::internal::scalar_inverse_mult_op<typename Derived::Scalar>, const Derived>
74
+ operator/(const typename Derived::Scalar& s, const Eigen::ArrayBase<Derived>& a)
75
+ {
76
+ return Eigen::CwiseUnaryOp<Eigen::internal::scalar_inverse_mult_op<typename Derived::Scalar>, const Derived>(
77
+ a.derived(),
78
+ Eigen::internal::scalar_inverse_mult_op<typename Derived::Scalar>(s)
79
+ );
80
+ }
81
+
82
+ namespace internal
83
+ {
84
+ EIGEN_ARRAY_DECLARE_GLOBAL_EIGEN_UNARY(real,scalar_real_op)
85
+ EIGEN_ARRAY_DECLARE_GLOBAL_EIGEN_UNARY(imag,scalar_imag_op)
86
+ EIGEN_ARRAY_DECLARE_GLOBAL_EIGEN_UNARY(abs2,scalar_abs2_op)
87
+ }
88
+ }
89
+
90
+ // TODO: cleanly disable those functions that are not supported on Array (numext::real_ref, internal::random, internal::isApprox...)
91
+
92
+ #endif // EIGEN_GLOBAL_FUNCTIONS_H
@@ -0,0 +1,250 @@
1
+ // This file is part of Eigen, a lightweight C++ template library
2
+ // for linear algebra.
3
+ //
4
+ // Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
5
+ // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
6
+ //
7
+ // This Source Code Form is subject to the terms of the Mozilla
8
+ // Public License v. 2.0. If a copy of the MPL was not distributed
9
+ // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10
+
11
+ #ifndef EIGEN_IO_H
12
+ #define EIGEN_IO_H
13
+
14
+ namespace Eigen {
15
+
16
+ enum { DontAlignCols = 1 };
17
+ enum { StreamPrecision = -1,
18
+ FullPrecision = -2 };
19
+
20
+ namespace internal {
21
+ template<typename Derived>
22
+ std::ostream & print_matrix(std::ostream & s, const Derived& _m, const IOFormat& fmt);
23
+ }
24
+
25
+ /** \class IOFormat
26
+ * \ingroup Core_Module
27
+ *
28
+ * \brief Stores a set of parameters controlling the way matrices are printed
29
+ *
30
+ * List of available parameters:
31
+ * - \b precision number of digits for floating point values, or one of the special constants \c StreamPrecision and \c FullPrecision.
32
+ * The default is the special value \c StreamPrecision which means to use the
33
+ * stream's own precision setting, as set for instance using \c cout.precision(3). The other special value
34
+ * \c FullPrecision means that the number of digits will be computed to match the full precision of each floating-point
35
+ * type.
36
+ * - \b flags an OR-ed combination of flags, the default value is 0, the only currently available flag is \c DontAlignCols which
37
+ * allows to disable the alignment of columns, resulting in faster code.
38
+ * - \b coeffSeparator string printed between two coefficients of the same row
39
+ * - \b rowSeparator string printed between two rows
40
+ * - \b rowPrefix string printed at the beginning of each row
41
+ * - \b rowSuffix string printed at the end of each row
42
+ * - \b matPrefix string printed at the beginning of the matrix
43
+ * - \b matSuffix string printed at the end of the matrix
44
+ *
45
+ * Example: \include IOFormat.cpp
46
+ * Output: \verbinclude IOFormat.out
47
+ *
48
+ * \sa DenseBase::format(), class WithFormat
49
+ */
50
+ struct IOFormat
51
+ {
52
+ /** Default contructor, see class IOFormat for the meaning of the parameters */
53
+ IOFormat(int _precision = StreamPrecision, int _flags = 0,
54
+ const std::string& _coeffSeparator = " ",
55
+ const std::string& _rowSeparator = "\n", const std::string& _rowPrefix="", const std::string& _rowSuffix="",
56
+ const std::string& _matPrefix="", const std::string& _matSuffix="")
57
+ : matPrefix(_matPrefix), matSuffix(_matSuffix), rowPrefix(_rowPrefix), rowSuffix(_rowSuffix), rowSeparator(_rowSeparator),
58
+ rowSpacer(""), coeffSeparator(_coeffSeparator), precision(_precision), flags(_flags)
59
+ {
60
+ int i = int(matSuffix.length())-1;
61
+ while (i>=0 && matSuffix[i]!='\n')
62
+ {
63
+ rowSpacer += ' ';
64
+ i--;
65
+ }
66
+ }
67
+ std::string matPrefix, matSuffix;
68
+ std::string rowPrefix, rowSuffix, rowSeparator, rowSpacer;
69
+ std::string coeffSeparator;
70
+ int precision;
71
+ int flags;
72
+ };
73
+
74
+ /** \class WithFormat
75
+ * \ingroup Core_Module
76
+ *
77
+ * \brief Pseudo expression providing matrix output with given format
78
+ *
79
+ * \param ExpressionType the type of the object on which IO stream operations are performed
80
+ *
81
+ * This class represents an expression with stream operators controlled by a given IOFormat.
82
+ * It is the return type of DenseBase::format()
83
+ * and most of the time this is the only way it is used.
84
+ *
85
+ * See class IOFormat for some examples.
86
+ *
87
+ * \sa DenseBase::format(), class IOFormat
88
+ */
89
+ template<typename ExpressionType>
90
+ class WithFormat
91
+ {
92
+ public:
93
+
94
+ WithFormat(const ExpressionType& matrix, const IOFormat& format)
95
+ : m_matrix(matrix), m_format(format)
96
+ {}
97
+
98
+ friend std::ostream & operator << (std::ostream & s, const WithFormat& wf)
99
+ {
100
+ return internal::print_matrix(s, wf.m_matrix.eval(), wf.m_format);
101
+ }
102
+
103
+ protected:
104
+ const typename ExpressionType::Nested m_matrix;
105
+ IOFormat m_format;
106
+ };
107
+
108
+ /** \returns a WithFormat proxy object allowing to print a matrix the with given
109
+ * format \a fmt.
110
+ *
111
+ * See class IOFormat for some examples.
112
+ *
113
+ * \sa class IOFormat, class WithFormat
114
+ */
115
+ template<typename Derived>
116
+ inline const WithFormat<Derived>
117
+ DenseBase<Derived>::format(const IOFormat& fmt) const
118
+ {
119
+ return WithFormat<Derived>(derived(), fmt);
120
+ }
121
+
122
+ namespace internal {
123
+
124
+ template<typename Scalar, bool IsInteger>
125
+ struct significant_decimals_default_impl
126
+ {
127
+ typedef typename NumTraits<Scalar>::Real RealScalar;
128
+ static inline int run()
129
+ {
130
+ using std::ceil;
131
+ using std::log;
132
+ return cast<RealScalar,int>(ceil(-log(NumTraits<RealScalar>::epsilon())/log(RealScalar(10))));
133
+ }
134
+ };
135
+
136
+ template<typename Scalar>
137
+ struct significant_decimals_default_impl<Scalar, true>
138
+ {
139
+ static inline int run()
140
+ {
141
+ return 0;
142
+ }
143
+ };
144
+
145
+ template<typename Scalar>
146
+ struct significant_decimals_impl
147
+ : significant_decimals_default_impl<Scalar, NumTraits<Scalar>::IsInteger>
148
+ {};
149
+
150
+ /** \internal
151
+ * print the matrix \a _m to the output stream \a s using the output format \a fmt */
152
+ template<typename Derived>
153
+ std::ostream & print_matrix(std::ostream & s, const Derived& _m, const IOFormat& fmt)
154
+ {
155
+ if(_m.size() == 0)
156
+ {
157
+ s << fmt.matPrefix << fmt.matSuffix;
158
+ return s;
159
+ }
160
+
161
+ typename Derived::Nested m = _m;
162
+ typedef typename Derived::Scalar Scalar;
163
+ typedef typename Derived::Index Index;
164
+
165
+ Index width = 0;
166
+
167
+ std::streamsize explicit_precision;
168
+ if(fmt.precision == StreamPrecision)
169
+ {
170
+ explicit_precision = 0;
171
+ }
172
+ else if(fmt.precision == FullPrecision)
173
+ {
174
+ if (NumTraits<Scalar>::IsInteger)
175
+ {
176
+ explicit_precision = 0;
177
+ }
178
+ else
179
+ {
180
+ explicit_precision = significant_decimals_impl<Scalar>::run();
181
+ }
182
+ }
183
+ else
184
+ {
185
+ explicit_precision = fmt.precision;
186
+ }
187
+
188
+ std::streamsize old_precision = 0;
189
+ if(explicit_precision) old_precision = s.precision(explicit_precision);
190
+
191
+ bool align_cols = !(fmt.flags & DontAlignCols);
192
+ if(align_cols)
193
+ {
194
+ // compute the largest width
195
+ for(Index j = 0; j < m.cols(); ++j)
196
+ for(Index i = 0; i < m.rows(); ++i)
197
+ {
198
+ std::stringstream sstr;
199
+ sstr.copyfmt(s);
200
+ sstr << m.coeff(i,j);
201
+ width = std::max<Index>(width, Index(sstr.str().length()));
202
+ }
203
+ }
204
+ s << fmt.matPrefix;
205
+ for(Index i = 0; i < m.rows(); ++i)
206
+ {
207
+ if (i)
208
+ s << fmt.rowSpacer;
209
+ s << fmt.rowPrefix;
210
+ if(width) s.width(width);
211
+ s << m.coeff(i, 0);
212
+ for(Index j = 1; j < m.cols(); ++j)
213
+ {
214
+ s << fmt.coeffSeparator;
215
+ if (width) s.width(width);
216
+ s << m.coeff(i, j);
217
+ }
218
+ s << fmt.rowSuffix;
219
+ if( i < m.rows() - 1)
220
+ s << fmt.rowSeparator;
221
+ }
222
+ s << fmt.matSuffix;
223
+ if(explicit_precision) s.precision(old_precision);
224
+ return s;
225
+ }
226
+
227
+ } // end namespace internal
228
+
229
+ /** \relates DenseBase
230
+ *
231
+ * Outputs the matrix, to the given stream.
232
+ *
233
+ * If you wish to print the matrix with a format different than the default, use DenseBase::format().
234
+ *
235
+ * It is also possible to change the default format by defining EIGEN_DEFAULT_IO_FORMAT before including Eigen headers.
236
+ * If not defined, this will automatically be defined to Eigen::IOFormat(), that is the Eigen::IOFormat with default parameters.
237
+ *
238
+ * \sa DenseBase::format()
239
+ */
240
+ template<typename Derived>
241
+ std::ostream & operator <<
242
+ (std::ostream & s,
243
+ const DenseBase<Derived> & m)
244
+ {
245
+ return internal::print_matrix(s, m.eval(), EIGEN_DEFAULT_IO_FORMAT);
246
+ }
247
+
248
+ } // end namespace Eigen
249
+
250
+ #endif // EIGEN_IO_H