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,108 @@
1
+ // This file is part of Eigen, a lightweight C++ template library
2
+ // for linear algebra.
3
+ //
4
+ // Copyright (C) 2010 Benoit Jacob <jacob.benoit.1@gmail.com>
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_STRIDE_H
11
+ #define EIGEN_STRIDE_H
12
+
13
+ namespace Eigen {
14
+
15
+ /** \class Stride
16
+ * \ingroup Core_Module
17
+ *
18
+ * \brief Holds strides information for Map
19
+ *
20
+ * This class holds the strides information for mapping arrays with strides with class Map.
21
+ *
22
+ * It holds two values: the inner stride and the outer stride.
23
+ *
24
+ * The inner stride is the pointer increment between two consecutive entries within a given row of a
25
+ * row-major matrix or within a given column of a column-major matrix.
26
+ *
27
+ * The outer stride is the pointer increment between two consecutive rows of a row-major matrix or
28
+ * between two consecutive columns of a column-major matrix.
29
+ *
30
+ * These two values can be passed either at compile-time as template parameters, or at runtime as
31
+ * arguments to the constructor.
32
+ *
33
+ * Indeed, this class takes two template parameters:
34
+ * \param _OuterStrideAtCompileTime the outer stride, or Dynamic if you want to specify it at runtime.
35
+ * \param _InnerStrideAtCompileTime the inner stride, or Dynamic if you want to specify it at runtime.
36
+ *
37
+ * Here is an example:
38
+ * \include Map_general_stride.cpp
39
+ * Output: \verbinclude Map_general_stride.out
40
+ *
41
+ * \sa class InnerStride, class OuterStride, \ref TopicStorageOrders
42
+ */
43
+ template<int _OuterStrideAtCompileTime, int _InnerStrideAtCompileTime>
44
+ class Stride
45
+ {
46
+ public:
47
+ typedef DenseIndex Index;
48
+ enum {
49
+ InnerStrideAtCompileTime = _InnerStrideAtCompileTime,
50
+ OuterStrideAtCompileTime = _OuterStrideAtCompileTime
51
+ };
52
+
53
+ /** Default constructor, for use when strides are fixed at compile time */
54
+ Stride()
55
+ : m_outer(OuterStrideAtCompileTime), m_inner(InnerStrideAtCompileTime)
56
+ {
57
+ eigen_assert(InnerStrideAtCompileTime != Dynamic && OuterStrideAtCompileTime != Dynamic);
58
+ }
59
+
60
+ /** Constructor allowing to pass the strides at runtime */
61
+ Stride(Index outerStride, Index innerStride)
62
+ : m_outer(outerStride), m_inner(innerStride)
63
+ {
64
+ eigen_assert(innerStride>=0 && outerStride>=0);
65
+ }
66
+
67
+ /** Copy constructor */
68
+ Stride(const Stride& other)
69
+ : m_outer(other.outer()), m_inner(other.inner())
70
+ {}
71
+
72
+ /** \returns the outer stride */
73
+ inline Index outer() const { return m_outer.value(); }
74
+ /** \returns the inner stride */
75
+ inline Index inner() const { return m_inner.value(); }
76
+
77
+ protected:
78
+ internal::variable_if_dynamic<Index, OuterStrideAtCompileTime> m_outer;
79
+ internal::variable_if_dynamic<Index, InnerStrideAtCompileTime> m_inner;
80
+ };
81
+
82
+ /** \brief Convenience specialization of Stride to specify only an inner stride
83
+ * See class Map for some examples */
84
+ template<int Value = Dynamic>
85
+ class InnerStride : public Stride<0, Value>
86
+ {
87
+ typedef Stride<0, Value> Base;
88
+ public:
89
+ typedef DenseIndex Index;
90
+ InnerStride() : Base() {}
91
+ InnerStride(Index v) : Base(0, v) {}
92
+ };
93
+
94
+ /** \brief Convenience specialization of Stride to specify only an outer stride
95
+ * See class Map for some examples */
96
+ template<int Value = Dynamic>
97
+ class OuterStride : public Stride<Value, 0>
98
+ {
99
+ typedef Stride<Value, 0> Base;
100
+ public:
101
+ typedef DenseIndex Index;
102
+ OuterStride() : Base() {}
103
+ OuterStride(Index v) : Base(v,0) {}
104
+ };
105
+
106
+ } // end namespace Eigen
107
+
108
+ #endif // EIGEN_STRIDE_H
@@ -0,0 +1,126 @@
1
+ // This file is part of Eigen, a lightweight C++ template library
2
+ // for linear algebra.
3
+ //
4
+ // Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
5
+ //
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_SWAP_H
11
+ #define EIGEN_SWAP_H
12
+
13
+ namespace Eigen {
14
+
15
+ /** \class SwapWrapper
16
+ * \ingroup Core_Module
17
+ *
18
+ * \internal
19
+ *
20
+ * \brief Internal helper class for swapping two expressions
21
+ */
22
+ namespace internal {
23
+ template<typename ExpressionType>
24
+ struct traits<SwapWrapper<ExpressionType> > : traits<ExpressionType> {};
25
+ }
26
+
27
+ template<typename ExpressionType> class SwapWrapper
28
+ : public internal::dense_xpr_base<SwapWrapper<ExpressionType> >::type
29
+ {
30
+ public:
31
+
32
+ typedef typename internal::dense_xpr_base<SwapWrapper>::type Base;
33
+ EIGEN_DENSE_PUBLIC_INTERFACE(SwapWrapper)
34
+ typedef typename internal::packet_traits<Scalar>::type Packet;
35
+
36
+ inline SwapWrapper(ExpressionType& xpr) : m_expression(xpr) {}
37
+
38
+ inline Index rows() const { return m_expression.rows(); }
39
+ inline Index cols() const { return m_expression.cols(); }
40
+ inline Index outerStride() const { return m_expression.outerStride(); }
41
+ inline Index innerStride() const { return m_expression.innerStride(); }
42
+
43
+ typedef typename internal::conditional<
44
+ internal::is_lvalue<ExpressionType>::value,
45
+ Scalar,
46
+ const Scalar
47
+ >::type ScalarWithConstIfNotLvalue;
48
+
49
+ inline ScalarWithConstIfNotLvalue* data() { return m_expression.data(); }
50
+ inline const Scalar* data() const { return m_expression.data(); }
51
+
52
+ inline Scalar& coeffRef(Index rowId, Index colId)
53
+ {
54
+ return m_expression.const_cast_derived().coeffRef(rowId, colId);
55
+ }
56
+
57
+ inline Scalar& coeffRef(Index index)
58
+ {
59
+ return m_expression.const_cast_derived().coeffRef(index);
60
+ }
61
+
62
+ inline Scalar& coeffRef(Index rowId, Index colId) const
63
+ {
64
+ return m_expression.coeffRef(rowId, colId);
65
+ }
66
+
67
+ inline Scalar& coeffRef(Index index) const
68
+ {
69
+ return m_expression.coeffRef(index);
70
+ }
71
+
72
+ template<typename OtherDerived>
73
+ void copyCoeff(Index rowId, Index colId, const DenseBase<OtherDerived>& other)
74
+ {
75
+ OtherDerived& _other = other.const_cast_derived();
76
+ eigen_internal_assert(rowId >= 0 && rowId < rows()
77
+ && colId >= 0 && colId < cols());
78
+ Scalar tmp = m_expression.coeff(rowId, colId);
79
+ m_expression.coeffRef(rowId, colId) = _other.coeff(rowId, colId);
80
+ _other.coeffRef(rowId, colId) = tmp;
81
+ }
82
+
83
+ template<typename OtherDerived>
84
+ void copyCoeff(Index index, const DenseBase<OtherDerived>& other)
85
+ {
86
+ OtherDerived& _other = other.const_cast_derived();
87
+ eigen_internal_assert(index >= 0 && index < m_expression.size());
88
+ Scalar tmp = m_expression.coeff(index);
89
+ m_expression.coeffRef(index) = _other.coeff(index);
90
+ _other.coeffRef(index) = tmp;
91
+ }
92
+
93
+ template<typename OtherDerived, int StoreMode, int LoadMode>
94
+ void copyPacket(Index rowId, Index colId, const DenseBase<OtherDerived>& other)
95
+ {
96
+ OtherDerived& _other = other.const_cast_derived();
97
+ eigen_internal_assert(rowId >= 0 && rowId < rows()
98
+ && colId >= 0 && colId < cols());
99
+ Packet tmp = m_expression.template packet<StoreMode>(rowId, colId);
100
+ m_expression.template writePacket<StoreMode>(rowId, colId,
101
+ _other.template packet<LoadMode>(rowId, colId)
102
+ );
103
+ _other.template writePacket<LoadMode>(rowId, colId, tmp);
104
+ }
105
+
106
+ template<typename OtherDerived, int StoreMode, int LoadMode>
107
+ void copyPacket(Index index, const DenseBase<OtherDerived>& other)
108
+ {
109
+ OtherDerived& _other = other.const_cast_derived();
110
+ eigen_internal_assert(index >= 0 && index < m_expression.size());
111
+ Packet tmp = m_expression.template packet<StoreMode>(index);
112
+ m_expression.template writePacket<StoreMode>(index,
113
+ _other.template packet<LoadMode>(index)
114
+ );
115
+ _other.template writePacket<LoadMode>(index, tmp);
116
+ }
117
+
118
+ ExpressionType& expression() const { return m_expression; }
119
+
120
+ protected:
121
+ ExpressionType& m_expression;
122
+ };
123
+
124
+ } // end namespace Eigen
125
+
126
+ #endif // EIGEN_SWAP_H
@@ -0,0 +1,419 @@
1
+ // This file is part of Eigen, a lightweight C++ template library
2
+ // for linear algebra.
3
+ //
4
+ // Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
5
+ // Copyright (C) 2009-2010 Gael Guennebaud <gael.guennebaud@inria.fr>
6
+ //
7
+ // This Source Code Form is subject to the terms of the Mozilla
8
+ // Public License v. 2.0. If a copy of the MPL was not distributed
9
+ // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10
+
11
+ #ifndef EIGEN_TRANSPOSE_H
12
+ #define EIGEN_TRANSPOSE_H
13
+
14
+ namespace Eigen {
15
+
16
+ /** \class Transpose
17
+ * \ingroup Core_Module
18
+ *
19
+ * \brief Expression of the transpose of a matrix
20
+ *
21
+ * \param MatrixType the type of the object of which we are taking the transpose
22
+ *
23
+ * This class represents an expression of the transpose of a matrix.
24
+ * It is the return type of MatrixBase::transpose() and MatrixBase::adjoint()
25
+ * and most of the time this is the only way it is used.
26
+ *
27
+ * \sa MatrixBase::transpose(), MatrixBase::adjoint()
28
+ */
29
+
30
+ namespace internal {
31
+ template<typename MatrixType>
32
+ struct traits<Transpose<MatrixType> > : traits<MatrixType>
33
+ {
34
+ typedef typename MatrixType::Scalar Scalar;
35
+ typedef typename nested<MatrixType>::type MatrixTypeNested;
36
+ typedef typename remove_reference<MatrixTypeNested>::type MatrixTypeNestedPlain;
37
+ typedef typename traits<MatrixType>::StorageKind StorageKind;
38
+ typedef typename traits<MatrixType>::XprKind XprKind;
39
+ enum {
40
+ RowsAtCompileTime = MatrixType::ColsAtCompileTime,
41
+ ColsAtCompileTime = MatrixType::RowsAtCompileTime,
42
+ MaxRowsAtCompileTime = MatrixType::MaxColsAtCompileTime,
43
+ MaxColsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
44
+ FlagsLvalueBit = is_lvalue<MatrixType>::value ? LvalueBit : 0,
45
+ Flags0 = MatrixTypeNestedPlain::Flags & ~(LvalueBit | NestByRefBit),
46
+ Flags1 = Flags0 | FlagsLvalueBit,
47
+ Flags = Flags1 ^ RowMajorBit,
48
+ CoeffReadCost = MatrixTypeNestedPlain::CoeffReadCost,
49
+ InnerStrideAtCompileTime = inner_stride_at_compile_time<MatrixType>::ret,
50
+ OuterStrideAtCompileTime = outer_stride_at_compile_time<MatrixType>::ret
51
+ };
52
+ };
53
+ }
54
+
55
+ template<typename MatrixType, typename StorageKind> class TransposeImpl;
56
+
57
+ template<typename MatrixType> class Transpose
58
+ : public TransposeImpl<MatrixType,typename internal::traits<MatrixType>::StorageKind>
59
+ {
60
+ public:
61
+
62
+ typedef typename TransposeImpl<MatrixType,typename internal::traits<MatrixType>::StorageKind>::Base Base;
63
+ EIGEN_GENERIC_PUBLIC_INTERFACE(Transpose)
64
+
65
+ inline Transpose(MatrixType& a_matrix) : m_matrix(a_matrix) {}
66
+
67
+ EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Transpose)
68
+
69
+ inline Index rows() const { return m_matrix.cols(); }
70
+ inline Index cols() const { return m_matrix.rows(); }
71
+
72
+ /** \returns the nested expression */
73
+ const typename internal::remove_all<typename MatrixType::Nested>::type&
74
+ nestedExpression() const { return m_matrix; }
75
+
76
+ /** \returns the nested expression */
77
+ typename internal::remove_all<typename MatrixType::Nested>::type&
78
+ nestedExpression() { return m_matrix.const_cast_derived(); }
79
+
80
+ protected:
81
+ typename MatrixType::Nested m_matrix;
82
+ };
83
+
84
+ namespace internal {
85
+
86
+ template<typename MatrixType, bool HasDirectAccess = has_direct_access<MatrixType>::ret>
87
+ struct TransposeImpl_base
88
+ {
89
+ typedef typename dense_xpr_base<Transpose<MatrixType> >::type type;
90
+ };
91
+
92
+ template<typename MatrixType>
93
+ struct TransposeImpl_base<MatrixType, false>
94
+ {
95
+ typedef typename dense_xpr_base<Transpose<MatrixType> >::type type;
96
+ };
97
+
98
+ } // end namespace internal
99
+
100
+ template<typename MatrixType> class TransposeImpl<MatrixType,Dense>
101
+ : public internal::TransposeImpl_base<MatrixType>::type
102
+ {
103
+ public:
104
+
105
+ typedef typename internal::TransposeImpl_base<MatrixType>::type Base;
106
+ EIGEN_DENSE_PUBLIC_INTERFACE(Transpose<MatrixType>)
107
+ EIGEN_INHERIT_ASSIGNMENT_OPERATORS(TransposeImpl)
108
+
109
+ inline Index innerStride() const { return derived().nestedExpression().innerStride(); }
110
+ inline Index outerStride() const { return derived().nestedExpression().outerStride(); }
111
+
112
+ typedef typename internal::conditional<
113
+ internal::is_lvalue<MatrixType>::value,
114
+ Scalar,
115
+ const Scalar
116
+ >::type ScalarWithConstIfNotLvalue;
117
+
118
+ inline ScalarWithConstIfNotLvalue* data() { return derived().nestedExpression().data(); }
119
+ inline const Scalar* data() const { return derived().nestedExpression().data(); }
120
+
121
+ inline ScalarWithConstIfNotLvalue& coeffRef(Index rowId, Index colId)
122
+ {
123
+ EIGEN_STATIC_ASSERT_LVALUE(MatrixType)
124
+ return derived().nestedExpression().const_cast_derived().coeffRef(colId, rowId);
125
+ }
126
+
127
+ inline ScalarWithConstIfNotLvalue& coeffRef(Index index)
128
+ {
129
+ EIGEN_STATIC_ASSERT_LVALUE(MatrixType)
130
+ return derived().nestedExpression().const_cast_derived().coeffRef(index);
131
+ }
132
+
133
+ inline const Scalar& coeffRef(Index rowId, Index colId) const
134
+ {
135
+ return derived().nestedExpression().coeffRef(colId, rowId);
136
+ }
137
+
138
+ inline const Scalar& coeffRef(Index index) const
139
+ {
140
+ return derived().nestedExpression().coeffRef(index);
141
+ }
142
+
143
+ inline CoeffReturnType coeff(Index rowId, Index colId) const
144
+ {
145
+ return derived().nestedExpression().coeff(colId, rowId);
146
+ }
147
+
148
+ inline CoeffReturnType coeff(Index index) const
149
+ {
150
+ return derived().nestedExpression().coeff(index);
151
+ }
152
+
153
+ template<int LoadMode>
154
+ inline const PacketScalar packet(Index rowId, Index colId) const
155
+ {
156
+ return derived().nestedExpression().template packet<LoadMode>(colId, rowId);
157
+ }
158
+
159
+ template<int LoadMode>
160
+ inline void writePacket(Index rowId, Index colId, const PacketScalar& x)
161
+ {
162
+ derived().nestedExpression().const_cast_derived().template writePacket<LoadMode>(colId, rowId, x);
163
+ }
164
+
165
+ template<int LoadMode>
166
+ inline const PacketScalar packet(Index index) const
167
+ {
168
+ return derived().nestedExpression().template packet<LoadMode>(index);
169
+ }
170
+
171
+ template<int LoadMode>
172
+ inline void writePacket(Index index, const PacketScalar& x)
173
+ {
174
+ derived().nestedExpression().const_cast_derived().template writePacket<LoadMode>(index, x);
175
+ }
176
+ };
177
+
178
+ /** \returns an expression of the transpose of *this.
179
+ *
180
+ * Example: \include MatrixBase_transpose.cpp
181
+ * Output: \verbinclude MatrixBase_transpose.out
182
+ *
183
+ * \warning If you want to replace a matrix by its own transpose, do \b NOT do this:
184
+ * \code
185
+ * m = m.transpose(); // bug!!! caused by aliasing effect
186
+ * \endcode
187
+ * Instead, use the transposeInPlace() method:
188
+ * \code
189
+ * m.transposeInPlace();
190
+ * \endcode
191
+ * which gives Eigen good opportunities for optimization, or alternatively you can also do:
192
+ * \code
193
+ * m = m.transpose().eval();
194
+ * \endcode
195
+ *
196
+ * \sa transposeInPlace(), adjoint() */
197
+ template<typename Derived>
198
+ inline Transpose<Derived>
199
+ DenseBase<Derived>::transpose()
200
+ {
201
+ return derived();
202
+ }
203
+
204
+ /** This is the const version of transpose().
205
+ *
206
+ * Make sure you read the warning for transpose() !
207
+ *
208
+ * \sa transposeInPlace(), adjoint() */
209
+ template<typename Derived>
210
+ inline typename DenseBase<Derived>::ConstTransposeReturnType
211
+ DenseBase<Derived>::transpose() const
212
+ {
213
+ return ConstTransposeReturnType(derived());
214
+ }
215
+
216
+ /** \returns an expression of the adjoint (i.e. conjugate transpose) of *this.
217
+ *
218
+ * Example: \include MatrixBase_adjoint.cpp
219
+ * Output: \verbinclude MatrixBase_adjoint.out
220
+ *
221
+ * \warning If you want to replace a matrix by its own adjoint, do \b NOT do this:
222
+ * \code
223
+ * m = m.adjoint(); // bug!!! caused by aliasing effect
224
+ * \endcode
225
+ * Instead, use the adjointInPlace() method:
226
+ * \code
227
+ * m.adjointInPlace();
228
+ * \endcode
229
+ * which gives Eigen good opportunities for optimization, or alternatively you can also do:
230
+ * \code
231
+ * m = m.adjoint().eval();
232
+ * \endcode
233
+ *
234
+ * \sa adjointInPlace(), transpose(), conjugate(), class Transpose, class internal::scalar_conjugate_op */
235
+ template<typename Derived>
236
+ inline const typename MatrixBase<Derived>::AdjointReturnType
237
+ MatrixBase<Derived>::adjoint() const
238
+ {
239
+ return this->transpose(); // in the complex case, the .conjugate() is be implicit here
240
+ // due to implicit conversion to return type
241
+ }
242
+
243
+ /***************************************************************************
244
+ * "in place" transpose implementation
245
+ ***************************************************************************/
246
+
247
+ namespace internal {
248
+
249
+ template<typename MatrixType,
250
+ bool IsSquare = (MatrixType::RowsAtCompileTime == MatrixType::ColsAtCompileTime) && MatrixType::RowsAtCompileTime!=Dynamic>
251
+ struct inplace_transpose_selector;
252
+
253
+ template<typename MatrixType>
254
+ struct inplace_transpose_selector<MatrixType,true> { // square matrix
255
+ static void run(MatrixType& m) {
256
+ m.matrix().template triangularView<StrictlyUpper>().swap(m.matrix().transpose());
257
+ }
258
+ };
259
+
260
+ template<typename MatrixType>
261
+ struct inplace_transpose_selector<MatrixType,false> { // non square matrix
262
+ static void run(MatrixType& m) {
263
+ if (m.rows()==m.cols())
264
+ m.matrix().template triangularView<StrictlyUpper>().swap(m.matrix().transpose());
265
+ else
266
+ m = m.transpose().eval();
267
+ }
268
+ };
269
+
270
+ } // end namespace internal
271
+
272
+ /** This is the "in place" version of transpose(): it replaces \c *this by its own transpose.
273
+ * Thus, doing
274
+ * \code
275
+ * m.transposeInPlace();
276
+ * \endcode
277
+ * has the same effect on m as doing
278
+ * \code
279
+ * m = m.transpose().eval();
280
+ * \endcode
281
+ * and is faster and also safer because in the latter line of code, forgetting the eval() results
282
+ * in a bug caused by \ref TopicAliasing "aliasing".
283
+ *
284
+ * Notice however that this method is only useful if you want to replace a matrix by its own transpose.
285
+ * If you just need the transpose of a matrix, use transpose().
286
+ *
287
+ * \note if the matrix is not square, then \c *this must be a resizable matrix.
288
+ * This excludes (non-square) fixed-size matrices, block-expressions and maps.
289
+ *
290
+ * \sa transpose(), adjoint(), adjointInPlace() */
291
+ template<typename Derived>
292
+ inline void DenseBase<Derived>::transposeInPlace()
293
+ {
294
+ eigen_assert((rows() == cols() || (RowsAtCompileTime == Dynamic && ColsAtCompileTime == Dynamic))
295
+ && "transposeInPlace() called on a non-square non-resizable matrix");
296
+ internal::inplace_transpose_selector<Derived>::run(derived());
297
+ }
298
+
299
+ /***************************************************************************
300
+ * "in place" adjoint implementation
301
+ ***************************************************************************/
302
+
303
+ /** This is the "in place" version of adjoint(): it replaces \c *this by its own transpose.
304
+ * Thus, doing
305
+ * \code
306
+ * m.adjointInPlace();
307
+ * \endcode
308
+ * has the same effect on m as doing
309
+ * \code
310
+ * m = m.adjoint().eval();
311
+ * \endcode
312
+ * and is faster and also safer because in the latter line of code, forgetting the eval() results
313
+ * in a bug caused by aliasing.
314
+ *
315
+ * Notice however that this method is only useful if you want to replace a matrix by its own adjoint.
316
+ * If you just need the adjoint of a matrix, use adjoint().
317
+ *
318
+ * \note if the matrix is not square, then \c *this must be a resizable matrix.
319
+ * This excludes (non-square) fixed-size matrices, block-expressions and maps.
320
+ *
321
+ * \sa transpose(), adjoint(), transposeInPlace() */
322
+ template<typename Derived>
323
+ inline void MatrixBase<Derived>::adjointInPlace()
324
+ {
325
+ derived() = adjoint().eval();
326
+ }
327
+
328
+ #ifndef EIGEN_NO_DEBUG
329
+
330
+ // The following is to detect aliasing problems in most common cases.
331
+
332
+ namespace internal {
333
+
334
+ template<typename BinOp,typename NestedXpr,typename Rhs>
335
+ struct blas_traits<SelfCwiseBinaryOp<BinOp,NestedXpr,Rhs> >
336
+ : blas_traits<NestedXpr>
337
+ {
338
+ typedef SelfCwiseBinaryOp<BinOp,NestedXpr,Rhs> XprType;
339
+ static inline const XprType extract(const XprType& x) { return x; }
340
+ };
341
+
342
+ template<bool DestIsTransposed, typename OtherDerived>
343
+ struct check_transpose_aliasing_compile_time_selector
344
+ {
345
+ enum { ret = bool(blas_traits<OtherDerived>::IsTransposed) != DestIsTransposed };
346
+ };
347
+
348
+ template<bool DestIsTransposed, typename BinOp, typename DerivedA, typename DerivedB>
349
+ struct check_transpose_aliasing_compile_time_selector<DestIsTransposed,CwiseBinaryOp<BinOp,DerivedA,DerivedB> >
350
+ {
351
+ enum { ret = bool(blas_traits<DerivedA>::IsTransposed) != DestIsTransposed
352
+ || bool(blas_traits<DerivedB>::IsTransposed) != DestIsTransposed
353
+ };
354
+ };
355
+
356
+ template<typename Scalar, bool DestIsTransposed, typename OtherDerived>
357
+ struct check_transpose_aliasing_run_time_selector
358
+ {
359
+ static bool run(const Scalar* dest, const OtherDerived& src)
360
+ {
361
+ return (bool(blas_traits<OtherDerived>::IsTransposed) != DestIsTransposed) && (dest!=0 && dest==(const Scalar*)extract_data(src));
362
+ }
363
+ };
364
+
365
+ template<typename Scalar, bool DestIsTransposed, typename BinOp, typename DerivedA, typename DerivedB>
366
+ struct check_transpose_aliasing_run_time_selector<Scalar,DestIsTransposed,CwiseBinaryOp<BinOp,DerivedA,DerivedB> >
367
+ {
368
+ static bool run(const Scalar* dest, const CwiseBinaryOp<BinOp,DerivedA,DerivedB>& src)
369
+ {
370
+ return ((blas_traits<DerivedA>::IsTransposed != DestIsTransposed) && (dest!=0 && dest==(const Scalar*)extract_data(src.lhs())))
371
+ || ((blas_traits<DerivedB>::IsTransposed != DestIsTransposed) && (dest!=0 && dest==(const Scalar*)extract_data(src.rhs())));
372
+ }
373
+ };
374
+
375
+ // the following selector, checkTransposeAliasing_impl, based on MightHaveTransposeAliasing,
376
+ // is because when the condition controlling the assert is known at compile time, ICC emits a warning.
377
+ // This is actually a good warning: in expressions that don't have any transposing, the condition is
378
+ // known at compile time to be false, and using that, we can avoid generating the code of the assert again
379
+ // and again for all these expressions that don't need it.
380
+
381
+ template<typename Derived, typename OtherDerived,
382
+ bool MightHaveTransposeAliasing
383
+ = check_transpose_aliasing_compile_time_selector
384
+ <blas_traits<Derived>::IsTransposed,OtherDerived>::ret
385
+ >
386
+ struct checkTransposeAliasing_impl
387
+ {
388
+ static void run(const Derived& dst, const OtherDerived& other)
389
+ {
390
+ eigen_assert((!check_transpose_aliasing_run_time_selector
391
+ <typename Derived::Scalar,blas_traits<Derived>::IsTransposed,OtherDerived>
392
+ ::run(extract_data(dst), other))
393
+ && "aliasing detected during transposition, use transposeInPlace() "
394
+ "or evaluate the rhs into a temporary using .eval()");
395
+
396
+ }
397
+ };
398
+
399
+ template<typename Derived, typename OtherDerived>
400
+ struct checkTransposeAliasing_impl<Derived, OtherDerived, false>
401
+ {
402
+ static void run(const Derived&, const OtherDerived&)
403
+ {
404
+ }
405
+ };
406
+
407
+ } // end namespace internal
408
+
409
+ template<typename Derived>
410
+ template<typename OtherDerived>
411
+ void DenseBase<Derived>::checkTransposeAliasing(const OtherDerived& other) const
412
+ {
413
+ internal::checkTransposeAliasing_impl<Derived, OtherDerived>::run(derived(), other);
414
+ }
415
+ #endif
416
+
417
+ } // end namespace Eigen
418
+
419
+ #endif // EIGEN_TRANSPOSE_H