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,822 @@
1
+ // This file is part of Eigen, a lightweight C++ template library
2
+ // for linear algebra.
3
+ //
4
+ // Copyright (C) 2008-2009 Gael Guennebaud <gael.guennebaud@inria.fr>
5
+ // 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_DENSESTORAGEBASE_H
12
+ #define EIGEN_DENSESTORAGEBASE_H
13
+
14
+ #if defined(EIGEN_INITIALIZE_MATRICES_BY_ZERO)
15
+ # define EIGEN_INITIALIZE_COEFFS
16
+ # define EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED for(int i=0;i<base().size();++i) coeffRef(i)=Scalar(0);
17
+ #elif defined(EIGEN_INITIALIZE_MATRICES_BY_NAN)
18
+ # define EIGEN_INITIALIZE_COEFFS
19
+ # define EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED for(int i=0;i<base().size();++i) coeffRef(i)=std::numeric_limits<Scalar>::quiet_NaN();
20
+ #else
21
+ # undef EIGEN_INITIALIZE_COEFFS
22
+ # define EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
23
+ #endif
24
+
25
+ namespace Eigen {
26
+
27
+ namespace internal {
28
+
29
+ template<int MaxSizeAtCompileTime> struct check_rows_cols_for_overflow {
30
+ template<typename Index>
31
+ static EIGEN_ALWAYS_INLINE void run(Index, Index)
32
+ {
33
+ }
34
+ };
35
+
36
+ template<> struct check_rows_cols_for_overflow<Dynamic> {
37
+ template<typename Index>
38
+ static EIGEN_ALWAYS_INLINE void run(Index rows, Index cols)
39
+ {
40
+ // http://hg.mozilla.org/mozilla-central/file/6c8a909977d3/xpcom/ds/CheckedInt.h#l242
41
+ // we assume Index is signed
42
+ Index max_index = (size_t(1) << (8 * sizeof(Index) - 1)) - 1; // assume Index is signed
43
+ bool error = (rows == 0 || cols == 0) ? false
44
+ : (rows > max_index / cols);
45
+ if (error)
46
+ throw_std_bad_alloc();
47
+ }
48
+ };
49
+
50
+ template <typename Derived,
51
+ typename OtherDerived = Derived,
52
+ bool IsVector = bool(Derived::IsVectorAtCompileTime) && bool(OtherDerived::IsVectorAtCompileTime)>
53
+ struct conservative_resize_like_impl;
54
+
55
+ template<typename MatrixTypeA, typename MatrixTypeB, bool SwapPointers> struct matrix_swap_impl;
56
+
57
+ } // end namespace internal
58
+
59
+ /** \class PlainObjectBase
60
+ * \brief %Dense storage base class for matrices and arrays.
61
+ *
62
+ * This class can be extended with the help of the plugin mechanism described on the page
63
+ * \ref TopicCustomizingEigen by defining the preprocessor symbol \c EIGEN_PLAINOBJECTBASE_PLUGIN.
64
+ *
65
+ * \sa \ref TopicClassHierarchy
66
+ */
67
+ #ifdef EIGEN_PARSED_BY_DOXYGEN
68
+ namespace internal {
69
+
70
+ // this is a warkaround to doxygen not being able to understand the inheritence logic
71
+ // when it is hidden by the dense_xpr_base helper struct.
72
+ template<typename Derived> struct dense_xpr_base_dispatcher_for_doxygen;// : public MatrixBase<Derived> {};
73
+ /** This class is just a workaround for Doxygen and it does not not actually exist. */
74
+ template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
75
+ struct dense_xpr_base_dispatcher_for_doxygen<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
76
+ : public MatrixBase<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> > {};
77
+ /** This class is just a workaround for Doxygen and it does not not actually exist. */
78
+ template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
79
+ struct dense_xpr_base_dispatcher_for_doxygen<Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
80
+ : public ArrayBase<Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> > {};
81
+
82
+ } // namespace internal
83
+
84
+ template<typename Derived>
85
+ class PlainObjectBase : public internal::dense_xpr_base_dispatcher_for_doxygen<Derived>
86
+ #else
87
+ template<typename Derived>
88
+ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type
89
+ #endif
90
+ {
91
+ public:
92
+ enum { Options = internal::traits<Derived>::Options };
93
+ typedef typename internal::dense_xpr_base<Derived>::type Base;
94
+
95
+ typedef typename internal::traits<Derived>::StorageKind StorageKind;
96
+ typedef typename internal::traits<Derived>::Index Index;
97
+ typedef typename internal::traits<Derived>::Scalar Scalar;
98
+ typedef typename internal::packet_traits<Scalar>::type PacketScalar;
99
+ typedef typename NumTraits<Scalar>::Real RealScalar;
100
+ typedef Derived DenseType;
101
+
102
+ using Base::RowsAtCompileTime;
103
+ using Base::ColsAtCompileTime;
104
+ using Base::SizeAtCompileTime;
105
+ using Base::MaxRowsAtCompileTime;
106
+ using Base::MaxColsAtCompileTime;
107
+ using Base::MaxSizeAtCompileTime;
108
+ using Base::IsVectorAtCompileTime;
109
+ using Base::Flags;
110
+
111
+ template<typename PlainObjectType, int MapOptions, typename StrideType> friend class Eigen::Map;
112
+ friend class Eigen::Map<Derived, Unaligned>;
113
+ typedef Eigen::Map<Derived, Unaligned> MapType;
114
+ friend class Eigen::Map<const Derived, Unaligned>;
115
+ typedef const Eigen::Map<const Derived, Unaligned> ConstMapType;
116
+ friend class Eigen::Map<Derived, Aligned>;
117
+ typedef Eigen::Map<Derived, Aligned> AlignedMapType;
118
+ friend class Eigen::Map<const Derived, Aligned>;
119
+ typedef const Eigen::Map<const Derived, Aligned> ConstAlignedMapType;
120
+ template<typename StrideType> struct StridedMapType { typedef Eigen::Map<Derived, Unaligned, StrideType> type; };
121
+ template<typename StrideType> struct StridedConstMapType { typedef Eigen::Map<const Derived, Unaligned, StrideType> type; };
122
+ template<typename StrideType> struct StridedAlignedMapType { typedef Eigen::Map<Derived, Aligned, StrideType> type; };
123
+ template<typename StrideType> struct StridedConstAlignedMapType { typedef Eigen::Map<const Derived, Aligned, StrideType> type; };
124
+
125
+ protected:
126
+ DenseStorage<Scalar, Base::MaxSizeAtCompileTime, Base::RowsAtCompileTime, Base::ColsAtCompileTime, Options> m_storage;
127
+
128
+ public:
129
+ enum { NeedsToAlign = SizeAtCompileTime != Dynamic && (internal::traits<Derived>::Flags & AlignedBit) != 0 };
130
+ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign)
131
+
132
+ Base& base() { return *static_cast<Base*>(this); }
133
+ const Base& base() const { return *static_cast<const Base*>(this); }
134
+
135
+ EIGEN_STRONG_INLINE Index rows() const { return m_storage.rows(); }
136
+ EIGEN_STRONG_INLINE Index cols() const { return m_storage.cols(); }
137
+
138
+ EIGEN_STRONG_INLINE const Scalar& coeff(Index rowId, Index colId) const
139
+ {
140
+ if(Flags & RowMajorBit)
141
+ return m_storage.data()[colId + rowId * m_storage.cols()];
142
+ else // column-major
143
+ return m_storage.data()[rowId + colId * m_storage.rows()];
144
+ }
145
+
146
+ EIGEN_STRONG_INLINE const Scalar& coeff(Index index) const
147
+ {
148
+ return m_storage.data()[index];
149
+ }
150
+
151
+ EIGEN_STRONG_INLINE Scalar& coeffRef(Index rowId, Index colId)
152
+ {
153
+ if(Flags & RowMajorBit)
154
+ return m_storage.data()[colId + rowId * m_storage.cols()];
155
+ else // column-major
156
+ return m_storage.data()[rowId + colId * m_storage.rows()];
157
+ }
158
+
159
+ EIGEN_STRONG_INLINE Scalar& coeffRef(Index index)
160
+ {
161
+ return m_storage.data()[index];
162
+ }
163
+
164
+ EIGEN_STRONG_INLINE const Scalar& coeffRef(Index rowId, Index colId) const
165
+ {
166
+ if(Flags & RowMajorBit)
167
+ return m_storage.data()[colId + rowId * m_storage.cols()];
168
+ else // column-major
169
+ return m_storage.data()[rowId + colId * m_storage.rows()];
170
+ }
171
+
172
+ EIGEN_STRONG_INLINE const Scalar& coeffRef(Index index) const
173
+ {
174
+ return m_storage.data()[index];
175
+ }
176
+
177
+ /** \internal */
178
+ template<int LoadMode>
179
+ EIGEN_STRONG_INLINE PacketScalar packet(Index rowId, Index colId) const
180
+ {
181
+ return internal::ploadt<PacketScalar, LoadMode>
182
+ (m_storage.data() + (Flags & RowMajorBit
183
+ ? colId + rowId * m_storage.cols()
184
+ : rowId + colId * m_storage.rows()));
185
+ }
186
+
187
+ /** \internal */
188
+ template<int LoadMode>
189
+ EIGEN_STRONG_INLINE PacketScalar packet(Index index) const
190
+ {
191
+ return internal::ploadt<PacketScalar, LoadMode>(m_storage.data() + index);
192
+ }
193
+
194
+ /** \internal */
195
+ template<int StoreMode>
196
+ EIGEN_STRONG_INLINE void writePacket(Index rowId, Index colId, const PacketScalar& val)
197
+ {
198
+ internal::pstoret<Scalar, PacketScalar, StoreMode>
199
+ (m_storage.data() + (Flags & RowMajorBit
200
+ ? colId + rowId * m_storage.cols()
201
+ : rowId + colId * m_storage.rows()), val);
202
+ }
203
+
204
+ /** \internal */
205
+ template<int StoreMode>
206
+ EIGEN_STRONG_INLINE void writePacket(Index index, const PacketScalar& val)
207
+ {
208
+ internal::pstoret<Scalar, PacketScalar, StoreMode>(m_storage.data() + index, val);
209
+ }
210
+
211
+ /** \returns a const pointer to the data array of this matrix */
212
+ EIGEN_STRONG_INLINE const Scalar *data() const
213
+ { return m_storage.data(); }
214
+
215
+ /** \returns a pointer to the data array of this matrix */
216
+ EIGEN_STRONG_INLINE Scalar *data()
217
+ { return m_storage.data(); }
218
+
219
+ /** Resizes \c *this to a \a rows x \a cols matrix.
220
+ *
221
+ * This method is intended for dynamic-size matrices, although it is legal to call it on any
222
+ * matrix as long as fixed dimensions are left unchanged. If you only want to change the number
223
+ * of rows and/or of columns, you can use resize(NoChange_t, Index), resize(Index, NoChange_t).
224
+ *
225
+ * If the current number of coefficients of \c *this exactly matches the
226
+ * product \a rows * \a cols, then no memory allocation is performed and
227
+ * the current values are left unchanged. In all other cases, including
228
+ * shrinking, the data is reallocated and all previous values are lost.
229
+ *
230
+ * Example: \include Matrix_resize_int_int.cpp
231
+ * Output: \verbinclude Matrix_resize_int_int.out
232
+ *
233
+ * \sa resize(Index) for vectors, resize(NoChange_t, Index), resize(Index, NoChange_t)
234
+ */
235
+ EIGEN_STRONG_INLINE void resize(Index nbRows, Index nbCols)
236
+ {
237
+ eigen_assert( EIGEN_IMPLIES(RowsAtCompileTime!=Dynamic,nbRows==RowsAtCompileTime)
238
+ && EIGEN_IMPLIES(ColsAtCompileTime!=Dynamic,nbCols==ColsAtCompileTime)
239
+ && EIGEN_IMPLIES(RowsAtCompileTime==Dynamic && MaxRowsAtCompileTime!=Dynamic,nbRows<=MaxRowsAtCompileTime)
240
+ && EIGEN_IMPLIES(ColsAtCompileTime==Dynamic && MaxColsAtCompileTime!=Dynamic,nbCols<=MaxColsAtCompileTime)
241
+ && nbRows>=0 && nbCols>=0 && "Invalid sizes when resizing a matrix or array.");
242
+ internal::check_rows_cols_for_overflow<MaxSizeAtCompileTime>::run(nbRows, nbCols);
243
+ #ifdef EIGEN_INITIALIZE_COEFFS
244
+ Index size = nbRows*nbCols;
245
+ bool size_changed = size != this->size();
246
+ m_storage.resize(size, nbRows, nbCols);
247
+ if(size_changed) EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
248
+ #else
249
+ internal::check_rows_cols_for_overflow<MaxSizeAtCompileTime>::run(nbRows, nbCols);
250
+ m_storage.resize(nbRows*nbCols, nbRows, nbCols);
251
+ #endif
252
+ }
253
+
254
+ /** Resizes \c *this to a vector of length \a size
255
+ *
256
+ * \only_for_vectors. This method does not work for
257
+ * partially dynamic matrices when the static dimension is anything other
258
+ * than 1. For example it will not work with Matrix<double, 2, Dynamic>.
259
+ *
260
+ * Example: \include Matrix_resize_int.cpp
261
+ * Output: \verbinclude Matrix_resize_int.out
262
+ *
263
+ * \sa resize(Index,Index), resize(NoChange_t, Index), resize(Index, NoChange_t)
264
+ */
265
+ inline void resize(Index size)
266
+ {
267
+ EIGEN_STATIC_ASSERT_VECTOR_ONLY(PlainObjectBase)
268
+ eigen_assert(((SizeAtCompileTime == Dynamic && (MaxSizeAtCompileTime==Dynamic || size<=MaxSizeAtCompileTime)) || SizeAtCompileTime == size) && size>=0);
269
+ #ifdef EIGEN_INITIALIZE_COEFFS
270
+ bool size_changed = size != this->size();
271
+ #endif
272
+ if(RowsAtCompileTime == 1)
273
+ m_storage.resize(size, 1, size);
274
+ else
275
+ m_storage.resize(size, size, 1);
276
+ #ifdef EIGEN_INITIALIZE_COEFFS
277
+ if(size_changed) EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
278
+ #endif
279
+ }
280
+
281
+ /** Resizes the matrix, changing only the number of columns. For the parameter of type NoChange_t, just pass the special value \c NoChange
282
+ * as in the example below.
283
+ *
284
+ * Example: \include Matrix_resize_NoChange_int.cpp
285
+ * Output: \verbinclude Matrix_resize_NoChange_int.out
286
+ *
287
+ * \sa resize(Index,Index)
288
+ */
289
+ inline void resize(NoChange_t, Index nbCols)
290
+ {
291
+ resize(rows(), nbCols);
292
+ }
293
+
294
+ /** Resizes the matrix, changing only the number of rows. For the parameter of type NoChange_t, just pass the special value \c NoChange
295
+ * as in the example below.
296
+ *
297
+ * Example: \include Matrix_resize_int_NoChange.cpp
298
+ * Output: \verbinclude Matrix_resize_int_NoChange.out
299
+ *
300
+ * \sa resize(Index,Index)
301
+ */
302
+ inline void resize(Index nbRows, NoChange_t)
303
+ {
304
+ resize(nbRows, cols());
305
+ }
306
+
307
+ /** Resizes \c *this to have the same dimensions as \a other.
308
+ * Takes care of doing all the checking that's needed.
309
+ *
310
+ * Note that copying a row-vector into a vector (and conversely) is allowed.
311
+ * The resizing, if any, is then done in the appropriate way so that row-vectors
312
+ * remain row-vectors and vectors remain vectors.
313
+ */
314
+ template<typename OtherDerived>
315
+ EIGEN_STRONG_INLINE void resizeLike(const EigenBase<OtherDerived>& _other)
316
+ {
317
+ const OtherDerived& other = _other.derived();
318
+ internal::check_rows_cols_for_overflow<MaxSizeAtCompileTime>::run(other.rows(), other.cols());
319
+ const Index othersize = other.rows()*other.cols();
320
+ if(RowsAtCompileTime == 1)
321
+ {
322
+ eigen_assert(other.rows() == 1 || other.cols() == 1);
323
+ resize(1, othersize);
324
+ }
325
+ else if(ColsAtCompileTime == 1)
326
+ {
327
+ eigen_assert(other.rows() == 1 || other.cols() == 1);
328
+ resize(othersize, 1);
329
+ }
330
+ else resize(other.rows(), other.cols());
331
+ }
332
+
333
+ /** Resizes the matrix to \a rows x \a cols while leaving old values untouched.
334
+ *
335
+ * The method is intended for matrices of dynamic size. If you only want to change the number
336
+ * of rows and/or of columns, you can use conservativeResize(NoChange_t, Index) or
337
+ * conservativeResize(Index, NoChange_t).
338
+ *
339
+ * Matrices are resized relative to the top-left element. In case values need to be
340
+ * appended to the matrix they will be uninitialized.
341
+ */
342
+ EIGEN_STRONG_INLINE void conservativeResize(Index nbRows, Index nbCols)
343
+ {
344
+ internal::conservative_resize_like_impl<Derived>::run(*this, nbRows, nbCols);
345
+ }
346
+
347
+ /** Resizes the matrix to \a rows x \a cols while leaving old values untouched.
348
+ *
349
+ * As opposed to conservativeResize(Index rows, Index cols), this version leaves
350
+ * the number of columns unchanged.
351
+ *
352
+ * In case the matrix is growing, new rows will be uninitialized.
353
+ */
354
+ EIGEN_STRONG_INLINE void conservativeResize(Index nbRows, NoChange_t)
355
+ {
356
+ // Note: see the comment in conservativeResize(Index,Index)
357
+ conservativeResize(nbRows, cols());
358
+ }
359
+
360
+ /** Resizes the matrix to \a rows x \a cols while leaving old values untouched.
361
+ *
362
+ * As opposed to conservativeResize(Index rows, Index cols), this version leaves
363
+ * the number of rows unchanged.
364
+ *
365
+ * In case the matrix is growing, new columns will be uninitialized.
366
+ */
367
+ EIGEN_STRONG_INLINE void conservativeResize(NoChange_t, Index nbCols)
368
+ {
369
+ // Note: see the comment in conservativeResize(Index,Index)
370
+ conservativeResize(rows(), nbCols);
371
+ }
372
+
373
+ /** Resizes the vector to \a size while retaining old values.
374
+ *
375
+ * \only_for_vectors. This method does not work for
376
+ * partially dynamic matrices when the static dimension is anything other
377
+ * than 1. For example it will not work with Matrix<double, 2, Dynamic>.
378
+ *
379
+ * When values are appended, they will be uninitialized.
380
+ */
381
+ EIGEN_STRONG_INLINE void conservativeResize(Index size)
382
+ {
383
+ internal::conservative_resize_like_impl<Derived>::run(*this, size);
384
+ }
385
+
386
+ /** Resizes the matrix to \a rows x \a cols of \c other, while leaving old values untouched.
387
+ *
388
+ * The method is intended for matrices of dynamic size. If you only want to change the number
389
+ * of rows and/or of columns, you can use conservativeResize(NoChange_t, Index) or
390
+ * conservativeResize(Index, NoChange_t).
391
+ *
392
+ * Matrices are resized relative to the top-left element. In case values need to be
393
+ * appended to the matrix they will copied from \c other.
394
+ */
395
+ template<typename OtherDerived>
396
+ EIGEN_STRONG_INLINE void conservativeResizeLike(const DenseBase<OtherDerived>& other)
397
+ {
398
+ internal::conservative_resize_like_impl<Derived,OtherDerived>::run(*this, other);
399
+ }
400
+
401
+ /** This is a special case of the templated operator=. Its purpose is to
402
+ * prevent a default operator= from hiding the templated operator=.
403
+ */
404
+ EIGEN_STRONG_INLINE Derived& operator=(const PlainObjectBase& other)
405
+ {
406
+ return _set(other);
407
+ }
408
+
409
+ /** \sa MatrixBase::lazyAssign() */
410
+ template<typename OtherDerived>
411
+ EIGEN_STRONG_INLINE Derived& lazyAssign(const DenseBase<OtherDerived>& other)
412
+ {
413
+ _resize_to_match(other);
414
+ return Base::lazyAssign(other.derived());
415
+ }
416
+
417
+ template<typename OtherDerived>
418
+ EIGEN_STRONG_INLINE Derived& operator=(const ReturnByValue<OtherDerived>& func)
419
+ {
420
+ resize(func.rows(), func.cols());
421
+ return Base::operator=(func);
422
+ }
423
+
424
+ EIGEN_STRONG_INLINE PlainObjectBase() : m_storage()
425
+ {
426
+ // _check_template_params();
427
+ // EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
428
+ }
429
+
430
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
431
+ // FIXME is it still needed ?
432
+ /** \internal */
433
+ PlainObjectBase(internal::constructor_without_unaligned_array_assert)
434
+ : m_storage(internal::constructor_without_unaligned_array_assert())
435
+ {
436
+ // _check_template_params(); EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
437
+ }
438
+ #endif
439
+
440
+ #ifdef EIGEN_HAVE_RVALUE_REFERENCES
441
+ PlainObjectBase(PlainObjectBase&& other)
442
+ : m_storage( std::move(other.m_storage) )
443
+ {
444
+ }
445
+
446
+ PlainObjectBase& operator=(PlainObjectBase&& other)
447
+ {
448
+ using std::swap;
449
+ swap(m_storage, other.m_storage);
450
+ return *this;
451
+ }
452
+ #endif
453
+
454
+ /** Copy constructor */
455
+ EIGEN_STRONG_INLINE PlainObjectBase(const PlainObjectBase& other)
456
+ : m_storage()
457
+ {
458
+ _check_template_params();
459
+ lazyAssign(other);
460
+ }
461
+
462
+ template<typename OtherDerived>
463
+ EIGEN_STRONG_INLINE PlainObjectBase(const DenseBase<OtherDerived> &other)
464
+ : m_storage()
465
+ {
466
+ _check_template_params();
467
+ lazyAssign(other);
468
+ }
469
+
470
+ EIGEN_STRONG_INLINE PlainObjectBase(Index a_size, Index nbRows, Index nbCols)
471
+ : m_storage(a_size, nbRows, nbCols)
472
+ {
473
+ // _check_template_params();
474
+ // EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
475
+ }
476
+
477
+ /** \copydoc MatrixBase::operator=(const EigenBase<OtherDerived>&)
478
+ */
479
+ template<typename OtherDerived>
480
+ EIGEN_STRONG_INLINE Derived& operator=(const EigenBase<OtherDerived> &other)
481
+ {
482
+ _resize_to_match(other);
483
+ Base::operator=(other.derived());
484
+ return this->derived();
485
+ }
486
+
487
+ /** \sa MatrixBase::operator=(const EigenBase<OtherDerived>&) */
488
+ template<typename OtherDerived>
489
+ EIGEN_STRONG_INLINE PlainObjectBase(const EigenBase<OtherDerived> &other)
490
+ : m_storage(other.derived().rows() * other.derived().cols(), other.derived().rows(), other.derived().cols())
491
+ {
492
+ _check_template_params();
493
+ internal::check_rows_cols_for_overflow<MaxSizeAtCompileTime>::run(other.derived().rows(), other.derived().cols());
494
+ Base::operator=(other.derived());
495
+ }
496
+
497
+ /** \name Map
498
+ * These are convenience functions returning Map objects. The Map() static functions return unaligned Map objects,
499
+ * while the AlignedMap() functions return aligned Map objects and thus should be called only with 16-byte-aligned
500
+ * \a data pointers.
501
+ *
502
+ * \see class Map
503
+ */
504
+ //@{
505
+ static inline ConstMapType Map(const Scalar* data)
506
+ { return ConstMapType(data); }
507
+ static inline MapType Map(Scalar* data)
508
+ { return MapType(data); }
509
+ static inline ConstMapType Map(const Scalar* data, Index size)
510
+ { return ConstMapType(data, size); }
511
+ static inline MapType Map(Scalar* data, Index size)
512
+ { return MapType(data, size); }
513
+ static inline ConstMapType Map(const Scalar* data, Index rows, Index cols)
514
+ { return ConstMapType(data, rows, cols); }
515
+ static inline MapType Map(Scalar* data, Index rows, Index cols)
516
+ { return MapType(data, rows, cols); }
517
+
518
+ static inline ConstAlignedMapType MapAligned(const Scalar* data)
519
+ { return ConstAlignedMapType(data); }
520
+ static inline AlignedMapType MapAligned(Scalar* data)
521
+ { return AlignedMapType(data); }
522
+ static inline ConstAlignedMapType MapAligned(const Scalar* data, Index size)
523
+ { return ConstAlignedMapType(data, size); }
524
+ static inline AlignedMapType MapAligned(Scalar* data, Index size)
525
+ { return AlignedMapType(data, size); }
526
+ static inline ConstAlignedMapType MapAligned(const Scalar* data, Index rows, Index cols)
527
+ { return ConstAlignedMapType(data, rows, cols); }
528
+ static inline AlignedMapType MapAligned(Scalar* data, Index rows, Index cols)
529
+ { return AlignedMapType(data, rows, cols); }
530
+
531
+ template<int Outer, int Inner>
532
+ static inline typename StridedConstMapType<Stride<Outer, Inner> >::type Map(const Scalar* data, const Stride<Outer, Inner>& stride)
533
+ { return typename StridedConstMapType<Stride<Outer, Inner> >::type(data, stride); }
534
+ template<int Outer, int Inner>
535
+ static inline typename StridedMapType<Stride<Outer, Inner> >::type Map(Scalar* data, const Stride<Outer, Inner>& stride)
536
+ { return typename StridedMapType<Stride<Outer, Inner> >::type(data, stride); }
537
+ template<int Outer, int Inner>
538
+ static inline typename StridedConstMapType<Stride<Outer, Inner> >::type Map(const Scalar* data, Index size, const Stride<Outer, Inner>& stride)
539
+ { return typename StridedConstMapType<Stride<Outer, Inner> >::type(data, size, stride); }
540
+ template<int Outer, int Inner>
541
+ static inline typename StridedMapType<Stride<Outer, Inner> >::type Map(Scalar* data, Index size, const Stride<Outer, Inner>& stride)
542
+ { return typename StridedMapType<Stride<Outer, Inner> >::type(data, size, stride); }
543
+ template<int Outer, int Inner>
544
+ static inline typename StridedConstMapType<Stride<Outer, Inner> >::type Map(const Scalar* data, Index rows, Index cols, const Stride<Outer, Inner>& stride)
545
+ { return typename StridedConstMapType<Stride<Outer, Inner> >::type(data, rows, cols, stride); }
546
+ template<int Outer, int Inner>
547
+ static inline typename StridedMapType<Stride<Outer, Inner> >::type Map(Scalar* data, Index rows, Index cols, const Stride<Outer, Inner>& stride)
548
+ { return typename StridedMapType<Stride<Outer, Inner> >::type(data, rows, cols, stride); }
549
+
550
+ template<int Outer, int Inner>
551
+ static inline typename StridedConstAlignedMapType<Stride<Outer, Inner> >::type MapAligned(const Scalar* data, const Stride<Outer, Inner>& stride)
552
+ { return typename StridedConstAlignedMapType<Stride<Outer, Inner> >::type(data, stride); }
553
+ template<int Outer, int Inner>
554
+ static inline typename StridedAlignedMapType<Stride<Outer, Inner> >::type MapAligned(Scalar* data, const Stride<Outer, Inner>& stride)
555
+ { return typename StridedAlignedMapType<Stride<Outer, Inner> >::type(data, stride); }
556
+ template<int Outer, int Inner>
557
+ static inline typename StridedConstAlignedMapType<Stride<Outer, Inner> >::type MapAligned(const Scalar* data, Index size, const Stride<Outer, Inner>& stride)
558
+ { return typename StridedConstAlignedMapType<Stride<Outer, Inner> >::type(data, size, stride); }
559
+ template<int Outer, int Inner>
560
+ static inline typename StridedAlignedMapType<Stride<Outer, Inner> >::type MapAligned(Scalar* data, Index size, const Stride<Outer, Inner>& stride)
561
+ { return typename StridedAlignedMapType<Stride<Outer, Inner> >::type(data, size, stride); }
562
+ template<int Outer, int Inner>
563
+ static inline typename StridedConstAlignedMapType<Stride<Outer, Inner> >::type MapAligned(const Scalar* data, Index rows, Index cols, const Stride<Outer, Inner>& stride)
564
+ { return typename StridedConstAlignedMapType<Stride<Outer, Inner> >::type(data, rows, cols, stride); }
565
+ template<int Outer, int Inner>
566
+ static inline typename StridedAlignedMapType<Stride<Outer, Inner> >::type MapAligned(Scalar* data, Index rows, Index cols, const Stride<Outer, Inner>& stride)
567
+ { return typename StridedAlignedMapType<Stride<Outer, Inner> >::type(data, rows, cols, stride); }
568
+ //@}
569
+
570
+ using Base::setConstant;
571
+ Derived& setConstant(Index size, const Scalar& value);
572
+ Derived& setConstant(Index rows, Index cols, const Scalar& value);
573
+
574
+ using Base::setZero;
575
+ Derived& setZero(Index size);
576
+ Derived& setZero(Index rows, Index cols);
577
+
578
+ using Base::setOnes;
579
+ Derived& setOnes(Index size);
580
+ Derived& setOnes(Index rows, Index cols);
581
+
582
+ using Base::setRandom;
583
+ Derived& setRandom(Index size);
584
+ Derived& setRandom(Index rows, Index cols);
585
+
586
+ #ifdef EIGEN_PLAINOBJECTBASE_PLUGIN
587
+ #include EIGEN_PLAINOBJECTBASE_PLUGIN
588
+ #endif
589
+
590
+ protected:
591
+ /** \internal Resizes *this in preparation for assigning \a other to it.
592
+ * Takes care of doing all the checking that's needed.
593
+ *
594
+ * Note that copying a row-vector into a vector (and conversely) is allowed.
595
+ * The resizing, if any, is then done in the appropriate way so that row-vectors
596
+ * remain row-vectors and vectors remain vectors.
597
+ */
598
+ template<typename OtherDerived>
599
+ EIGEN_STRONG_INLINE void _resize_to_match(const EigenBase<OtherDerived>& other)
600
+ {
601
+ #ifdef EIGEN_NO_AUTOMATIC_RESIZING
602
+ eigen_assert((this->size()==0 || (IsVectorAtCompileTime ? (this->size() == other.size())
603
+ : (rows() == other.rows() && cols() == other.cols())))
604
+ && "Size mismatch. Automatic resizing is disabled because EIGEN_NO_AUTOMATIC_RESIZING is defined");
605
+ EIGEN_ONLY_USED_FOR_DEBUG(other);
606
+ if(this->size()==0)
607
+ resizeLike(other);
608
+ #else
609
+ resizeLike(other);
610
+ #endif
611
+ }
612
+
613
+ /**
614
+ * \brief Copies the value of the expression \a other into \c *this with automatic resizing.
615
+ *
616
+ * *this might be resized to match the dimensions of \a other. If *this was a null matrix (not already initialized),
617
+ * it will be initialized.
618
+ *
619
+ * Note that copying a row-vector into a vector (and conversely) is allowed.
620
+ * The resizing, if any, is then done in the appropriate way so that row-vectors
621
+ * remain row-vectors and vectors remain vectors.
622
+ *
623
+ * \sa operator=(const MatrixBase<OtherDerived>&), _set_noalias()
624
+ *
625
+ * \internal
626
+ */
627
+ template<typename OtherDerived>
628
+ EIGEN_STRONG_INLINE Derived& _set(const DenseBase<OtherDerived>& other)
629
+ {
630
+ _set_selector(other.derived(), typename internal::conditional<static_cast<bool>(int(OtherDerived::Flags) & EvalBeforeAssigningBit), internal::true_type, internal::false_type>::type());
631
+ return this->derived();
632
+ }
633
+
634
+ template<typename OtherDerived>
635
+ EIGEN_STRONG_INLINE void _set_selector(const OtherDerived& other, const internal::true_type&) { _set_noalias(other.eval()); }
636
+
637
+ template<typename OtherDerived>
638
+ EIGEN_STRONG_INLINE void _set_selector(const OtherDerived& other, const internal::false_type&) { _set_noalias(other); }
639
+
640
+ /** \internal Like _set() but additionally makes the assumption that no aliasing effect can happen (which
641
+ * is the case when creating a new matrix) so one can enforce lazy evaluation.
642
+ *
643
+ * \sa operator=(const MatrixBase<OtherDerived>&), _set()
644
+ */
645
+ template<typename OtherDerived>
646
+ EIGEN_STRONG_INLINE Derived& _set_noalias(const DenseBase<OtherDerived>& other)
647
+ {
648
+ // I don't think we need this resize call since the lazyAssign will anyways resize
649
+ // and lazyAssign will be called by the assign selector.
650
+ //_resize_to_match(other);
651
+ // the 'false' below means to enforce lazy evaluation. We don't use lazyAssign() because
652
+ // it wouldn't allow to copy a row-vector into a column-vector.
653
+ return internal::assign_selector<Derived,OtherDerived,false>::run(this->derived(), other.derived());
654
+ }
655
+
656
+ template<typename T0, typename T1>
657
+ EIGEN_STRONG_INLINE void _init2(Index nbRows, Index nbCols, typename internal::enable_if<Base::SizeAtCompileTime!=2,T0>::type* = 0)
658
+ {
659
+ EIGEN_STATIC_ASSERT(bool(NumTraits<T0>::IsInteger) &&
660
+ bool(NumTraits<T1>::IsInteger),
661
+ FLOATING_POINT_ARGUMENT_PASSED__INTEGER_WAS_EXPECTED)
662
+ resize(nbRows,nbCols);
663
+ }
664
+ template<typename T0, typename T1>
665
+ EIGEN_STRONG_INLINE void _init2(const Scalar& val0, const Scalar& val1, typename internal::enable_if<Base::SizeAtCompileTime==2,T0>::type* = 0)
666
+ {
667
+ EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, 2)
668
+ m_storage.data()[0] = val0;
669
+ m_storage.data()[1] = val1;
670
+ }
671
+
672
+ template<typename MatrixTypeA, typename MatrixTypeB, bool SwapPointers>
673
+ friend struct internal::matrix_swap_impl;
674
+
675
+ /** \internal generic implementation of swap for dense storage since for dynamic-sized matrices of same type it is enough to swap the
676
+ * data pointers.
677
+ */
678
+ template<typename OtherDerived>
679
+ void _swap(DenseBase<OtherDerived> const & other)
680
+ {
681
+ enum { SwapPointers = internal::is_same<Derived, OtherDerived>::value && Base::SizeAtCompileTime==Dynamic };
682
+ internal::matrix_swap_impl<Derived, OtherDerived, bool(SwapPointers)>::run(this->derived(), other.const_cast_derived());
683
+ }
684
+
685
+ public:
686
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
687
+ static EIGEN_STRONG_INLINE void _check_template_params()
688
+ {
689
+ EIGEN_STATIC_ASSERT((EIGEN_IMPLIES(MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1, (Options&RowMajor)==RowMajor)
690
+ && EIGEN_IMPLIES(MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1, (Options&RowMajor)==0)
691
+ && ((RowsAtCompileTime == Dynamic) || (RowsAtCompileTime >= 0))
692
+ && ((ColsAtCompileTime == Dynamic) || (ColsAtCompileTime >= 0))
693
+ && ((MaxRowsAtCompileTime == Dynamic) || (MaxRowsAtCompileTime >= 0))
694
+ && ((MaxColsAtCompileTime == Dynamic) || (MaxColsAtCompileTime >= 0))
695
+ && (MaxRowsAtCompileTime == RowsAtCompileTime || RowsAtCompileTime==Dynamic)
696
+ && (MaxColsAtCompileTime == ColsAtCompileTime || ColsAtCompileTime==Dynamic)
697
+ && (Options & (DontAlign|RowMajor)) == Options),
698
+ INVALID_MATRIX_TEMPLATE_PARAMETERS)
699
+ }
700
+ #endif
701
+
702
+ private:
703
+ enum { ThisConstantIsPrivateInPlainObjectBase };
704
+ };
705
+
706
+ namespace internal {
707
+
708
+ template <typename Derived, typename OtherDerived, bool IsVector>
709
+ struct conservative_resize_like_impl
710
+ {
711
+ typedef typename Derived::Index Index;
712
+ static void run(DenseBase<Derived>& _this, Index rows, Index cols)
713
+ {
714
+ if (_this.rows() == rows && _this.cols() == cols) return;
715
+ EIGEN_STATIC_ASSERT_DYNAMIC_SIZE(Derived)
716
+
717
+ if ( ( Derived::IsRowMajor && _this.cols() == cols) || // row-major and we change only the number of rows
718
+ (!Derived::IsRowMajor && _this.rows() == rows) ) // column-major and we change only the number of columns
719
+ {
720
+ internal::check_rows_cols_for_overflow<Derived::MaxSizeAtCompileTime>::run(rows, cols);
721
+ _this.derived().m_storage.conservativeResize(rows*cols,rows,cols);
722
+ }
723
+ else
724
+ {
725
+ // The storage order does not allow us to use reallocation.
726
+ typename Derived::PlainObject tmp(rows,cols);
727
+ const Index common_rows = (std::min)(rows, _this.rows());
728
+ const Index common_cols = (std::min)(cols, _this.cols());
729
+ tmp.block(0,0,common_rows,common_cols) = _this.block(0,0,common_rows,common_cols);
730
+ _this.derived().swap(tmp);
731
+ }
732
+ }
733
+
734
+ static void run(DenseBase<Derived>& _this, const DenseBase<OtherDerived>& other)
735
+ {
736
+ if (_this.rows() == other.rows() && _this.cols() == other.cols()) return;
737
+
738
+ // Note: Here is space for improvement. Basically, for conservativeResize(Index,Index),
739
+ // neither RowsAtCompileTime or ColsAtCompileTime must be Dynamic. If only one of the
740
+ // dimensions is dynamic, one could use either conservativeResize(Index rows, NoChange_t) or
741
+ // conservativeResize(NoChange_t, Index cols). For these methods new static asserts like
742
+ // EIGEN_STATIC_ASSERT_DYNAMIC_ROWS and EIGEN_STATIC_ASSERT_DYNAMIC_COLS would be good.
743
+ EIGEN_STATIC_ASSERT_DYNAMIC_SIZE(Derived)
744
+ EIGEN_STATIC_ASSERT_DYNAMIC_SIZE(OtherDerived)
745
+
746
+ if ( ( Derived::IsRowMajor && _this.cols() == other.cols()) || // row-major and we change only the number of rows
747
+ (!Derived::IsRowMajor && _this.rows() == other.rows()) ) // column-major and we change only the number of columns
748
+ {
749
+ const Index new_rows = other.rows() - _this.rows();
750
+ const Index new_cols = other.cols() - _this.cols();
751
+ _this.derived().m_storage.conservativeResize(other.size(),other.rows(),other.cols());
752
+ if (new_rows>0)
753
+ _this.bottomRightCorner(new_rows, other.cols()) = other.bottomRows(new_rows);
754
+ else if (new_cols>0)
755
+ _this.bottomRightCorner(other.rows(), new_cols) = other.rightCols(new_cols);
756
+ }
757
+ else
758
+ {
759
+ // The storage order does not allow us to use reallocation.
760
+ typename Derived::PlainObject tmp(other);
761
+ const Index common_rows = (std::min)(tmp.rows(), _this.rows());
762
+ const Index common_cols = (std::min)(tmp.cols(), _this.cols());
763
+ tmp.block(0,0,common_rows,common_cols) = _this.block(0,0,common_rows,common_cols);
764
+ _this.derived().swap(tmp);
765
+ }
766
+ }
767
+ };
768
+
769
+ // Here, the specialization for vectors inherits from the general matrix case
770
+ // to allow calling .conservativeResize(rows,cols) on vectors.
771
+ template <typename Derived, typename OtherDerived>
772
+ struct conservative_resize_like_impl<Derived,OtherDerived,true>
773
+ : conservative_resize_like_impl<Derived,OtherDerived,false>
774
+ {
775
+ using conservative_resize_like_impl<Derived,OtherDerived,false>::run;
776
+
777
+ typedef typename Derived::Index Index;
778
+ static void run(DenseBase<Derived>& _this, Index size)
779
+ {
780
+ const Index new_rows = Derived::RowsAtCompileTime==1 ? 1 : size;
781
+ const Index new_cols = Derived::RowsAtCompileTime==1 ? size : 1;
782
+ _this.derived().m_storage.conservativeResize(size,new_rows,new_cols);
783
+ }
784
+
785
+ static void run(DenseBase<Derived>& _this, const DenseBase<OtherDerived>& other)
786
+ {
787
+ if (_this.rows() == other.rows() && _this.cols() == other.cols()) return;
788
+
789
+ const Index num_new_elements = other.size() - _this.size();
790
+
791
+ const Index new_rows = Derived::RowsAtCompileTime==1 ? 1 : other.rows();
792
+ const Index new_cols = Derived::RowsAtCompileTime==1 ? other.cols() : 1;
793
+ _this.derived().m_storage.conservativeResize(other.size(),new_rows,new_cols);
794
+
795
+ if (num_new_elements > 0)
796
+ _this.tail(num_new_elements) = other.tail(num_new_elements);
797
+ }
798
+ };
799
+
800
+ template<typename MatrixTypeA, typename MatrixTypeB, bool SwapPointers>
801
+ struct matrix_swap_impl
802
+ {
803
+ static inline void run(MatrixTypeA& a, MatrixTypeB& b)
804
+ {
805
+ a.base().swap(b);
806
+ }
807
+ };
808
+
809
+ template<typename MatrixTypeA, typename MatrixTypeB>
810
+ struct matrix_swap_impl<MatrixTypeA, MatrixTypeB, true>
811
+ {
812
+ static inline void run(MatrixTypeA& a, MatrixTypeB& b)
813
+ {
814
+ static_cast<typename MatrixTypeA::Base&>(a).m_storage.swap(static_cast<typename MatrixTypeB::Base&>(b).m_storage);
815
+ }
816
+ };
817
+
818
+ } // end namespace internal
819
+
820
+ } // end namespace Eigen
821
+
822
+ #endif // EIGEN_DENSESTORAGEBASE_H