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.
- checksums.yaml +4 -4
- data/LICENSE +22 -0
- data/README.md +21 -0
- data/ext/eigen/eigen3/COPYING.BSD +26 -0
- data/ext/eigen/eigen3/COPYING.MPL2 +373 -0
- data/ext/eigen/eigen3/COPYING.README +18 -0
- data/ext/eigen/eigen3/Eigen/Array +11 -0
- data/ext/eigen/eigen3/Eigen/Cholesky +32 -0
- data/ext/eigen/eigen3/Eigen/CholmodSupport +45 -0
- data/ext/eigen/eigen3/Eigen/Core +376 -0
- data/ext/eigen/eigen3/Eigen/Dense +7 -0
- data/ext/eigen/eigen3/Eigen/Eigen +2 -0
- data/ext/eigen/eigen3/Eigen/Eigen2Support +95 -0
- data/ext/eigen/eigen3/Eigen/Eigenvalues +48 -0
- data/ext/eigen/eigen3/Eigen/Geometry +63 -0
- data/ext/eigen/eigen3/Eigen/Householder +23 -0
- data/ext/eigen/eigen3/Eigen/IterativeLinearSolvers +40 -0
- data/ext/eigen/eigen3/Eigen/Jacobi +26 -0
- data/ext/eigen/eigen3/Eigen/LU +41 -0
- data/ext/eigen/eigen3/Eigen/LeastSquares +32 -0
- data/ext/eigen/eigen3/Eigen/MetisSupport +28 -0
- data/ext/eigen/eigen3/Eigen/PaStiXSupport +46 -0
- data/ext/eigen/eigen3/Eigen/PardisoSupport +30 -0
- data/ext/eigen/eigen3/Eigen/QR +45 -0
- data/ext/eigen/eigen3/Eigen/QtAlignedMalloc +34 -0
- data/ext/eigen/eigen3/Eigen/SPQRSupport +29 -0
- data/ext/eigen/eigen3/Eigen/SVD +37 -0
- data/ext/eigen/eigen3/Eigen/Sparse +27 -0
- data/ext/eigen/eigen3/Eigen/SparseCore +64 -0
- data/ext/eigen/eigen3/Eigen/SparseLU +49 -0
- data/ext/eigen/eigen3/Eigen/SparseQR +33 -0
- data/ext/eigen/eigen3/Eigen/StdDeque +27 -0
- data/ext/eigen/eigen3/Eigen/StdList +26 -0
- data/ext/eigen/eigen3/Eigen/StdVector +27 -0
- data/ext/eigen/eigen3/Eigen/SuperLUSupport +59 -0
- data/ext/eigen/eigen3/Eigen/UmfPackSupport +36 -0
- data/ext/eigen/eigen3/Eigen/src/Cholesky/LDLT.h +611 -0
- data/ext/eigen/eigen3/Eigen/src/Cholesky/LLT.h +498 -0
- data/ext/eigen/eigen3/Eigen/src/Cholesky/LLT_MKL.h +102 -0
- data/ext/eigen/eigen3/Eigen/src/CholmodSupport/CholmodSupport.h +607 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Array.h +323 -0
- data/ext/eigen/eigen3/Eigen/src/Core/ArrayBase.h +226 -0
- data/ext/eigen/eigen3/Eigen/src/Core/ArrayWrapper.h +264 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Assign.h +590 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Assign_MKL.h +224 -0
- data/ext/eigen/eigen3/Eigen/src/Core/BandMatrix.h +334 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Block.h +406 -0
- data/ext/eigen/eigen3/Eigen/src/Core/BooleanRedux.h +154 -0
- data/ext/eigen/eigen3/Eigen/src/Core/CommaInitializer.h +154 -0
- data/ext/eigen/eigen3/Eigen/src/Core/CoreIterators.h +61 -0
- data/ext/eigen/eigen3/Eigen/src/Core/CwiseBinaryOp.h +230 -0
- data/ext/eigen/eigen3/Eigen/src/Core/CwiseNullaryOp.h +864 -0
- data/ext/eigen/eigen3/Eigen/src/Core/CwiseUnaryOp.h +126 -0
- data/ext/eigen/eigen3/Eigen/src/Core/CwiseUnaryView.h +139 -0
- data/ext/eigen/eigen3/Eigen/src/Core/DenseBase.h +521 -0
- data/ext/eigen/eigen3/Eigen/src/Core/DenseCoeffsBase.h +754 -0
- data/ext/eigen/eigen3/Eigen/src/Core/DenseStorage.h +434 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Diagonal.h +237 -0
- data/ext/eigen/eigen3/Eigen/src/Core/DiagonalMatrix.h +313 -0
- data/ext/eigen/eigen3/Eigen/src/Core/DiagonalProduct.h +131 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Dot.h +263 -0
- data/ext/eigen/eigen3/Eigen/src/Core/EigenBase.h +131 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Flagged.h +140 -0
- data/ext/eigen/eigen3/Eigen/src/Core/ForceAlignedAccess.h +146 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Functors.h +1026 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Fuzzy.h +150 -0
- data/ext/eigen/eigen3/Eigen/src/Core/GeneralProduct.h +635 -0
- data/ext/eigen/eigen3/Eigen/src/Core/GenericPacketMath.h +350 -0
- data/ext/eigen/eigen3/Eigen/src/Core/GlobalFunctions.h +92 -0
- data/ext/eigen/eigen3/Eigen/src/Core/IO.h +250 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Map.h +192 -0
- data/ext/eigen/eigen3/Eigen/src/Core/MapBase.h +247 -0
- data/ext/eigen/eigen3/Eigen/src/Core/MathFunctions.h +768 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Matrix.h +420 -0
- data/ext/eigen/eigen3/Eigen/src/Core/MatrixBase.h +563 -0
- data/ext/eigen/eigen3/Eigen/src/Core/NestByValue.h +111 -0
- data/ext/eigen/eigen3/Eigen/src/Core/NoAlias.h +134 -0
- data/ext/eigen/eigen3/Eigen/src/Core/NumTraits.h +150 -0
- data/ext/eigen/eigen3/Eigen/src/Core/PermutationMatrix.h +721 -0
- data/ext/eigen/eigen3/Eigen/src/Core/PlainObjectBase.h +822 -0
- data/ext/eigen/eigen3/Eigen/src/Core/ProductBase.h +290 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Random.h +152 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Redux.h +409 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Ref.h +278 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Replicate.h +177 -0
- data/ext/eigen/eigen3/Eigen/src/Core/ReturnByValue.h +99 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Reverse.h +224 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Select.h +162 -0
- data/ext/eigen/eigen3/Eigen/src/Core/SelfAdjointView.h +314 -0
- data/ext/eigen/eigen3/Eigen/src/Core/SelfCwiseBinaryOp.h +191 -0
- data/ext/eigen/eigen3/Eigen/src/Core/SolveTriangular.h +260 -0
- data/ext/eigen/eigen3/Eigen/src/Core/StableNorm.h +203 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Stride.h +108 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Swap.h +126 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Transpose.h +419 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Transpositions.h +436 -0
- data/ext/eigen/eigen3/Eigen/src/Core/TriangularMatrix.h +839 -0
- data/ext/eigen/eigen3/Eigen/src/Core/VectorBlock.h +95 -0
- data/ext/eigen/eigen3/Eigen/src/Core/VectorwiseOp.h +642 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Visitor.h +237 -0
- data/ext/eigen/eigen3/Eigen/src/Core/arch/AltiVec/Complex.h +217 -0
- data/ext/eigen/eigen3/Eigen/src/Core/arch/AltiVec/PacketMath.h +501 -0
- data/ext/eigen/eigen3/Eigen/src/Core/arch/Default/Settings.h +49 -0
- data/ext/eigen/eigen3/Eigen/src/Core/arch/NEON/Complex.h +253 -0
- data/ext/eigen/eigen3/Eigen/src/Core/arch/NEON/PacketMath.h +420 -0
- data/ext/eigen/eigen3/Eigen/src/Core/arch/SSE/Complex.h +442 -0
- data/ext/eigen/eigen3/Eigen/src/Core/arch/SSE/MathFunctions.h +475 -0
- data/ext/eigen/eigen3/Eigen/src/Core/arch/SSE/PacketMath.h +649 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/CoeffBasedProduct.h +476 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralBlockPanelKernel.h +1341 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixMatrix.h +427 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +278 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_MKL.h +146 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixMatrix_MKL.h +118 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixVector.h +566 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixVector_MKL.h +131 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/Parallelizer.h +162 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +436 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointMatrixMatrix_MKL.h +295 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointMatrixVector.h +281 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointMatrixVector_MKL.h +114 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointProduct.h +123 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointRank2Update.h +93 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularMatrixMatrix.h +427 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularMatrixMatrix_MKL.h +309 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularMatrixVector.h +348 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularMatrixVector_MKL.h +247 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularSolverMatrix.h +332 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h +155 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularSolverVector.h +139 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/BlasUtil.h +264 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/Constants.h +451 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/DisableStupidWarnings.h +40 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/ForwardDeclarations.h +302 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/MKL_support.h +158 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/Macros.h +451 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/Memory.h +977 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/Meta.h +243 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/NonMPL2.h +3 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/ReenableStupidWarnings.h +14 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/StaticAssert.h +208 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/XprHelper.h +469 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Block.h +126 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Cwise.h +192 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/CwiseOperators.h +298 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/AlignedBox.h +159 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/All.h +115 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/AngleAxis.h +214 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Hyperplane.h +254 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/ParametrizedLine.h +141 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Quaternion.h +495 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Rotation2D.h +145 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/RotationBase.h +123 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Scaling.h +167 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Transform.h +786 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Translation.h +184 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/LU.h +120 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Lazy.h +71 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/LeastSquares.h +169 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Macros.h +20 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/MathFunctions.h +57 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Memory.h +45 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Meta.h +75 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Minor.h +117 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/QR.h +67 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/SVD.h +637 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/TriangularSolver.h +42 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/VectorBlock.h +94 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/ComplexEigenSolver.h +341 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/ComplexSchur.h +456 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/ComplexSchur_MKL.h +94 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/EigenSolver.h +607 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +350 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +227 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/HessenbergDecomposition.h +373 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +160 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/RealQZ.h +624 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/RealSchur.h +525 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/RealSchur_MKL.h +83 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +801 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_MKL.h +92 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/Tridiagonalization.h +557 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/AlignedBox.h +392 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/AngleAxis.h +233 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/EulerAngles.h +104 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/Homogeneous.h +307 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/Hyperplane.h +280 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/OrthoMethods.h +218 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/ParametrizedLine.h +195 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/Quaternion.h +776 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/Rotation2D.h +160 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/RotationBase.h +206 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/Scaling.h +166 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/Transform.h +1455 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/Translation.h +206 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/Umeyama.h +177 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/arch/Geometry_SSE.h +115 -0
- data/ext/eigen/eigen3/Eigen/src/Householder/BlockHouseholder.h +68 -0
- data/ext/eigen/eigen3/Eigen/src/Householder/Householder.h +171 -0
- data/ext/eigen/eigen3/Eigen/src/Householder/HouseholderSequence.h +441 -0
- data/ext/eigen/eigen3/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +149 -0
- data/ext/eigen/eigen3/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +263 -0
- data/ext/eigen/eigen3/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +256 -0
- data/ext/eigen/eigen3/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +282 -0
- data/ext/eigen/eigen3/Eigen/src/Jacobi/Jacobi.h +433 -0
- data/ext/eigen/eigen3/Eigen/src/LU/Determinant.h +101 -0
- data/ext/eigen/eigen3/Eigen/src/LU/FullPivLU.h +751 -0
- data/ext/eigen/eigen3/Eigen/src/LU/Inverse.h +400 -0
- data/ext/eigen/eigen3/Eigen/src/LU/PartialPivLU.h +509 -0
- data/ext/eigen/eigen3/Eigen/src/LU/PartialPivLU_MKL.h +85 -0
- data/ext/eigen/eigen3/Eigen/src/LU/arch/Inverse_SSE.h +329 -0
- data/ext/eigen/eigen3/Eigen/src/MetisSupport/MetisSupport.h +137 -0
- data/ext/eigen/eigen3/Eigen/src/OrderingMethods/Amd.h +444 -0
- data/ext/eigen/eigen3/Eigen/src/OrderingMethods/Eigen_Colamd.h +1850 -0
- data/ext/eigen/eigen3/Eigen/src/PaStiXSupport/PaStiXSupport.h +721 -0
- data/ext/eigen/eigen3/Eigen/src/PardisoSupport/PardisoSupport.h +592 -0
- data/ext/eigen/eigen3/Eigen/src/QR/ColPivHouseholderQR.h +580 -0
- data/ext/eigen/eigen3/Eigen/src/QR/ColPivHouseholderQR_MKL.h +99 -0
- data/ext/eigen/eigen3/Eigen/src/QR/FullPivHouseholderQR.h +622 -0
- data/ext/eigen/eigen3/Eigen/src/QR/HouseholderQR.h +388 -0
- data/ext/eigen/eigen3/Eigen/src/QR/HouseholderQR_MKL.h +71 -0
- data/ext/eigen/eigen3/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +338 -0
- data/ext/eigen/eigen3/Eigen/src/SVD/JacobiSVD.h +976 -0
- data/ext/eigen/eigen3/Eigen/src/SVD/JacobiSVD_MKL.h +92 -0
- data/ext/eigen/eigen3/Eigen/src/SVD/UpperBidiagonalization.h +148 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCholesky/SimplicialCholesky.h +671 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +199 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/AmbiVector.h +373 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/CompressedStorage.h +233 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +245 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/MappedSparseMatrix.h +181 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseBlock.h +537 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseColEtree.h +206 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +325 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +163 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseDenseProduct.h +311 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseDiagonalProduct.h +196 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseDot.h +101 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseFuzzy.h +26 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseMatrix.h +1262 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseMatrixBase.h +461 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparsePermutation.h +148 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseProduct.h +188 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseRedux.h +45 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseSelfAdjointView.h +507 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +150 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseTranspose.h +63 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseTriangularView.h +179 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseUtil.h +172 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseVector.h +448 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseView.h +99 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/TriangularSolver.h +334 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU.h +806 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLUImpl.h +66 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_Memory.h +227 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_Structs.h +111 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +298 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_Utils.h +80 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_column_bmod.h +180 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_column_dfs.h +177 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +106 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +279 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +127 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +130 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_panel_bmod.h +223 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_panel_dfs.h +258 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_pivotL.h +137 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_pruneL.h +135 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_relax_snode.h +83 -0
- data/ext/eigen/eigen3/Eigen/src/SparseQR/SparseQR.h +714 -0
- data/ext/eigen/eigen3/Eigen/src/StlSupport/StdDeque.h +134 -0
- data/ext/eigen/eigen3/Eigen/src/StlSupport/StdList.h +114 -0
- data/ext/eigen/eigen3/Eigen/src/StlSupport/StdVector.h +126 -0
- data/ext/eigen/eigen3/Eigen/src/StlSupport/details.h +84 -0
- data/ext/eigen/eigen3/Eigen/src/SuperLUSupport/SuperLUSupport.h +1026 -0
- data/ext/eigen/eigen3/Eigen/src/UmfPackSupport/UmfPackSupport.h +474 -0
- data/ext/eigen/eigen3/Eigen/src/misc/Image.h +84 -0
- data/ext/eigen/eigen3/Eigen/src/misc/Kernel.h +81 -0
- data/ext/eigen/eigen3/Eigen/src/misc/Solve.h +76 -0
- data/ext/eigen/eigen3/Eigen/src/misc/SparseSolve.h +128 -0
- data/ext/eigen/eigen3/Eigen/src/misc/blas.h +658 -0
- data/ext/eigen/eigen3/Eigen/src/plugins/ArrayCwiseBinaryOps.h +253 -0
- data/ext/eigen/eigen3/Eigen/src/plugins/ArrayCwiseUnaryOps.h +187 -0
- data/ext/eigen/eigen3/Eigen/src/plugins/BlockMethods.h +935 -0
- data/ext/eigen/eigen3/Eigen/src/plugins/CommonCwiseBinaryOps.h +46 -0
- data/ext/eigen/eigen3/Eigen/src/plugins/CommonCwiseUnaryOps.h +172 -0
- data/ext/eigen/eigen3/Eigen/src/plugins/MatrixCwiseBinaryOps.h +143 -0
- data/ext/eigen/eigen3/Eigen/src/plugins/MatrixCwiseUnaryOps.h +52 -0
- data/ext/eigen/eigen3/signature_of_eigen3_matrix_library +1 -0
- data/ext/eigen/eigen_wrap.cxx +19420 -10396
- data/ext/eigen/extconf.rb +37 -2
- data/lib/eigen.rb +146 -3
- metadata +294 -7
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
|
2
|
+
// for linear algebra.
|
|
3
|
+
//
|
|
4
|
+
// Copyright (C) 2012 Gael Guennebaud <gael.guennebaud@inria.fr>
|
|
5
|
+
//
|
|
6
|
+
// This Source Code Form is subject to the terms of the Mozilla
|
|
7
|
+
// Public License v. 2.0. If a copy of the MPL was not distributed
|
|
8
|
+
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
9
|
+
|
|
10
|
+
#ifndef EIGEN_REF_H
|
|
11
|
+
#define EIGEN_REF_H
|
|
12
|
+
|
|
13
|
+
namespace Eigen {
|
|
14
|
+
|
|
15
|
+
template<typename Derived> class RefBase;
|
|
16
|
+
template<typename PlainObjectType, int Options = 0,
|
|
17
|
+
typename StrideType = typename internal::conditional<PlainObjectType::IsVectorAtCompileTime,InnerStride<1>,OuterStride<> >::type > class Ref;
|
|
18
|
+
|
|
19
|
+
/** \class Ref
|
|
20
|
+
* \ingroup Core_Module
|
|
21
|
+
*
|
|
22
|
+
* \brief A matrix or vector expression mapping an existing expressions
|
|
23
|
+
*
|
|
24
|
+
* \tparam PlainObjectType the equivalent matrix type of the mapped data
|
|
25
|
+
* \tparam Options specifies whether the pointer is \c #Aligned, or \c #Unaligned.
|
|
26
|
+
* The default is \c #Unaligned.
|
|
27
|
+
* \tparam StrideType optionally specifies strides. By default, Ref implies a contiguous storage along the inner dimension (inner stride==1),
|
|
28
|
+
* but accept a variable outer stride (leading dimension).
|
|
29
|
+
* This can be overridden by specifying strides.
|
|
30
|
+
* The type passed here must be a specialization of the Stride template, see examples below.
|
|
31
|
+
*
|
|
32
|
+
* This class permits to write non template functions taking Eigen's object as parameters while limiting the number of copies.
|
|
33
|
+
* A Ref<> object can represent either a const expression or a l-value:
|
|
34
|
+
* \code
|
|
35
|
+
* // in-out argument:
|
|
36
|
+
* void foo1(Ref<VectorXf> x);
|
|
37
|
+
*
|
|
38
|
+
* // read-only const argument:
|
|
39
|
+
* void foo2(const Ref<const VectorXf>& x);
|
|
40
|
+
* \endcode
|
|
41
|
+
*
|
|
42
|
+
* In the in-out case, the input argument must satisfies the constraints of the actual Ref<> type, otherwise a compilation issue will be triggered.
|
|
43
|
+
* By default, a Ref<VectorXf> can reference any dense vector expression of float having a contiguous memory layout.
|
|
44
|
+
* Likewise, a Ref<MatrixXf> can reference any column major dense matrix expression of float whose column's elements are contiguously stored with
|
|
45
|
+
* the possibility to have a constant space inbetween each column, i.e.: the inner stride mmust be equal to 1, but the outer-stride (or leading dimension),
|
|
46
|
+
* can be greater than the number of rows.
|
|
47
|
+
*
|
|
48
|
+
* In the const case, if the input expression does not match the above requirement, then it is evaluated into a temporary before being passed to the function.
|
|
49
|
+
* Here are some examples:
|
|
50
|
+
* \code
|
|
51
|
+
* MatrixXf A;
|
|
52
|
+
* VectorXf a;
|
|
53
|
+
* foo1(a.head()); // OK
|
|
54
|
+
* foo1(A.col()); // OK
|
|
55
|
+
* foo1(A.row()); // compilation error because here innerstride!=1
|
|
56
|
+
* foo2(A.row()); // The row is copied into a contiguous temporary
|
|
57
|
+
* foo2(2*a); // The expression is evaluated into a temporary
|
|
58
|
+
* foo2(A.col().segment(2,4)); // No temporary
|
|
59
|
+
* \endcode
|
|
60
|
+
*
|
|
61
|
+
* The range of inputs that can be referenced without temporary can be enlarged using the last two template parameter.
|
|
62
|
+
* Here is an example accepting an innerstride!=1:
|
|
63
|
+
* \code
|
|
64
|
+
* // in-out argument:
|
|
65
|
+
* void foo3(Ref<VectorXf,0,InnerStride<> > x);
|
|
66
|
+
* foo3(A.row()); // OK
|
|
67
|
+
* \endcode
|
|
68
|
+
* The downside here is that the function foo3 might be significantly slower than foo1 because it won't be able to exploit vectorization, and will involved more
|
|
69
|
+
* expensive address computations even if the input is contiguously stored in memory. To overcome this issue, one might propose to overloads internally calling a
|
|
70
|
+
* template function, e.g.:
|
|
71
|
+
* \code
|
|
72
|
+
* // in the .h:
|
|
73
|
+
* void foo(const Ref<MatrixXf>& A);
|
|
74
|
+
* void foo(const Ref<MatrixXf,0,Stride<> >& A);
|
|
75
|
+
*
|
|
76
|
+
* // in the .cpp:
|
|
77
|
+
* template<typename TypeOfA> void foo_impl(const TypeOfA& A) {
|
|
78
|
+
* ... // crazy code goes here
|
|
79
|
+
* }
|
|
80
|
+
* void foo(const Ref<MatrixXf>& A) { foo_impl(A); }
|
|
81
|
+
* void foo(const Ref<MatrixXf,0,Stride<> >& A) { foo_impl(A); }
|
|
82
|
+
* \endcode
|
|
83
|
+
*
|
|
84
|
+
*
|
|
85
|
+
* \sa PlainObjectBase::Map(), \ref TopicStorageOrders
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
namespace internal {
|
|
89
|
+
|
|
90
|
+
template<typename _PlainObjectType, int _Options, typename _StrideType>
|
|
91
|
+
struct traits<Ref<_PlainObjectType, _Options, _StrideType> >
|
|
92
|
+
: public traits<Map<_PlainObjectType, _Options, _StrideType> >
|
|
93
|
+
{
|
|
94
|
+
typedef _PlainObjectType PlainObjectType;
|
|
95
|
+
typedef _StrideType StrideType;
|
|
96
|
+
enum {
|
|
97
|
+
Options = _Options,
|
|
98
|
+
Flags = traits<Map<_PlainObjectType, _Options, _StrideType> >::Flags | NestByRefBit
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
template<typename Derived> struct match {
|
|
102
|
+
enum {
|
|
103
|
+
HasDirectAccess = internal::has_direct_access<Derived>::ret,
|
|
104
|
+
StorageOrderMatch = PlainObjectType::IsVectorAtCompileTime || Derived::IsVectorAtCompileTime || ((PlainObjectType::Flags&RowMajorBit)==(Derived::Flags&RowMajorBit)),
|
|
105
|
+
InnerStrideMatch = int(StrideType::InnerStrideAtCompileTime)==int(Dynamic)
|
|
106
|
+
|| int(StrideType::InnerStrideAtCompileTime)==int(Derived::InnerStrideAtCompileTime)
|
|
107
|
+
|| (int(StrideType::InnerStrideAtCompileTime)==0 && int(Derived::InnerStrideAtCompileTime)==1),
|
|
108
|
+
OuterStrideMatch = Derived::IsVectorAtCompileTime
|
|
109
|
+
|| int(StrideType::OuterStrideAtCompileTime)==int(Dynamic) || int(StrideType::OuterStrideAtCompileTime)==int(Derived::OuterStrideAtCompileTime),
|
|
110
|
+
AlignmentMatch = (_Options!=Aligned) || ((PlainObjectType::Flags&AlignedBit)==0) || ((traits<Derived>::Flags&AlignedBit)==AlignedBit),
|
|
111
|
+
ScalarTypeMatch = internal::is_same<typename PlainObjectType::Scalar, typename Derived::Scalar>::value,
|
|
112
|
+
MatchAtCompileTime = HasDirectAccess && StorageOrderMatch && InnerStrideMatch && OuterStrideMatch && AlignmentMatch && ScalarTypeMatch
|
|
113
|
+
};
|
|
114
|
+
typedef typename internal::conditional<MatchAtCompileTime,internal::true_type,internal::false_type>::type type;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
template<typename Derived>
|
|
120
|
+
struct traits<RefBase<Derived> > : public traits<Derived> {};
|
|
121
|
+
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
template<typename Derived> class RefBase
|
|
125
|
+
: public MapBase<Derived>
|
|
126
|
+
{
|
|
127
|
+
typedef typename internal::traits<Derived>::PlainObjectType PlainObjectType;
|
|
128
|
+
typedef typename internal::traits<Derived>::StrideType StrideType;
|
|
129
|
+
|
|
130
|
+
public:
|
|
131
|
+
|
|
132
|
+
typedef MapBase<Derived> Base;
|
|
133
|
+
EIGEN_DENSE_PUBLIC_INTERFACE(RefBase)
|
|
134
|
+
|
|
135
|
+
inline Index innerStride() const
|
|
136
|
+
{
|
|
137
|
+
return StrideType::InnerStrideAtCompileTime != 0 ? m_stride.inner() : 1;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
inline Index outerStride() const
|
|
141
|
+
{
|
|
142
|
+
return StrideType::OuterStrideAtCompileTime != 0 ? m_stride.outer()
|
|
143
|
+
: IsVectorAtCompileTime ? this->size()
|
|
144
|
+
: int(Flags)&RowMajorBit ? this->cols()
|
|
145
|
+
: this->rows();
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
RefBase()
|
|
149
|
+
: Base(0,RowsAtCompileTime==Dynamic?0:RowsAtCompileTime,ColsAtCompileTime==Dynamic?0:ColsAtCompileTime),
|
|
150
|
+
// Stride<> does not allow default ctor for Dynamic strides, so let' initialize it with dummy values:
|
|
151
|
+
m_stride(StrideType::OuterStrideAtCompileTime==Dynamic?0:StrideType::OuterStrideAtCompileTime,
|
|
152
|
+
StrideType::InnerStrideAtCompileTime==Dynamic?0:StrideType::InnerStrideAtCompileTime)
|
|
153
|
+
{}
|
|
154
|
+
|
|
155
|
+
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(RefBase)
|
|
156
|
+
|
|
157
|
+
protected:
|
|
158
|
+
|
|
159
|
+
typedef Stride<StrideType::OuterStrideAtCompileTime,StrideType::InnerStrideAtCompileTime> StrideBase;
|
|
160
|
+
|
|
161
|
+
template<typename Expression>
|
|
162
|
+
void construct(Expression& expr)
|
|
163
|
+
{
|
|
164
|
+
if(PlainObjectType::RowsAtCompileTime==1)
|
|
165
|
+
{
|
|
166
|
+
eigen_assert(expr.rows()==1 || expr.cols()==1);
|
|
167
|
+
::new (static_cast<Base*>(this)) Base(expr.data(), 1, expr.size());
|
|
168
|
+
}
|
|
169
|
+
else if(PlainObjectType::ColsAtCompileTime==1)
|
|
170
|
+
{
|
|
171
|
+
eigen_assert(expr.rows()==1 || expr.cols()==1);
|
|
172
|
+
::new (static_cast<Base*>(this)) Base(expr.data(), expr.size(), 1);
|
|
173
|
+
}
|
|
174
|
+
else
|
|
175
|
+
::new (static_cast<Base*>(this)) Base(expr.data(), expr.rows(), expr.cols());
|
|
176
|
+
|
|
177
|
+
if(Expression::IsVectorAtCompileTime && (!PlainObjectType::IsVectorAtCompileTime) && ((Expression::Flags&RowMajorBit)!=(PlainObjectType::Flags&RowMajorBit)))
|
|
178
|
+
::new (&m_stride) StrideBase(expr.innerStride(), StrideType::InnerStrideAtCompileTime==0?0:1);
|
|
179
|
+
else
|
|
180
|
+
::new (&m_stride) StrideBase(StrideType::OuterStrideAtCompileTime==0?0:expr.outerStride(),
|
|
181
|
+
StrideType::InnerStrideAtCompileTime==0?0:expr.innerStride());
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
StrideBase m_stride;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
template<typename PlainObjectType, int Options, typename StrideType> class Ref
|
|
189
|
+
: public RefBase<Ref<PlainObjectType, Options, StrideType> >
|
|
190
|
+
{
|
|
191
|
+
private:
|
|
192
|
+
typedef internal::traits<Ref> Traits;
|
|
193
|
+
template<typename Derived>
|
|
194
|
+
inline Ref(const PlainObjectBase<Derived>& expr,
|
|
195
|
+
typename internal::enable_if<bool(Traits::template match<Derived>::MatchAtCompileTime),Derived>::type* = 0);
|
|
196
|
+
public:
|
|
197
|
+
|
|
198
|
+
typedef RefBase<Ref> Base;
|
|
199
|
+
EIGEN_DENSE_PUBLIC_INTERFACE(Ref)
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
|
203
|
+
template<typename Derived>
|
|
204
|
+
inline Ref(PlainObjectBase<Derived>& expr,
|
|
205
|
+
typename internal::enable_if<bool(Traits::template match<Derived>::MatchAtCompileTime),Derived>::type* = 0)
|
|
206
|
+
{
|
|
207
|
+
EIGEN_STATIC_ASSERT(static_cast<bool>(Traits::template match<Derived>::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH);
|
|
208
|
+
Base::construct(expr.derived());
|
|
209
|
+
}
|
|
210
|
+
template<typename Derived>
|
|
211
|
+
inline Ref(const DenseBase<Derived>& expr,
|
|
212
|
+
typename internal::enable_if<bool(Traits::template match<Derived>::MatchAtCompileTime),Derived>::type* = 0)
|
|
213
|
+
#else
|
|
214
|
+
template<typename Derived>
|
|
215
|
+
inline Ref(DenseBase<Derived>& expr)
|
|
216
|
+
#endif
|
|
217
|
+
{
|
|
218
|
+
EIGEN_STATIC_ASSERT(static_cast<bool>(internal::is_lvalue<Derived>::value), THIS_EXPRESSION_IS_NOT_A_LVALUE__IT_IS_READ_ONLY);
|
|
219
|
+
EIGEN_STATIC_ASSERT(static_cast<bool>(Traits::template match<Derived>::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH);
|
|
220
|
+
enum { THIS_EXPRESSION_IS_NOT_A_LVALUE__IT_IS_READ_ONLY = Derived::ThisConstantIsPrivateInPlainObjectBase};
|
|
221
|
+
Base::construct(expr.const_cast_derived());
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Ref)
|
|
225
|
+
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
// this is the const ref version
|
|
229
|
+
template<typename TPlainObjectType, int Options, typename StrideType> class Ref<const TPlainObjectType, Options, StrideType>
|
|
230
|
+
: public RefBase<Ref<const TPlainObjectType, Options, StrideType> >
|
|
231
|
+
{
|
|
232
|
+
typedef internal::traits<Ref> Traits;
|
|
233
|
+
public:
|
|
234
|
+
|
|
235
|
+
typedef RefBase<Ref> Base;
|
|
236
|
+
EIGEN_DENSE_PUBLIC_INTERFACE(Ref)
|
|
237
|
+
|
|
238
|
+
template<typename Derived>
|
|
239
|
+
inline Ref(const DenseBase<Derived>& expr,
|
|
240
|
+
typename internal::enable_if<bool(Traits::template match<Derived>::ScalarTypeMatch),Derived>::type* = 0)
|
|
241
|
+
{
|
|
242
|
+
// std::cout << match_helper<Derived>::HasDirectAccess << "," << match_helper<Derived>::OuterStrideMatch << "," << match_helper<Derived>::InnerStrideMatch << "\n";
|
|
243
|
+
// std::cout << int(StrideType::OuterStrideAtCompileTime) << " - " << int(Derived::OuterStrideAtCompileTime) << "\n";
|
|
244
|
+
// std::cout << int(StrideType::InnerStrideAtCompileTime) << " - " << int(Derived::InnerStrideAtCompileTime) << "\n";
|
|
245
|
+
construct(expr.derived(), typename Traits::template match<Derived>::type());
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
inline Ref(const Ref& other) : Base(other) {
|
|
249
|
+
// copy constructor shall not copy the m_object, to avoid unnecessary malloc and copy
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
template<typename OtherRef>
|
|
253
|
+
inline Ref(const RefBase<OtherRef>& other) {
|
|
254
|
+
construct(other.derived(), typename Traits::template match<OtherRef>::type());
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
protected:
|
|
258
|
+
|
|
259
|
+
template<typename Expression>
|
|
260
|
+
void construct(const Expression& expr,internal::true_type)
|
|
261
|
+
{
|
|
262
|
+
Base::construct(expr);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
template<typename Expression>
|
|
266
|
+
void construct(const Expression& expr, internal::false_type)
|
|
267
|
+
{
|
|
268
|
+
m_object.lazyAssign(expr);
|
|
269
|
+
Base::construct(m_object);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
protected:
|
|
273
|
+
TPlainObjectType m_object;
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
} // end namespace Eigen
|
|
277
|
+
|
|
278
|
+
#endif // EIGEN_REF_H
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
|
2
|
+
// for linear algebra.
|
|
3
|
+
//
|
|
4
|
+
// Copyright (C) 2009-2010 Gael Guennebaud <gael.guennebaud@inria.fr>
|
|
5
|
+
//
|
|
6
|
+
// This Source Code Form is subject to the terms of the Mozilla
|
|
7
|
+
// Public License v. 2.0. If a copy of the MPL was not distributed
|
|
8
|
+
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
9
|
+
|
|
10
|
+
#ifndef EIGEN_REPLICATE_H
|
|
11
|
+
#define EIGEN_REPLICATE_H
|
|
12
|
+
|
|
13
|
+
namespace Eigen {
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* \class Replicate
|
|
17
|
+
* \ingroup Core_Module
|
|
18
|
+
*
|
|
19
|
+
* \brief Expression of the multiple replication of a matrix or vector
|
|
20
|
+
*
|
|
21
|
+
* \param MatrixType the type of the object we are replicating
|
|
22
|
+
*
|
|
23
|
+
* This class represents an expression of the multiple replication of a matrix or vector.
|
|
24
|
+
* It is the return type of DenseBase::replicate() and most of the time
|
|
25
|
+
* this is the only way it is used.
|
|
26
|
+
*
|
|
27
|
+
* \sa DenseBase::replicate()
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
namespace internal {
|
|
31
|
+
template<typename MatrixType,int RowFactor,int ColFactor>
|
|
32
|
+
struct traits<Replicate<MatrixType,RowFactor,ColFactor> >
|
|
33
|
+
: traits<MatrixType>
|
|
34
|
+
{
|
|
35
|
+
typedef typename MatrixType::Scalar Scalar;
|
|
36
|
+
typedef typename traits<MatrixType>::StorageKind StorageKind;
|
|
37
|
+
typedef typename traits<MatrixType>::XprKind XprKind;
|
|
38
|
+
enum {
|
|
39
|
+
Factor = (RowFactor==Dynamic || ColFactor==Dynamic) ? Dynamic : RowFactor*ColFactor
|
|
40
|
+
};
|
|
41
|
+
typedef typename nested<MatrixType,Factor>::type MatrixTypeNested;
|
|
42
|
+
typedef typename remove_reference<MatrixTypeNested>::type _MatrixTypeNested;
|
|
43
|
+
enum {
|
|
44
|
+
RowsAtCompileTime = RowFactor==Dynamic || int(MatrixType::RowsAtCompileTime)==Dynamic
|
|
45
|
+
? Dynamic
|
|
46
|
+
: RowFactor * MatrixType::RowsAtCompileTime,
|
|
47
|
+
ColsAtCompileTime = ColFactor==Dynamic || int(MatrixType::ColsAtCompileTime)==Dynamic
|
|
48
|
+
? Dynamic
|
|
49
|
+
: ColFactor * MatrixType::ColsAtCompileTime,
|
|
50
|
+
//FIXME we don't propagate the max sizes !!!
|
|
51
|
+
MaxRowsAtCompileTime = RowsAtCompileTime,
|
|
52
|
+
MaxColsAtCompileTime = ColsAtCompileTime,
|
|
53
|
+
IsRowMajor = MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1 ? 1
|
|
54
|
+
: MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1 ? 0
|
|
55
|
+
: (MatrixType::Flags & RowMajorBit) ? 1 : 0,
|
|
56
|
+
Flags = (_MatrixTypeNested::Flags & HereditaryBits & ~RowMajorBit) | (IsRowMajor ? RowMajorBit : 0),
|
|
57
|
+
CoeffReadCost = _MatrixTypeNested::CoeffReadCost
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
template<typename MatrixType,int RowFactor,int ColFactor> class Replicate
|
|
63
|
+
: public internal::dense_xpr_base< Replicate<MatrixType,RowFactor,ColFactor> >::type
|
|
64
|
+
{
|
|
65
|
+
typedef typename internal::traits<Replicate>::MatrixTypeNested MatrixTypeNested;
|
|
66
|
+
typedef typename internal::traits<Replicate>::_MatrixTypeNested _MatrixTypeNested;
|
|
67
|
+
public:
|
|
68
|
+
|
|
69
|
+
typedef typename internal::dense_xpr_base<Replicate>::type Base;
|
|
70
|
+
EIGEN_DENSE_PUBLIC_INTERFACE(Replicate)
|
|
71
|
+
|
|
72
|
+
template<typename OriginalMatrixType>
|
|
73
|
+
inline explicit Replicate(const OriginalMatrixType& a_matrix)
|
|
74
|
+
: m_matrix(a_matrix), m_rowFactor(RowFactor), m_colFactor(ColFactor)
|
|
75
|
+
{
|
|
76
|
+
EIGEN_STATIC_ASSERT((internal::is_same<typename internal::remove_const<MatrixType>::type,OriginalMatrixType>::value),
|
|
77
|
+
THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE)
|
|
78
|
+
eigen_assert(RowFactor!=Dynamic && ColFactor!=Dynamic);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
template<typename OriginalMatrixType>
|
|
82
|
+
inline Replicate(const OriginalMatrixType& a_matrix, Index rowFactor, Index colFactor)
|
|
83
|
+
: m_matrix(a_matrix), m_rowFactor(rowFactor), m_colFactor(colFactor)
|
|
84
|
+
{
|
|
85
|
+
EIGEN_STATIC_ASSERT((internal::is_same<typename internal::remove_const<MatrixType>::type,OriginalMatrixType>::value),
|
|
86
|
+
THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
inline Index rows() const { return m_matrix.rows() * m_rowFactor.value(); }
|
|
90
|
+
inline Index cols() const { return m_matrix.cols() * m_colFactor.value(); }
|
|
91
|
+
|
|
92
|
+
inline Scalar coeff(Index rowId, Index colId) const
|
|
93
|
+
{
|
|
94
|
+
// try to avoid using modulo; this is a pure optimization strategy
|
|
95
|
+
const Index actual_row = internal::traits<MatrixType>::RowsAtCompileTime==1 ? 0
|
|
96
|
+
: RowFactor==1 ? rowId
|
|
97
|
+
: rowId%m_matrix.rows();
|
|
98
|
+
const Index actual_col = internal::traits<MatrixType>::ColsAtCompileTime==1 ? 0
|
|
99
|
+
: ColFactor==1 ? colId
|
|
100
|
+
: colId%m_matrix.cols();
|
|
101
|
+
|
|
102
|
+
return m_matrix.coeff(actual_row, actual_col);
|
|
103
|
+
}
|
|
104
|
+
template<int LoadMode>
|
|
105
|
+
inline PacketScalar packet(Index rowId, Index colId) const
|
|
106
|
+
{
|
|
107
|
+
const Index actual_row = internal::traits<MatrixType>::RowsAtCompileTime==1 ? 0
|
|
108
|
+
: RowFactor==1 ? rowId
|
|
109
|
+
: rowId%m_matrix.rows();
|
|
110
|
+
const Index actual_col = internal::traits<MatrixType>::ColsAtCompileTime==1 ? 0
|
|
111
|
+
: ColFactor==1 ? colId
|
|
112
|
+
: colId%m_matrix.cols();
|
|
113
|
+
|
|
114
|
+
return m_matrix.template packet<LoadMode>(actual_row, actual_col);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const _MatrixTypeNested& nestedExpression() const
|
|
118
|
+
{
|
|
119
|
+
return m_matrix;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
protected:
|
|
123
|
+
MatrixTypeNested m_matrix;
|
|
124
|
+
const internal::variable_if_dynamic<Index, RowFactor> m_rowFactor;
|
|
125
|
+
const internal::variable_if_dynamic<Index, ColFactor> m_colFactor;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* \return an expression of the replication of \c *this
|
|
130
|
+
*
|
|
131
|
+
* Example: \include MatrixBase_replicate.cpp
|
|
132
|
+
* Output: \verbinclude MatrixBase_replicate.out
|
|
133
|
+
*
|
|
134
|
+
* \sa VectorwiseOp::replicate(), DenseBase::replicate(Index,Index), class Replicate
|
|
135
|
+
*/
|
|
136
|
+
template<typename Derived>
|
|
137
|
+
template<int RowFactor, int ColFactor>
|
|
138
|
+
const Replicate<Derived,RowFactor,ColFactor>
|
|
139
|
+
DenseBase<Derived>::replicate() const
|
|
140
|
+
{
|
|
141
|
+
return Replicate<Derived,RowFactor,ColFactor>(derived());
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* \return an expression of the replication of \c *this
|
|
146
|
+
*
|
|
147
|
+
* Example: \include MatrixBase_replicate_int_int.cpp
|
|
148
|
+
* Output: \verbinclude MatrixBase_replicate_int_int.out
|
|
149
|
+
*
|
|
150
|
+
* \sa VectorwiseOp::replicate(), DenseBase::replicate<int,int>(), class Replicate
|
|
151
|
+
*/
|
|
152
|
+
template<typename Derived>
|
|
153
|
+
const typename DenseBase<Derived>::ReplicateReturnType
|
|
154
|
+
DenseBase<Derived>::replicate(Index rowFactor,Index colFactor) const
|
|
155
|
+
{
|
|
156
|
+
return Replicate<Derived,Dynamic,Dynamic>(derived(),rowFactor,colFactor);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* \return an expression of the replication of each column (or row) of \c *this
|
|
161
|
+
*
|
|
162
|
+
* Example: \include DirectionWise_replicate_int.cpp
|
|
163
|
+
* Output: \verbinclude DirectionWise_replicate_int.out
|
|
164
|
+
*
|
|
165
|
+
* \sa VectorwiseOp::replicate(), DenseBase::replicate(), class Replicate
|
|
166
|
+
*/
|
|
167
|
+
template<typename ExpressionType, int Direction>
|
|
168
|
+
const typename VectorwiseOp<ExpressionType,Direction>::ReplicateReturnType
|
|
169
|
+
VectorwiseOp<ExpressionType,Direction>::replicate(Index factor) const
|
|
170
|
+
{
|
|
171
|
+
return typename VectorwiseOp<ExpressionType,Direction>::ReplicateReturnType
|
|
172
|
+
(_expression(),Direction==Vertical?factor:1,Direction==Horizontal?factor:1);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
} // end namespace Eigen
|
|
176
|
+
|
|
177
|
+
#endif // EIGEN_REPLICATE_H
|