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,102 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2011, Intel Corporation. All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without modification,
|
|
5
|
+
are permitted provided that the following conditions are met:
|
|
6
|
+
|
|
7
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
8
|
+
list of conditions and the following disclaimer.
|
|
9
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
10
|
+
this list of conditions and the following disclaimer in the documentation
|
|
11
|
+
and/or other materials provided with the distribution.
|
|
12
|
+
* Neither the name of Intel Corporation nor the names of its contributors may
|
|
13
|
+
be used to endorse or promote products derived from this software without
|
|
14
|
+
specific prior written permission.
|
|
15
|
+
|
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
17
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
18
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
19
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
20
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
21
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
22
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
23
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
24
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
25
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
26
|
+
|
|
27
|
+
********************************************************************************
|
|
28
|
+
* Content : Eigen bindings to Intel(R) MKL
|
|
29
|
+
* LLt decomposition based on LAPACKE_?potrf function.
|
|
30
|
+
********************************************************************************
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
#ifndef EIGEN_LLT_MKL_H
|
|
34
|
+
#define EIGEN_LLT_MKL_H
|
|
35
|
+
|
|
36
|
+
#include "Eigen/src/Core/util/MKL_support.h"
|
|
37
|
+
#include <iostream>
|
|
38
|
+
|
|
39
|
+
namespace Eigen {
|
|
40
|
+
|
|
41
|
+
namespace internal {
|
|
42
|
+
|
|
43
|
+
template<typename Scalar> struct mkl_llt;
|
|
44
|
+
|
|
45
|
+
#define EIGEN_MKL_LLT(EIGTYPE, MKLTYPE, MKLPREFIX) \
|
|
46
|
+
template<> struct mkl_llt<EIGTYPE> \
|
|
47
|
+
{ \
|
|
48
|
+
template<typename MatrixType> \
|
|
49
|
+
static inline typename MatrixType::Index potrf(MatrixType& m, char uplo) \
|
|
50
|
+
{ \
|
|
51
|
+
lapack_int matrix_order; \
|
|
52
|
+
lapack_int size, lda, info, StorageOrder; \
|
|
53
|
+
EIGTYPE* a; \
|
|
54
|
+
eigen_assert(m.rows()==m.cols()); \
|
|
55
|
+
/* Set up parameters for ?potrf */ \
|
|
56
|
+
size = m.rows(); \
|
|
57
|
+
StorageOrder = MatrixType::Flags&RowMajorBit?RowMajor:ColMajor; \
|
|
58
|
+
matrix_order = StorageOrder==RowMajor ? LAPACK_ROW_MAJOR : LAPACK_COL_MAJOR; \
|
|
59
|
+
a = &(m.coeffRef(0,0)); \
|
|
60
|
+
lda = m.outerStride(); \
|
|
61
|
+
\
|
|
62
|
+
info = LAPACKE_##MKLPREFIX##potrf( matrix_order, uplo, size, (MKLTYPE*)a, lda ); \
|
|
63
|
+
info = (info==0) ? -1 : info>0 ? info-1 : size; \
|
|
64
|
+
return info; \
|
|
65
|
+
} \
|
|
66
|
+
}; \
|
|
67
|
+
template<> struct llt_inplace<EIGTYPE, Lower> \
|
|
68
|
+
{ \
|
|
69
|
+
template<typename MatrixType> \
|
|
70
|
+
static typename MatrixType::Index blocked(MatrixType& m) \
|
|
71
|
+
{ \
|
|
72
|
+
return mkl_llt<EIGTYPE>::potrf(m, 'L'); \
|
|
73
|
+
} \
|
|
74
|
+
template<typename MatrixType, typename VectorType> \
|
|
75
|
+
static typename MatrixType::Index rankUpdate(MatrixType& mat, const VectorType& vec, const typename MatrixType::RealScalar& sigma) \
|
|
76
|
+
{ return Eigen::internal::llt_rank_update_lower(mat, vec, sigma); } \
|
|
77
|
+
}; \
|
|
78
|
+
template<> struct llt_inplace<EIGTYPE, Upper> \
|
|
79
|
+
{ \
|
|
80
|
+
template<typename MatrixType> \
|
|
81
|
+
static typename MatrixType::Index blocked(MatrixType& m) \
|
|
82
|
+
{ \
|
|
83
|
+
return mkl_llt<EIGTYPE>::potrf(m, 'U'); \
|
|
84
|
+
} \
|
|
85
|
+
template<typename MatrixType, typename VectorType> \
|
|
86
|
+
static typename MatrixType::Index rankUpdate(MatrixType& mat, const VectorType& vec, const typename MatrixType::RealScalar& sigma) \
|
|
87
|
+
{ \
|
|
88
|
+
Transpose<MatrixType> matt(mat); \
|
|
89
|
+
return llt_inplace<EIGTYPE, Lower>::rankUpdate(matt, vec.conjugate(), sigma); \
|
|
90
|
+
} \
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
EIGEN_MKL_LLT(double, double, d)
|
|
94
|
+
EIGEN_MKL_LLT(float, float, s)
|
|
95
|
+
EIGEN_MKL_LLT(dcomplex, MKL_Complex16, z)
|
|
96
|
+
EIGEN_MKL_LLT(scomplex, MKL_Complex8, c)
|
|
97
|
+
|
|
98
|
+
} // end namespace internal
|
|
99
|
+
|
|
100
|
+
} // end namespace Eigen
|
|
101
|
+
|
|
102
|
+
#endif // EIGEN_LLT_MKL_H
|
|
@@ -0,0 +1,607 @@
|
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
|
2
|
+
// for linear algebra.
|
|
3
|
+
//
|
|
4
|
+
// Copyright (C) 2008-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_CHOLMODSUPPORT_H
|
|
11
|
+
#define EIGEN_CHOLMODSUPPORT_H
|
|
12
|
+
|
|
13
|
+
namespace Eigen {
|
|
14
|
+
|
|
15
|
+
namespace internal {
|
|
16
|
+
|
|
17
|
+
template<typename Scalar, typename CholmodType>
|
|
18
|
+
void cholmod_configure_matrix(CholmodType& mat)
|
|
19
|
+
{
|
|
20
|
+
if (internal::is_same<Scalar,float>::value)
|
|
21
|
+
{
|
|
22
|
+
mat.xtype = CHOLMOD_REAL;
|
|
23
|
+
mat.dtype = CHOLMOD_SINGLE;
|
|
24
|
+
}
|
|
25
|
+
else if (internal::is_same<Scalar,double>::value)
|
|
26
|
+
{
|
|
27
|
+
mat.xtype = CHOLMOD_REAL;
|
|
28
|
+
mat.dtype = CHOLMOD_DOUBLE;
|
|
29
|
+
}
|
|
30
|
+
else if (internal::is_same<Scalar,std::complex<float> >::value)
|
|
31
|
+
{
|
|
32
|
+
mat.xtype = CHOLMOD_COMPLEX;
|
|
33
|
+
mat.dtype = CHOLMOD_SINGLE;
|
|
34
|
+
}
|
|
35
|
+
else if (internal::is_same<Scalar,std::complex<double> >::value)
|
|
36
|
+
{
|
|
37
|
+
mat.xtype = CHOLMOD_COMPLEX;
|
|
38
|
+
mat.dtype = CHOLMOD_DOUBLE;
|
|
39
|
+
}
|
|
40
|
+
else
|
|
41
|
+
{
|
|
42
|
+
eigen_assert(false && "Scalar type not supported by CHOLMOD");
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
} // namespace internal
|
|
47
|
+
|
|
48
|
+
/** Wraps the Eigen sparse matrix \a mat into a Cholmod sparse matrix object.
|
|
49
|
+
* Note that the data are shared.
|
|
50
|
+
*/
|
|
51
|
+
template<typename _Scalar, int _Options, typename _Index>
|
|
52
|
+
cholmod_sparse viewAsCholmod(SparseMatrix<_Scalar,_Options,_Index>& mat)
|
|
53
|
+
{
|
|
54
|
+
cholmod_sparse res;
|
|
55
|
+
res.nzmax = mat.nonZeros();
|
|
56
|
+
res.nrow = mat.rows();;
|
|
57
|
+
res.ncol = mat.cols();
|
|
58
|
+
res.p = mat.outerIndexPtr();
|
|
59
|
+
res.i = mat.innerIndexPtr();
|
|
60
|
+
res.x = mat.valuePtr();
|
|
61
|
+
res.z = 0;
|
|
62
|
+
res.sorted = 1;
|
|
63
|
+
if(mat.isCompressed())
|
|
64
|
+
{
|
|
65
|
+
res.packed = 1;
|
|
66
|
+
res.nz = 0;
|
|
67
|
+
}
|
|
68
|
+
else
|
|
69
|
+
{
|
|
70
|
+
res.packed = 0;
|
|
71
|
+
res.nz = mat.innerNonZeroPtr();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
res.dtype = 0;
|
|
75
|
+
res.stype = -1;
|
|
76
|
+
|
|
77
|
+
if (internal::is_same<_Index,int>::value)
|
|
78
|
+
{
|
|
79
|
+
res.itype = CHOLMOD_INT;
|
|
80
|
+
}
|
|
81
|
+
else if (internal::is_same<_Index,SuiteSparse_long>::value)
|
|
82
|
+
{
|
|
83
|
+
res.itype = CHOLMOD_LONG;
|
|
84
|
+
}
|
|
85
|
+
else
|
|
86
|
+
{
|
|
87
|
+
eigen_assert(false && "Index type not supported yet");
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// setup res.xtype
|
|
91
|
+
internal::cholmod_configure_matrix<_Scalar>(res);
|
|
92
|
+
|
|
93
|
+
res.stype = 0;
|
|
94
|
+
|
|
95
|
+
return res;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
template<typename _Scalar, int _Options, typename _Index>
|
|
99
|
+
const cholmod_sparse viewAsCholmod(const SparseMatrix<_Scalar,_Options,_Index>& mat)
|
|
100
|
+
{
|
|
101
|
+
cholmod_sparse res = viewAsCholmod(mat.const_cast_derived());
|
|
102
|
+
return res;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** Returns a view of the Eigen sparse matrix \a mat as Cholmod sparse matrix.
|
|
106
|
+
* The data are not copied but shared. */
|
|
107
|
+
template<typename _Scalar, int _Options, typename _Index, unsigned int UpLo>
|
|
108
|
+
cholmod_sparse viewAsCholmod(const SparseSelfAdjointView<SparseMatrix<_Scalar,_Options,_Index>, UpLo>& mat)
|
|
109
|
+
{
|
|
110
|
+
cholmod_sparse res = viewAsCholmod(mat.matrix().const_cast_derived());
|
|
111
|
+
|
|
112
|
+
if(UpLo==Upper) res.stype = 1;
|
|
113
|
+
if(UpLo==Lower) res.stype = -1;
|
|
114
|
+
|
|
115
|
+
return res;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** Returns a view of the Eigen \b dense matrix \a mat as Cholmod dense matrix.
|
|
119
|
+
* The data are not copied but shared. */
|
|
120
|
+
template<typename Derived>
|
|
121
|
+
cholmod_dense viewAsCholmod(MatrixBase<Derived>& mat)
|
|
122
|
+
{
|
|
123
|
+
EIGEN_STATIC_ASSERT((internal::traits<Derived>::Flags&RowMajorBit)==0,THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES);
|
|
124
|
+
typedef typename Derived::Scalar Scalar;
|
|
125
|
+
|
|
126
|
+
cholmod_dense res;
|
|
127
|
+
res.nrow = mat.rows();
|
|
128
|
+
res.ncol = mat.cols();
|
|
129
|
+
res.nzmax = res.nrow * res.ncol;
|
|
130
|
+
res.d = Derived::IsVectorAtCompileTime ? mat.derived().size() : mat.derived().outerStride();
|
|
131
|
+
res.x = (void*)(mat.derived().data());
|
|
132
|
+
res.z = 0;
|
|
133
|
+
|
|
134
|
+
internal::cholmod_configure_matrix<Scalar>(res);
|
|
135
|
+
|
|
136
|
+
return res;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** Returns a view of the Cholmod sparse matrix \a cm as an Eigen sparse matrix.
|
|
140
|
+
* The data are not copied but shared. */
|
|
141
|
+
template<typename Scalar, int Flags, typename Index>
|
|
142
|
+
MappedSparseMatrix<Scalar,Flags,Index> viewAsEigen(cholmod_sparse& cm)
|
|
143
|
+
{
|
|
144
|
+
return MappedSparseMatrix<Scalar,Flags,Index>
|
|
145
|
+
(cm.nrow, cm.ncol, static_cast<Index*>(cm.p)[cm.ncol],
|
|
146
|
+
static_cast<Index*>(cm.p), static_cast<Index*>(cm.i),static_cast<Scalar*>(cm.x) );
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
enum CholmodMode {
|
|
150
|
+
CholmodAuto, CholmodSimplicialLLt, CholmodSupernodalLLt, CholmodLDLt
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
/** \ingroup CholmodSupport_Module
|
|
155
|
+
* \class CholmodBase
|
|
156
|
+
* \brief The base class for the direct Cholesky factorization of Cholmod
|
|
157
|
+
* \sa class CholmodSupernodalLLT, class CholmodSimplicialLDLT, class CholmodSimplicialLLT
|
|
158
|
+
*/
|
|
159
|
+
template<typename _MatrixType, int _UpLo, typename Derived>
|
|
160
|
+
class CholmodBase : internal::noncopyable
|
|
161
|
+
{
|
|
162
|
+
public:
|
|
163
|
+
typedef _MatrixType MatrixType;
|
|
164
|
+
enum { UpLo = _UpLo };
|
|
165
|
+
typedef typename MatrixType::Scalar Scalar;
|
|
166
|
+
typedef typename MatrixType::RealScalar RealScalar;
|
|
167
|
+
typedef MatrixType CholMatrixType;
|
|
168
|
+
typedef typename MatrixType::Index Index;
|
|
169
|
+
|
|
170
|
+
public:
|
|
171
|
+
|
|
172
|
+
CholmodBase()
|
|
173
|
+
: m_cholmodFactor(0), m_info(Success), m_isInitialized(false)
|
|
174
|
+
{
|
|
175
|
+
m_shiftOffset[0] = m_shiftOffset[1] = RealScalar(0.0);
|
|
176
|
+
cholmod_start(&m_cholmod);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
CholmodBase(const MatrixType& matrix)
|
|
180
|
+
: m_cholmodFactor(0), m_info(Success), m_isInitialized(false)
|
|
181
|
+
{
|
|
182
|
+
m_shiftOffset[0] = m_shiftOffset[1] = RealScalar(0.0);
|
|
183
|
+
cholmod_start(&m_cholmod);
|
|
184
|
+
compute(matrix);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
~CholmodBase()
|
|
188
|
+
{
|
|
189
|
+
if(m_cholmodFactor)
|
|
190
|
+
cholmod_free_factor(&m_cholmodFactor, &m_cholmod);
|
|
191
|
+
cholmod_finish(&m_cholmod);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
inline Index cols() const { return m_cholmodFactor->n; }
|
|
195
|
+
inline Index rows() const { return m_cholmodFactor->n; }
|
|
196
|
+
|
|
197
|
+
Derived& derived() { return *static_cast<Derived*>(this); }
|
|
198
|
+
const Derived& derived() const { return *static_cast<const Derived*>(this); }
|
|
199
|
+
|
|
200
|
+
/** \brief Reports whether previous computation was successful.
|
|
201
|
+
*
|
|
202
|
+
* \returns \c Success if computation was succesful,
|
|
203
|
+
* \c NumericalIssue if the matrix.appears to be negative.
|
|
204
|
+
*/
|
|
205
|
+
ComputationInfo info() const
|
|
206
|
+
{
|
|
207
|
+
eigen_assert(m_isInitialized && "Decomposition is not initialized.");
|
|
208
|
+
return m_info;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/** Computes the sparse Cholesky decomposition of \a matrix */
|
|
212
|
+
Derived& compute(const MatrixType& matrix)
|
|
213
|
+
{
|
|
214
|
+
analyzePattern(matrix);
|
|
215
|
+
factorize(matrix);
|
|
216
|
+
return derived();
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/** \returns the solution x of \f$ A x = b \f$ using the current decomposition of A.
|
|
220
|
+
*
|
|
221
|
+
* \sa compute()
|
|
222
|
+
*/
|
|
223
|
+
template<typename Rhs>
|
|
224
|
+
inline const internal::solve_retval<CholmodBase, Rhs>
|
|
225
|
+
solve(const MatrixBase<Rhs>& b) const
|
|
226
|
+
{
|
|
227
|
+
eigen_assert(m_isInitialized && "LLT is not initialized.");
|
|
228
|
+
eigen_assert(rows()==b.rows()
|
|
229
|
+
&& "CholmodDecomposition::solve(): invalid number of rows of the right hand side matrix b");
|
|
230
|
+
return internal::solve_retval<CholmodBase, Rhs>(*this, b.derived());
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/** \returns the solution x of \f$ A x = b \f$ using the current decomposition of A.
|
|
234
|
+
*
|
|
235
|
+
* \sa compute()
|
|
236
|
+
*/
|
|
237
|
+
template<typename Rhs>
|
|
238
|
+
inline const internal::sparse_solve_retval<CholmodBase, Rhs>
|
|
239
|
+
solve(const SparseMatrixBase<Rhs>& b) const
|
|
240
|
+
{
|
|
241
|
+
eigen_assert(m_isInitialized && "LLT is not initialized.");
|
|
242
|
+
eigen_assert(rows()==b.rows()
|
|
243
|
+
&& "CholmodDecomposition::solve(): invalid number of rows of the right hand side matrix b");
|
|
244
|
+
return internal::sparse_solve_retval<CholmodBase, Rhs>(*this, b.derived());
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/** Performs a symbolic decomposition on the sparsity pattern of \a matrix.
|
|
248
|
+
*
|
|
249
|
+
* This function is particularly useful when solving for several problems having the same structure.
|
|
250
|
+
*
|
|
251
|
+
* \sa factorize()
|
|
252
|
+
*/
|
|
253
|
+
void analyzePattern(const MatrixType& matrix)
|
|
254
|
+
{
|
|
255
|
+
if(m_cholmodFactor)
|
|
256
|
+
{
|
|
257
|
+
cholmod_free_factor(&m_cholmodFactor, &m_cholmod);
|
|
258
|
+
m_cholmodFactor = 0;
|
|
259
|
+
}
|
|
260
|
+
cholmod_sparse A = viewAsCholmod(matrix.template selfadjointView<UpLo>());
|
|
261
|
+
m_cholmodFactor = cholmod_analyze(&A, &m_cholmod);
|
|
262
|
+
|
|
263
|
+
this->m_isInitialized = true;
|
|
264
|
+
this->m_info = Success;
|
|
265
|
+
m_analysisIsOk = true;
|
|
266
|
+
m_factorizationIsOk = false;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/** Performs a numeric decomposition of \a matrix
|
|
270
|
+
*
|
|
271
|
+
* The given matrix must have the same sparsity pattern as the matrix on which the symbolic decomposition has been performed.
|
|
272
|
+
*
|
|
273
|
+
* \sa analyzePattern()
|
|
274
|
+
*/
|
|
275
|
+
void factorize(const MatrixType& matrix)
|
|
276
|
+
{
|
|
277
|
+
eigen_assert(m_analysisIsOk && "You must first call analyzePattern()");
|
|
278
|
+
cholmod_sparse A = viewAsCholmod(matrix.template selfadjointView<UpLo>());
|
|
279
|
+
cholmod_factorize_p(&A, m_shiftOffset, 0, 0, m_cholmodFactor, &m_cholmod);
|
|
280
|
+
|
|
281
|
+
// If the factorization failed, minor is the column at which it did. On success minor == n.
|
|
282
|
+
this->m_info = (m_cholmodFactor->minor == m_cholmodFactor->n ? Success : NumericalIssue);
|
|
283
|
+
m_factorizationIsOk = true;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/** Returns a reference to the Cholmod's configuration structure to get a full control over the performed operations.
|
|
287
|
+
* See the Cholmod user guide for details. */
|
|
288
|
+
cholmod_common& cholmod() { return m_cholmod; }
|
|
289
|
+
|
|
290
|
+
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
|
291
|
+
/** \internal */
|
|
292
|
+
template<typename Rhs,typename Dest>
|
|
293
|
+
void _solve(const MatrixBase<Rhs> &b, MatrixBase<Dest> &dest) const
|
|
294
|
+
{
|
|
295
|
+
eigen_assert(m_factorizationIsOk && "The decomposition is not in a valid state for solving, you must first call either compute() or symbolic()/numeric()");
|
|
296
|
+
const Index size = m_cholmodFactor->n;
|
|
297
|
+
EIGEN_UNUSED_VARIABLE(size);
|
|
298
|
+
eigen_assert(size==b.rows());
|
|
299
|
+
|
|
300
|
+
// note: cd stands for Cholmod Dense
|
|
301
|
+
Rhs& b_ref(b.const_cast_derived());
|
|
302
|
+
cholmod_dense b_cd = viewAsCholmod(b_ref);
|
|
303
|
+
cholmod_dense* x_cd = cholmod_solve(CHOLMOD_A, m_cholmodFactor, &b_cd, &m_cholmod);
|
|
304
|
+
if(!x_cd)
|
|
305
|
+
{
|
|
306
|
+
this->m_info = NumericalIssue;
|
|
307
|
+
}
|
|
308
|
+
// TODO optimize this copy by swapping when possible (be careful with alignment, etc.)
|
|
309
|
+
dest = Matrix<Scalar,Dest::RowsAtCompileTime,Dest::ColsAtCompileTime>::Map(reinterpret_cast<Scalar*>(x_cd->x),b.rows(),b.cols());
|
|
310
|
+
cholmod_free_dense(&x_cd, &m_cholmod);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/** \internal */
|
|
314
|
+
template<typename RhsScalar, int RhsOptions, typename RhsIndex, typename DestScalar, int DestOptions, typename DestIndex>
|
|
315
|
+
void _solve(const SparseMatrix<RhsScalar,RhsOptions,RhsIndex> &b, SparseMatrix<DestScalar,DestOptions,DestIndex> &dest) const
|
|
316
|
+
{
|
|
317
|
+
eigen_assert(m_factorizationIsOk && "The decomposition is not in a valid state for solving, you must first call either compute() or symbolic()/numeric()");
|
|
318
|
+
const Index size = m_cholmodFactor->n;
|
|
319
|
+
EIGEN_UNUSED_VARIABLE(size);
|
|
320
|
+
eigen_assert(size==b.rows());
|
|
321
|
+
|
|
322
|
+
// note: cs stands for Cholmod Sparse
|
|
323
|
+
cholmod_sparse b_cs = viewAsCholmod(b);
|
|
324
|
+
cholmod_sparse* x_cs = cholmod_spsolve(CHOLMOD_A, m_cholmodFactor, &b_cs, &m_cholmod);
|
|
325
|
+
if(!x_cs)
|
|
326
|
+
{
|
|
327
|
+
this->m_info = NumericalIssue;
|
|
328
|
+
}
|
|
329
|
+
// TODO optimize this copy by swapping when possible (be careful with alignment, etc.)
|
|
330
|
+
dest = viewAsEigen<DestScalar,DestOptions,DestIndex>(*x_cs);
|
|
331
|
+
cholmod_free_sparse(&x_cs, &m_cholmod);
|
|
332
|
+
}
|
|
333
|
+
#endif // EIGEN_PARSED_BY_DOXYGEN
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
/** Sets the shift parameter that will be used to adjust the diagonal coefficients during the numerical factorization.
|
|
337
|
+
*
|
|
338
|
+
* During the numerical factorization, an offset term is added to the diagonal coefficients:\n
|
|
339
|
+
* \c d_ii = \a offset + \c d_ii
|
|
340
|
+
*
|
|
341
|
+
* The default is \a offset=0.
|
|
342
|
+
*
|
|
343
|
+
* \returns a reference to \c *this.
|
|
344
|
+
*/
|
|
345
|
+
Derived& setShift(const RealScalar& offset)
|
|
346
|
+
{
|
|
347
|
+
m_shiftOffset[0] = offset;
|
|
348
|
+
return derived();
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
template<typename Stream>
|
|
352
|
+
void dumpMemory(Stream& /*s*/)
|
|
353
|
+
{}
|
|
354
|
+
|
|
355
|
+
protected:
|
|
356
|
+
mutable cholmod_common m_cholmod;
|
|
357
|
+
cholmod_factor* m_cholmodFactor;
|
|
358
|
+
RealScalar m_shiftOffset[2];
|
|
359
|
+
mutable ComputationInfo m_info;
|
|
360
|
+
bool m_isInitialized;
|
|
361
|
+
int m_factorizationIsOk;
|
|
362
|
+
int m_analysisIsOk;
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
/** \ingroup CholmodSupport_Module
|
|
366
|
+
* \class CholmodSimplicialLLT
|
|
367
|
+
* \brief A simplicial direct Cholesky (LLT) factorization and solver based on Cholmod
|
|
368
|
+
*
|
|
369
|
+
* This class allows to solve for A.X = B sparse linear problems via a simplicial LL^T Cholesky factorization
|
|
370
|
+
* using the Cholmod library.
|
|
371
|
+
* This simplicial variant is equivalent to Eigen's built-in SimplicialLLT class. Therefore, it has little practical interest.
|
|
372
|
+
* The sparse matrix A must be selfadjoint and positive definite. The vectors or matrices
|
|
373
|
+
* X and B can be either dense or sparse.
|
|
374
|
+
*
|
|
375
|
+
* \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<>
|
|
376
|
+
* \tparam _UpLo the triangular part that will be used for the computations. It can be Lower
|
|
377
|
+
* or Upper. Default is Lower.
|
|
378
|
+
*
|
|
379
|
+
* This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed.
|
|
380
|
+
*
|
|
381
|
+
* \sa \ref TutorialSparseDirectSolvers, class CholmodSupernodalLLT, class SimplicialLLT
|
|
382
|
+
*/
|
|
383
|
+
template<typename _MatrixType, int _UpLo = Lower>
|
|
384
|
+
class CholmodSimplicialLLT : public CholmodBase<_MatrixType, _UpLo, CholmodSimplicialLLT<_MatrixType, _UpLo> >
|
|
385
|
+
{
|
|
386
|
+
typedef CholmodBase<_MatrixType, _UpLo, CholmodSimplicialLLT> Base;
|
|
387
|
+
using Base::m_cholmod;
|
|
388
|
+
|
|
389
|
+
public:
|
|
390
|
+
|
|
391
|
+
typedef _MatrixType MatrixType;
|
|
392
|
+
|
|
393
|
+
CholmodSimplicialLLT() : Base() { init(); }
|
|
394
|
+
|
|
395
|
+
CholmodSimplicialLLT(const MatrixType& matrix) : Base()
|
|
396
|
+
{
|
|
397
|
+
init();
|
|
398
|
+
Base::compute(matrix);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
~CholmodSimplicialLLT() {}
|
|
402
|
+
protected:
|
|
403
|
+
void init()
|
|
404
|
+
{
|
|
405
|
+
m_cholmod.final_asis = 0;
|
|
406
|
+
m_cholmod.supernodal = CHOLMOD_SIMPLICIAL;
|
|
407
|
+
m_cholmod.final_ll = 1;
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
/** \ingroup CholmodSupport_Module
|
|
413
|
+
* \class CholmodSimplicialLDLT
|
|
414
|
+
* \brief A simplicial direct Cholesky (LDLT) factorization and solver based on Cholmod
|
|
415
|
+
*
|
|
416
|
+
* This class allows to solve for A.X = B sparse linear problems via a simplicial LDL^T Cholesky factorization
|
|
417
|
+
* using the Cholmod library.
|
|
418
|
+
* This simplicial variant is equivalent to Eigen's built-in SimplicialLDLT class. Therefore, it has little practical interest.
|
|
419
|
+
* The sparse matrix A must be selfadjoint and positive definite. The vectors or matrices
|
|
420
|
+
* X and B can be either dense or sparse.
|
|
421
|
+
*
|
|
422
|
+
* \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<>
|
|
423
|
+
* \tparam _UpLo the triangular part that will be used for the computations. It can be Lower
|
|
424
|
+
* or Upper. Default is Lower.
|
|
425
|
+
*
|
|
426
|
+
* This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed.
|
|
427
|
+
*
|
|
428
|
+
* \sa \ref TutorialSparseDirectSolvers, class CholmodSupernodalLLT, class SimplicialLDLT
|
|
429
|
+
*/
|
|
430
|
+
template<typename _MatrixType, int _UpLo = Lower>
|
|
431
|
+
class CholmodSimplicialLDLT : public CholmodBase<_MatrixType, _UpLo, CholmodSimplicialLDLT<_MatrixType, _UpLo> >
|
|
432
|
+
{
|
|
433
|
+
typedef CholmodBase<_MatrixType, _UpLo, CholmodSimplicialLDLT> Base;
|
|
434
|
+
using Base::m_cholmod;
|
|
435
|
+
|
|
436
|
+
public:
|
|
437
|
+
|
|
438
|
+
typedef _MatrixType MatrixType;
|
|
439
|
+
|
|
440
|
+
CholmodSimplicialLDLT() : Base() { init(); }
|
|
441
|
+
|
|
442
|
+
CholmodSimplicialLDLT(const MatrixType& matrix) : Base()
|
|
443
|
+
{
|
|
444
|
+
init();
|
|
445
|
+
Base::compute(matrix);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
~CholmodSimplicialLDLT() {}
|
|
449
|
+
protected:
|
|
450
|
+
void init()
|
|
451
|
+
{
|
|
452
|
+
m_cholmod.final_asis = 1;
|
|
453
|
+
m_cholmod.supernodal = CHOLMOD_SIMPLICIAL;
|
|
454
|
+
}
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
/** \ingroup CholmodSupport_Module
|
|
458
|
+
* \class CholmodSupernodalLLT
|
|
459
|
+
* \brief A supernodal Cholesky (LLT) factorization and solver based on Cholmod
|
|
460
|
+
*
|
|
461
|
+
* This class allows to solve for A.X = B sparse linear problems via a supernodal LL^T Cholesky factorization
|
|
462
|
+
* using the Cholmod library.
|
|
463
|
+
* This supernodal variant performs best on dense enough problems, e.g., 3D FEM, or very high order 2D FEM.
|
|
464
|
+
* The sparse matrix A must be selfadjoint and positive definite. The vectors or matrices
|
|
465
|
+
* X and B can be either dense or sparse.
|
|
466
|
+
*
|
|
467
|
+
* \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<>
|
|
468
|
+
* \tparam _UpLo the triangular part that will be used for the computations. It can be Lower
|
|
469
|
+
* or Upper. Default is Lower.
|
|
470
|
+
*
|
|
471
|
+
* This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed.
|
|
472
|
+
*
|
|
473
|
+
* \sa \ref TutorialSparseDirectSolvers
|
|
474
|
+
*/
|
|
475
|
+
template<typename _MatrixType, int _UpLo = Lower>
|
|
476
|
+
class CholmodSupernodalLLT : public CholmodBase<_MatrixType, _UpLo, CholmodSupernodalLLT<_MatrixType, _UpLo> >
|
|
477
|
+
{
|
|
478
|
+
typedef CholmodBase<_MatrixType, _UpLo, CholmodSupernodalLLT> Base;
|
|
479
|
+
using Base::m_cholmod;
|
|
480
|
+
|
|
481
|
+
public:
|
|
482
|
+
|
|
483
|
+
typedef _MatrixType MatrixType;
|
|
484
|
+
|
|
485
|
+
CholmodSupernodalLLT() : Base() { init(); }
|
|
486
|
+
|
|
487
|
+
CholmodSupernodalLLT(const MatrixType& matrix) : Base()
|
|
488
|
+
{
|
|
489
|
+
init();
|
|
490
|
+
Base::compute(matrix);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
~CholmodSupernodalLLT() {}
|
|
494
|
+
protected:
|
|
495
|
+
void init()
|
|
496
|
+
{
|
|
497
|
+
m_cholmod.final_asis = 1;
|
|
498
|
+
m_cholmod.supernodal = CHOLMOD_SUPERNODAL;
|
|
499
|
+
}
|
|
500
|
+
};
|
|
501
|
+
|
|
502
|
+
/** \ingroup CholmodSupport_Module
|
|
503
|
+
* \class CholmodDecomposition
|
|
504
|
+
* \brief A general Cholesky factorization and solver based on Cholmod
|
|
505
|
+
*
|
|
506
|
+
* This class allows to solve for A.X = B sparse linear problems via a LL^T or LDL^T Cholesky factorization
|
|
507
|
+
* using the Cholmod library. The sparse matrix A must be selfadjoint and positive definite. The vectors or matrices
|
|
508
|
+
* X and B can be either dense or sparse.
|
|
509
|
+
*
|
|
510
|
+
* This variant permits to change the underlying Cholesky method at runtime.
|
|
511
|
+
* On the other hand, it does not provide access to the result of the factorization.
|
|
512
|
+
* The default is to let Cholmod automatically choose between a simplicial and supernodal factorization.
|
|
513
|
+
*
|
|
514
|
+
* \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<>
|
|
515
|
+
* \tparam _UpLo the triangular part that will be used for the computations. It can be Lower
|
|
516
|
+
* or Upper. Default is Lower.
|
|
517
|
+
*
|
|
518
|
+
* This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed.
|
|
519
|
+
*
|
|
520
|
+
* \sa \ref TutorialSparseDirectSolvers
|
|
521
|
+
*/
|
|
522
|
+
template<typename _MatrixType, int _UpLo = Lower>
|
|
523
|
+
class CholmodDecomposition : public CholmodBase<_MatrixType, _UpLo, CholmodDecomposition<_MatrixType, _UpLo> >
|
|
524
|
+
{
|
|
525
|
+
typedef CholmodBase<_MatrixType, _UpLo, CholmodDecomposition> Base;
|
|
526
|
+
using Base::m_cholmod;
|
|
527
|
+
|
|
528
|
+
public:
|
|
529
|
+
|
|
530
|
+
typedef _MatrixType MatrixType;
|
|
531
|
+
|
|
532
|
+
CholmodDecomposition() : Base() { init(); }
|
|
533
|
+
|
|
534
|
+
CholmodDecomposition(const MatrixType& matrix) : Base()
|
|
535
|
+
{
|
|
536
|
+
init();
|
|
537
|
+
Base::compute(matrix);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
~CholmodDecomposition() {}
|
|
541
|
+
|
|
542
|
+
void setMode(CholmodMode mode)
|
|
543
|
+
{
|
|
544
|
+
switch(mode)
|
|
545
|
+
{
|
|
546
|
+
case CholmodAuto:
|
|
547
|
+
m_cholmod.final_asis = 1;
|
|
548
|
+
m_cholmod.supernodal = CHOLMOD_AUTO;
|
|
549
|
+
break;
|
|
550
|
+
case CholmodSimplicialLLt:
|
|
551
|
+
m_cholmod.final_asis = 0;
|
|
552
|
+
m_cholmod.supernodal = CHOLMOD_SIMPLICIAL;
|
|
553
|
+
m_cholmod.final_ll = 1;
|
|
554
|
+
break;
|
|
555
|
+
case CholmodSupernodalLLt:
|
|
556
|
+
m_cholmod.final_asis = 1;
|
|
557
|
+
m_cholmod.supernodal = CHOLMOD_SUPERNODAL;
|
|
558
|
+
break;
|
|
559
|
+
case CholmodLDLt:
|
|
560
|
+
m_cholmod.final_asis = 1;
|
|
561
|
+
m_cholmod.supernodal = CHOLMOD_SIMPLICIAL;
|
|
562
|
+
break;
|
|
563
|
+
default:
|
|
564
|
+
break;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
protected:
|
|
568
|
+
void init()
|
|
569
|
+
{
|
|
570
|
+
m_cholmod.final_asis = 1;
|
|
571
|
+
m_cholmod.supernodal = CHOLMOD_AUTO;
|
|
572
|
+
}
|
|
573
|
+
};
|
|
574
|
+
|
|
575
|
+
namespace internal {
|
|
576
|
+
|
|
577
|
+
template<typename _MatrixType, int _UpLo, typename Derived, typename Rhs>
|
|
578
|
+
struct solve_retval<CholmodBase<_MatrixType,_UpLo,Derived>, Rhs>
|
|
579
|
+
: solve_retval_base<CholmodBase<_MatrixType,_UpLo,Derived>, Rhs>
|
|
580
|
+
{
|
|
581
|
+
typedef CholmodBase<_MatrixType,_UpLo,Derived> Dec;
|
|
582
|
+
EIGEN_MAKE_SOLVE_HELPERS(Dec,Rhs)
|
|
583
|
+
|
|
584
|
+
template<typename Dest> void evalTo(Dest& dst) const
|
|
585
|
+
{
|
|
586
|
+
dec()._solve(rhs(),dst);
|
|
587
|
+
}
|
|
588
|
+
};
|
|
589
|
+
|
|
590
|
+
template<typename _MatrixType, int _UpLo, typename Derived, typename Rhs>
|
|
591
|
+
struct sparse_solve_retval<CholmodBase<_MatrixType,_UpLo,Derived>, Rhs>
|
|
592
|
+
: sparse_solve_retval_base<CholmodBase<_MatrixType,_UpLo,Derived>, Rhs>
|
|
593
|
+
{
|
|
594
|
+
typedef CholmodBase<_MatrixType,_UpLo,Derived> Dec;
|
|
595
|
+
EIGEN_MAKE_SPARSE_SOLVE_HELPERS(Dec,Rhs)
|
|
596
|
+
|
|
597
|
+
template<typename Dest> void evalTo(Dest& dst) const
|
|
598
|
+
{
|
|
599
|
+
dec()._solve(rhs(),dst);
|
|
600
|
+
}
|
|
601
|
+
};
|
|
602
|
+
|
|
603
|
+
} // end namespace internal
|
|
604
|
+
|
|
605
|
+
} // end namespace Eigen
|
|
606
|
+
|
|
607
|
+
#endif // EIGEN_CHOLMODSUPPORT_H
|