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,406 @@
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-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_BLOCK_H
12
+ #define EIGEN_BLOCK_H
13
+
14
+ namespace Eigen {
15
+
16
+ /** \class Block
17
+ * \ingroup Core_Module
18
+ *
19
+ * \brief Expression of a fixed-size or dynamic-size block
20
+ *
21
+ * \param XprType the type of the expression in which we are taking a block
22
+ * \param BlockRows the number of rows of the block we are taking at compile time (optional)
23
+ * \param BlockCols the number of columns of the block we are taking at compile time (optional)
24
+ *
25
+ * This class represents an expression of either a fixed-size or dynamic-size block. It is the return
26
+ * type of DenseBase::block(Index,Index,Index,Index) and DenseBase::block<int,int>(Index,Index) and
27
+ * most of the time this is the only way it is used.
28
+ *
29
+ * However, if you want to directly maniputate block expressions,
30
+ * for instance if you want to write a function returning such an expression, you
31
+ * will need to use this class.
32
+ *
33
+ * Here is an example illustrating the dynamic case:
34
+ * \include class_Block.cpp
35
+ * Output: \verbinclude class_Block.out
36
+ *
37
+ * \note Even though this expression has dynamic size, in the case where \a XprType
38
+ * has fixed size, this expression inherits a fixed maximal size which means that evaluating
39
+ * it does not cause a dynamic memory allocation.
40
+ *
41
+ * Here is an example illustrating the fixed-size case:
42
+ * \include class_FixedBlock.cpp
43
+ * Output: \verbinclude class_FixedBlock.out
44
+ *
45
+ * \sa DenseBase::block(Index,Index,Index,Index), DenseBase::block(Index,Index), class VectorBlock
46
+ */
47
+
48
+ namespace internal {
49
+ template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel>
50
+ struct traits<Block<XprType, BlockRows, BlockCols, InnerPanel> > : traits<XprType>
51
+ {
52
+ typedef typename traits<XprType>::Scalar Scalar;
53
+ typedef typename traits<XprType>::StorageKind StorageKind;
54
+ typedef typename traits<XprType>::XprKind XprKind;
55
+ typedef typename nested<XprType>::type XprTypeNested;
56
+ typedef typename remove_reference<XprTypeNested>::type _XprTypeNested;
57
+ enum{
58
+ MatrixRows = traits<XprType>::RowsAtCompileTime,
59
+ MatrixCols = traits<XprType>::ColsAtCompileTime,
60
+ RowsAtCompileTime = MatrixRows == 0 ? 0 : BlockRows,
61
+ ColsAtCompileTime = MatrixCols == 0 ? 0 : BlockCols,
62
+ MaxRowsAtCompileTime = BlockRows==0 ? 0
63
+ : RowsAtCompileTime != Dynamic ? int(RowsAtCompileTime)
64
+ : int(traits<XprType>::MaxRowsAtCompileTime),
65
+ MaxColsAtCompileTime = BlockCols==0 ? 0
66
+ : ColsAtCompileTime != Dynamic ? int(ColsAtCompileTime)
67
+ : int(traits<XprType>::MaxColsAtCompileTime),
68
+ XprTypeIsRowMajor = (int(traits<XprType>::Flags)&RowMajorBit) != 0,
69
+ IsDense = is_same<StorageKind,Dense>::value,
70
+ IsRowMajor = (IsDense&&MaxRowsAtCompileTime==1&&MaxColsAtCompileTime!=1) ? 1
71
+ : (IsDense&&MaxColsAtCompileTime==1&&MaxRowsAtCompileTime!=1) ? 0
72
+ : XprTypeIsRowMajor,
73
+ HasSameStorageOrderAsXprType = (IsRowMajor == XprTypeIsRowMajor),
74
+ InnerSize = IsRowMajor ? int(ColsAtCompileTime) : int(RowsAtCompileTime),
75
+ InnerStrideAtCompileTime = HasSameStorageOrderAsXprType
76
+ ? int(inner_stride_at_compile_time<XprType>::ret)
77
+ : int(outer_stride_at_compile_time<XprType>::ret),
78
+ OuterStrideAtCompileTime = HasSameStorageOrderAsXprType
79
+ ? int(outer_stride_at_compile_time<XprType>::ret)
80
+ : int(inner_stride_at_compile_time<XprType>::ret),
81
+ MaskPacketAccessBit = (InnerSize == Dynamic || (InnerSize % packet_traits<Scalar>::size) == 0)
82
+ && (InnerStrideAtCompileTime == 1)
83
+ ? PacketAccessBit : 0,
84
+ MaskAlignedBit = (InnerPanel && (OuterStrideAtCompileTime!=Dynamic) && (((OuterStrideAtCompileTime * int(sizeof(Scalar))) % 16) == 0)) ? AlignedBit : 0,
85
+ FlagsLinearAccessBit = (RowsAtCompileTime == 1 || ColsAtCompileTime == 1 || (InnerPanel && (traits<XprType>::Flags&LinearAccessBit))) ? LinearAccessBit : 0,
86
+ FlagsLvalueBit = is_lvalue<XprType>::value ? LvalueBit : 0,
87
+ FlagsRowMajorBit = IsRowMajor ? RowMajorBit : 0,
88
+ Flags0 = traits<XprType>::Flags & ( (HereditaryBits & ~RowMajorBit) |
89
+ DirectAccessBit |
90
+ MaskPacketAccessBit |
91
+ MaskAlignedBit),
92
+ Flags = Flags0 | FlagsLinearAccessBit | FlagsLvalueBit | FlagsRowMajorBit
93
+ };
94
+ };
95
+
96
+ template<typename XprType, int BlockRows=Dynamic, int BlockCols=Dynamic, bool InnerPanel = false,
97
+ bool HasDirectAccess = internal::has_direct_access<XprType>::ret> class BlockImpl_dense;
98
+
99
+ } // end namespace internal
100
+
101
+ template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel, typename StorageKind> class BlockImpl;
102
+
103
+ template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel> class Block
104
+ : public BlockImpl<XprType, BlockRows, BlockCols, InnerPanel, typename internal::traits<XprType>::StorageKind>
105
+ {
106
+ typedef BlockImpl<XprType, BlockRows, BlockCols, InnerPanel, typename internal::traits<XprType>::StorageKind> Impl;
107
+ public:
108
+ //typedef typename Impl::Base Base;
109
+ typedef Impl Base;
110
+ EIGEN_GENERIC_PUBLIC_INTERFACE(Block)
111
+ EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Block)
112
+
113
+ /** Column or Row constructor
114
+ */
115
+ inline Block(XprType& xpr, Index i) : Impl(xpr,i)
116
+ {
117
+ eigen_assert( (i>=0) && (
118
+ ((BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) && i<xpr.rows())
119
+ ||((BlockRows==XprType::RowsAtCompileTime) && (BlockCols==1) && i<xpr.cols())));
120
+ }
121
+
122
+ /** Fixed-size constructor
123
+ */
124
+ inline Block(XprType& xpr, Index a_startRow, Index a_startCol)
125
+ : Impl(xpr, a_startRow, a_startCol)
126
+ {
127
+ EIGEN_STATIC_ASSERT(RowsAtCompileTime!=Dynamic && ColsAtCompileTime!=Dynamic,THIS_METHOD_IS_ONLY_FOR_FIXED_SIZE)
128
+ eigen_assert(a_startRow >= 0 && BlockRows >= 1 && a_startRow + BlockRows <= xpr.rows()
129
+ && a_startCol >= 0 && BlockCols >= 1 && a_startCol + BlockCols <= xpr.cols());
130
+ }
131
+
132
+ /** Dynamic-size constructor
133
+ */
134
+ inline Block(XprType& xpr,
135
+ Index a_startRow, Index a_startCol,
136
+ Index blockRows, Index blockCols)
137
+ : Impl(xpr, a_startRow, a_startCol, blockRows, blockCols)
138
+ {
139
+ eigen_assert((RowsAtCompileTime==Dynamic || RowsAtCompileTime==blockRows)
140
+ && (ColsAtCompileTime==Dynamic || ColsAtCompileTime==blockCols));
141
+ eigen_assert(a_startRow >= 0 && blockRows >= 0 && a_startRow <= xpr.rows() - blockRows
142
+ && a_startCol >= 0 && blockCols >= 0 && a_startCol <= xpr.cols() - blockCols);
143
+ }
144
+ };
145
+
146
+ // The generic default implementation for dense block simplu forward to the internal::BlockImpl_dense
147
+ // that must be specialized for direct and non-direct access...
148
+ template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel>
149
+ class BlockImpl<XprType, BlockRows, BlockCols, InnerPanel, Dense>
150
+ : public internal::BlockImpl_dense<XprType, BlockRows, BlockCols, InnerPanel>
151
+ {
152
+ typedef internal::BlockImpl_dense<XprType, BlockRows, BlockCols, InnerPanel> Impl;
153
+ typedef typename XprType::Index Index;
154
+ public:
155
+ typedef Impl Base;
156
+ EIGEN_INHERIT_ASSIGNMENT_OPERATORS(BlockImpl)
157
+ inline BlockImpl(XprType& xpr, Index i) : Impl(xpr,i) {}
158
+ inline BlockImpl(XprType& xpr, Index a_startRow, Index a_startCol) : Impl(xpr, a_startRow, a_startCol) {}
159
+ inline BlockImpl(XprType& xpr, Index a_startRow, Index a_startCol, Index blockRows, Index blockCols)
160
+ : Impl(xpr, a_startRow, a_startCol, blockRows, blockCols) {}
161
+ };
162
+
163
+ namespace internal {
164
+
165
+ /** \internal Internal implementation of dense Blocks in the general case. */
166
+ template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel, bool HasDirectAccess> class BlockImpl_dense
167
+ : public internal::dense_xpr_base<Block<XprType, BlockRows, BlockCols, InnerPanel> >::type
168
+ {
169
+ typedef Block<XprType, BlockRows, BlockCols, InnerPanel> BlockType;
170
+ public:
171
+
172
+ typedef typename internal::dense_xpr_base<BlockType>::type Base;
173
+ EIGEN_DENSE_PUBLIC_INTERFACE(BlockType)
174
+ EIGEN_INHERIT_ASSIGNMENT_OPERATORS(BlockImpl_dense)
175
+
176
+ class InnerIterator;
177
+
178
+ /** Column or Row constructor
179
+ */
180
+ inline BlockImpl_dense(XprType& xpr, Index i)
181
+ : m_xpr(xpr),
182
+ // It is a row if and only if BlockRows==1 and BlockCols==XprType::ColsAtCompileTime,
183
+ // and it is a column if and only if BlockRows==XprType::RowsAtCompileTime and BlockCols==1,
184
+ // all other cases are invalid.
185
+ // The case a 1x1 matrix seems ambiguous, but the result is the same anyway.
186
+ m_startRow( (BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) ? i : 0),
187
+ m_startCol( (BlockRows==XprType::RowsAtCompileTime) && (BlockCols==1) ? i : 0),
188
+ m_blockRows(BlockRows==1 ? 1 : xpr.rows()),
189
+ m_blockCols(BlockCols==1 ? 1 : xpr.cols())
190
+ {}
191
+
192
+ /** Fixed-size constructor
193
+ */
194
+ inline BlockImpl_dense(XprType& xpr, Index a_startRow, Index a_startCol)
195
+ : m_xpr(xpr), m_startRow(a_startRow), m_startCol(a_startCol),
196
+ m_blockRows(BlockRows), m_blockCols(BlockCols)
197
+ {}
198
+
199
+ /** Dynamic-size constructor
200
+ */
201
+ inline BlockImpl_dense(XprType& xpr,
202
+ Index a_startRow, Index a_startCol,
203
+ Index blockRows, Index blockCols)
204
+ : m_xpr(xpr), m_startRow(a_startRow), m_startCol(a_startCol),
205
+ m_blockRows(blockRows), m_blockCols(blockCols)
206
+ {}
207
+
208
+ inline Index rows() const { return m_blockRows.value(); }
209
+ inline Index cols() const { return m_blockCols.value(); }
210
+
211
+ inline Scalar& coeffRef(Index rowId, Index colId)
212
+ {
213
+ EIGEN_STATIC_ASSERT_LVALUE(XprType)
214
+ return m_xpr.const_cast_derived()
215
+ .coeffRef(rowId + m_startRow.value(), colId + m_startCol.value());
216
+ }
217
+
218
+ inline const Scalar& coeffRef(Index rowId, Index colId) const
219
+ {
220
+ return m_xpr.derived()
221
+ .coeffRef(rowId + m_startRow.value(), colId + m_startCol.value());
222
+ }
223
+
224
+ EIGEN_STRONG_INLINE const CoeffReturnType coeff(Index rowId, Index colId) const
225
+ {
226
+ return m_xpr.coeff(rowId + m_startRow.value(), colId + m_startCol.value());
227
+ }
228
+
229
+ inline Scalar& coeffRef(Index index)
230
+ {
231
+ EIGEN_STATIC_ASSERT_LVALUE(XprType)
232
+ return m_xpr.const_cast_derived()
233
+ .coeffRef(m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index),
234
+ m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0));
235
+ }
236
+
237
+ inline const Scalar& coeffRef(Index index) const
238
+ {
239
+ return m_xpr.const_cast_derived()
240
+ .coeffRef(m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index),
241
+ m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0));
242
+ }
243
+
244
+ inline const CoeffReturnType coeff(Index index) const
245
+ {
246
+ return m_xpr
247
+ .coeff(m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index),
248
+ m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0));
249
+ }
250
+
251
+ template<int LoadMode>
252
+ inline PacketScalar packet(Index rowId, Index colId) const
253
+ {
254
+ return m_xpr.template packet<Unaligned>
255
+ (rowId + m_startRow.value(), colId + m_startCol.value());
256
+ }
257
+
258
+ template<int LoadMode>
259
+ inline void writePacket(Index rowId, Index colId, const PacketScalar& val)
260
+ {
261
+ m_xpr.const_cast_derived().template writePacket<Unaligned>
262
+ (rowId + m_startRow.value(), colId + m_startCol.value(), val);
263
+ }
264
+
265
+ template<int LoadMode>
266
+ inline PacketScalar packet(Index index) const
267
+ {
268
+ return m_xpr.template packet<Unaligned>
269
+ (m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index),
270
+ m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0));
271
+ }
272
+
273
+ template<int LoadMode>
274
+ inline void writePacket(Index index, const PacketScalar& val)
275
+ {
276
+ m_xpr.const_cast_derived().template writePacket<Unaligned>
277
+ (m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index),
278
+ m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0), val);
279
+ }
280
+
281
+ #ifdef EIGEN_PARSED_BY_DOXYGEN
282
+ /** \sa MapBase::data() */
283
+ inline const Scalar* data() const;
284
+ inline Index innerStride() const;
285
+ inline Index outerStride() const;
286
+ #endif
287
+
288
+ const typename internal::remove_all<typename XprType::Nested>::type& nestedExpression() const
289
+ {
290
+ return m_xpr;
291
+ }
292
+
293
+ Index startRow() const
294
+ {
295
+ return m_startRow.value();
296
+ }
297
+
298
+ Index startCol() const
299
+ {
300
+ return m_startCol.value();
301
+ }
302
+
303
+ protected:
304
+
305
+ const typename XprType::Nested m_xpr;
306
+ const internal::variable_if_dynamic<Index, XprType::RowsAtCompileTime == 1 ? 0 : Dynamic> m_startRow;
307
+ const internal::variable_if_dynamic<Index, XprType::ColsAtCompileTime == 1 ? 0 : Dynamic> m_startCol;
308
+ const internal::variable_if_dynamic<Index, RowsAtCompileTime> m_blockRows;
309
+ const internal::variable_if_dynamic<Index, ColsAtCompileTime> m_blockCols;
310
+ };
311
+
312
+ /** \internal Internal implementation of dense Blocks in the direct access case.*/
313
+ template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel>
314
+ class BlockImpl_dense<XprType,BlockRows,BlockCols, InnerPanel,true>
315
+ : public MapBase<Block<XprType, BlockRows, BlockCols, InnerPanel> >
316
+ {
317
+ typedef Block<XprType, BlockRows, BlockCols, InnerPanel> BlockType;
318
+ public:
319
+
320
+ typedef MapBase<BlockType> Base;
321
+ EIGEN_DENSE_PUBLIC_INTERFACE(BlockType)
322
+ EIGEN_INHERIT_ASSIGNMENT_OPERATORS(BlockImpl_dense)
323
+
324
+ /** Column or Row constructor
325
+ */
326
+ inline BlockImpl_dense(XprType& xpr, Index i)
327
+ : Base(internal::const_cast_ptr(&xpr.coeffRef(
328
+ (BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) ? i : 0,
329
+ (BlockRows==XprType::RowsAtCompileTime) && (BlockCols==1) ? i : 0)),
330
+ BlockRows==1 ? 1 : xpr.rows(),
331
+ BlockCols==1 ? 1 : xpr.cols()),
332
+ m_xpr(xpr)
333
+ {
334
+ init();
335
+ }
336
+
337
+ /** Fixed-size constructor
338
+ */
339
+ inline BlockImpl_dense(XprType& xpr, Index startRow, Index startCol)
340
+ : Base(internal::const_cast_ptr(&xpr.coeffRef(startRow,startCol))), m_xpr(xpr)
341
+ {
342
+ init();
343
+ }
344
+
345
+ /** Dynamic-size constructor
346
+ */
347
+ inline BlockImpl_dense(XprType& xpr,
348
+ Index startRow, Index startCol,
349
+ Index blockRows, Index blockCols)
350
+ : Base(internal::const_cast_ptr(&xpr.coeffRef(startRow,startCol)), blockRows, blockCols),
351
+ m_xpr(xpr)
352
+ {
353
+ init();
354
+ }
355
+
356
+ const typename internal::remove_all<typename XprType::Nested>::type& nestedExpression() const
357
+ {
358
+ return m_xpr;
359
+ }
360
+
361
+ /** \sa MapBase::innerStride() */
362
+ inline Index innerStride() const
363
+ {
364
+ return internal::traits<BlockType>::HasSameStorageOrderAsXprType
365
+ ? m_xpr.innerStride()
366
+ : m_xpr.outerStride();
367
+ }
368
+
369
+ /** \sa MapBase::outerStride() */
370
+ inline Index outerStride() const
371
+ {
372
+ return m_outerStride;
373
+ }
374
+
375
+ #ifndef __SUNPRO_CC
376
+ // FIXME sunstudio is not friendly with the above friend...
377
+ // META-FIXME there is no 'friend' keyword around here. Is this obsolete?
378
+ protected:
379
+ #endif
380
+
381
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
382
+ /** \internal used by allowAligned() */
383
+ inline BlockImpl_dense(XprType& xpr, const Scalar* data, Index blockRows, Index blockCols)
384
+ : Base(data, blockRows, blockCols), m_xpr(xpr)
385
+ {
386
+ init();
387
+ }
388
+ #endif
389
+
390
+ protected:
391
+ void init()
392
+ {
393
+ m_outerStride = internal::traits<BlockType>::HasSameStorageOrderAsXprType
394
+ ? m_xpr.outerStride()
395
+ : m_xpr.innerStride();
396
+ }
397
+
398
+ typename XprType::Nested m_xpr;
399
+ Index m_outerStride;
400
+ };
401
+
402
+ } // end namespace internal
403
+
404
+ } // end namespace Eigen
405
+
406
+ #endif // EIGEN_BLOCK_H
@@ -0,0 +1,154 @@
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
+ //
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_ALLANDANY_H
11
+ #define EIGEN_ALLANDANY_H
12
+
13
+ namespace Eigen {
14
+
15
+ namespace internal {
16
+
17
+ template<typename Derived, int UnrollCount>
18
+ struct all_unroller
19
+ {
20
+ enum {
21
+ col = (UnrollCount-1) / Derived::RowsAtCompileTime,
22
+ row = (UnrollCount-1) % Derived::RowsAtCompileTime
23
+ };
24
+
25
+ static inline bool run(const Derived &mat)
26
+ {
27
+ return all_unroller<Derived, UnrollCount-1>::run(mat) && mat.coeff(row, col);
28
+ }
29
+ };
30
+
31
+ template<typename Derived>
32
+ struct all_unroller<Derived, 0>
33
+ {
34
+ static inline bool run(const Derived &/*mat*/) { return true; }
35
+ };
36
+
37
+ template<typename Derived>
38
+ struct all_unroller<Derived, Dynamic>
39
+ {
40
+ static inline bool run(const Derived &) { return false; }
41
+ };
42
+
43
+ template<typename Derived, int UnrollCount>
44
+ struct any_unroller
45
+ {
46
+ enum {
47
+ col = (UnrollCount-1) / Derived::RowsAtCompileTime,
48
+ row = (UnrollCount-1) % Derived::RowsAtCompileTime
49
+ };
50
+
51
+ static inline bool run(const Derived &mat)
52
+ {
53
+ return any_unroller<Derived, UnrollCount-1>::run(mat) || mat.coeff(row, col);
54
+ }
55
+ };
56
+
57
+ template<typename Derived>
58
+ struct any_unroller<Derived, 0>
59
+ {
60
+ static inline bool run(const Derived & /*mat*/) { return false; }
61
+ };
62
+
63
+ template<typename Derived>
64
+ struct any_unroller<Derived, Dynamic>
65
+ {
66
+ static inline bool run(const Derived &) { return false; }
67
+ };
68
+
69
+ } // end namespace internal
70
+
71
+ /** \returns true if all coefficients are true
72
+ *
73
+ * Example: \include MatrixBase_all.cpp
74
+ * Output: \verbinclude MatrixBase_all.out
75
+ *
76
+ * \sa any(), Cwise::operator<()
77
+ */
78
+ template<typename Derived>
79
+ inline bool DenseBase<Derived>::all() const
80
+ {
81
+ enum {
82
+ unroll = SizeAtCompileTime != Dynamic
83
+ && CoeffReadCost != Dynamic
84
+ && NumTraits<Scalar>::AddCost != Dynamic
85
+ && SizeAtCompileTime * (CoeffReadCost + NumTraits<Scalar>::AddCost) <= EIGEN_UNROLLING_LIMIT
86
+ };
87
+ if(unroll)
88
+ return internal::all_unroller<Derived, unroll ? int(SizeAtCompileTime) : Dynamic>::run(derived());
89
+ else
90
+ {
91
+ for(Index j = 0; j < cols(); ++j)
92
+ for(Index i = 0; i < rows(); ++i)
93
+ if (!coeff(i, j)) return false;
94
+ return true;
95
+ }
96
+ }
97
+
98
+ /** \returns true if at least one coefficient is true
99
+ *
100
+ * \sa all()
101
+ */
102
+ template<typename Derived>
103
+ inline bool DenseBase<Derived>::any() const
104
+ {
105
+ enum {
106
+ unroll = SizeAtCompileTime != Dynamic
107
+ && CoeffReadCost != Dynamic
108
+ && NumTraits<Scalar>::AddCost != Dynamic
109
+ && SizeAtCompileTime * (CoeffReadCost + NumTraits<Scalar>::AddCost) <= EIGEN_UNROLLING_LIMIT
110
+ };
111
+ if(unroll)
112
+ return internal::any_unroller<Derived, unroll ? int(SizeAtCompileTime) : Dynamic>::run(derived());
113
+ else
114
+ {
115
+ for(Index j = 0; j < cols(); ++j)
116
+ for(Index i = 0; i < rows(); ++i)
117
+ if (coeff(i, j)) return true;
118
+ return false;
119
+ }
120
+ }
121
+
122
+ /** \returns the number of coefficients which evaluate to true
123
+ *
124
+ * \sa all(), any()
125
+ */
126
+ template<typename Derived>
127
+ inline typename DenseBase<Derived>::Index DenseBase<Derived>::count() const
128
+ {
129
+ return derived().template cast<bool>().template cast<Index>().sum();
130
+ }
131
+
132
+ /** \returns true is \c *this contains at least one Not A Number (NaN).
133
+ *
134
+ * \sa allFinite()
135
+ */
136
+ template<typename Derived>
137
+ inline bool DenseBase<Derived>::hasNaN() const
138
+ {
139
+ return !((derived().array()==derived().array()).all());
140
+ }
141
+
142
+ /** \returns true if \c *this contains only finite numbers, i.e., no NaN and no +/-INF values.
143
+ *
144
+ * \sa hasNaN()
145
+ */
146
+ template<typename Derived>
147
+ inline bool DenseBase<Derived>::allFinite() const
148
+ {
149
+ return !((derived()-derived()).hasNaN());
150
+ }
151
+
152
+ } // end namespace Eigen
153
+
154
+ #endif // EIGEN_ALLANDANY_H