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,99 @@
|
|
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
|
+
* Householder QR decomposition of a matrix with column pivoting based on
|
30
|
+
* LAPACKE_?geqp3 function.
|
31
|
+
********************************************************************************
|
32
|
+
*/
|
33
|
+
|
34
|
+
#ifndef EIGEN_COLPIVOTINGHOUSEHOLDERQR_MKL_H
|
35
|
+
#define EIGEN_COLPIVOTINGHOUSEHOLDERQR_MKL_H
|
36
|
+
|
37
|
+
#include "Eigen/src/Core/util/MKL_support.h"
|
38
|
+
|
39
|
+
namespace Eigen {
|
40
|
+
|
41
|
+
/** \internal Specialization for the data types supported by MKL */
|
42
|
+
|
43
|
+
#define EIGEN_MKL_QR_COLPIV(EIGTYPE, MKLTYPE, MKLPREFIX, EIGCOLROW, MKLCOLROW) \
|
44
|
+
template<> inline \
|
45
|
+
ColPivHouseholderQR<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic> >& \
|
46
|
+
ColPivHouseholderQR<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic> >::compute( \
|
47
|
+
const Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic>& matrix) \
|
48
|
+
\
|
49
|
+
{ \
|
50
|
+
using std::abs; \
|
51
|
+
typedef Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic> MatrixType; \
|
52
|
+
typedef MatrixType::Scalar Scalar; \
|
53
|
+
typedef MatrixType::RealScalar RealScalar; \
|
54
|
+
Index rows = matrix.rows();\
|
55
|
+
Index cols = matrix.cols();\
|
56
|
+
Index size = matrix.diagonalSize();\
|
57
|
+
\
|
58
|
+
m_qr = matrix;\
|
59
|
+
m_hCoeffs.resize(size);\
|
60
|
+
\
|
61
|
+
m_colsTranspositions.resize(cols);\
|
62
|
+
/*Index number_of_transpositions = 0;*/ \
|
63
|
+
\
|
64
|
+
m_nonzero_pivots = 0; \
|
65
|
+
m_maxpivot = RealScalar(0);\
|
66
|
+
m_colsPermutation.resize(cols); \
|
67
|
+
m_colsPermutation.indices().setZero(); \
|
68
|
+
\
|
69
|
+
lapack_int lda = m_qr.outerStride(), i; \
|
70
|
+
lapack_int matrix_order = MKLCOLROW; \
|
71
|
+
LAPACKE_##MKLPREFIX##geqp3( matrix_order, rows, cols, (MKLTYPE*)m_qr.data(), lda, (lapack_int*)m_colsPermutation.indices().data(), (MKLTYPE*)m_hCoeffs.data()); \
|
72
|
+
m_isInitialized = true; \
|
73
|
+
m_maxpivot=m_qr.diagonal().cwiseAbs().maxCoeff(); \
|
74
|
+
m_hCoeffs.adjointInPlace(); \
|
75
|
+
RealScalar premultiplied_threshold = abs(m_maxpivot) * threshold(); \
|
76
|
+
lapack_int *perm = m_colsPermutation.indices().data(); \
|
77
|
+
for(i=0;i<size;i++) { \
|
78
|
+
m_nonzero_pivots += (abs(m_qr.coeff(i,i)) > premultiplied_threshold);\
|
79
|
+
} \
|
80
|
+
for(i=0;i<cols;i++) perm[i]--;\
|
81
|
+
\
|
82
|
+
/*m_det_pq = (number_of_transpositions%2) ? -1 : 1; // TODO: It's not needed now; fix upon availability in Eigen */ \
|
83
|
+
\
|
84
|
+
return *this; \
|
85
|
+
}
|
86
|
+
|
87
|
+
EIGEN_MKL_QR_COLPIV(double, double, d, ColMajor, LAPACK_COL_MAJOR)
|
88
|
+
EIGEN_MKL_QR_COLPIV(float, float, s, ColMajor, LAPACK_COL_MAJOR)
|
89
|
+
EIGEN_MKL_QR_COLPIV(dcomplex, MKL_Complex16, z, ColMajor, LAPACK_COL_MAJOR)
|
90
|
+
EIGEN_MKL_QR_COLPIV(scomplex, MKL_Complex8, c, ColMajor, LAPACK_COL_MAJOR)
|
91
|
+
|
92
|
+
EIGEN_MKL_QR_COLPIV(double, double, d, RowMajor, LAPACK_ROW_MAJOR)
|
93
|
+
EIGEN_MKL_QR_COLPIV(float, float, s, RowMajor, LAPACK_ROW_MAJOR)
|
94
|
+
EIGEN_MKL_QR_COLPIV(dcomplex, MKL_Complex16, z, RowMajor, LAPACK_ROW_MAJOR)
|
95
|
+
EIGEN_MKL_QR_COLPIV(scomplex, MKL_Complex8, c, RowMajor, LAPACK_ROW_MAJOR)
|
96
|
+
|
97
|
+
} // end namespace Eigen
|
98
|
+
|
99
|
+
#endif // EIGEN_COLPIVOTINGHOUSEHOLDERQR_MKL_H
|
@@ -0,0 +1,622 @@
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
2
|
+
// for linear algebra.
|
3
|
+
//
|
4
|
+
// Copyright (C) 2008-2009 Gael Guennebaud <gael.guennebaud@inria.fr>
|
5
|
+
// Copyright (C) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
|
6
|
+
//
|
7
|
+
// This Source Code Form is subject to the terms of the Mozilla
|
8
|
+
// Public License v. 2.0. If a copy of the MPL was not distributed
|
9
|
+
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
10
|
+
|
11
|
+
#ifndef EIGEN_FULLPIVOTINGHOUSEHOLDERQR_H
|
12
|
+
#define EIGEN_FULLPIVOTINGHOUSEHOLDERQR_H
|
13
|
+
|
14
|
+
namespace Eigen {
|
15
|
+
|
16
|
+
namespace internal {
|
17
|
+
|
18
|
+
template<typename MatrixType> struct FullPivHouseholderQRMatrixQReturnType;
|
19
|
+
|
20
|
+
template<typename MatrixType>
|
21
|
+
struct traits<FullPivHouseholderQRMatrixQReturnType<MatrixType> >
|
22
|
+
{
|
23
|
+
typedef typename MatrixType::PlainObject ReturnType;
|
24
|
+
};
|
25
|
+
|
26
|
+
}
|
27
|
+
|
28
|
+
/** \ingroup QR_Module
|
29
|
+
*
|
30
|
+
* \class FullPivHouseholderQR
|
31
|
+
*
|
32
|
+
* \brief Householder rank-revealing QR decomposition of a matrix with full pivoting
|
33
|
+
*
|
34
|
+
* \param MatrixType the type of the matrix of which we are computing the QR decomposition
|
35
|
+
*
|
36
|
+
* This class performs a rank-revealing QR decomposition of a matrix \b A into matrices \b P, \b Q and \b R
|
37
|
+
* such that
|
38
|
+
* \f[
|
39
|
+
* \mathbf{A} \, \mathbf{P} = \mathbf{Q} \, \mathbf{R}
|
40
|
+
* \f]
|
41
|
+
* by using Householder transformations. Here, \b P is a permutation matrix, \b Q a unitary matrix and \b R an
|
42
|
+
* upper triangular matrix.
|
43
|
+
*
|
44
|
+
* This decomposition performs a very prudent full pivoting in order to be rank-revealing and achieve optimal
|
45
|
+
* numerical stability. The trade-off is that it is slower than HouseholderQR and ColPivHouseholderQR.
|
46
|
+
*
|
47
|
+
* \sa MatrixBase::fullPivHouseholderQr()
|
48
|
+
*/
|
49
|
+
template<typename _MatrixType> class FullPivHouseholderQR
|
50
|
+
{
|
51
|
+
public:
|
52
|
+
|
53
|
+
typedef _MatrixType MatrixType;
|
54
|
+
enum {
|
55
|
+
RowsAtCompileTime = MatrixType::RowsAtCompileTime,
|
56
|
+
ColsAtCompileTime = MatrixType::ColsAtCompileTime,
|
57
|
+
Options = MatrixType::Options,
|
58
|
+
MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
|
59
|
+
MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
|
60
|
+
};
|
61
|
+
typedef typename MatrixType::Scalar Scalar;
|
62
|
+
typedef typename MatrixType::RealScalar RealScalar;
|
63
|
+
typedef typename MatrixType::Index Index;
|
64
|
+
typedef internal::FullPivHouseholderQRMatrixQReturnType<MatrixType> MatrixQReturnType;
|
65
|
+
typedef typename internal::plain_diag_type<MatrixType>::type HCoeffsType;
|
66
|
+
typedef Matrix<Index, 1,
|
67
|
+
EIGEN_SIZE_MIN_PREFER_DYNAMIC(ColsAtCompileTime,RowsAtCompileTime), RowMajor, 1,
|
68
|
+
EIGEN_SIZE_MIN_PREFER_FIXED(MaxColsAtCompileTime,MaxRowsAtCompileTime)> IntDiagSizeVectorType;
|
69
|
+
typedef PermutationMatrix<ColsAtCompileTime, MaxColsAtCompileTime> PermutationType;
|
70
|
+
typedef typename internal::plain_row_type<MatrixType>::type RowVectorType;
|
71
|
+
typedef typename internal::plain_col_type<MatrixType>::type ColVectorType;
|
72
|
+
|
73
|
+
/** \brief Default Constructor.
|
74
|
+
*
|
75
|
+
* The default constructor is useful in cases in which the user intends to
|
76
|
+
* perform decompositions via FullPivHouseholderQR::compute(const MatrixType&).
|
77
|
+
*/
|
78
|
+
FullPivHouseholderQR()
|
79
|
+
: m_qr(),
|
80
|
+
m_hCoeffs(),
|
81
|
+
m_rows_transpositions(),
|
82
|
+
m_cols_transpositions(),
|
83
|
+
m_cols_permutation(),
|
84
|
+
m_temp(),
|
85
|
+
m_isInitialized(false),
|
86
|
+
m_usePrescribedThreshold(false) {}
|
87
|
+
|
88
|
+
/** \brief Default Constructor with memory preallocation
|
89
|
+
*
|
90
|
+
* Like the default constructor but with preallocation of the internal data
|
91
|
+
* according to the specified problem \a size.
|
92
|
+
* \sa FullPivHouseholderQR()
|
93
|
+
*/
|
94
|
+
FullPivHouseholderQR(Index rows, Index cols)
|
95
|
+
: m_qr(rows, cols),
|
96
|
+
m_hCoeffs((std::min)(rows,cols)),
|
97
|
+
m_rows_transpositions((std::min)(rows,cols)),
|
98
|
+
m_cols_transpositions((std::min)(rows,cols)),
|
99
|
+
m_cols_permutation(cols),
|
100
|
+
m_temp(cols),
|
101
|
+
m_isInitialized(false),
|
102
|
+
m_usePrescribedThreshold(false) {}
|
103
|
+
|
104
|
+
/** \brief Constructs a QR factorization from a given matrix
|
105
|
+
*
|
106
|
+
* This constructor computes the QR factorization of the matrix \a matrix by calling
|
107
|
+
* the method compute(). It is a short cut for:
|
108
|
+
*
|
109
|
+
* \code
|
110
|
+
* FullPivHouseholderQR<MatrixType> qr(matrix.rows(), matrix.cols());
|
111
|
+
* qr.compute(matrix);
|
112
|
+
* \endcode
|
113
|
+
*
|
114
|
+
* \sa compute()
|
115
|
+
*/
|
116
|
+
FullPivHouseholderQR(const MatrixType& matrix)
|
117
|
+
: m_qr(matrix.rows(), matrix.cols()),
|
118
|
+
m_hCoeffs((std::min)(matrix.rows(), matrix.cols())),
|
119
|
+
m_rows_transpositions((std::min)(matrix.rows(), matrix.cols())),
|
120
|
+
m_cols_transpositions((std::min)(matrix.rows(), matrix.cols())),
|
121
|
+
m_cols_permutation(matrix.cols()),
|
122
|
+
m_temp(matrix.cols()),
|
123
|
+
m_isInitialized(false),
|
124
|
+
m_usePrescribedThreshold(false)
|
125
|
+
{
|
126
|
+
compute(matrix);
|
127
|
+
}
|
128
|
+
|
129
|
+
/** This method finds a solution x to the equation Ax=b, where A is the matrix of which
|
130
|
+
* \c *this is the QR decomposition.
|
131
|
+
*
|
132
|
+
* \param b the right-hand-side of the equation to solve.
|
133
|
+
*
|
134
|
+
* \returns the exact or least-square solution if the rank is greater or equal to the number of columns of A,
|
135
|
+
* and an arbitrary solution otherwise.
|
136
|
+
*
|
137
|
+
* \note The case where b is a matrix is not yet implemented. Also, this
|
138
|
+
* code is space inefficient.
|
139
|
+
*
|
140
|
+
* \note_about_checking_solutions
|
141
|
+
*
|
142
|
+
* \note_about_arbitrary_choice_of_solution
|
143
|
+
*
|
144
|
+
* Example: \include FullPivHouseholderQR_solve.cpp
|
145
|
+
* Output: \verbinclude FullPivHouseholderQR_solve.out
|
146
|
+
*/
|
147
|
+
template<typename Rhs>
|
148
|
+
inline const internal::solve_retval<FullPivHouseholderQR, Rhs>
|
149
|
+
solve(const MatrixBase<Rhs>& b) const
|
150
|
+
{
|
151
|
+
eigen_assert(m_isInitialized && "FullPivHouseholderQR is not initialized.");
|
152
|
+
return internal::solve_retval<FullPivHouseholderQR, Rhs>(*this, b.derived());
|
153
|
+
}
|
154
|
+
|
155
|
+
/** \returns Expression object representing the matrix Q
|
156
|
+
*/
|
157
|
+
MatrixQReturnType matrixQ(void) const;
|
158
|
+
|
159
|
+
/** \returns a reference to the matrix where the Householder QR decomposition is stored
|
160
|
+
*/
|
161
|
+
const MatrixType& matrixQR() const
|
162
|
+
{
|
163
|
+
eigen_assert(m_isInitialized && "FullPivHouseholderQR is not initialized.");
|
164
|
+
return m_qr;
|
165
|
+
}
|
166
|
+
|
167
|
+
FullPivHouseholderQR& compute(const MatrixType& matrix);
|
168
|
+
|
169
|
+
/** \returns a const reference to the column permutation matrix */
|
170
|
+
const PermutationType& colsPermutation() const
|
171
|
+
{
|
172
|
+
eigen_assert(m_isInitialized && "FullPivHouseholderQR is not initialized.");
|
173
|
+
return m_cols_permutation;
|
174
|
+
}
|
175
|
+
|
176
|
+
/** \returns a const reference to the vector of indices representing the rows transpositions */
|
177
|
+
const IntDiagSizeVectorType& rowsTranspositions() const
|
178
|
+
{
|
179
|
+
eigen_assert(m_isInitialized && "FullPivHouseholderQR is not initialized.");
|
180
|
+
return m_rows_transpositions;
|
181
|
+
}
|
182
|
+
|
183
|
+
/** \returns the absolute value of the determinant of the matrix of which
|
184
|
+
* *this is the QR decomposition. It has only linear complexity
|
185
|
+
* (that is, O(n) where n is the dimension of the square matrix)
|
186
|
+
* as the QR decomposition has already been computed.
|
187
|
+
*
|
188
|
+
* \note This is only for square matrices.
|
189
|
+
*
|
190
|
+
* \warning a determinant can be very big or small, so for matrices
|
191
|
+
* of large enough dimension, there is a risk of overflow/underflow.
|
192
|
+
* One way to work around that is to use logAbsDeterminant() instead.
|
193
|
+
*
|
194
|
+
* \sa logAbsDeterminant(), MatrixBase::determinant()
|
195
|
+
*/
|
196
|
+
typename MatrixType::RealScalar absDeterminant() const;
|
197
|
+
|
198
|
+
/** \returns the natural log of the absolute value of the determinant of the matrix of which
|
199
|
+
* *this is the QR decomposition. It has only linear complexity
|
200
|
+
* (that is, O(n) where n is the dimension of the square matrix)
|
201
|
+
* as the QR decomposition has already been computed.
|
202
|
+
*
|
203
|
+
* \note This is only for square matrices.
|
204
|
+
*
|
205
|
+
* \note This method is useful to work around the risk of overflow/underflow that's inherent
|
206
|
+
* to determinant computation.
|
207
|
+
*
|
208
|
+
* \sa absDeterminant(), MatrixBase::determinant()
|
209
|
+
*/
|
210
|
+
typename MatrixType::RealScalar logAbsDeterminant() const;
|
211
|
+
|
212
|
+
/** \returns the rank of the matrix of which *this is the QR decomposition.
|
213
|
+
*
|
214
|
+
* \note This method has to determine which pivots should be considered nonzero.
|
215
|
+
* For that, it uses the threshold value that you can control by calling
|
216
|
+
* setThreshold(const RealScalar&).
|
217
|
+
*/
|
218
|
+
inline Index rank() const
|
219
|
+
{
|
220
|
+
using std::abs;
|
221
|
+
eigen_assert(m_isInitialized && "FullPivHouseholderQR is not initialized.");
|
222
|
+
RealScalar premultiplied_threshold = abs(m_maxpivot) * threshold();
|
223
|
+
Index result = 0;
|
224
|
+
for(Index i = 0; i < m_nonzero_pivots; ++i)
|
225
|
+
result += (abs(m_qr.coeff(i,i)) > premultiplied_threshold);
|
226
|
+
return result;
|
227
|
+
}
|
228
|
+
|
229
|
+
/** \returns the dimension of the kernel of the matrix of which *this is the QR decomposition.
|
230
|
+
*
|
231
|
+
* \note This method has to determine which pivots should be considered nonzero.
|
232
|
+
* For that, it uses the threshold value that you can control by calling
|
233
|
+
* setThreshold(const RealScalar&).
|
234
|
+
*/
|
235
|
+
inline Index dimensionOfKernel() const
|
236
|
+
{
|
237
|
+
eigen_assert(m_isInitialized && "FullPivHouseholderQR is not initialized.");
|
238
|
+
return cols() - rank();
|
239
|
+
}
|
240
|
+
|
241
|
+
/** \returns true if the matrix of which *this is the QR decomposition represents an injective
|
242
|
+
* linear map, i.e. has trivial kernel; false otherwise.
|
243
|
+
*
|
244
|
+
* \note This method has to determine which pivots should be considered nonzero.
|
245
|
+
* For that, it uses the threshold value that you can control by calling
|
246
|
+
* setThreshold(const RealScalar&).
|
247
|
+
*/
|
248
|
+
inline bool isInjective() const
|
249
|
+
{
|
250
|
+
eigen_assert(m_isInitialized && "FullPivHouseholderQR is not initialized.");
|
251
|
+
return rank() == cols();
|
252
|
+
}
|
253
|
+
|
254
|
+
/** \returns true if the matrix of which *this is the QR decomposition represents a surjective
|
255
|
+
* linear map; false otherwise.
|
256
|
+
*
|
257
|
+
* \note This method has to determine which pivots should be considered nonzero.
|
258
|
+
* For that, it uses the threshold value that you can control by calling
|
259
|
+
* setThreshold(const RealScalar&).
|
260
|
+
*/
|
261
|
+
inline bool isSurjective() const
|
262
|
+
{
|
263
|
+
eigen_assert(m_isInitialized && "FullPivHouseholderQR is not initialized.");
|
264
|
+
return rank() == rows();
|
265
|
+
}
|
266
|
+
|
267
|
+
/** \returns true if the matrix of which *this is the QR decomposition is invertible.
|
268
|
+
*
|
269
|
+
* \note This method has to determine which pivots should be considered nonzero.
|
270
|
+
* For that, it uses the threshold value that you can control by calling
|
271
|
+
* setThreshold(const RealScalar&).
|
272
|
+
*/
|
273
|
+
inline bool isInvertible() const
|
274
|
+
{
|
275
|
+
eigen_assert(m_isInitialized && "FullPivHouseholderQR is not initialized.");
|
276
|
+
return isInjective() && isSurjective();
|
277
|
+
}
|
278
|
+
|
279
|
+
/** \returns the inverse of the matrix of which *this is the QR decomposition.
|
280
|
+
*
|
281
|
+
* \note If this matrix is not invertible, the returned matrix has undefined coefficients.
|
282
|
+
* Use isInvertible() to first determine whether this matrix is invertible.
|
283
|
+
*/ inline const
|
284
|
+
internal::solve_retval<FullPivHouseholderQR, typename MatrixType::IdentityReturnType>
|
285
|
+
inverse() const
|
286
|
+
{
|
287
|
+
eigen_assert(m_isInitialized && "FullPivHouseholderQR is not initialized.");
|
288
|
+
return internal::solve_retval<FullPivHouseholderQR,typename MatrixType::IdentityReturnType>
|
289
|
+
(*this, MatrixType::Identity(m_qr.rows(), m_qr.cols()));
|
290
|
+
}
|
291
|
+
|
292
|
+
inline Index rows() const { return m_qr.rows(); }
|
293
|
+
inline Index cols() const { return m_qr.cols(); }
|
294
|
+
|
295
|
+
/** \returns a const reference to the vector of Householder coefficients used to represent the factor \c Q.
|
296
|
+
*
|
297
|
+
* For advanced uses only.
|
298
|
+
*/
|
299
|
+
const HCoeffsType& hCoeffs() const { return m_hCoeffs; }
|
300
|
+
|
301
|
+
/** Allows to prescribe a threshold to be used by certain methods, such as rank(),
|
302
|
+
* who need to determine when pivots are to be considered nonzero. This is not used for the
|
303
|
+
* QR decomposition itself.
|
304
|
+
*
|
305
|
+
* When it needs to get the threshold value, Eigen calls threshold(). By default, this
|
306
|
+
* uses a formula to automatically determine a reasonable threshold.
|
307
|
+
* Once you have called the present method setThreshold(const RealScalar&),
|
308
|
+
* your value is used instead.
|
309
|
+
*
|
310
|
+
* \param threshold The new value to use as the threshold.
|
311
|
+
*
|
312
|
+
* A pivot will be considered nonzero if its absolute value is strictly greater than
|
313
|
+
* \f$ \vert pivot \vert \leqslant threshold \times \vert maxpivot \vert \f$
|
314
|
+
* where maxpivot is the biggest pivot.
|
315
|
+
*
|
316
|
+
* If you want to come back to the default behavior, call setThreshold(Default_t)
|
317
|
+
*/
|
318
|
+
FullPivHouseholderQR& setThreshold(const RealScalar& threshold)
|
319
|
+
{
|
320
|
+
m_usePrescribedThreshold = true;
|
321
|
+
m_prescribedThreshold = threshold;
|
322
|
+
return *this;
|
323
|
+
}
|
324
|
+
|
325
|
+
/** Allows to come back to the default behavior, letting Eigen use its default formula for
|
326
|
+
* determining the threshold.
|
327
|
+
*
|
328
|
+
* You should pass the special object Eigen::Default as parameter here.
|
329
|
+
* \code qr.setThreshold(Eigen::Default); \endcode
|
330
|
+
*
|
331
|
+
* See the documentation of setThreshold(const RealScalar&).
|
332
|
+
*/
|
333
|
+
FullPivHouseholderQR& setThreshold(Default_t)
|
334
|
+
{
|
335
|
+
m_usePrescribedThreshold = false;
|
336
|
+
return *this;
|
337
|
+
}
|
338
|
+
|
339
|
+
/** Returns the threshold that will be used by certain methods such as rank().
|
340
|
+
*
|
341
|
+
* See the documentation of setThreshold(const RealScalar&).
|
342
|
+
*/
|
343
|
+
RealScalar threshold() const
|
344
|
+
{
|
345
|
+
eigen_assert(m_isInitialized || m_usePrescribedThreshold);
|
346
|
+
return m_usePrescribedThreshold ? m_prescribedThreshold
|
347
|
+
// this formula comes from experimenting (see "LU precision tuning" thread on the list)
|
348
|
+
// and turns out to be identical to Higham's formula used already in LDLt.
|
349
|
+
: NumTraits<Scalar>::epsilon() * RealScalar(m_qr.diagonalSize());
|
350
|
+
}
|
351
|
+
|
352
|
+
/** \returns the number of nonzero pivots in the QR decomposition.
|
353
|
+
* Here nonzero is meant in the exact sense, not in a fuzzy sense.
|
354
|
+
* So that notion isn't really intrinsically interesting, but it is
|
355
|
+
* still useful when implementing algorithms.
|
356
|
+
*
|
357
|
+
* \sa rank()
|
358
|
+
*/
|
359
|
+
inline Index nonzeroPivots() const
|
360
|
+
{
|
361
|
+
eigen_assert(m_isInitialized && "LU is not initialized.");
|
362
|
+
return m_nonzero_pivots;
|
363
|
+
}
|
364
|
+
|
365
|
+
/** \returns the absolute value of the biggest pivot, i.e. the biggest
|
366
|
+
* diagonal coefficient of U.
|
367
|
+
*/
|
368
|
+
RealScalar maxPivot() const { return m_maxpivot; }
|
369
|
+
|
370
|
+
protected:
|
371
|
+
|
372
|
+
static void check_template_parameters()
|
373
|
+
{
|
374
|
+
EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar);
|
375
|
+
}
|
376
|
+
|
377
|
+
MatrixType m_qr;
|
378
|
+
HCoeffsType m_hCoeffs;
|
379
|
+
IntDiagSizeVectorType m_rows_transpositions;
|
380
|
+
IntDiagSizeVectorType m_cols_transpositions;
|
381
|
+
PermutationType m_cols_permutation;
|
382
|
+
RowVectorType m_temp;
|
383
|
+
bool m_isInitialized, m_usePrescribedThreshold;
|
384
|
+
RealScalar m_prescribedThreshold, m_maxpivot;
|
385
|
+
Index m_nonzero_pivots;
|
386
|
+
RealScalar m_precision;
|
387
|
+
Index m_det_pq;
|
388
|
+
};
|
389
|
+
|
390
|
+
template<typename MatrixType>
|
391
|
+
typename MatrixType::RealScalar FullPivHouseholderQR<MatrixType>::absDeterminant() const
|
392
|
+
{
|
393
|
+
using std::abs;
|
394
|
+
eigen_assert(m_isInitialized && "FullPivHouseholderQR is not initialized.");
|
395
|
+
eigen_assert(m_qr.rows() == m_qr.cols() && "You can't take the determinant of a non-square matrix!");
|
396
|
+
return abs(m_qr.diagonal().prod());
|
397
|
+
}
|
398
|
+
|
399
|
+
template<typename MatrixType>
|
400
|
+
typename MatrixType::RealScalar FullPivHouseholderQR<MatrixType>::logAbsDeterminant() const
|
401
|
+
{
|
402
|
+
eigen_assert(m_isInitialized && "FullPivHouseholderQR is not initialized.");
|
403
|
+
eigen_assert(m_qr.rows() == m_qr.cols() && "You can't take the determinant of a non-square matrix!");
|
404
|
+
return m_qr.diagonal().cwiseAbs().array().log().sum();
|
405
|
+
}
|
406
|
+
|
407
|
+
/** Performs the QR factorization of the given matrix \a matrix. The result of
|
408
|
+
* the factorization is stored into \c *this, and a reference to \c *this
|
409
|
+
* is returned.
|
410
|
+
*
|
411
|
+
* \sa class FullPivHouseholderQR, FullPivHouseholderQR(const MatrixType&)
|
412
|
+
*/
|
413
|
+
template<typename MatrixType>
|
414
|
+
FullPivHouseholderQR<MatrixType>& FullPivHouseholderQR<MatrixType>::compute(const MatrixType& matrix)
|
415
|
+
{
|
416
|
+
check_template_parameters();
|
417
|
+
|
418
|
+
using std::abs;
|
419
|
+
Index rows = matrix.rows();
|
420
|
+
Index cols = matrix.cols();
|
421
|
+
Index size = (std::min)(rows,cols);
|
422
|
+
|
423
|
+
m_qr = matrix;
|
424
|
+
m_hCoeffs.resize(size);
|
425
|
+
|
426
|
+
m_temp.resize(cols);
|
427
|
+
|
428
|
+
m_precision = NumTraits<Scalar>::epsilon() * RealScalar(size);
|
429
|
+
|
430
|
+
m_rows_transpositions.resize(size);
|
431
|
+
m_cols_transpositions.resize(size);
|
432
|
+
Index number_of_transpositions = 0;
|
433
|
+
|
434
|
+
RealScalar biggest(0);
|
435
|
+
|
436
|
+
m_nonzero_pivots = size; // the generic case is that in which all pivots are nonzero (invertible case)
|
437
|
+
m_maxpivot = RealScalar(0);
|
438
|
+
|
439
|
+
for (Index k = 0; k < size; ++k)
|
440
|
+
{
|
441
|
+
Index row_of_biggest_in_corner, col_of_biggest_in_corner;
|
442
|
+
RealScalar biggest_in_corner;
|
443
|
+
|
444
|
+
biggest_in_corner = m_qr.bottomRightCorner(rows-k, cols-k)
|
445
|
+
.cwiseAbs()
|
446
|
+
.maxCoeff(&row_of_biggest_in_corner, &col_of_biggest_in_corner);
|
447
|
+
row_of_biggest_in_corner += k;
|
448
|
+
col_of_biggest_in_corner += k;
|
449
|
+
if(k==0) biggest = biggest_in_corner;
|
450
|
+
|
451
|
+
// if the corner is negligible, then we have less than full rank, and we can finish early
|
452
|
+
if(internal::isMuchSmallerThan(biggest_in_corner, biggest, m_precision))
|
453
|
+
{
|
454
|
+
m_nonzero_pivots = k;
|
455
|
+
for(Index i = k; i < size; i++)
|
456
|
+
{
|
457
|
+
m_rows_transpositions.coeffRef(i) = i;
|
458
|
+
m_cols_transpositions.coeffRef(i) = i;
|
459
|
+
m_hCoeffs.coeffRef(i) = Scalar(0);
|
460
|
+
}
|
461
|
+
break;
|
462
|
+
}
|
463
|
+
|
464
|
+
m_rows_transpositions.coeffRef(k) = row_of_biggest_in_corner;
|
465
|
+
m_cols_transpositions.coeffRef(k) = col_of_biggest_in_corner;
|
466
|
+
if(k != row_of_biggest_in_corner) {
|
467
|
+
m_qr.row(k).tail(cols-k).swap(m_qr.row(row_of_biggest_in_corner).tail(cols-k));
|
468
|
+
++number_of_transpositions;
|
469
|
+
}
|
470
|
+
if(k != col_of_biggest_in_corner) {
|
471
|
+
m_qr.col(k).swap(m_qr.col(col_of_biggest_in_corner));
|
472
|
+
++number_of_transpositions;
|
473
|
+
}
|
474
|
+
|
475
|
+
RealScalar beta;
|
476
|
+
m_qr.col(k).tail(rows-k).makeHouseholderInPlace(m_hCoeffs.coeffRef(k), beta);
|
477
|
+
m_qr.coeffRef(k,k) = beta;
|
478
|
+
|
479
|
+
// remember the maximum absolute value of diagonal coefficients
|
480
|
+
if(abs(beta) > m_maxpivot) m_maxpivot = abs(beta);
|
481
|
+
|
482
|
+
m_qr.bottomRightCorner(rows-k, cols-k-1)
|
483
|
+
.applyHouseholderOnTheLeft(m_qr.col(k).tail(rows-k-1), m_hCoeffs.coeffRef(k), &m_temp.coeffRef(k+1));
|
484
|
+
}
|
485
|
+
|
486
|
+
m_cols_permutation.setIdentity(cols);
|
487
|
+
for(Index k = 0; k < size; ++k)
|
488
|
+
m_cols_permutation.applyTranspositionOnTheRight(k, m_cols_transpositions.coeff(k));
|
489
|
+
|
490
|
+
m_det_pq = (number_of_transpositions%2) ? -1 : 1;
|
491
|
+
m_isInitialized = true;
|
492
|
+
|
493
|
+
return *this;
|
494
|
+
}
|
495
|
+
|
496
|
+
namespace internal {
|
497
|
+
|
498
|
+
template<typename _MatrixType, typename Rhs>
|
499
|
+
struct solve_retval<FullPivHouseholderQR<_MatrixType>, Rhs>
|
500
|
+
: solve_retval_base<FullPivHouseholderQR<_MatrixType>, Rhs>
|
501
|
+
{
|
502
|
+
EIGEN_MAKE_SOLVE_HELPERS(FullPivHouseholderQR<_MatrixType>,Rhs)
|
503
|
+
|
504
|
+
template<typename Dest> void evalTo(Dest& dst) const
|
505
|
+
{
|
506
|
+
const Index rows = dec().rows(), cols = dec().cols();
|
507
|
+
eigen_assert(rhs().rows() == rows);
|
508
|
+
|
509
|
+
// FIXME introduce nonzeroPivots() and use it here. and more generally,
|
510
|
+
// make the same improvements in this dec as in FullPivLU.
|
511
|
+
if(dec().rank()==0)
|
512
|
+
{
|
513
|
+
dst.setZero();
|
514
|
+
return;
|
515
|
+
}
|
516
|
+
|
517
|
+
typename Rhs::PlainObject c(rhs());
|
518
|
+
|
519
|
+
Matrix<Scalar,1,Rhs::ColsAtCompileTime> temp(rhs().cols());
|
520
|
+
for (Index k = 0; k < dec().rank(); ++k)
|
521
|
+
{
|
522
|
+
Index remainingSize = rows-k;
|
523
|
+
c.row(k).swap(c.row(dec().rowsTranspositions().coeff(k)));
|
524
|
+
c.bottomRightCorner(remainingSize, rhs().cols())
|
525
|
+
.applyHouseholderOnTheLeft(dec().matrixQR().col(k).tail(remainingSize-1),
|
526
|
+
dec().hCoeffs().coeff(k), &temp.coeffRef(0));
|
527
|
+
}
|
528
|
+
|
529
|
+
dec().matrixQR()
|
530
|
+
.topLeftCorner(dec().rank(), dec().rank())
|
531
|
+
.template triangularView<Upper>()
|
532
|
+
.solveInPlace(c.topRows(dec().rank()));
|
533
|
+
|
534
|
+
for(Index i = 0; i < dec().rank(); ++i) dst.row(dec().colsPermutation().indices().coeff(i)) = c.row(i);
|
535
|
+
for(Index i = dec().rank(); i < cols; ++i) dst.row(dec().colsPermutation().indices().coeff(i)).setZero();
|
536
|
+
}
|
537
|
+
};
|
538
|
+
|
539
|
+
/** \ingroup QR_Module
|
540
|
+
*
|
541
|
+
* \brief Expression type for return value of FullPivHouseholderQR::matrixQ()
|
542
|
+
*
|
543
|
+
* \tparam MatrixType type of underlying dense matrix
|
544
|
+
*/
|
545
|
+
template<typename MatrixType> struct FullPivHouseholderQRMatrixQReturnType
|
546
|
+
: public ReturnByValue<FullPivHouseholderQRMatrixQReturnType<MatrixType> >
|
547
|
+
{
|
548
|
+
public:
|
549
|
+
typedef typename MatrixType::Index Index;
|
550
|
+
typedef typename FullPivHouseholderQR<MatrixType>::IntDiagSizeVectorType IntDiagSizeVectorType;
|
551
|
+
typedef typename internal::plain_diag_type<MatrixType>::type HCoeffsType;
|
552
|
+
typedef Matrix<typename MatrixType::Scalar, 1, MatrixType::RowsAtCompileTime, RowMajor, 1,
|
553
|
+
MatrixType::MaxRowsAtCompileTime> WorkVectorType;
|
554
|
+
|
555
|
+
FullPivHouseholderQRMatrixQReturnType(const MatrixType& qr,
|
556
|
+
const HCoeffsType& hCoeffs,
|
557
|
+
const IntDiagSizeVectorType& rowsTranspositions)
|
558
|
+
: m_qr(qr),
|
559
|
+
m_hCoeffs(hCoeffs),
|
560
|
+
m_rowsTranspositions(rowsTranspositions)
|
561
|
+
{}
|
562
|
+
|
563
|
+
template <typename ResultType>
|
564
|
+
void evalTo(ResultType& result) const
|
565
|
+
{
|
566
|
+
const Index rows = m_qr.rows();
|
567
|
+
WorkVectorType workspace(rows);
|
568
|
+
evalTo(result, workspace);
|
569
|
+
}
|
570
|
+
|
571
|
+
template <typename ResultType>
|
572
|
+
void evalTo(ResultType& result, WorkVectorType& workspace) const
|
573
|
+
{
|
574
|
+
using numext::conj;
|
575
|
+
// compute the product H'_0 H'_1 ... H'_n-1,
|
576
|
+
// where H_k is the k-th Householder transformation I - h_k v_k v_k'
|
577
|
+
// and v_k is the k-th Householder vector [1,m_qr(k+1,k), m_qr(k+2,k), ...]
|
578
|
+
const Index rows = m_qr.rows();
|
579
|
+
const Index cols = m_qr.cols();
|
580
|
+
const Index size = (std::min)(rows, cols);
|
581
|
+
workspace.resize(rows);
|
582
|
+
result.setIdentity(rows, rows);
|
583
|
+
for (Index k = size-1; k >= 0; k--)
|
584
|
+
{
|
585
|
+
result.block(k, k, rows-k, rows-k)
|
586
|
+
.applyHouseholderOnTheLeft(m_qr.col(k).tail(rows-k-1), conj(m_hCoeffs.coeff(k)), &workspace.coeffRef(k));
|
587
|
+
result.row(k).swap(result.row(m_rowsTranspositions.coeff(k)));
|
588
|
+
}
|
589
|
+
}
|
590
|
+
|
591
|
+
Index rows() const { return m_qr.rows(); }
|
592
|
+
Index cols() const { return m_qr.rows(); }
|
593
|
+
|
594
|
+
protected:
|
595
|
+
typename MatrixType::Nested m_qr;
|
596
|
+
typename HCoeffsType::Nested m_hCoeffs;
|
597
|
+
typename IntDiagSizeVectorType::Nested m_rowsTranspositions;
|
598
|
+
};
|
599
|
+
|
600
|
+
} // end namespace internal
|
601
|
+
|
602
|
+
template<typename MatrixType>
|
603
|
+
inline typename FullPivHouseholderQR<MatrixType>::MatrixQReturnType FullPivHouseholderQR<MatrixType>::matrixQ() const
|
604
|
+
{
|
605
|
+
eigen_assert(m_isInitialized && "FullPivHouseholderQR is not initialized.");
|
606
|
+
return MatrixQReturnType(m_qr, m_hCoeffs, m_rows_transpositions);
|
607
|
+
}
|
608
|
+
|
609
|
+
/** \return the full-pivoting Householder QR decomposition of \c *this.
|
610
|
+
*
|
611
|
+
* \sa class FullPivHouseholderQR
|
612
|
+
*/
|
613
|
+
template<typename Derived>
|
614
|
+
const FullPivHouseholderQR<typename MatrixBase<Derived>::PlainObject>
|
615
|
+
MatrixBase<Derived>::fullPivHouseholderQr() const
|
616
|
+
{
|
617
|
+
return FullPivHouseholderQR<PlainObject>(eval());
|
618
|
+
}
|
619
|
+
|
620
|
+
} // end namespace Eigen
|
621
|
+
|
622
|
+
#endif // EIGEN_FULLPIVOTINGHOUSEHOLDERQR_H
|