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.
- 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,434 @@
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
2
|
+
// for linear algebra.
|
3
|
+
//
|
4
|
+
// Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
|
5
|
+
// Copyright (C) 2006-2009 Benoit Jacob <jacob.benoit.1@gmail.com>
|
6
|
+
// Copyright (C) 2010 Hauke Heibel <hauke.heibel@gmail.com>
|
7
|
+
//
|
8
|
+
// This Source Code Form is subject to the terms of the Mozilla
|
9
|
+
// Public License v. 2.0. If a copy of the MPL was not distributed
|
10
|
+
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
11
|
+
|
12
|
+
#ifndef EIGEN_MATRIXSTORAGE_H
|
13
|
+
#define EIGEN_MATRIXSTORAGE_H
|
14
|
+
|
15
|
+
#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
|
16
|
+
#define EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN EIGEN_DENSE_STORAGE_CTOR_PLUGIN;
|
17
|
+
#else
|
18
|
+
#define EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN
|
19
|
+
#endif
|
20
|
+
|
21
|
+
namespace Eigen {
|
22
|
+
|
23
|
+
namespace internal {
|
24
|
+
|
25
|
+
struct constructor_without_unaligned_array_assert {};
|
26
|
+
|
27
|
+
template<typename T, int Size> void check_static_allocation_size()
|
28
|
+
{
|
29
|
+
// if EIGEN_STACK_ALLOCATION_LIMIT is defined to 0, then no limit
|
30
|
+
#if EIGEN_STACK_ALLOCATION_LIMIT
|
31
|
+
EIGEN_STATIC_ASSERT(Size * sizeof(T) <= EIGEN_STACK_ALLOCATION_LIMIT, OBJECT_ALLOCATED_ON_STACK_IS_TOO_BIG);
|
32
|
+
#endif
|
33
|
+
}
|
34
|
+
|
35
|
+
/** \internal
|
36
|
+
* Static array. If the MatrixOrArrayOptions require auto-alignment, the array will be automatically aligned:
|
37
|
+
* to 16 bytes boundary if the total size is a multiple of 16 bytes.
|
38
|
+
*/
|
39
|
+
template <typename T, int Size, int MatrixOrArrayOptions,
|
40
|
+
int Alignment = (MatrixOrArrayOptions&DontAlign) ? 0
|
41
|
+
: (((Size*sizeof(T))%16)==0) ? 16
|
42
|
+
: 0 >
|
43
|
+
struct plain_array
|
44
|
+
{
|
45
|
+
T array[Size];
|
46
|
+
|
47
|
+
plain_array()
|
48
|
+
{
|
49
|
+
check_static_allocation_size<T,Size>();
|
50
|
+
}
|
51
|
+
|
52
|
+
plain_array(constructor_without_unaligned_array_assert)
|
53
|
+
{
|
54
|
+
check_static_allocation_size<T,Size>();
|
55
|
+
}
|
56
|
+
};
|
57
|
+
|
58
|
+
#if defined(EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT)
|
59
|
+
#define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask)
|
60
|
+
#elif EIGEN_GNUC_AT_LEAST(4,7)
|
61
|
+
// GCC 4.7 is too aggressive in its optimizations and remove the alignement test based on the fact the array is declared to be aligned.
|
62
|
+
// See this bug report: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53900
|
63
|
+
// Hiding the origin of the array pointer behind a function argument seems to do the trick even if the function is inlined:
|
64
|
+
template<typename PtrType>
|
65
|
+
EIGEN_ALWAYS_INLINE PtrType eigen_unaligned_array_assert_workaround_gcc47(PtrType array) { return array; }
|
66
|
+
#define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask) \
|
67
|
+
eigen_assert((reinterpret_cast<size_t>(eigen_unaligned_array_assert_workaround_gcc47(array)) & sizemask) == 0 \
|
68
|
+
&& "this assertion is explained here: " \
|
69
|
+
"http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" \
|
70
|
+
" **** READ THIS WEB PAGE !!! ****");
|
71
|
+
#else
|
72
|
+
#define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask) \
|
73
|
+
eigen_assert((reinterpret_cast<size_t>(array) & sizemask) == 0 \
|
74
|
+
&& "this assertion is explained here: " \
|
75
|
+
"http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" \
|
76
|
+
" **** READ THIS WEB PAGE !!! ****");
|
77
|
+
#endif
|
78
|
+
|
79
|
+
template <typename T, int Size, int MatrixOrArrayOptions>
|
80
|
+
struct plain_array<T, Size, MatrixOrArrayOptions, 16>
|
81
|
+
{
|
82
|
+
EIGEN_USER_ALIGN16 T array[Size];
|
83
|
+
|
84
|
+
plain_array()
|
85
|
+
{
|
86
|
+
EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(0xf);
|
87
|
+
check_static_allocation_size<T,Size>();
|
88
|
+
}
|
89
|
+
|
90
|
+
plain_array(constructor_without_unaligned_array_assert)
|
91
|
+
{
|
92
|
+
check_static_allocation_size<T,Size>();
|
93
|
+
}
|
94
|
+
};
|
95
|
+
|
96
|
+
template <typename T, int MatrixOrArrayOptions, int Alignment>
|
97
|
+
struct plain_array<T, 0, MatrixOrArrayOptions, Alignment>
|
98
|
+
{
|
99
|
+
EIGEN_USER_ALIGN16 T array[1];
|
100
|
+
plain_array() {}
|
101
|
+
plain_array(constructor_without_unaligned_array_assert) {}
|
102
|
+
};
|
103
|
+
|
104
|
+
} // end namespace internal
|
105
|
+
|
106
|
+
/** \internal
|
107
|
+
*
|
108
|
+
* \class DenseStorage
|
109
|
+
* \ingroup Core_Module
|
110
|
+
*
|
111
|
+
* \brief Stores the data of a matrix
|
112
|
+
*
|
113
|
+
* This class stores the data of fixed-size, dynamic-size or mixed matrices
|
114
|
+
* in a way as compact as possible.
|
115
|
+
*
|
116
|
+
* \sa Matrix
|
117
|
+
*/
|
118
|
+
template<typename T, int Size, int _Rows, int _Cols, int _Options> class DenseStorage;
|
119
|
+
|
120
|
+
// purely fixed-size matrix
|
121
|
+
template<typename T, int Size, int _Rows, int _Cols, int _Options> class DenseStorage
|
122
|
+
{
|
123
|
+
internal::plain_array<T,Size,_Options> m_data;
|
124
|
+
public:
|
125
|
+
DenseStorage() {}
|
126
|
+
DenseStorage(internal::constructor_without_unaligned_array_assert)
|
127
|
+
: m_data(internal::constructor_without_unaligned_array_assert()) {}
|
128
|
+
DenseStorage(const DenseStorage& other) : m_data(other.m_data) {}
|
129
|
+
DenseStorage& operator=(const DenseStorage& other)
|
130
|
+
{
|
131
|
+
if (this != &other) m_data = other.m_data;
|
132
|
+
return *this;
|
133
|
+
}
|
134
|
+
DenseStorage(DenseIndex,DenseIndex,DenseIndex) {}
|
135
|
+
void swap(DenseStorage& other) { std::swap(m_data,other.m_data); }
|
136
|
+
static DenseIndex rows(void) {return _Rows;}
|
137
|
+
static DenseIndex cols(void) {return _Cols;}
|
138
|
+
void conservativeResize(DenseIndex,DenseIndex,DenseIndex) {}
|
139
|
+
void resize(DenseIndex,DenseIndex,DenseIndex) {}
|
140
|
+
const T *data() const { return m_data.array; }
|
141
|
+
T *data() { return m_data.array; }
|
142
|
+
};
|
143
|
+
|
144
|
+
// null matrix
|
145
|
+
template<typename T, int _Rows, int _Cols, int _Options> class DenseStorage<T, 0, _Rows, _Cols, _Options>
|
146
|
+
{
|
147
|
+
public:
|
148
|
+
DenseStorage() {}
|
149
|
+
DenseStorage(internal::constructor_without_unaligned_array_assert) {}
|
150
|
+
DenseStorage(const DenseStorage&) {}
|
151
|
+
DenseStorage& operator=(const DenseStorage&) { return *this; }
|
152
|
+
DenseStorage(DenseIndex,DenseIndex,DenseIndex) {}
|
153
|
+
void swap(DenseStorage& ) {}
|
154
|
+
static DenseIndex rows(void) {return _Rows;}
|
155
|
+
static DenseIndex cols(void) {return _Cols;}
|
156
|
+
void conservativeResize(DenseIndex,DenseIndex,DenseIndex) {}
|
157
|
+
void resize(DenseIndex,DenseIndex,DenseIndex) {}
|
158
|
+
const T *data() const { return 0; }
|
159
|
+
T *data() { return 0; }
|
160
|
+
};
|
161
|
+
|
162
|
+
// more specializations for null matrices; these are necessary to resolve ambiguities
|
163
|
+
template<typename T, int _Options> class DenseStorage<T, 0, Dynamic, Dynamic, _Options>
|
164
|
+
: public DenseStorage<T, 0, 0, 0, _Options> { };
|
165
|
+
|
166
|
+
template<typename T, int _Rows, int _Options> class DenseStorage<T, 0, _Rows, Dynamic, _Options>
|
167
|
+
: public DenseStorage<T, 0, 0, 0, _Options> { };
|
168
|
+
|
169
|
+
template<typename T, int _Cols, int _Options> class DenseStorage<T, 0, Dynamic, _Cols, _Options>
|
170
|
+
: public DenseStorage<T, 0, 0, 0, _Options> { };
|
171
|
+
|
172
|
+
// dynamic-size matrix with fixed-size storage
|
173
|
+
template<typename T, int Size, int _Options> class DenseStorage<T, Size, Dynamic, Dynamic, _Options>
|
174
|
+
{
|
175
|
+
internal::plain_array<T,Size,_Options> m_data;
|
176
|
+
DenseIndex m_rows;
|
177
|
+
DenseIndex m_cols;
|
178
|
+
public:
|
179
|
+
DenseStorage() : m_rows(0), m_cols(0) {}
|
180
|
+
DenseStorage(internal::constructor_without_unaligned_array_assert)
|
181
|
+
: m_data(internal::constructor_without_unaligned_array_assert()), m_rows(0), m_cols(0) {}
|
182
|
+
DenseStorage(const DenseStorage& other) : m_data(other.m_data), m_rows(other.m_rows), m_cols(other.m_cols) {}
|
183
|
+
DenseStorage& operator=(const DenseStorage& other)
|
184
|
+
{
|
185
|
+
if (this != &other)
|
186
|
+
{
|
187
|
+
m_data = other.m_data;
|
188
|
+
m_rows = other.m_rows;
|
189
|
+
m_cols = other.m_cols;
|
190
|
+
}
|
191
|
+
return *this;
|
192
|
+
}
|
193
|
+
DenseStorage(DenseIndex, DenseIndex nbRows, DenseIndex nbCols) : m_rows(nbRows), m_cols(nbCols) {}
|
194
|
+
void swap(DenseStorage& other)
|
195
|
+
{ std::swap(m_data,other.m_data); std::swap(m_rows,other.m_rows); std::swap(m_cols,other.m_cols); }
|
196
|
+
DenseIndex rows() const {return m_rows;}
|
197
|
+
DenseIndex cols() const {return m_cols;}
|
198
|
+
void conservativeResize(DenseIndex, DenseIndex nbRows, DenseIndex nbCols) { m_rows = nbRows; m_cols = nbCols; }
|
199
|
+
void resize(DenseIndex, DenseIndex nbRows, DenseIndex nbCols) { m_rows = nbRows; m_cols = nbCols; }
|
200
|
+
const T *data() const { return m_data.array; }
|
201
|
+
T *data() { return m_data.array; }
|
202
|
+
};
|
203
|
+
|
204
|
+
// dynamic-size matrix with fixed-size storage and fixed width
|
205
|
+
template<typename T, int Size, int _Cols, int _Options> class DenseStorage<T, Size, Dynamic, _Cols, _Options>
|
206
|
+
{
|
207
|
+
internal::plain_array<T,Size,_Options> m_data;
|
208
|
+
DenseIndex m_rows;
|
209
|
+
public:
|
210
|
+
DenseStorage() : m_rows(0) {}
|
211
|
+
DenseStorage(internal::constructor_without_unaligned_array_assert)
|
212
|
+
: m_data(internal::constructor_without_unaligned_array_assert()), m_rows(0) {}
|
213
|
+
DenseStorage(const DenseStorage& other) : m_data(other.m_data), m_rows(other.m_rows) {}
|
214
|
+
DenseStorage& operator=(const DenseStorage& other)
|
215
|
+
{
|
216
|
+
if (this != &other)
|
217
|
+
{
|
218
|
+
m_data = other.m_data;
|
219
|
+
m_rows = other.m_rows;
|
220
|
+
}
|
221
|
+
return *this;
|
222
|
+
}
|
223
|
+
DenseStorage(DenseIndex, DenseIndex nbRows, DenseIndex) : m_rows(nbRows) {}
|
224
|
+
void swap(DenseStorage& other) { std::swap(m_data,other.m_data); std::swap(m_rows,other.m_rows); }
|
225
|
+
DenseIndex rows(void) const {return m_rows;}
|
226
|
+
DenseIndex cols(void) const {return _Cols;}
|
227
|
+
void conservativeResize(DenseIndex, DenseIndex nbRows, DenseIndex) { m_rows = nbRows; }
|
228
|
+
void resize(DenseIndex, DenseIndex nbRows, DenseIndex) { m_rows = nbRows; }
|
229
|
+
const T *data() const { return m_data.array; }
|
230
|
+
T *data() { return m_data.array; }
|
231
|
+
};
|
232
|
+
|
233
|
+
// dynamic-size matrix with fixed-size storage and fixed height
|
234
|
+
template<typename T, int Size, int _Rows, int _Options> class DenseStorage<T, Size, _Rows, Dynamic, _Options>
|
235
|
+
{
|
236
|
+
internal::plain_array<T,Size,_Options> m_data;
|
237
|
+
DenseIndex m_cols;
|
238
|
+
public:
|
239
|
+
DenseStorage() : m_cols(0) {}
|
240
|
+
DenseStorage(internal::constructor_without_unaligned_array_assert)
|
241
|
+
: m_data(internal::constructor_without_unaligned_array_assert()), m_cols(0) {}
|
242
|
+
DenseStorage(const DenseStorage& other) : m_data(other.m_data), m_cols(other.m_cols) {}
|
243
|
+
DenseStorage& operator=(const DenseStorage& other)
|
244
|
+
{
|
245
|
+
if (this != &other)
|
246
|
+
{
|
247
|
+
m_data = other.m_data;
|
248
|
+
m_cols = other.m_cols;
|
249
|
+
}
|
250
|
+
return *this;
|
251
|
+
}
|
252
|
+
DenseStorage(DenseIndex, DenseIndex, DenseIndex nbCols) : m_cols(nbCols) {}
|
253
|
+
void swap(DenseStorage& other) { std::swap(m_data,other.m_data); std::swap(m_cols,other.m_cols); }
|
254
|
+
DenseIndex rows(void) const {return _Rows;}
|
255
|
+
DenseIndex cols(void) const {return m_cols;}
|
256
|
+
void conservativeResize(DenseIndex, DenseIndex, DenseIndex nbCols) { m_cols = nbCols; }
|
257
|
+
void resize(DenseIndex, DenseIndex, DenseIndex nbCols) { m_cols = nbCols; }
|
258
|
+
const T *data() const { return m_data.array; }
|
259
|
+
T *data() { return m_data.array; }
|
260
|
+
};
|
261
|
+
|
262
|
+
// purely dynamic matrix.
|
263
|
+
template<typename T, int _Options> class DenseStorage<T, Dynamic, Dynamic, Dynamic, _Options>
|
264
|
+
{
|
265
|
+
T *m_data;
|
266
|
+
DenseIndex m_rows;
|
267
|
+
DenseIndex m_cols;
|
268
|
+
public:
|
269
|
+
DenseStorage() : m_data(0), m_rows(0), m_cols(0) {}
|
270
|
+
DenseStorage(internal::constructor_without_unaligned_array_assert)
|
271
|
+
: m_data(0), m_rows(0), m_cols(0) {}
|
272
|
+
DenseStorage(DenseIndex size, DenseIndex nbRows, DenseIndex nbCols)
|
273
|
+
: m_data(internal::conditional_aligned_new_auto<T,(_Options&DontAlign)==0>(size)), m_rows(nbRows), m_cols(nbCols)
|
274
|
+
{ EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN }
|
275
|
+
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
|
276
|
+
DenseStorage(DenseStorage&& other)
|
277
|
+
: m_data(std::move(other.m_data))
|
278
|
+
, m_rows(std::move(other.m_rows))
|
279
|
+
, m_cols(std::move(other.m_cols))
|
280
|
+
{
|
281
|
+
other.m_data = nullptr;
|
282
|
+
}
|
283
|
+
DenseStorage& operator=(DenseStorage&& other)
|
284
|
+
{
|
285
|
+
using std::swap;
|
286
|
+
swap(m_data, other.m_data);
|
287
|
+
swap(m_rows, other.m_rows);
|
288
|
+
swap(m_cols, other.m_cols);
|
289
|
+
return *this;
|
290
|
+
}
|
291
|
+
#endif
|
292
|
+
~DenseStorage() { internal::conditional_aligned_delete_auto<T,(_Options&DontAlign)==0>(m_data, m_rows*m_cols); }
|
293
|
+
void swap(DenseStorage& other)
|
294
|
+
{ std::swap(m_data,other.m_data); std::swap(m_rows,other.m_rows); std::swap(m_cols,other.m_cols); }
|
295
|
+
DenseIndex rows(void) const {return m_rows;}
|
296
|
+
DenseIndex cols(void) const {return m_cols;}
|
297
|
+
void conservativeResize(DenseIndex size, DenseIndex nbRows, DenseIndex nbCols)
|
298
|
+
{
|
299
|
+
m_data = internal::conditional_aligned_realloc_new_auto<T,(_Options&DontAlign)==0>(m_data, size, m_rows*m_cols);
|
300
|
+
m_rows = nbRows;
|
301
|
+
m_cols = nbCols;
|
302
|
+
}
|
303
|
+
void resize(DenseIndex size, DenseIndex nbRows, DenseIndex nbCols)
|
304
|
+
{
|
305
|
+
if(size != m_rows*m_cols)
|
306
|
+
{
|
307
|
+
internal::conditional_aligned_delete_auto<T,(_Options&DontAlign)==0>(m_data, m_rows*m_cols);
|
308
|
+
if (size)
|
309
|
+
m_data = internal::conditional_aligned_new_auto<T,(_Options&DontAlign)==0>(size);
|
310
|
+
else
|
311
|
+
m_data = 0;
|
312
|
+
EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN
|
313
|
+
}
|
314
|
+
m_rows = nbRows;
|
315
|
+
m_cols = nbCols;
|
316
|
+
}
|
317
|
+
const T *data() const { return m_data; }
|
318
|
+
T *data() { return m_data; }
|
319
|
+
private:
|
320
|
+
DenseStorage(const DenseStorage&);
|
321
|
+
DenseStorage& operator=(const DenseStorage&);
|
322
|
+
};
|
323
|
+
|
324
|
+
// matrix with dynamic width and fixed height (so that matrix has dynamic size).
|
325
|
+
template<typename T, int _Rows, int _Options> class DenseStorage<T, Dynamic, _Rows, Dynamic, _Options>
|
326
|
+
{
|
327
|
+
T *m_data;
|
328
|
+
DenseIndex m_cols;
|
329
|
+
public:
|
330
|
+
DenseStorage() : m_data(0), m_cols(0) {}
|
331
|
+
DenseStorage(internal::constructor_without_unaligned_array_assert) : m_data(0), m_cols(0) {}
|
332
|
+
DenseStorage(DenseIndex size, DenseIndex, DenseIndex nbCols) : m_data(internal::conditional_aligned_new_auto<T,(_Options&DontAlign)==0>(size)), m_cols(nbCols)
|
333
|
+
{ EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN }
|
334
|
+
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
|
335
|
+
DenseStorage(DenseStorage&& other)
|
336
|
+
: m_data(std::move(other.m_data))
|
337
|
+
, m_cols(std::move(other.m_cols))
|
338
|
+
{
|
339
|
+
other.m_data = nullptr;
|
340
|
+
}
|
341
|
+
DenseStorage& operator=(DenseStorage&& other)
|
342
|
+
{
|
343
|
+
using std::swap;
|
344
|
+
swap(m_data, other.m_data);
|
345
|
+
swap(m_cols, other.m_cols);
|
346
|
+
return *this;
|
347
|
+
}
|
348
|
+
#endif
|
349
|
+
~DenseStorage() { internal::conditional_aligned_delete_auto<T,(_Options&DontAlign)==0>(m_data, _Rows*m_cols); }
|
350
|
+
void swap(DenseStorage& other) { std::swap(m_data,other.m_data); std::swap(m_cols,other.m_cols); }
|
351
|
+
static DenseIndex rows(void) {return _Rows;}
|
352
|
+
DenseIndex cols(void) const {return m_cols;}
|
353
|
+
void conservativeResize(DenseIndex size, DenseIndex, DenseIndex nbCols)
|
354
|
+
{
|
355
|
+
m_data = internal::conditional_aligned_realloc_new_auto<T,(_Options&DontAlign)==0>(m_data, size, _Rows*m_cols);
|
356
|
+
m_cols = nbCols;
|
357
|
+
}
|
358
|
+
EIGEN_STRONG_INLINE void resize(DenseIndex size, DenseIndex, DenseIndex nbCols)
|
359
|
+
{
|
360
|
+
if(size != _Rows*m_cols)
|
361
|
+
{
|
362
|
+
internal::conditional_aligned_delete_auto<T,(_Options&DontAlign)==0>(m_data, _Rows*m_cols);
|
363
|
+
if (size)
|
364
|
+
m_data = internal::conditional_aligned_new_auto<T,(_Options&DontAlign)==0>(size);
|
365
|
+
else
|
366
|
+
m_data = 0;
|
367
|
+
EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN
|
368
|
+
}
|
369
|
+
m_cols = nbCols;
|
370
|
+
}
|
371
|
+
const T *data() const { return m_data; }
|
372
|
+
T *data() { return m_data; }
|
373
|
+
private:
|
374
|
+
DenseStorage(const DenseStorage&);
|
375
|
+
DenseStorage& operator=(const DenseStorage&);
|
376
|
+
};
|
377
|
+
|
378
|
+
// matrix with dynamic height and fixed width (so that matrix has dynamic size).
|
379
|
+
template<typename T, int _Cols, int _Options> class DenseStorage<T, Dynamic, Dynamic, _Cols, _Options>
|
380
|
+
{
|
381
|
+
T *m_data;
|
382
|
+
DenseIndex m_rows;
|
383
|
+
public:
|
384
|
+
DenseStorage() : m_data(0), m_rows(0) {}
|
385
|
+
DenseStorage(internal::constructor_without_unaligned_array_assert) : m_data(0), m_rows(0) {}
|
386
|
+
DenseStorage(DenseIndex size, DenseIndex nbRows, DenseIndex) : m_data(internal::conditional_aligned_new_auto<T,(_Options&DontAlign)==0>(size)), m_rows(nbRows)
|
387
|
+
{ EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN }
|
388
|
+
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
|
389
|
+
DenseStorage(DenseStorage&& other)
|
390
|
+
: m_data(std::move(other.m_data))
|
391
|
+
, m_rows(std::move(other.m_rows))
|
392
|
+
{
|
393
|
+
other.m_data = nullptr;
|
394
|
+
}
|
395
|
+
DenseStorage& operator=(DenseStorage&& other)
|
396
|
+
{
|
397
|
+
using std::swap;
|
398
|
+
swap(m_data, other.m_data);
|
399
|
+
swap(m_rows, other.m_rows);
|
400
|
+
return *this;
|
401
|
+
}
|
402
|
+
#endif
|
403
|
+
~DenseStorage() { internal::conditional_aligned_delete_auto<T,(_Options&DontAlign)==0>(m_data, _Cols*m_rows); }
|
404
|
+
void swap(DenseStorage& other) { std::swap(m_data,other.m_data); std::swap(m_rows,other.m_rows); }
|
405
|
+
DenseIndex rows(void) const {return m_rows;}
|
406
|
+
static DenseIndex cols(void) {return _Cols;}
|
407
|
+
void conservativeResize(DenseIndex size, DenseIndex nbRows, DenseIndex)
|
408
|
+
{
|
409
|
+
m_data = internal::conditional_aligned_realloc_new_auto<T,(_Options&DontAlign)==0>(m_data, size, m_rows*_Cols);
|
410
|
+
m_rows = nbRows;
|
411
|
+
}
|
412
|
+
EIGEN_STRONG_INLINE void resize(DenseIndex size, DenseIndex nbRows, DenseIndex)
|
413
|
+
{
|
414
|
+
if(size != m_rows*_Cols)
|
415
|
+
{
|
416
|
+
internal::conditional_aligned_delete_auto<T,(_Options&DontAlign)==0>(m_data, _Cols*m_rows);
|
417
|
+
if (size)
|
418
|
+
m_data = internal::conditional_aligned_new_auto<T,(_Options&DontAlign)==0>(size);
|
419
|
+
else
|
420
|
+
m_data = 0;
|
421
|
+
EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN
|
422
|
+
}
|
423
|
+
m_rows = nbRows;
|
424
|
+
}
|
425
|
+
const T *data() const { return m_data; }
|
426
|
+
T *data() { return m_data; }
|
427
|
+
private:
|
428
|
+
DenseStorage(const DenseStorage&);
|
429
|
+
DenseStorage& operator=(const DenseStorage&);
|
430
|
+
};
|
431
|
+
|
432
|
+
} // end namespace Eigen
|
433
|
+
|
434
|
+
#endif // EIGEN_MATRIX_H
|
@@ -0,0 +1,237 @@
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
2
|
+
// for linear algebra.
|
3
|
+
//
|
4
|
+
// Copyright (C) 2007-2009 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_DIAGONAL_H
|
12
|
+
#define EIGEN_DIAGONAL_H
|
13
|
+
|
14
|
+
namespace Eigen {
|
15
|
+
|
16
|
+
/** \class Diagonal
|
17
|
+
* \ingroup Core_Module
|
18
|
+
*
|
19
|
+
* \brief Expression of a diagonal/subdiagonal/superdiagonal in a matrix
|
20
|
+
*
|
21
|
+
* \param MatrixType the type of the object in which we are taking a sub/main/super diagonal
|
22
|
+
* \param DiagIndex the index of the sub/super diagonal. The default is 0 and it means the main diagonal.
|
23
|
+
* A positive value means a superdiagonal, a negative value means a subdiagonal.
|
24
|
+
* You can also use Dynamic so the index can be set at runtime.
|
25
|
+
*
|
26
|
+
* The matrix is not required to be square.
|
27
|
+
*
|
28
|
+
* This class represents an expression of the main diagonal, or any sub/super diagonal
|
29
|
+
* of a square matrix. It is the return type of MatrixBase::diagonal() and MatrixBase::diagonal(Index) and most of the
|
30
|
+
* time this is the only way it is used.
|
31
|
+
*
|
32
|
+
* \sa MatrixBase::diagonal(), MatrixBase::diagonal(Index)
|
33
|
+
*/
|
34
|
+
|
35
|
+
namespace internal {
|
36
|
+
template<typename MatrixType, int DiagIndex>
|
37
|
+
struct traits<Diagonal<MatrixType,DiagIndex> >
|
38
|
+
: traits<MatrixType>
|
39
|
+
{
|
40
|
+
typedef typename nested<MatrixType>::type MatrixTypeNested;
|
41
|
+
typedef typename remove_reference<MatrixTypeNested>::type _MatrixTypeNested;
|
42
|
+
typedef typename MatrixType::StorageKind StorageKind;
|
43
|
+
enum {
|
44
|
+
RowsAtCompileTime = (int(DiagIndex) == DynamicIndex || int(MatrixType::SizeAtCompileTime) == Dynamic) ? Dynamic
|
45
|
+
: (EIGEN_PLAIN_ENUM_MIN(MatrixType::RowsAtCompileTime - EIGEN_PLAIN_ENUM_MAX(-DiagIndex, 0),
|
46
|
+
MatrixType::ColsAtCompileTime - EIGEN_PLAIN_ENUM_MAX( DiagIndex, 0))),
|
47
|
+
ColsAtCompileTime = 1,
|
48
|
+
MaxRowsAtCompileTime = int(MatrixType::MaxSizeAtCompileTime) == Dynamic ? Dynamic
|
49
|
+
: DiagIndex == DynamicIndex ? EIGEN_SIZE_MIN_PREFER_FIXED(MatrixType::MaxRowsAtCompileTime,
|
50
|
+
MatrixType::MaxColsAtCompileTime)
|
51
|
+
: (EIGEN_PLAIN_ENUM_MIN(MatrixType::MaxRowsAtCompileTime - EIGEN_PLAIN_ENUM_MAX(-DiagIndex, 0),
|
52
|
+
MatrixType::MaxColsAtCompileTime - EIGEN_PLAIN_ENUM_MAX( DiagIndex, 0))),
|
53
|
+
MaxColsAtCompileTime = 1,
|
54
|
+
MaskLvalueBit = is_lvalue<MatrixType>::value ? LvalueBit : 0,
|
55
|
+
Flags = (unsigned int)_MatrixTypeNested::Flags & (HereditaryBits | LinearAccessBit | MaskLvalueBit | DirectAccessBit) & ~RowMajorBit,
|
56
|
+
CoeffReadCost = _MatrixTypeNested::CoeffReadCost,
|
57
|
+
MatrixTypeOuterStride = outer_stride_at_compile_time<MatrixType>::ret,
|
58
|
+
InnerStrideAtCompileTime = MatrixTypeOuterStride == Dynamic ? Dynamic : MatrixTypeOuterStride+1,
|
59
|
+
OuterStrideAtCompileTime = 0
|
60
|
+
};
|
61
|
+
};
|
62
|
+
}
|
63
|
+
|
64
|
+
template<typename MatrixType, int _DiagIndex> class Diagonal
|
65
|
+
: public internal::dense_xpr_base< Diagonal<MatrixType,_DiagIndex> >::type
|
66
|
+
{
|
67
|
+
public:
|
68
|
+
|
69
|
+
enum { DiagIndex = _DiagIndex };
|
70
|
+
typedef typename internal::dense_xpr_base<Diagonal>::type Base;
|
71
|
+
EIGEN_DENSE_PUBLIC_INTERFACE(Diagonal)
|
72
|
+
|
73
|
+
inline Diagonal(MatrixType& matrix, Index a_index = DiagIndex) : m_matrix(matrix), m_index(a_index) {}
|
74
|
+
|
75
|
+
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Diagonal)
|
76
|
+
|
77
|
+
inline Index rows() const
|
78
|
+
{ return m_index.value()<0 ? (std::min<Index>)(m_matrix.cols(),m_matrix.rows()+m_index.value()) : (std::min<Index>)(m_matrix.rows(),m_matrix.cols()-m_index.value()); }
|
79
|
+
|
80
|
+
inline Index cols() const { return 1; }
|
81
|
+
|
82
|
+
inline Index innerStride() const
|
83
|
+
{
|
84
|
+
return m_matrix.outerStride() + 1;
|
85
|
+
}
|
86
|
+
|
87
|
+
inline Index outerStride() const
|
88
|
+
{
|
89
|
+
return 0;
|
90
|
+
}
|
91
|
+
|
92
|
+
typedef typename internal::conditional<
|
93
|
+
internal::is_lvalue<MatrixType>::value,
|
94
|
+
Scalar,
|
95
|
+
const Scalar
|
96
|
+
>::type ScalarWithConstIfNotLvalue;
|
97
|
+
|
98
|
+
inline ScalarWithConstIfNotLvalue* data() { return &(m_matrix.const_cast_derived().coeffRef(rowOffset(), colOffset())); }
|
99
|
+
inline const Scalar* data() const { return &(m_matrix.const_cast_derived().coeffRef(rowOffset(), colOffset())); }
|
100
|
+
|
101
|
+
inline Scalar& coeffRef(Index row, Index)
|
102
|
+
{
|
103
|
+
EIGEN_STATIC_ASSERT_LVALUE(MatrixType)
|
104
|
+
return m_matrix.const_cast_derived().coeffRef(row+rowOffset(), row+colOffset());
|
105
|
+
}
|
106
|
+
|
107
|
+
inline const Scalar& coeffRef(Index row, Index) const
|
108
|
+
{
|
109
|
+
return m_matrix.const_cast_derived().coeffRef(row+rowOffset(), row+colOffset());
|
110
|
+
}
|
111
|
+
|
112
|
+
inline CoeffReturnType coeff(Index row, Index) const
|
113
|
+
{
|
114
|
+
return m_matrix.coeff(row+rowOffset(), row+colOffset());
|
115
|
+
}
|
116
|
+
|
117
|
+
inline Scalar& coeffRef(Index idx)
|
118
|
+
{
|
119
|
+
EIGEN_STATIC_ASSERT_LVALUE(MatrixType)
|
120
|
+
return m_matrix.const_cast_derived().coeffRef(idx+rowOffset(), idx+colOffset());
|
121
|
+
}
|
122
|
+
|
123
|
+
inline const Scalar& coeffRef(Index idx) const
|
124
|
+
{
|
125
|
+
return m_matrix.const_cast_derived().coeffRef(idx+rowOffset(), idx+colOffset());
|
126
|
+
}
|
127
|
+
|
128
|
+
inline CoeffReturnType coeff(Index idx) const
|
129
|
+
{
|
130
|
+
return m_matrix.coeff(idx+rowOffset(), idx+colOffset());
|
131
|
+
}
|
132
|
+
|
133
|
+
const typename internal::remove_all<typename MatrixType::Nested>::type&
|
134
|
+
nestedExpression() const
|
135
|
+
{
|
136
|
+
return m_matrix;
|
137
|
+
}
|
138
|
+
|
139
|
+
int index() const
|
140
|
+
{
|
141
|
+
return m_index.value();
|
142
|
+
}
|
143
|
+
|
144
|
+
protected:
|
145
|
+
typename MatrixType::Nested m_matrix;
|
146
|
+
const internal::variable_if_dynamicindex<Index, DiagIndex> m_index;
|
147
|
+
|
148
|
+
private:
|
149
|
+
// some compilers may fail to optimize std::max etc in case of compile-time constants...
|
150
|
+
EIGEN_STRONG_INLINE Index absDiagIndex() const { return m_index.value()>0 ? m_index.value() : -m_index.value(); }
|
151
|
+
EIGEN_STRONG_INLINE Index rowOffset() const { return m_index.value()>0 ? 0 : -m_index.value(); }
|
152
|
+
EIGEN_STRONG_INLINE Index colOffset() const { return m_index.value()>0 ? m_index.value() : 0; }
|
153
|
+
// triger a compile time error is someone try to call packet
|
154
|
+
template<int LoadMode> typename MatrixType::PacketReturnType packet(Index) const;
|
155
|
+
template<int LoadMode> typename MatrixType::PacketReturnType packet(Index,Index) const;
|
156
|
+
};
|
157
|
+
|
158
|
+
/** \returns an expression of the main diagonal of the matrix \c *this
|
159
|
+
*
|
160
|
+
* \c *this is not required to be square.
|
161
|
+
*
|
162
|
+
* Example: \include MatrixBase_diagonal.cpp
|
163
|
+
* Output: \verbinclude MatrixBase_diagonal.out
|
164
|
+
*
|
165
|
+
* \sa class Diagonal */
|
166
|
+
template<typename Derived>
|
167
|
+
inline typename MatrixBase<Derived>::DiagonalReturnType
|
168
|
+
MatrixBase<Derived>::diagonal()
|
169
|
+
{
|
170
|
+
return derived();
|
171
|
+
}
|
172
|
+
|
173
|
+
/** This is the const version of diagonal(). */
|
174
|
+
template<typename Derived>
|
175
|
+
inline typename MatrixBase<Derived>::ConstDiagonalReturnType
|
176
|
+
MatrixBase<Derived>::diagonal() const
|
177
|
+
{
|
178
|
+
return ConstDiagonalReturnType(derived());
|
179
|
+
}
|
180
|
+
|
181
|
+
/** \returns an expression of the \a DiagIndex-th sub or super diagonal of the matrix \c *this
|
182
|
+
*
|
183
|
+
* \c *this is not required to be square.
|
184
|
+
*
|
185
|
+
* The template parameter \a DiagIndex represent a super diagonal if \a DiagIndex > 0
|
186
|
+
* and a sub diagonal otherwise. \a DiagIndex == 0 is equivalent to the main diagonal.
|
187
|
+
*
|
188
|
+
* Example: \include MatrixBase_diagonal_int.cpp
|
189
|
+
* Output: \verbinclude MatrixBase_diagonal_int.out
|
190
|
+
*
|
191
|
+
* \sa MatrixBase::diagonal(), class Diagonal */
|
192
|
+
template<typename Derived>
|
193
|
+
inline typename MatrixBase<Derived>::DiagonalDynamicIndexReturnType
|
194
|
+
MatrixBase<Derived>::diagonal(Index index)
|
195
|
+
{
|
196
|
+
return DiagonalDynamicIndexReturnType(derived(), index);
|
197
|
+
}
|
198
|
+
|
199
|
+
/** This is the const version of diagonal(Index). */
|
200
|
+
template<typename Derived>
|
201
|
+
inline typename MatrixBase<Derived>::ConstDiagonalDynamicIndexReturnType
|
202
|
+
MatrixBase<Derived>::diagonal(Index index) const
|
203
|
+
{
|
204
|
+
return ConstDiagonalDynamicIndexReturnType(derived(), index);
|
205
|
+
}
|
206
|
+
|
207
|
+
/** \returns an expression of the \a DiagIndex-th sub or super diagonal of the matrix \c *this
|
208
|
+
*
|
209
|
+
* \c *this is not required to be square.
|
210
|
+
*
|
211
|
+
* The template parameter \a DiagIndex represent a super diagonal if \a DiagIndex > 0
|
212
|
+
* and a sub diagonal otherwise. \a DiagIndex == 0 is equivalent to the main diagonal.
|
213
|
+
*
|
214
|
+
* Example: \include MatrixBase_diagonal_template_int.cpp
|
215
|
+
* Output: \verbinclude MatrixBase_diagonal_template_int.out
|
216
|
+
*
|
217
|
+
* \sa MatrixBase::diagonal(), class Diagonal */
|
218
|
+
template<typename Derived>
|
219
|
+
template<int Index>
|
220
|
+
inline typename MatrixBase<Derived>::template DiagonalIndexReturnType<Index>::Type
|
221
|
+
MatrixBase<Derived>::diagonal()
|
222
|
+
{
|
223
|
+
return derived();
|
224
|
+
}
|
225
|
+
|
226
|
+
/** This is the const version of diagonal<int>(). */
|
227
|
+
template<typename Derived>
|
228
|
+
template<int Index>
|
229
|
+
inline typename MatrixBase<Derived>::template ConstDiagonalIndexReturnType<Index>::Type
|
230
|
+
MatrixBase<Derived>::diagonal() const
|
231
|
+
{
|
232
|
+
return derived();
|
233
|
+
}
|
234
|
+
|
235
|
+
} // end namespace Eigen
|
236
|
+
|
237
|
+
#endif // EIGEN_DIAGONAL_H
|