@smake/eigen 1.0.2 → 1.1.1
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.
- package/README.md +1 -1
- package/eigen/Eigen/AccelerateSupport +52 -0
- package/eigen/Eigen/Cholesky +18 -21
- package/eigen/Eigen/CholmodSupport +28 -28
- package/eigen/Eigen/Core +235 -326
- package/eigen/Eigen/Eigenvalues +16 -14
- package/eigen/Eigen/Geometry +21 -24
- package/eigen/Eigen/Householder +9 -8
- package/eigen/Eigen/IterativeLinearSolvers +8 -4
- package/eigen/Eigen/Jacobi +14 -14
- package/eigen/Eigen/KLUSupport +43 -0
- package/eigen/Eigen/LU +16 -20
- package/eigen/Eigen/MetisSupport +12 -12
- package/eigen/Eigen/OrderingMethods +54 -54
- package/eigen/Eigen/PaStiXSupport +23 -20
- package/eigen/Eigen/PardisoSupport +17 -14
- package/eigen/Eigen/QR +18 -21
- package/eigen/Eigen/QtAlignedMalloc +5 -13
- package/eigen/Eigen/SPQRSupport +21 -14
- package/eigen/Eigen/SVD +23 -18
- package/eigen/Eigen/Sparse +1 -4
- package/eigen/Eigen/SparseCholesky +18 -23
- package/eigen/Eigen/SparseCore +18 -17
- package/eigen/Eigen/SparseLU +12 -8
- package/eigen/Eigen/SparseQR +16 -14
- package/eigen/Eigen/StdDeque +5 -2
- package/eigen/Eigen/StdList +5 -2
- package/eigen/Eigen/StdVector +5 -2
- package/eigen/Eigen/SuperLUSupport +30 -24
- package/eigen/Eigen/ThreadPool +80 -0
- package/eigen/Eigen/UmfPackSupport +19 -17
- package/eigen/Eigen/Version +14 -0
- package/eigen/Eigen/src/AccelerateSupport/AccelerateSupport.h +423 -0
- package/eigen/Eigen/src/AccelerateSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Cholesky/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Cholesky/LDLT.h +377 -401
- package/eigen/Eigen/src/Cholesky/LLT.h +332 -360
- package/eigen/Eigen/src/Cholesky/LLT_LAPACKE.h +81 -56
- package/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +620 -521
- package/eigen/Eigen/src/CholmodSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Core/ArithmeticSequence.h +239 -0
- package/eigen/Eigen/src/Core/Array.h +341 -294
- package/eigen/Eigen/src/Core/ArrayBase.h +190 -203
- package/eigen/Eigen/src/Core/ArrayWrapper.h +127 -171
- package/eigen/Eigen/src/Core/Assign.h +30 -40
- package/eigen/Eigen/src/Core/AssignEvaluator.h +711 -589
- package/eigen/Eigen/src/Core/Assign_MKL.h +130 -125
- package/eigen/Eigen/src/Core/BandMatrix.h +268 -283
- package/eigen/Eigen/src/Core/Block.h +375 -398
- package/eigen/Eigen/src/Core/CommaInitializer.h +86 -97
- package/eigen/Eigen/src/Core/ConditionEstimator.h +51 -53
- package/eigen/Eigen/src/Core/CoreEvaluators.h +1356 -1026
- package/eigen/Eigen/src/Core/CoreIterators.h +73 -59
- package/eigen/Eigen/src/Core/CwiseBinaryOp.h +114 -132
- package/eigen/Eigen/src/Core/CwiseNullaryOp.h +726 -617
- package/eigen/Eigen/src/Core/CwiseTernaryOp.h +77 -103
- package/eigen/Eigen/src/Core/CwiseUnaryOp.h +56 -68
- package/eigen/Eigen/src/Core/CwiseUnaryView.h +132 -95
- package/eigen/Eigen/src/Core/DenseBase.h +632 -571
- package/eigen/Eigen/src/Core/DenseCoeffsBase.h +511 -624
- package/eigen/Eigen/src/Core/DenseStorage.h +512 -509
- package/eigen/Eigen/src/Core/DeviceWrapper.h +153 -0
- package/eigen/Eigen/src/Core/Diagonal.h +169 -210
- package/eigen/Eigen/src/Core/DiagonalMatrix.h +351 -274
- package/eigen/Eigen/src/Core/DiagonalProduct.h +12 -10
- package/eigen/Eigen/src/Core/Dot.h +172 -222
- package/eigen/Eigen/src/Core/EigenBase.h +75 -85
- package/eigen/Eigen/src/Core/Fill.h +138 -0
- package/eigen/Eigen/src/Core/FindCoeff.h +464 -0
- package/eigen/Eigen/src/Core/ForceAlignedAccess.h +90 -109
- package/eigen/Eigen/src/Core/Fuzzy.h +82 -105
- package/eigen/Eigen/src/Core/GeneralProduct.h +327 -263
- package/eigen/Eigen/src/Core/GenericPacketMath.h +1472 -360
- package/eigen/Eigen/src/Core/GlobalFunctions.h +194 -151
- package/eigen/Eigen/src/Core/IO.h +147 -139
- package/eigen/Eigen/src/Core/IndexedView.h +321 -0
- package/eigen/Eigen/src/Core/InnerProduct.h +260 -0
- package/eigen/Eigen/src/Core/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Core/Inverse.h +56 -66
- package/eigen/Eigen/src/Core/Map.h +124 -142
- package/eigen/Eigen/src/Core/MapBase.h +256 -281
- package/eigen/Eigen/src/Core/MathFunctions.h +1620 -938
- package/eigen/Eigen/src/Core/MathFunctionsImpl.h +233 -71
- package/eigen/Eigen/src/Core/Matrix.h +491 -416
- package/eigen/Eigen/src/Core/MatrixBase.h +468 -453
- package/eigen/Eigen/src/Core/NestByValue.h +66 -85
- package/eigen/Eigen/src/Core/NoAlias.h +79 -85
- package/eigen/Eigen/src/Core/NumTraits.h +235 -148
- package/eigen/Eigen/src/Core/PartialReduxEvaluator.h +253 -0
- package/eigen/Eigen/src/Core/PermutationMatrix.h +461 -511
- package/eigen/Eigen/src/Core/PlainObjectBase.h +871 -894
- package/eigen/Eigen/src/Core/Product.h +260 -139
- package/eigen/Eigen/src/Core/ProductEvaluators.h +863 -714
- package/eigen/Eigen/src/Core/Random.h +161 -136
- package/eigen/Eigen/src/Core/RandomImpl.h +262 -0
- package/eigen/Eigen/src/Core/RealView.h +250 -0
- package/eigen/Eigen/src/Core/Redux.h +366 -336
- package/eigen/Eigen/src/Core/Ref.h +308 -209
- package/eigen/Eigen/src/Core/Replicate.h +94 -106
- package/eigen/Eigen/src/Core/Reshaped.h +398 -0
- package/eigen/Eigen/src/Core/ReturnByValue.h +49 -55
- package/eigen/Eigen/src/Core/Reverse.h +136 -145
- package/eigen/Eigen/src/Core/Select.h +70 -140
- package/eigen/Eigen/src/Core/SelfAdjointView.h +262 -285
- package/eigen/Eigen/src/Core/SelfCwiseBinaryOp.h +23 -20
- package/eigen/Eigen/src/Core/SkewSymmetricMatrix3.h +382 -0
- package/eigen/Eigen/src/Core/Solve.h +97 -111
- package/eigen/Eigen/src/Core/SolveTriangular.h +131 -129
- package/eigen/Eigen/src/Core/SolverBase.h +138 -101
- package/eigen/Eigen/src/Core/StableNorm.h +156 -160
- package/eigen/Eigen/src/Core/StlIterators.h +619 -0
- package/eigen/Eigen/src/Core/Stride.h +91 -88
- package/eigen/Eigen/src/Core/Swap.h +70 -38
- package/eigen/Eigen/src/Core/Transpose.h +295 -273
- package/eigen/Eigen/src/Core/Transpositions.h +272 -317
- package/eigen/Eigen/src/Core/TriangularMatrix.h +670 -755
- package/eigen/Eigen/src/Core/VectorBlock.h +59 -72
- package/eigen/Eigen/src/Core/VectorwiseOp.h +668 -630
- package/eigen/Eigen/src/Core/Visitor.h +480 -216
- package/eigen/Eigen/src/Core/arch/AVX/Complex.h +407 -293
- package/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +79 -388
- package/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +2935 -491
- package/eigen/Eigen/src/Core/arch/AVX/Reductions.h +353 -0
- package/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +279 -22
- package/eigen/Eigen/src/Core/arch/AVX512/Complex.h +472 -0
- package/eigen/Eigen/src/Core/arch/AVX512/GemmKernel.h +1245 -0
- package/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +85 -333
- package/eigen/Eigen/src/Core/arch/AVX512/MathFunctionsFP16.h +75 -0
- package/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +2490 -649
- package/eigen/Eigen/src/Core/arch/AVX512/PacketMathFP16.h +1413 -0
- package/eigen/Eigen/src/Core/arch/AVX512/Reductions.h +297 -0
- package/eigen/Eigen/src/Core/arch/AVX512/TrsmKernel.h +1167 -0
- package/eigen/Eigen/src/Core/arch/AVX512/TrsmUnrolls.inc +1219 -0
- package/eigen/Eigen/src/Core/arch/AVX512/TypeCasting.h +277 -0
- package/eigen/Eigen/src/Core/arch/AVX512/TypeCastingFP16.h +130 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +521 -298
- package/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +39 -280
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +3686 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +205 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +901 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMAbfloat16.h +742 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixVectorProduct.inc +2818 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h +3391 -723
- package/eigen/Eigen/src/Core/arch/AltiVec/TypeCasting.h +153 -0
- package/eigen/Eigen/src/Core/arch/Default/BFloat16.h +866 -0
- package/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +113 -14
- package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +2634 -0
- package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +227 -0
- package/eigen/Eigen/src/Core/arch/Default/Half.h +1091 -0
- package/eigen/Eigen/src/Core/arch/Default/Settings.h +11 -13
- package/eigen/Eigen/src/Core/arch/GPU/Complex.h +244 -0
- package/eigen/Eigen/src/Core/arch/GPU/MathFunctions.h +104 -0
- package/eigen/Eigen/src/Core/arch/GPU/PacketMath.h +1712 -0
- package/eigen/Eigen/src/Core/arch/GPU/Tuple.h +268 -0
- package/eigen/Eigen/src/Core/arch/GPU/TypeCasting.h +77 -0
- package/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h +23 -0
- package/eigen/Eigen/src/Core/arch/HVX/PacketMath.h +1088 -0
- package/eigen/Eigen/src/Core/arch/LSX/Complex.h +520 -0
- package/eigen/Eigen/src/Core/arch/LSX/GeneralBlockPanelKernel.h +23 -0
- package/eigen/Eigen/src/Core/arch/LSX/MathFunctions.h +43 -0
- package/eigen/Eigen/src/Core/arch/LSX/PacketMath.h +2866 -0
- package/eigen/Eigen/src/Core/arch/LSX/TypeCasting.h +526 -0
- package/eigen/Eigen/src/Core/arch/MSA/Complex.h +620 -0
- package/eigen/Eigen/src/Core/arch/MSA/MathFunctions.h +379 -0
- package/eigen/Eigen/src/Core/arch/MSA/PacketMath.h +1237 -0
- package/eigen/Eigen/src/Core/arch/NEON/Complex.h +531 -289
- package/eigen/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +243 -0
- package/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +50 -73
- package/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +5915 -579
- package/eigen/Eigen/src/Core/arch/NEON/TypeCasting.h +1642 -0
- package/eigen/Eigen/src/Core/arch/NEON/UnaryFunctors.h +57 -0
- package/eigen/Eigen/src/Core/arch/SSE/Complex.h +366 -334
- package/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +40 -514
- package/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +2164 -675
- package/eigen/Eigen/src/Core/arch/SSE/Reductions.h +324 -0
- package/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +188 -35
- package/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h +48 -0
- package/eigen/Eigen/src/Core/arch/SVE/PacketMath.h +674 -0
- package/eigen/Eigen/src/Core/arch/SVE/TypeCasting.h +52 -0
- package/eigen/Eigen/src/Core/arch/SYCL/InteropHeaders.h +227 -0
- package/eigen/Eigen/src/Core/arch/SYCL/MathFunctions.h +303 -0
- package/eigen/Eigen/src/Core/arch/SYCL/PacketMath.h +576 -0
- package/eigen/Eigen/src/Core/arch/SYCL/TypeCasting.h +83 -0
- package/eigen/Eigen/src/Core/arch/ZVector/Complex.h +434 -261
- package/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +160 -53
- package/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +1073 -605
- package/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +123 -117
- package/eigen/Eigen/src/Core/functors/BinaryFunctors.h +594 -322
- package/eigen/Eigen/src/Core/functors/NullaryFunctors.h +204 -118
- package/eigen/Eigen/src/Core/functors/StlFunctors.h +110 -97
- package/eigen/Eigen/src/Core/functors/TernaryFunctors.h +34 -7
- package/eigen/Eigen/src/Core/functors/UnaryFunctors.h +1158 -530
- package/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +2329 -1333
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +328 -364
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +191 -178
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +85 -82
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +154 -73
- package/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +396 -542
- package/eigen/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +80 -77
- package/eigen/Eigen/src/Core/products/Parallelizer.h +208 -92
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +331 -375
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +206 -224
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +139 -146
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h +58 -61
- package/eigen/Eigen/src/Core/products/SelfadjointProduct.h +71 -71
- package/eigen/Eigen/src/Core/products/SelfadjointRank2Update.h +48 -46
- package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix.h +294 -369
- package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +246 -238
- package/eigen/Eigen/src/Core/products/TriangularMatrixVector.h +244 -247
- package/eigen/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h +212 -192
- package/eigen/Eigen/src/Core/products/TriangularSolverMatrix.h +328 -275
- package/eigen/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +108 -109
- package/eigen/Eigen/src/Core/products/TriangularSolverVector.h +70 -93
- package/eigen/Eigen/src/Core/util/Assert.h +158 -0
- package/eigen/Eigen/src/Core/util/BlasUtil.h +413 -290
- package/eigen/Eigen/src/Core/util/ConfigureVectorization.h +543 -0
- package/eigen/Eigen/src/Core/util/Constants.h +314 -263
- package/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +130 -78
- package/eigen/Eigen/src/Core/util/EmulateArray.h +270 -0
- package/eigen/Eigen/src/Core/util/ForwardDeclarations.h +450 -224
- package/eigen/Eigen/src/Core/util/GpuHipCudaDefines.inc +101 -0
- package/eigen/Eigen/src/Core/util/GpuHipCudaUndefines.inc +45 -0
- package/eigen/Eigen/src/Core/util/IndexedViewHelper.h +487 -0
- package/eigen/Eigen/src/Core/util/IntegralConstant.h +279 -0
- package/eigen/Eigen/src/Core/util/MKL_support.h +39 -30
- package/eigen/Eigen/src/Core/util/Macros.h +939 -646
- package/eigen/Eigen/src/Core/util/MaxSizeVector.h +139 -0
- package/eigen/Eigen/src/Core/util/Memory.h +1042 -650
- package/eigen/Eigen/src/Core/util/Meta.h +618 -426
- package/eigen/Eigen/src/Core/util/MoreMeta.h +638 -0
- package/eigen/Eigen/src/Core/util/ReenableStupidWarnings.h +32 -19
- package/eigen/Eigen/src/Core/util/ReshapedHelper.h +51 -0
- package/eigen/Eigen/src/Core/util/Serializer.h +209 -0
- package/eigen/Eigen/src/Core/util/StaticAssert.h +51 -164
- package/eigen/Eigen/src/Core/util/SymbolicIndex.h +445 -0
- package/eigen/Eigen/src/Core/util/XprHelper.h +793 -538
- package/eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h +246 -277
- package/eigen/Eigen/src/Eigenvalues/ComplexSchur.h +299 -319
- package/eigen/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h +52 -48
- package/eigen/Eigen/src/Eigenvalues/EigenSolver.h +413 -456
- package/eigen/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +309 -325
- package/eigen/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +157 -171
- package/eigen/Eigen/src/Eigenvalues/HessenbergDecomposition.h +292 -310
- package/eigen/Eigen/src/Eigenvalues/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +91 -107
- package/eigen/Eigen/src/Eigenvalues/RealQZ.h +539 -606
- package/eigen/Eigen/src/Eigenvalues/RealSchur.h +348 -382
- package/eigen/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +41 -35
- package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +579 -600
- package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +47 -44
- package/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +434 -461
- package/eigen/Eigen/src/Geometry/AlignedBox.h +307 -214
- package/eigen/Eigen/src/Geometry/AngleAxis.h +135 -137
- package/eigen/Eigen/src/Geometry/EulerAngles.h +163 -74
- package/eigen/Eigen/src/Geometry/Homogeneous.h +289 -333
- package/eigen/Eigen/src/Geometry/Hyperplane.h +152 -161
- package/eigen/Eigen/src/Geometry/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Geometry/OrthoMethods.h +168 -145
- package/eigen/Eigen/src/Geometry/ParametrizedLine.h +141 -104
- package/eigen/Eigen/src/Geometry/Quaternion.h +595 -497
- package/eigen/Eigen/src/Geometry/Rotation2D.h +110 -108
- package/eigen/Eigen/src/Geometry/RotationBase.h +148 -145
- package/eigen/Eigen/src/Geometry/Scaling.h +115 -90
- package/eigen/Eigen/src/Geometry/Transform.h +896 -953
- package/eigen/Eigen/src/Geometry/Translation.h +100 -98
- package/eigen/Eigen/src/Geometry/Umeyama.h +79 -84
- package/eigen/Eigen/src/Geometry/arch/Geometry_SIMD.h +154 -0
- package/eigen/Eigen/src/Householder/BlockHouseholder.h +54 -42
- package/eigen/Eigen/src/Householder/Householder.h +104 -122
- package/eigen/Eigen/src/Householder/HouseholderSequence.h +416 -382
- package/eigen/Eigen/src/Householder/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +153 -166
- package/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +127 -138
- package/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +95 -124
- package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +269 -267
- package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +246 -259
- package/eigen/Eigen/src/IterativeLinearSolvers/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +218 -217
- package/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +80 -103
- package/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +59 -63
- package/eigen/Eigen/src/Jacobi/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Jacobi/Jacobi.h +256 -291
- package/eigen/Eigen/src/KLUSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/KLUSupport/KLUSupport.h +339 -0
- package/eigen/Eigen/src/LU/Determinant.h +60 -63
- package/eigen/Eigen/src/LU/FullPivLU.h +561 -626
- package/eigen/Eigen/src/LU/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/LU/InverseImpl.h +213 -275
- package/eigen/Eigen/src/LU/PartialPivLU.h +407 -435
- package/eigen/Eigen/src/LU/PartialPivLU_LAPACKE.h +54 -40
- package/eigen/Eigen/src/LU/arch/InverseSize4.h +353 -0
- package/eigen/Eigen/src/MetisSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/MetisSupport/MetisSupport.h +81 -93
- package/eigen/Eigen/src/OrderingMethods/Amd.h +250 -282
- package/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +950 -1103
- package/eigen/Eigen/src/OrderingMethods/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/OrderingMethods/Ordering.h +111 -122
- package/eigen/Eigen/src/PaStiXSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h +524 -570
- package/eigen/Eigen/src/PardisoSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/PardisoSupport/PardisoSupport.h +385 -429
- package/eigen/Eigen/src/QR/ColPivHouseholderQR.h +494 -473
- package/eigen/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +120 -56
- package/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +223 -137
- package/eigen/Eigen/src/QR/FullPivHouseholderQR.h +517 -460
- package/eigen/Eigen/src/QR/HouseholderQR.h +412 -278
- package/eigen/Eigen/src/QR/HouseholderQR_LAPACKE.h +32 -23
- package/eigen/Eigen/src/QR/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SPQRSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +263 -261
- package/eigen/Eigen/src/SVD/BDCSVD.h +872 -679
- package/eigen/Eigen/src/SVD/BDCSVD_LAPACKE.h +174 -0
- package/eigen/Eigen/src/SVD/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SVD/JacobiSVD.h +585 -543
- package/eigen/Eigen/src/SVD/JacobiSVD_LAPACKE.h +85 -49
- package/eigen/Eigen/src/SVD/SVDBase.h +281 -160
- package/eigen/Eigen/src/SVD/UpperBidiagonalization.h +202 -237
- package/eigen/Eigen/src/SparseCholesky/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +769 -590
- package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +318 -129
- package/eigen/Eigen/src/SparseCore/AmbiVector.h +202 -251
- package/eigen/Eigen/src/SparseCore/CompressedStorage.h +184 -236
- package/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +140 -184
- package/eigen/Eigen/src/SparseCore/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseCore/SparseAssign.h +174 -111
- package/eigen/Eigen/src/SparseCore/SparseBlock.h +408 -477
- package/eigen/Eigen/src/SparseCore/SparseColEtree.h +100 -112
- package/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +531 -280
- package/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +559 -347
- package/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +100 -108
- package/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +185 -191
- package/eigen/Eigen/src/SparseCore/SparseDiagonalProduct.h +71 -71
- package/eigen/Eigen/src/SparseCore/SparseDot.h +49 -47
- package/eigen/Eigen/src/SparseCore/SparseFuzzy.h +13 -11
- package/eigen/Eigen/src/SparseCore/SparseMap.h +243 -253
- package/eigen/Eigen/src/SparseCore/SparseMatrix.h +1614 -1142
- package/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +403 -357
- package/eigen/Eigen/src/SparseCore/SparsePermutation.h +186 -115
- package/eigen/Eigen/src/SparseCore/SparseProduct.h +100 -91
- package/eigen/Eigen/src/SparseCore/SparseRedux.h +22 -24
- package/eigen/Eigen/src/SparseCore/SparseRef.h +268 -295
- package/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h +371 -414
- package/eigen/Eigen/src/SparseCore/SparseSolverBase.h +78 -87
- package/eigen/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +81 -95
- package/eigen/Eigen/src/SparseCore/SparseTranspose.h +62 -71
- package/eigen/Eigen/src/SparseCore/SparseTriangularView.h +132 -144
- package/eigen/Eigen/src/SparseCore/SparseUtil.h +146 -115
- package/eigen/Eigen/src/SparseCore/SparseVector.h +426 -372
- package/eigen/Eigen/src/SparseCore/SparseView.h +164 -193
- package/eigen/Eigen/src/SparseCore/TriangularSolver.h +129 -170
- package/eigen/Eigen/src/SparseLU/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseLU/SparseLU.h +814 -618
- package/eigen/Eigen/src/SparseLU/SparseLUImpl.h +61 -48
- package/eigen/Eigen/src/SparseLU/SparseLU_Memory.h +102 -118
- package/eigen/Eigen/src/SparseLU/SparseLU_Structs.h +38 -35
- package/eigen/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +273 -255
- package/eigen/Eigen/src/SparseLU/SparseLU_Utils.h +44 -49
- package/eigen/Eigen/src/SparseLU/SparseLU_column_bmod.h +104 -108
- package/eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h +90 -101
- package/eigen/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +57 -58
- package/eigen/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +43 -55
- package/eigen/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +74 -71
- package/eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h +125 -133
- package/eigen/Eigen/src/SparseLU/SparseLU_panel_dfs.h +136 -159
- package/eigen/Eigen/src/SparseLU/SparseLU_pivotL.h +51 -52
- package/eigen/Eigen/src/SparseLU/SparseLU_pruneL.h +67 -73
- package/eigen/Eigen/src/SparseLU/SparseLU_relax_snode.h +24 -26
- package/eigen/Eigen/src/SparseQR/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseQR/SparseQR.h +451 -490
- package/eigen/Eigen/src/StlSupport/StdDeque.h +28 -105
- package/eigen/Eigen/src/StlSupport/StdList.h +28 -84
- package/eigen/Eigen/src/StlSupport/StdVector.h +28 -108
- package/eigen/Eigen/src/StlSupport/details.h +48 -50
- package/eigen/Eigen/src/SuperLUSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SuperLUSupport/SuperLUSupport.h +634 -732
- package/eigen/Eigen/src/ThreadPool/Barrier.h +70 -0
- package/eigen/Eigen/src/ThreadPool/CoreThreadPoolDevice.h +336 -0
- package/eigen/Eigen/src/ThreadPool/EventCount.h +241 -0
- package/eigen/Eigen/src/ThreadPool/ForkJoin.h +140 -0
- package/eigen/Eigen/src/ThreadPool/InternalHeaderCheck.h +4 -0
- package/eigen/Eigen/src/ThreadPool/NonBlockingThreadPool.h +587 -0
- package/eigen/Eigen/src/ThreadPool/RunQueue.h +230 -0
- package/eigen/Eigen/src/ThreadPool/ThreadCancel.h +21 -0
- package/eigen/Eigen/src/ThreadPool/ThreadEnvironment.h +43 -0
- package/eigen/Eigen/src/ThreadPool/ThreadLocal.h +289 -0
- package/eigen/Eigen/src/ThreadPool/ThreadPoolInterface.h +50 -0
- package/eigen/Eigen/src/ThreadPool/ThreadYield.h +16 -0
- package/eigen/Eigen/src/UmfPackSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/UmfPackSupport/UmfPackSupport.h +480 -380
- package/eigen/Eigen/src/misc/Image.h +41 -43
- package/eigen/Eigen/src/misc/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/misc/Kernel.h +39 -41
- package/eigen/Eigen/src/misc/RealSvd2x2.h +19 -21
- package/eigen/Eigen/src/misc/blas.h +83 -426
- package/eigen/Eigen/src/misc/lapacke.h +9976 -16182
- package/eigen/Eigen/src/misc/lapacke_helpers.h +163 -0
- package/eigen/Eigen/src/misc/lapacke_mangling.h +4 -5
- package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.inc +344 -0
- package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.inc +544 -0
- package/eigen/Eigen/src/plugins/BlockMethods.inc +1370 -0
- package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.inc +116 -0
- package/eigen/Eigen/src/plugins/CommonCwiseUnaryOps.inc +167 -0
- package/eigen/Eigen/src/plugins/IndexedViewMethods.inc +192 -0
- package/eigen/Eigen/src/plugins/InternalHeaderCheck.inc +3 -0
- package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.inc +331 -0
- package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.inc +118 -0
- package/eigen/Eigen/src/plugins/ReshapedMethods.inc +133 -0
- package/lib/LibEigen.d.ts +4 -0
- package/lib/LibEigen.js +14 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +7 -3
- package/package.json +2 -10
- package/eigen/Eigen/CMakeLists.txt +0 -19
- package/eigen/Eigen/src/Core/BooleanRedux.h +0 -164
- package/eigen/Eigen/src/Core/arch/CUDA/Complex.h +0 -103
- package/eigen/Eigen/src/Core/arch/CUDA/Half.h +0 -675
- package/eigen/Eigen/src/Core/arch/CUDA/MathFunctions.h +0 -91
- package/eigen/Eigen/src/Core/arch/CUDA/PacketMath.h +0 -333
- package/eigen/Eigen/src/Core/arch/CUDA/PacketMathHalf.h +0 -1124
- package/eigen/Eigen/src/Core/arch/CUDA/TypeCasting.h +0 -212
- package/eigen/Eigen/src/Core/util/NonMPL2.h +0 -3
- package/eigen/Eigen/src/Geometry/arch/Geometry_SSE.h +0 -161
- package/eigen/Eigen/src/LU/arch/Inverse_SSE.h +0 -338
- package/eigen/Eigen/src/SparseCore/MappedSparseMatrix.h +0 -67
- package/eigen/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +0 -280
- package/eigen/Eigen/src/misc/lapack.h +0 -152
- package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.h +0 -332
- package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h +0 -552
- package/eigen/Eigen/src/plugins/BlockMethods.h +0 -1058
- package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.h +0 -115
- package/eigen/Eigen/src/plugins/CommonCwiseUnaryOps.h +0 -163
- package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h +0 -152
- package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h +0 -85
- package/lib/eigen.d.ts +0 -2
- package/lib/eigen.js +0 -15
|
@@ -10,523 +10,711 @@
|
|
|
10
10
|
#ifndef EIGEN_SIMPLICIAL_CHOLESKY_H
|
|
11
11
|
#define EIGEN_SIMPLICIAL_CHOLESKY_H
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
// IWYU pragma: private
|
|
14
|
+
#include "./InternalHeaderCheck.h"
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
16
|
+
namespace Eigen {
|
|
17
|
+
|
|
18
|
+
enum SimplicialCholeskyMode { SimplicialCholeskyLLT, SimplicialCholeskyLDLT };
|
|
19
19
|
|
|
20
20
|
namespace internal {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
pmat = &input;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
} // end namespace internal
|
|
21
|
+
template <typename CholMatrixType, typename InputMatrixType>
|
|
22
|
+
struct simplicial_cholesky_grab_input {
|
|
23
|
+
typedef CholMatrixType const* ConstCholMatrixPtr;
|
|
24
|
+
static void run(const InputMatrixType& input, ConstCholMatrixPtr& pmat, CholMatrixType& tmp) {
|
|
25
|
+
tmp = input;
|
|
26
|
+
pmat = &tmp;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
template <typename MatrixType>
|
|
31
|
+
struct simplicial_cholesky_grab_input<MatrixType, MatrixType> {
|
|
32
|
+
typedef MatrixType const* ConstMatrixPtr;
|
|
33
|
+
static void run(const MatrixType& input, ConstMatrixPtr& pmat, MatrixType& /*tmp*/) { pmat = &input; }
|
|
34
|
+
};
|
|
35
|
+
} // end namespace internal
|
|
40
36
|
|
|
41
37
|
/** \ingroup SparseCholesky_Module
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
template<typename Derived>
|
|
55
|
-
class SimplicialCholeskyBase : public SparseSolverBase<Derived>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
explicit SimplicialCholeskyBase(const MatrixType& matrix)
|
|
87
|
-
: m_info(Success), m_shiftOffset(0), m_shiftScale(1)
|
|
88
|
-
{
|
|
89
|
-
derived().compute(matrix);
|
|
90
|
-
}
|
|
38
|
+
* \brief A base class for direct sparse Cholesky factorizations
|
|
39
|
+
*
|
|
40
|
+
* This is a base class for LL^T and LDL^T Cholesky factorizations of sparse matrices that are
|
|
41
|
+
* selfadjoint and positive definite. These factorizations allow for solving A.X = B where
|
|
42
|
+
* X and B can be either dense or sparse.
|
|
43
|
+
*
|
|
44
|
+
* In order to reduce the fill-in, a symmetric permutation P is applied prior to the factorization
|
|
45
|
+
* such that the factorized matrix is P A P^-1.
|
|
46
|
+
*
|
|
47
|
+
* \tparam Derived the type of the derived class, that is the actual factorization type.
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
template <typename Derived>
|
|
51
|
+
class SimplicialCholeskyBase : public SparseSolverBase<Derived> {
|
|
52
|
+
typedef SparseSolverBase<Derived> Base;
|
|
53
|
+
using Base::m_isInitialized;
|
|
54
|
+
|
|
55
|
+
public:
|
|
56
|
+
typedef typename internal::traits<Derived>::MatrixType MatrixType;
|
|
57
|
+
typedef typename internal::traits<Derived>::OrderingType OrderingType;
|
|
58
|
+
enum { UpLo = internal::traits<Derived>::UpLo };
|
|
59
|
+
typedef typename MatrixType::Scalar Scalar;
|
|
60
|
+
typedef typename MatrixType::RealScalar RealScalar;
|
|
61
|
+
typedef typename internal::traits<Derived>::DiagonalScalar DiagonalScalar;
|
|
62
|
+
typedef typename MatrixType::StorageIndex StorageIndex;
|
|
63
|
+
typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
|
|
64
|
+
typedef CholMatrixType const* ConstCholMatrixPtr;
|
|
65
|
+
typedef Matrix<Scalar, Dynamic, 1> VectorType;
|
|
66
|
+
typedef Matrix<StorageIndex, Dynamic, 1> VectorI;
|
|
67
|
+
|
|
68
|
+
enum { ColsAtCompileTime = MatrixType::ColsAtCompileTime, MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime };
|
|
69
|
+
|
|
70
|
+
public:
|
|
71
|
+
using Base::derived;
|
|
72
|
+
|
|
73
|
+
/** Default constructor */
|
|
74
|
+
SimplicialCholeskyBase()
|
|
75
|
+
: m_info(Success), m_factorizationIsOk(false), m_analysisIsOk(false), m_shiftOffset(0), m_shiftScale(1) {}
|
|
76
|
+
|
|
77
|
+
explicit SimplicialCholeskyBase(const MatrixType& matrix)
|
|
78
|
+
: m_info(Success), m_factorizationIsOk(false), m_analysisIsOk(false), m_shiftOffset(0), m_shiftScale(1) {
|
|
79
|
+
derived().compute(matrix);
|
|
80
|
+
}
|
|
91
81
|
|
|
92
|
-
|
|
93
|
-
{
|
|
94
|
-
}
|
|
82
|
+
~SimplicialCholeskyBase() {}
|
|
95
83
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
m_shiftScale = scale;
|
|
136
|
-
return derived();
|
|
137
|
-
}
|
|
84
|
+
Derived& derived() { return *static_cast<Derived*>(this); }
|
|
85
|
+
const Derived& derived() const { return *static_cast<const Derived*>(this); }
|
|
86
|
+
|
|
87
|
+
inline Index cols() const { return m_matrix.cols(); }
|
|
88
|
+
inline Index rows() const { return m_matrix.rows(); }
|
|
89
|
+
|
|
90
|
+
/** \brief Reports whether previous computation was successful.
|
|
91
|
+
*
|
|
92
|
+
* \returns \c Success if computation was successful,
|
|
93
|
+
* \c NumericalIssue if the matrix.appears to be negative.
|
|
94
|
+
*/
|
|
95
|
+
ComputationInfo info() const {
|
|
96
|
+
eigen_assert(m_isInitialized && "Decomposition is not initialized.");
|
|
97
|
+
return m_info;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** \returns the permutation P
|
|
101
|
+
* \sa permutationPinv() */
|
|
102
|
+
const PermutationMatrix<Dynamic, Dynamic, StorageIndex>& permutationP() const { return m_P; }
|
|
103
|
+
|
|
104
|
+
/** \returns the inverse P^-1 of the permutation P
|
|
105
|
+
* \sa permutationP() */
|
|
106
|
+
const PermutationMatrix<Dynamic, Dynamic, StorageIndex>& permutationPinv() const { return m_Pinv; }
|
|
107
|
+
|
|
108
|
+
/** Sets the shift parameters that will be used to adjust the diagonal coefficients during the numerical
|
|
109
|
+
* factorization.
|
|
110
|
+
*
|
|
111
|
+
* During the numerical factorization, the diagonal coefficients are transformed by the following linear model:\n
|
|
112
|
+
* \c d_ii = \a offset + \a scale * \c d_ii
|
|
113
|
+
*
|
|
114
|
+
* The default is the identity transformation with \a offset=0, and \a scale=1.
|
|
115
|
+
*
|
|
116
|
+
* \returns a reference to \c *this.
|
|
117
|
+
*/
|
|
118
|
+
Derived& setShift(const DiagonalScalar& offset, const DiagonalScalar& scale = 1) {
|
|
119
|
+
m_shiftOffset = offset;
|
|
120
|
+
m_shiftScale = scale;
|
|
121
|
+
return derived();
|
|
122
|
+
}
|
|
138
123
|
|
|
139
124
|
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
125
|
+
/** \internal */
|
|
126
|
+
template <typename Stream>
|
|
127
|
+
void dumpMemory(Stream& s) {
|
|
128
|
+
int total = 0;
|
|
129
|
+
s << " L: "
|
|
130
|
+
<< ((total += (m_matrix.cols() + 1) * sizeof(int) + m_matrix.nonZeros() * (sizeof(int) + sizeof(Scalar))) >> 20)
|
|
131
|
+
<< "Mb"
|
|
132
|
+
<< "\n";
|
|
133
|
+
s << " diag: " << ((total += m_diag.size() * sizeof(Scalar)) >> 20) << "Mb"
|
|
134
|
+
<< "\n";
|
|
135
|
+
s << " tree: " << ((total += m_parent.size() * sizeof(int)) >> 20) << "Mb"
|
|
136
|
+
<< "\n";
|
|
137
|
+
s << " nonzeros: " << ((total += m_workSpace.size() * sizeof(int)) >> 20) << "Mb"
|
|
138
|
+
<< "\n";
|
|
139
|
+
s << " perm: " << ((total += m_P.size() * sizeof(int)) >> 20) << "Mb"
|
|
140
|
+
<< "\n";
|
|
141
|
+
s << " perm^-1: " << ((total += m_Pinv.size() * sizeof(int)) >> 20) << "Mb"
|
|
142
|
+
<< "\n";
|
|
143
|
+
s << " TOTAL: " << (total >> 20) << "Mb"
|
|
144
|
+
<< "\n";
|
|
145
|
+
}
|
|
153
146
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
147
|
+
/** \internal */
|
|
148
|
+
template <typename Rhs, typename Dest>
|
|
149
|
+
void _solve_impl(const MatrixBase<Rhs>& b, MatrixBase<Dest>& dest) const {
|
|
150
|
+
eigen_assert(m_factorizationIsOk &&
|
|
151
|
+
"The decomposition is not in a valid state for solving, you must first call either compute() or "
|
|
152
|
+
"symbolic()/numeric()");
|
|
153
|
+
eigen_assert(m_matrix.rows() == b.rows());
|
|
160
154
|
|
|
161
|
-
|
|
162
|
-
return;
|
|
155
|
+
if (m_info != Success) return;
|
|
163
156
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
157
|
+
if (m_P.size() > 0)
|
|
158
|
+
dest = m_P * b;
|
|
159
|
+
else
|
|
160
|
+
dest = b;
|
|
168
161
|
|
|
169
|
-
|
|
170
|
-
|
|
162
|
+
if (m_matrix.nonZeros() > 0) // otherwise L==I
|
|
163
|
+
derived().matrixL().solveInPlace(dest);
|
|
171
164
|
|
|
172
|
-
|
|
173
|
-
dest = m_diag.asDiagonal().inverse() * dest;
|
|
165
|
+
if (m_diag.size() > 0) dest = m_diag.asDiagonal().inverse() * dest;
|
|
174
166
|
|
|
175
|
-
|
|
176
|
-
|
|
167
|
+
if (m_matrix.nonZeros() > 0) // otherwise U==I
|
|
168
|
+
derived().matrixU().solveInPlace(dest);
|
|
177
169
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
template<typename Rhs,typename Dest>
|
|
183
|
-
void _solve_impl(const SparseMatrixBase<Rhs> &b, SparseMatrixBase<Dest> &dest) const
|
|
184
|
-
{
|
|
185
|
-
internal::solve_sparse_through_dense_panels(derived(), b, dest);
|
|
186
|
-
}
|
|
170
|
+
if (m_P.size() > 0) dest = m_Pinv * dest;
|
|
171
|
+
}
|
|
187
172
|
|
|
188
|
-
|
|
173
|
+
template <typename Rhs, typename Dest>
|
|
174
|
+
void _solve_impl(const SparseMatrixBase<Rhs>& b, SparseMatrixBase<Dest>& dest) const {
|
|
175
|
+
internal::solve_sparse_through_dense_panels(derived(), b, dest);
|
|
176
|
+
}
|
|
189
177
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
else
|
|
219
|
-
{
|
|
220
|
-
tmp.template selfadjointView<Upper>() = a.template selfadjointView<UpLo>().twistedBy(m_P);
|
|
221
|
-
pmat = &tmp;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
factorize_preordered<DoLDLT>(*pmat);
|
|
178
|
+
#endif // EIGEN_PARSED_BY_DOXYGEN
|
|
179
|
+
|
|
180
|
+
protected:
|
|
181
|
+
/** Computes the sparse Cholesky decomposition of \a matrix */
|
|
182
|
+
template <bool DoLDLT, bool NonHermitian>
|
|
183
|
+
void compute(const MatrixType& matrix) {
|
|
184
|
+
eigen_assert(matrix.rows() == matrix.cols());
|
|
185
|
+
Index size = matrix.cols();
|
|
186
|
+
CholMatrixType tmp(size, size);
|
|
187
|
+
ConstCholMatrixPtr pmat;
|
|
188
|
+
ordering<NonHermitian>(matrix, pmat, tmp);
|
|
189
|
+
analyzePattern_preordered(*pmat, DoLDLT);
|
|
190
|
+
factorize_preordered<DoLDLT, NonHermitian>(*pmat);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
template <bool DoLDLT, bool NonHermitian>
|
|
194
|
+
void factorize(const MatrixType& a) {
|
|
195
|
+
eigen_assert(a.rows() == a.cols());
|
|
196
|
+
Index size = a.cols();
|
|
197
|
+
CholMatrixType tmp(size, size);
|
|
198
|
+
ConstCholMatrixPtr pmat;
|
|
199
|
+
|
|
200
|
+
if (m_P.size() == 0 && (int(UpLo) & int(Upper)) == Upper) {
|
|
201
|
+
// If there is no ordering, try to directly use the input matrix without any copy
|
|
202
|
+
internal::simplicial_cholesky_grab_input<CholMatrixType, MatrixType>::run(a, pmat, tmp);
|
|
203
|
+
} else {
|
|
204
|
+
internal::permute_symm_to_symm<UpLo, Upper, NonHermitian>(a, tmp, m_P.indices().data());
|
|
205
|
+
pmat = &tmp;
|
|
225
206
|
}
|
|
226
207
|
|
|
227
|
-
|
|
228
|
-
|
|
208
|
+
factorize_preordered<DoLDLT, NonHermitian>(*pmat);
|
|
209
|
+
}
|
|
229
210
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
bool
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
211
|
+
template <bool DoLDLT, bool NonHermitian>
|
|
212
|
+
void factorize_preordered(const CholMatrixType& a);
|
|
213
|
+
|
|
214
|
+
template <bool DoLDLT, bool NonHermitian>
|
|
215
|
+
void analyzePattern(const MatrixType& a) {
|
|
216
|
+
eigen_assert(a.rows() == a.cols());
|
|
217
|
+
Index size = a.cols();
|
|
218
|
+
CholMatrixType tmp(size, size);
|
|
219
|
+
ConstCholMatrixPtr pmat;
|
|
220
|
+
ordering<NonHermitian>(a, pmat, tmp);
|
|
221
|
+
analyzePattern_preordered(*pmat, DoLDLT);
|
|
222
|
+
}
|
|
223
|
+
void analyzePattern_preordered(const CholMatrixType& a, bool doLDLT);
|
|
224
|
+
|
|
225
|
+
template <bool NonHermitian>
|
|
226
|
+
void ordering(const MatrixType& a, ConstCholMatrixPtr& pmat, CholMatrixType& ap);
|
|
227
|
+
|
|
228
|
+
inline DiagonalScalar getDiag(Scalar x) { return internal::traits<Derived>::getDiag(x); }
|
|
229
|
+
inline Scalar getSymm(Scalar x) { return internal::traits<Derived>::getSymm(x); }
|
|
230
|
+
|
|
231
|
+
/** keeps off-diagonal entries; drops diagonal entries */
|
|
232
|
+
struct keep_diag {
|
|
233
|
+
inline bool operator()(const Index& row, const Index& col, const Scalar&) const { return row != col; }
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
mutable ComputationInfo m_info;
|
|
237
|
+
bool m_factorizationIsOk;
|
|
238
|
+
bool m_analysisIsOk;
|
|
239
|
+
|
|
240
|
+
CholMatrixType m_matrix;
|
|
241
|
+
VectorType m_diag; // the diagonal coefficients (LDLT mode)
|
|
242
|
+
VectorI m_parent; // elimination tree
|
|
243
|
+
VectorI m_workSpace;
|
|
244
|
+
PermutationMatrix<Dynamic, Dynamic, StorageIndex> m_P; // the permutation
|
|
245
|
+
PermutationMatrix<Dynamic, Dynamic, StorageIndex> m_Pinv; // the inverse permutation
|
|
246
|
+
|
|
247
|
+
DiagonalScalar m_shiftOffset;
|
|
248
|
+
DiagonalScalar m_shiftScale;
|
|
264
249
|
};
|
|
265
250
|
|
|
266
|
-
template<typename
|
|
267
|
-
|
|
268
|
-
|
|
251
|
+
template <typename MatrixType_, int UpLo_ = Lower,
|
|
252
|
+
typename Ordering_ = AMDOrdering<typename MatrixType_::StorageIndex> >
|
|
253
|
+
class SimplicialLLT;
|
|
254
|
+
template <typename MatrixType_, int UpLo_ = Lower,
|
|
255
|
+
typename Ordering_ = AMDOrdering<typename MatrixType_::StorageIndex> >
|
|
256
|
+
class SimplicialLDLT;
|
|
257
|
+
template <typename MatrixType_, int UpLo_ = Lower,
|
|
258
|
+
typename Ordering_ = AMDOrdering<typename MatrixType_::StorageIndex> >
|
|
259
|
+
class SimplicialNonHermitianLLT;
|
|
260
|
+
template <typename MatrixType_, int UpLo_ = Lower,
|
|
261
|
+
typename Ordering_ = AMDOrdering<typename MatrixType_::StorageIndex> >
|
|
262
|
+
class SimplicialNonHermitianLDLT;
|
|
263
|
+
template <typename MatrixType_, int UpLo_ = Lower,
|
|
264
|
+
typename Ordering_ = AMDOrdering<typename MatrixType_::StorageIndex> >
|
|
265
|
+
class SimplicialCholesky;
|
|
269
266
|
|
|
270
267
|
namespace internal {
|
|
271
268
|
|
|
272
|
-
template<typename
|
|
273
|
-
{
|
|
274
|
-
typedef
|
|
275
|
-
typedef
|
|
276
|
-
enum { UpLo =
|
|
277
|
-
typedef typename MatrixType::Scalar
|
|
278
|
-
typedef typename MatrixType::
|
|
279
|
-
typedef
|
|
280
|
-
typedef
|
|
281
|
-
typedef TriangularView<const
|
|
282
|
-
|
|
283
|
-
static inline
|
|
269
|
+
template <typename MatrixType_, int UpLo_, typename Ordering_>
|
|
270
|
+
struct traits<SimplicialLLT<MatrixType_, UpLo_, Ordering_> > {
|
|
271
|
+
typedef MatrixType_ MatrixType;
|
|
272
|
+
typedef Ordering_ OrderingType;
|
|
273
|
+
enum { UpLo = UpLo_ };
|
|
274
|
+
typedef typename MatrixType::Scalar Scalar;
|
|
275
|
+
typedef typename MatrixType::RealScalar DiagonalScalar;
|
|
276
|
+
typedef typename MatrixType::StorageIndex StorageIndex;
|
|
277
|
+
typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
|
|
278
|
+
typedef TriangularView<const CholMatrixType, Eigen::Lower> MatrixL;
|
|
279
|
+
typedef TriangularView<const typename CholMatrixType::AdjointReturnType, Eigen::Upper> MatrixU;
|
|
280
|
+
static inline MatrixL getL(const CholMatrixType& m) { return MatrixL(m); }
|
|
281
|
+
static inline MatrixU getU(const CholMatrixType& m) { return MatrixU(m.adjoint()); }
|
|
282
|
+
static inline DiagonalScalar getDiag(Scalar x) { return numext::real(x); }
|
|
283
|
+
static inline Scalar getSymm(Scalar x) { return numext::conj(x); }
|
|
284
284
|
};
|
|
285
285
|
|
|
286
|
-
template<typename
|
|
287
|
-
{
|
|
288
|
-
typedef
|
|
289
|
-
typedef
|
|
290
|
-
enum { UpLo =
|
|
291
|
-
typedef typename MatrixType::Scalar
|
|
292
|
-
typedef typename MatrixType::
|
|
293
|
-
typedef
|
|
294
|
-
typedef
|
|
286
|
+
template <typename MatrixType_, int UpLo_, typename Ordering_>
|
|
287
|
+
struct traits<SimplicialLDLT<MatrixType_, UpLo_, Ordering_> > {
|
|
288
|
+
typedef MatrixType_ MatrixType;
|
|
289
|
+
typedef Ordering_ OrderingType;
|
|
290
|
+
enum { UpLo = UpLo_ };
|
|
291
|
+
typedef typename MatrixType::Scalar Scalar;
|
|
292
|
+
typedef typename MatrixType::RealScalar DiagonalScalar;
|
|
293
|
+
typedef typename MatrixType::StorageIndex StorageIndex;
|
|
294
|
+
typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
|
|
295
|
+
typedef TriangularView<const CholMatrixType, Eigen::UnitLower> MatrixL;
|
|
295
296
|
typedef TriangularView<const typename CholMatrixType::AdjointReturnType, Eigen::UnitUpper> MatrixU;
|
|
296
|
-
static inline MatrixL getL(const
|
|
297
|
-
static inline MatrixU getU(const
|
|
297
|
+
static inline MatrixL getL(const CholMatrixType& m) { return MatrixL(m); }
|
|
298
|
+
static inline MatrixU getU(const CholMatrixType& m) { return MatrixU(m.adjoint()); }
|
|
299
|
+
static inline DiagonalScalar getDiag(Scalar x) { return numext::real(x); }
|
|
300
|
+
static inline Scalar getSymm(Scalar x) { return numext::conj(x); }
|
|
298
301
|
};
|
|
299
302
|
|
|
300
|
-
template<typename
|
|
301
|
-
{
|
|
302
|
-
typedef
|
|
303
|
-
typedef
|
|
304
|
-
enum { UpLo =
|
|
303
|
+
template <typename MatrixType_, int UpLo_, typename Ordering_>
|
|
304
|
+
struct traits<SimplicialNonHermitianLLT<MatrixType_, UpLo_, Ordering_> > {
|
|
305
|
+
typedef MatrixType_ MatrixType;
|
|
306
|
+
typedef Ordering_ OrderingType;
|
|
307
|
+
enum { UpLo = UpLo_ };
|
|
308
|
+
typedef typename MatrixType::Scalar Scalar;
|
|
309
|
+
typedef typename MatrixType::Scalar DiagonalScalar;
|
|
310
|
+
typedef typename MatrixType::StorageIndex StorageIndex;
|
|
311
|
+
typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
|
|
312
|
+
typedef TriangularView<const CholMatrixType, Eigen::Lower> MatrixL;
|
|
313
|
+
typedef TriangularView<const typename CholMatrixType::ConstTransposeReturnType, Eigen::Upper> MatrixU;
|
|
314
|
+
static inline MatrixL getL(const CholMatrixType& m) { return MatrixL(m); }
|
|
315
|
+
static inline MatrixU getU(const CholMatrixType& m) { return MatrixU(m.transpose()); }
|
|
316
|
+
static inline DiagonalScalar getDiag(Scalar x) { return x; }
|
|
317
|
+
static inline Scalar getSymm(Scalar x) { return x; }
|
|
305
318
|
};
|
|
306
319
|
|
|
307
|
-
|
|
320
|
+
template <typename MatrixType_, int UpLo_, typename Ordering_>
|
|
321
|
+
struct traits<SimplicialNonHermitianLDLT<MatrixType_, UpLo_, Ordering_> > {
|
|
322
|
+
typedef MatrixType_ MatrixType;
|
|
323
|
+
typedef Ordering_ OrderingType;
|
|
324
|
+
enum { UpLo = UpLo_ };
|
|
325
|
+
typedef typename MatrixType::Scalar Scalar;
|
|
326
|
+
typedef typename MatrixType::Scalar DiagonalScalar;
|
|
327
|
+
typedef typename MatrixType::StorageIndex StorageIndex;
|
|
328
|
+
typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
|
|
329
|
+
typedef TriangularView<const CholMatrixType, Eigen::UnitLower> MatrixL;
|
|
330
|
+
typedef TriangularView<const typename CholMatrixType::ConstTransposeReturnType, Eigen::UnitUpper> MatrixU;
|
|
331
|
+
static inline MatrixL getL(const CholMatrixType& m) { return MatrixL(m); }
|
|
332
|
+
static inline MatrixU getU(const CholMatrixType& m) { return MatrixU(m.transpose()); }
|
|
333
|
+
static inline DiagonalScalar getDiag(Scalar x) { return x; }
|
|
334
|
+
static inline Scalar getSymm(Scalar x) { return x; }
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
template <typename MatrixType_, int UpLo_, typename Ordering_>
|
|
338
|
+
struct traits<SimplicialCholesky<MatrixType_, UpLo_, Ordering_> > {
|
|
339
|
+
typedef MatrixType_ MatrixType;
|
|
340
|
+
typedef Ordering_ OrderingType;
|
|
341
|
+
enum { UpLo = UpLo_ };
|
|
342
|
+
typedef typename MatrixType::Scalar Scalar;
|
|
343
|
+
typedef typename MatrixType::RealScalar DiagonalScalar;
|
|
344
|
+
static inline DiagonalScalar getDiag(Scalar x) { return numext::real(x); }
|
|
345
|
+
static inline Scalar getSymm(Scalar x) { return numext::conj(x); }
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
} // namespace internal
|
|
308
349
|
|
|
309
350
|
/** \ingroup SparseCholesky_Module
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
template<typename
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
public:
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
}
|
|
351
|
+
* \class SimplicialLLT
|
|
352
|
+
* \brief A direct sparse LLT Cholesky factorizations
|
|
353
|
+
*
|
|
354
|
+
* This class provides a LL^T Cholesky factorizations of sparse matrices that are
|
|
355
|
+
* selfadjoint and positive definite. The factorization allows for solving A.X = B where
|
|
356
|
+
* X and B can be either dense or sparse.
|
|
357
|
+
*
|
|
358
|
+
* In order to reduce the fill-in, a symmetric permutation P is applied prior to the factorization
|
|
359
|
+
* such that the factorized matrix is P A P^-1.
|
|
360
|
+
*
|
|
361
|
+
* \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
|
|
362
|
+
* \tparam UpLo_ the triangular part that will be used for the computations. It can be Lower
|
|
363
|
+
* or Upper. Default is Lower.
|
|
364
|
+
* \tparam Ordering_ The ordering method to use, either AMDOrdering<> or NaturalOrdering<>. Default is AMDOrdering<>
|
|
365
|
+
*
|
|
366
|
+
* \implsparsesolverconcept
|
|
367
|
+
*
|
|
368
|
+
* \sa class SimplicialLDLT, class AMDOrdering, class NaturalOrdering
|
|
369
|
+
*/
|
|
370
|
+
template <typename MatrixType_, int UpLo_, typename Ordering_>
|
|
371
|
+
class SimplicialLLT : public SimplicialCholeskyBase<SimplicialLLT<MatrixType_, UpLo_, Ordering_> > {
|
|
372
|
+
public:
|
|
373
|
+
typedef MatrixType_ MatrixType;
|
|
374
|
+
enum { UpLo = UpLo_ };
|
|
375
|
+
typedef SimplicialCholeskyBase<SimplicialLLT> Base;
|
|
376
|
+
typedef typename MatrixType::Scalar Scalar;
|
|
377
|
+
typedef typename MatrixType::RealScalar RealScalar;
|
|
378
|
+
typedef typename MatrixType::StorageIndex StorageIndex;
|
|
379
|
+
typedef SparseMatrix<Scalar, ColMajor, Index> CholMatrixType;
|
|
380
|
+
typedef Matrix<Scalar, Dynamic, 1> VectorType;
|
|
381
|
+
typedef internal::traits<SimplicialLLT> Traits;
|
|
382
|
+
typedef typename Traits::MatrixL MatrixL;
|
|
383
|
+
typedef typename Traits::MatrixU MatrixU;
|
|
384
|
+
|
|
385
|
+
public:
|
|
386
|
+
/** Default constructor */
|
|
387
|
+
SimplicialLLT() : Base() {}
|
|
388
|
+
/** Constructs and performs the LLT factorization of \a matrix */
|
|
389
|
+
explicit SimplicialLLT(const MatrixType& matrix) : Base(matrix) {}
|
|
390
|
+
|
|
391
|
+
/** \returns an expression of the factor L */
|
|
392
|
+
inline const MatrixL matrixL() const {
|
|
393
|
+
eigen_assert(Base::m_factorizationIsOk && "Simplicial LLT not factorized");
|
|
394
|
+
return Traits::getL(Base::m_matrix);
|
|
395
|
+
}
|
|
356
396
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
/** Computes the sparse Cholesky decomposition of \a matrix */
|
|
364
|
-
SimplicialLLT& compute(const MatrixType& matrix)
|
|
365
|
-
{
|
|
366
|
-
Base::template compute<false>(matrix);
|
|
367
|
-
return *this;
|
|
368
|
-
}
|
|
397
|
+
/** \returns an expression of the factor U (= L^*) */
|
|
398
|
+
inline const MatrixU matrixU() const {
|
|
399
|
+
eigen_assert(Base::m_factorizationIsOk && "Simplicial LLT not factorized");
|
|
400
|
+
return Traits::getU(Base::m_matrix);
|
|
401
|
+
}
|
|
369
402
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
*/
|
|
376
|
-
void analyzePattern(const MatrixType& a)
|
|
377
|
-
{
|
|
378
|
-
Base::analyzePattern(a, false);
|
|
379
|
-
}
|
|
403
|
+
/** Computes the sparse Cholesky decomposition of \a matrix */
|
|
404
|
+
SimplicialLLT& compute(const MatrixType& matrix) {
|
|
405
|
+
Base::template compute<false, false>(matrix);
|
|
406
|
+
return *this;
|
|
407
|
+
}
|
|
380
408
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
409
|
+
/** Performs a symbolic decomposition on the sparsity of \a matrix.
|
|
410
|
+
*
|
|
411
|
+
* This function is particularly useful when solving for several problems having the same structure.
|
|
412
|
+
*
|
|
413
|
+
* \sa factorize()
|
|
414
|
+
*/
|
|
415
|
+
void analyzePattern(const MatrixType& a) { Base::template analyzePattern<false, false>(a); }
|
|
416
|
+
|
|
417
|
+
/** Performs a numeric decomposition of \a matrix
|
|
418
|
+
*
|
|
419
|
+
* The given matrix must have the same sparsity than the matrix on which the symbolic decomposition has been
|
|
420
|
+
* performed.
|
|
421
|
+
*
|
|
422
|
+
* \sa analyzePattern()
|
|
423
|
+
*/
|
|
424
|
+
void factorize(const MatrixType& a) { Base::template factorize<false, false>(a); }
|
|
425
|
+
|
|
426
|
+
/** \returns the determinant of the underlying matrix from the current factorization */
|
|
427
|
+
Scalar determinant() const {
|
|
428
|
+
Scalar detL = Base::m_matrix.diagonal().prod();
|
|
429
|
+
return numext::abs2(detL);
|
|
430
|
+
}
|
|
431
|
+
};
|
|
391
432
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
433
|
+
/** \ingroup SparseCholesky_Module
|
|
434
|
+
* \class SimplicialLDLT
|
|
435
|
+
* \brief A direct sparse LDLT Cholesky factorizations without square root.
|
|
436
|
+
*
|
|
437
|
+
* This class provides a LDL^T Cholesky factorizations without square root of sparse matrices that are
|
|
438
|
+
* selfadjoint and positive definite. The factorization allows for solving A.X = B where
|
|
439
|
+
* X and B can be either dense or sparse.
|
|
440
|
+
*
|
|
441
|
+
* In order to reduce the fill-in, a symmetric permutation P is applied prior to the factorization
|
|
442
|
+
* such that the factorized matrix is P A P^-1.
|
|
443
|
+
*
|
|
444
|
+
* \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
|
|
445
|
+
* \tparam UpLo_ the triangular part that will be used for the computations. It can be Lower
|
|
446
|
+
* or Upper. Default is Lower.
|
|
447
|
+
* \tparam Ordering_ The ordering method to use, either AMDOrdering<> or NaturalOrdering<>. Default is AMDOrdering<>
|
|
448
|
+
*
|
|
449
|
+
* \implsparsesolverconcept
|
|
450
|
+
*
|
|
451
|
+
* \sa class SimplicialLLT, class AMDOrdering, class NaturalOrdering
|
|
452
|
+
*/
|
|
453
|
+
template <typename MatrixType_, int UpLo_, typename Ordering_>
|
|
454
|
+
class SimplicialLDLT : public SimplicialCholeskyBase<SimplicialLDLT<MatrixType_, UpLo_, Ordering_> > {
|
|
455
|
+
public:
|
|
456
|
+
typedef MatrixType_ MatrixType;
|
|
457
|
+
enum { UpLo = UpLo_ };
|
|
458
|
+
typedef SimplicialCholeskyBase<SimplicialLDLT> Base;
|
|
459
|
+
typedef typename MatrixType::Scalar Scalar;
|
|
460
|
+
typedef typename MatrixType::RealScalar RealScalar;
|
|
461
|
+
typedef typename MatrixType::StorageIndex StorageIndex;
|
|
462
|
+
typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
|
|
463
|
+
typedef Matrix<Scalar, Dynamic, 1> VectorType;
|
|
464
|
+
typedef internal::traits<SimplicialLDLT> Traits;
|
|
465
|
+
typedef typename Traits::MatrixL MatrixL;
|
|
466
|
+
typedef typename Traits::MatrixU MatrixU;
|
|
467
|
+
|
|
468
|
+
public:
|
|
469
|
+
/** Default constructor */
|
|
470
|
+
SimplicialLDLT() : Base() {}
|
|
471
|
+
|
|
472
|
+
/** Constructs and performs the LLT factorization of \a matrix */
|
|
473
|
+
explicit SimplicialLDLT(const MatrixType& matrix) : Base(matrix) {}
|
|
474
|
+
|
|
475
|
+
/** \returns a vector expression of the diagonal D */
|
|
476
|
+
inline const VectorType vectorD() const {
|
|
477
|
+
eigen_assert(Base::m_factorizationIsOk && "Simplicial LDLT not factorized");
|
|
478
|
+
return Base::m_diag;
|
|
479
|
+
}
|
|
480
|
+
/** \returns an expression of the factor L */
|
|
481
|
+
inline const MatrixL matrixL() const {
|
|
482
|
+
eigen_assert(Base::m_factorizationIsOk && "Simplicial LDLT not factorized");
|
|
483
|
+
return Traits::getL(Base::m_matrix);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
/** \returns an expression of the factor U (= L^*) */
|
|
487
|
+
inline const MatrixU matrixU() const {
|
|
488
|
+
eigen_assert(Base::m_factorizationIsOk && "Simplicial LDLT not factorized");
|
|
489
|
+
return Traits::getU(Base::m_matrix);
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/** Computes the sparse Cholesky decomposition of \a matrix */
|
|
493
|
+
SimplicialLDLT& compute(const MatrixType& matrix) {
|
|
494
|
+
Base::template compute<true, false>(matrix);
|
|
495
|
+
return *this;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/** Performs a symbolic decomposition on the sparsity of \a matrix.
|
|
499
|
+
*
|
|
500
|
+
* This function is particularly useful when solving for several problems having the same structure.
|
|
501
|
+
*
|
|
502
|
+
* \sa factorize()
|
|
503
|
+
*/
|
|
504
|
+
void analyzePattern(const MatrixType& a) { Base::template analyzePattern<true, false>(a); }
|
|
505
|
+
|
|
506
|
+
/** Performs a numeric decomposition of \a matrix
|
|
507
|
+
*
|
|
508
|
+
* The given matrix must have the same sparsity than the matrix on which the symbolic decomposition has been
|
|
509
|
+
* performed.
|
|
510
|
+
*
|
|
511
|
+
* \sa analyzePattern()
|
|
512
|
+
*/
|
|
513
|
+
void factorize(const MatrixType& a) { Base::template factorize<true, false>(a); }
|
|
514
|
+
|
|
515
|
+
/** \returns the determinant of the underlying matrix from the current factorization */
|
|
516
|
+
Scalar determinant() const { return Base::m_diag.prod(); }
|
|
398
517
|
};
|
|
399
518
|
|
|
400
519
|
/** \ingroup SparseCholesky_Module
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
template<typename
|
|
421
|
-
|
|
422
|
-
{
|
|
423
|
-
public:
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
/** \returns an expression of the factor L */
|
|
449
|
-
inline const MatrixL matrixL() const {
|
|
450
|
-
eigen_assert(Base::m_factorizationIsOk && "Simplicial LDLT not factorized");
|
|
451
|
-
return Traits::getL(Base::m_matrix);
|
|
452
|
-
}
|
|
520
|
+
* \class SimplicialNonHermitianLLT
|
|
521
|
+
* \brief A direct sparse LLT Cholesky factorizations, for symmetric non-hermitian matrices.
|
|
522
|
+
*
|
|
523
|
+
* This class provides a LL^T Cholesky factorizations of sparse matrices that are
|
|
524
|
+
* symmetric but not hermitian. For real matrices, this is equivalent to the regular LLT factorization.
|
|
525
|
+
* The factorization allows for solving A.X = B where X and B can be either dense or sparse.
|
|
526
|
+
*
|
|
527
|
+
* In order to reduce the fill-in, a symmetric permutation P is applied prior to the factorization
|
|
528
|
+
* such that the factorized matrix is P A P^-1.
|
|
529
|
+
*
|
|
530
|
+
* \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
|
|
531
|
+
* \tparam UpLo_ the triangular part that will be used for the computations. It can be Lower
|
|
532
|
+
* or Upper. Default is Lower.
|
|
533
|
+
* \tparam Ordering_ The ordering method to use, either AMDOrdering<> or NaturalOrdering<>. Default is AMDOrdering<>
|
|
534
|
+
*
|
|
535
|
+
* \implsparsesolverconcept
|
|
536
|
+
*
|
|
537
|
+
* \sa class SimplicialNonHermitianLDLT, SimplicialLLT, class AMDOrdering, class NaturalOrdering
|
|
538
|
+
*/
|
|
539
|
+
template <typename MatrixType_, int UpLo_, typename Ordering_>
|
|
540
|
+
class SimplicialNonHermitianLLT
|
|
541
|
+
: public SimplicialCholeskyBase<SimplicialNonHermitianLLT<MatrixType_, UpLo_, Ordering_> > {
|
|
542
|
+
public:
|
|
543
|
+
typedef MatrixType_ MatrixType;
|
|
544
|
+
enum { UpLo = UpLo_ };
|
|
545
|
+
typedef SimplicialCholeskyBase<SimplicialNonHermitianLLT> Base;
|
|
546
|
+
typedef typename MatrixType::Scalar Scalar;
|
|
547
|
+
typedef typename MatrixType::RealScalar RealScalar;
|
|
548
|
+
typedef typename MatrixType::StorageIndex StorageIndex;
|
|
549
|
+
typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
|
|
550
|
+
typedef Matrix<Scalar, Dynamic, 1> VectorType;
|
|
551
|
+
typedef internal::traits<SimplicialNonHermitianLLT> Traits;
|
|
552
|
+
typedef typename Traits::MatrixL MatrixL;
|
|
553
|
+
typedef typename Traits::MatrixU MatrixU;
|
|
554
|
+
|
|
555
|
+
public:
|
|
556
|
+
/** Default constructor */
|
|
557
|
+
SimplicialNonHermitianLLT() : Base() {}
|
|
558
|
+
|
|
559
|
+
/** Constructs and performs the LLT factorization of \a matrix */
|
|
560
|
+
explicit SimplicialNonHermitianLLT(const MatrixType& matrix) : Base(matrix) {}
|
|
561
|
+
|
|
562
|
+
/** \returns an expression of the factor L */
|
|
563
|
+
inline const MatrixL matrixL() const {
|
|
564
|
+
eigen_assert(Base::m_factorizationIsOk && "Simplicial LLT not factorized");
|
|
565
|
+
return Traits::getL(Base::m_matrix);
|
|
566
|
+
}
|
|
453
567
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
568
|
+
/** \returns an expression of the factor U (= L^*) */
|
|
569
|
+
inline const MatrixU matrixU() const {
|
|
570
|
+
eigen_assert(Base::m_factorizationIsOk && "Simplicial LLT not factorized");
|
|
571
|
+
return Traits::getU(Base::m_matrix);
|
|
572
|
+
}
|
|
459
573
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
/** Performs a symbolic decomposition on the sparcity of \a matrix.
|
|
468
|
-
*
|
|
469
|
-
* This function is particularly useful when solving for several problems having the same structure.
|
|
470
|
-
*
|
|
471
|
-
* \sa factorize()
|
|
472
|
-
*/
|
|
473
|
-
void analyzePattern(const MatrixType& a)
|
|
474
|
-
{
|
|
475
|
-
Base::analyzePattern(a, true);
|
|
476
|
-
}
|
|
574
|
+
/** Computes the sparse Cholesky decomposition of \a matrix */
|
|
575
|
+
SimplicialNonHermitianLLT& compute(const MatrixType& matrix) {
|
|
576
|
+
Base::template compute<false, true>(matrix);
|
|
577
|
+
return *this;
|
|
578
|
+
}
|
|
477
579
|
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
580
|
+
/** Performs a symbolic decomposition on the sparsity of \a matrix.
|
|
581
|
+
*
|
|
582
|
+
* This function is particularly useful when solving for several problems having the same structure.
|
|
583
|
+
*
|
|
584
|
+
* \sa factorize()
|
|
585
|
+
*/
|
|
586
|
+
void analyzePattern(const MatrixType& a) { Base::template analyzePattern<false, true>(a); }
|
|
587
|
+
|
|
588
|
+
/** Performs a numeric decomposition of \a matrix
|
|
589
|
+
*
|
|
590
|
+
* The given matrix must have the same sparsity than the matrix on which the symbolic decomposition has been
|
|
591
|
+
* performed.
|
|
592
|
+
*
|
|
593
|
+
* \sa analyzePattern()
|
|
594
|
+
*/
|
|
595
|
+
void factorize(const MatrixType& a) { Base::template factorize<false, true>(a); }
|
|
596
|
+
|
|
597
|
+
/** \returns the determinant of the underlying matrix from the current factorization */
|
|
598
|
+
Scalar determinant() const {
|
|
599
|
+
Scalar detL = Base::m_matrix.diagonal().prod();
|
|
600
|
+
return detL * detL;
|
|
601
|
+
}
|
|
602
|
+
};
|
|
488
603
|
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
604
|
+
/** \ingroup SparseCholesky_Module
|
|
605
|
+
* \class SimplicialNonHermitianLDLT
|
|
606
|
+
* \brief A direct sparse LDLT Cholesky factorizations without square root, for symmetric non-hermitian matrices.
|
|
607
|
+
*
|
|
608
|
+
* This class provides a LDL^T Cholesky factorizations without square root of sparse matrices that are
|
|
609
|
+
* symmetric but not hermitian. For real matrices, this is equivalent to the regular LDLT factorization.
|
|
610
|
+
* The factorization allows for solving A.X = B where X and B can be either dense or sparse.
|
|
611
|
+
*
|
|
612
|
+
* In order to reduce the fill-in, a symmetric permutation P is applied prior to the factorization
|
|
613
|
+
* such that the factorized matrix is P A P^-1.
|
|
614
|
+
*
|
|
615
|
+
* \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
|
|
616
|
+
* \tparam UpLo_ the triangular part that will be used for the computations. It can be Lower
|
|
617
|
+
* or Upper. Default is Lower.
|
|
618
|
+
* \tparam Ordering_ The ordering method to use, either AMDOrdering<> or NaturalOrdering<>. Default is AMDOrdering<>
|
|
619
|
+
*
|
|
620
|
+
* \implsparsesolverconcept
|
|
621
|
+
*
|
|
622
|
+
* \sa class SimplicialNonHermitianLLT, SimplicialLDLT, class AMDOrdering, class NaturalOrdering
|
|
623
|
+
*/
|
|
624
|
+
template <typename MatrixType_, int UpLo_, typename Ordering_>
|
|
625
|
+
class SimplicialNonHermitianLDLT
|
|
626
|
+
: public SimplicialCholeskyBase<SimplicialNonHermitianLDLT<MatrixType_, UpLo_, Ordering_> > {
|
|
627
|
+
public:
|
|
628
|
+
typedef MatrixType_ MatrixType;
|
|
629
|
+
enum { UpLo = UpLo_ };
|
|
630
|
+
typedef SimplicialCholeskyBase<SimplicialNonHermitianLDLT> Base;
|
|
631
|
+
typedef typename MatrixType::Scalar Scalar;
|
|
632
|
+
typedef typename MatrixType::RealScalar RealScalar;
|
|
633
|
+
typedef typename MatrixType::StorageIndex StorageIndex;
|
|
634
|
+
typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
|
|
635
|
+
typedef Matrix<Scalar, Dynamic, 1> VectorType;
|
|
636
|
+
typedef internal::traits<SimplicialNonHermitianLDLT> Traits;
|
|
637
|
+
typedef typename Traits::MatrixL MatrixL;
|
|
638
|
+
typedef typename Traits::MatrixU MatrixU;
|
|
639
|
+
|
|
640
|
+
public:
|
|
641
|
+
/** Default constructor */
|
|
642
|
+
SimplicialNonHermitianLDLT() : Base() {}
|
|
643
|
+
|
|
644
|
+
/** Constructs and performs the LLT factorization of \a matrix */
|
|
645
|
+
explicit SimplicialNonHermitianLDLT(const MatrixType& matrix) : Base(matrix) {}
|
|
646
|
+
|
|
647
|
+
/** \returns a vector expression of the diagonal D */
|
|
648
|
+
inline const VectorType vectorD() const {
|
|
649
|
+
eigen_assert(Base::m_factorizationIsOk && "Simplicial LDLT not factorized");
|
|
650
|
+
return Base::m_diag;
|
|
651
|
+
}
|
|
652
|
+
/** \returns an expression of the factor L */
|
|
653
|
+
inline const MatrixL matrixL() const {
|
|
654
|
+
eigen_assert(Base::m_factorizationIsOk && "Simplicial LDLT not factorized");
|
|
655
|
+
return Traits::getL(Base::m_matrix);
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
/** \returns an expression of the factor U (= L^*) */
|
|
659
|
+
inline const MatrixU matrixU() const {
|
|
660
|
+
eigen_assert(Base::m_factorizationIsOk && "Simplicial LDLT not factorized");
|
|
661
|
+
return Traits::getU(Base::m_matrix);
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
/** Computes the sparse Cholesky decomposition of \a matrix */
|
|
665
|
+
SimplicialNonHermitianLDLT& compute(const MatrixType& matrix) {
|
|
666
|
+
Base::template compute<true, true>(matrix);
|
|
667
|
+
return *this;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
/** Performs a symbolic decomposition on the sparsity of \a matrix.
|
|
671
|
+
*
|
|
672
|
+
* This function is particularly useful when solving for several problems having the same structure.
|
|
673
|
+
*
|
|
674
|
+
* \sa factorize()
|
|
675
|
+
*/
|
|
676
|
+
void analyzePattern(const MatrixType& a) { Base::template analyzePattern<true, true>(a); }
|
|
677
|
+
|
|
678
|
+
/** Performs a numeric decomposition of \a matrix
|
|
679
|
+
*
|
|
680
|
+
* The given matrix must have the same sparsity than the matrix on which the symbolic decomposition has been
|
|
681
|
+
* performed.
|
|
682
|
+
*
|
|
683
|
+
* \sa analyzePattern()
|
|
684
|
+
*/
|
|
685
|
+
void factorize(const MatrixType& a) { Base::template factorize<true, true>(a); }
|
|
686
|
+
|
|
687
|
+
/** \returns the determinant of the underlying matrix from the current factorization */
|
|
688
|
+
Scalar determinant() const { return Base::m_diag.prod(); }
|
|
494
689
|
};
|
|
495
690
|
|
|
496
691
|
/** \deprecated use SimplicialLDLT or class SimplicialLLT
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
template<typename
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
{
|
|
523
|
-
compute(matrix);
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
SimplicialCholesky& setMode(SimplicialCholeskyMode mode)
|
|
527
|
-
{
|
|
528
|
-
switch(mode)
|
|
529
|
-
{
|
|
692
|
+
* \ingroup SparseCholesky_Module
|
|
693
|
+
* \class SimplicialCholesky
|
|
694
|
+
*
|
|
695
|
+
* \sa class SimplicialLDLT, class SimplicialLLT
|
|
696
|
+
*/
|
|
697
|
+
template <typename MatrixType_, int UpLo_, typename Ordering_>
|
|
698
|
+
class SimplicialCholesky : public SimplicialCholeskyBase<SimplicialCholesky<MatrixType_, UpLo_, Ordering_> > {
|
|
699
|
+
public:
|
|
700
|
+
typedef MatrixType_ MatrixType;
|
|
701
|
+
enum { UpLo = UpLo_ };
|
|
702
|
+
typedef SimplicialCholeskyBase<SimplicialCholesky> Base;
|
|
703
|
+
typedef typename MatrixType::Scalar Scalar;
|
|
704
|
+
typedef typename MatrixType::RealScalar RealScalar;
|
|
705
|
+
typedef typename MatrixType::StorageIndex StorageIndex;
|
|
706
|
+
typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
|
|
707
|
+
typedef Matrix<Scalar, Dynamic, 1> VectorType;
|
|
708
|
+
typedef internal::traits<SimplicialLDLT<MatrixType, UpLo> > LDLTTraits;
|
|
709
|
+
typedef internal::traits<SimplicialLLT<MatrixType, UpLo> > LLTTraits;
|
|
710
|
+
|
|
711
|
+
public:
|
|
712
|
+
SimplicialCholesky() : Base(), m_LDLT(true) {}
|
|
713
|
+
|
|
714
|
+
explicit SimplicialCholesky(const MatrixType& matrix) : Base(), m_LDLT(true) { compute(matrix); }
|
|
715
|
+
|
|
716
|
+
SimplicialCholesky& setMode(SimplicialCholeskyMode mode) {
|
|
717
|
+
switch (mode) {
|
|
530
718
|
case SimplicialCholeskyLLT:
|
|
531
719
|
m_LDLT = false;
|
|
532
720
|
break;
|
|
@@ -535,155 +723,146 @@ public:
|
|
|
535
723
|
break;
|
|
536
724
|
default:
|
|
537
725
|
break;
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
return *this;
|
|
541
726
|
}
|
|
542
727
|
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
728
|
+
return *this;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
inline const VectorType vectorD() const {
|
|
732
|
+
eigen_assert(Base::m_factorizationIsOk && "Simplicial Cholesky not factorized");
|
|
733
|
+
return Base::m_diag;
|
|
734
|
+
}
|
|
735
|
+
inline const CholMatrixType rawMatrix() const {
|
|
736
|
+
eigen_assert(Base::m_factorizationIsOk && "Simplicial Cholesky not factorized");
|
|
737
|
+
return Base::m_matrix;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
/** Computes the sparse Cholesky decomposition of \a matrix */
|
|
741
|
+
SimplicialCholesky& compute(const MatrixType& matrix) {
|
|
742
|
+
if (m_LDLT)
|
|
743
|
+
Base::template compute<true, false>(matrix);
|
|
744
|
+
else
|
|
745
|
+
Base::template compute<false, false>(matrix);
|
|
746
|
+
return *this;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
/** Performs a symbolic decomposition on the sparsity of \a matrix.
|
|
750
|
+
*
|
|
751
|
+
* This function is particularly useful when solving for several problems having the same structure.
|
|
752
|
+
*
|
|
753
|
+
* \sa factorize()
|
|
754
|
+
*/
|
|
755
|
+
void analyzePattern(const MatrixType& a) {
|
|
756
|
+
if (m_LDLT)
|
|
757
|
+
Base::template analyzePattern<true, false>(a);
|
|
758
|
+
else
|
|
759
|
+
Base::template analyzePattern<false, false>(a);
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
/** Performs a numeric decomposition of \a matrix
|
|
763
|
+
*
|
|
764
|
+
* The given matrix must have the same sparsity than the matrix on which the symbolic decomposition has been
|
|
765
|
+
* performed.
|
|
766
|
+
*
|
|
767
|
+
* \sa analyzePattern()
|
|
768
|
+
*/
|
|
769
|
+
void factorize(const MatrixType& a) {
|
|
770
|
+
if (m_LDLT)
|
|
771
|
+
Base::template factorize<true, false>(a);
|
|
772
|
+
else
|
|
773
|
+
Base::template factorize<false, false>(a);
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
/** \internal */
|
|
777
|
+
template <typename Rhs, typename Dest>
|
|
778
|
+
void _solve_impl(const MatrixBase<Rhs>& b, MatrixBase<Dest>& dest) const {
|
|
779
|
+
eigen_assert(Base::m_factorizationIsOk &&
|
|
780
|
+
"The decomposition is not in a valid state for solving, you must first call either compute() or "
|
|
781
|
+
"symbolic()/numeric()");
|
|
782
|
+
eigen_assert(Base::m_matrix.rows() == b.rows());
|
|
783
|
+
|
|
784
|
+
if (Base::m_info != Success) return;
|
|
785
|
+
|
|
786
|
+
if (Base::m_P.size() > 0)
|
|
787
|
+
dest = Base::m_P * b;
|
|
788
|
+
else
|
|
789
|
+
dest = b;
|
|
790
|
+
|
|
791
|
+
if (Base::m_matrix.nonZeros() > 0) // otherwise L==I
|
|
554
792
|
{
|
|
555
|
-
if(m_LDLT)
|
|
556
|
-
Base::
|
|
793
|
+
if (m_LDLT)
|
|
794
|
+
LDLTTraits::getL(Base::m_matrix).solveInPlace(dest);
|
|
557
795
|
else
|
|
558
|
-
Base::
|
|
559
|
-
return *this;
|
|
796
|
+
LLTTraits::getL(Base::m_matrix).solveInPlace(dest);
|
|
560
797
|
}
|
|
561
798
|
|
|
562
|
-
|
|
563
|
-
*
|
|
564
|
-
* This function is particularly useful when solving for several problems having the same structure.
|
|
565
|
-
*
|
|
566
|
-
* \sa factorize()
|
|
567
|
-
*/
|
|
568
|
-
void analyzePattern(const MatrixType& a)
|
|
569
|
-
{
|
|
570
|
-
Base::analyzePattern(a, m_LDLT);
|
|
571
|
-
}
|
|
799
|
+
if (Base::m_diag.size() > 0) dest = Base::m_diag.real().asDiagonal().inverse() * dest;
|
|
572
800
|
|
|
573
|
-
|
|
574
|
-
*
|
|
575
|
-
* The given matrix must has the same sparcity than the matrix on which the symbolic decomposition has been performed.
|
|
576
|
-
*
|
|
577
|
-
* \sa analyzePattern()
|
|
578
|
-
*/
|
|
579
|
-
void factorize(const MatrixType& a)
|
|
801
|
+
if (Base::m_matrix.nonZeros() > 0) // otherwise I==I
|
|
580
802
|
{
|
|
581
|
-
if(m_LDLT)
|
|
582
|
-
Base::
|
|
803
|
+
if (m_LDLT)
|
|
804
|
+
LDLTTraits::getU(Base::m_matrix).solveInPlace(dest);
|
|
583
805
|
else
|
|
584
|
-
Base::
|
|
806
|
+
LLTTraits::getU(Base::m_matrix).solveInPlace(dest);
|
|
585
807
|
}
|
|
586
808
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
void _solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest> &dest) const
|
|
590
|
-
{
|
|
591
|
-
eigen_assert(Base::m_factorizationIsOk && "The decomposition is not in a valid state for solving, you must first call either compute() or symbolic()/numeric()");
|
|
592
|
-
eigen_assert(Base::m_matrix.rows()==b.rows());
|
|
809
|
+
if (Base::m_P.size() > 0) dest = Base::m_Pinv * dest;
|
|
810
|
+
}
|
|
593
811
|
|
|
594
|
-
|
|
595
|
-
|
|
812
|
+
/** \internal */
|
|
813
|
+
template <typename Rhs, typename Dest>
|
|
814
|
+
void _solve_impl(const SparseMatrixBase<Rhs>& b, SparseMatrixBase<Dest>& dest) const {
|
|
815
|
+
internal::solve_sparse_through_dense_panels(*this, b, dest);
|
|
816
|
+
}
|
|
596
817
|
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
{
|
|
604
|
-
if(m_LDLT)
|
|
605
|
-
LDLTTraits::getL(Base::m_matrix).solveInPlace(dest);
|
|
606
|
-
else
|
|
607
|
-
LLTTraits::getL(Base::m_matrix).solveInPlace(dest);
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
if(Base::m_diag.size()>0)
|
|
611
|
-
dest = Base::m_diag.real().asDiagonal().inverse() * dest;
|
|
612
|
-
|
|
613
|
-
if (Base::m_matrix.nonZeros()>0) // otherwise I==I
|
|
614
|
-
{
|
|
615
|
-
if(m_LDLT)
|
|
616
|
-
LDLTTraits::getU(Base::m_matrix).solveInPlace(dest);
|
|
617
|
-
else
|
|
618
|
-
LLTTraits::getU(Base::m_matrix).solveInPlace(dest);
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
if(Base::m_P.size()>0)
|
|
622
|
-
dest = Base::m_Pinv * dest;
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
/** \internal */
|
|
626
|
-
template<typename Rhs,typename Dest>
|
|
627
|
-
void _solve_impl(const SparseMatrixBase<Rhs> &b, SparseMatrixBase<Dest> &dest) const
|
|
628
|
-
{
|
|
629
|
-
internal::solve_sparse_through_dense_panels(*this, b, dest);
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
Scalar determinant() const
|
|
633
|
-
{
|
|
634
|
-
if(m_LDLT)
|
|
635
|
-
{
|
|
636
|
-
return Base::m_diag.prod();
|
|
637
|
-
}
|
|
638
|
-
else
|
|
639
|
-
{
|
|
640
|
-
Scalar detL = Diagonal<const CholMatrixType>(Base::m_matrix).prod();
|
|
641
|
-
return numext::abs2(detL);
|
|
642
|
-
}
|
|
818
|
+
Scalar determinant() const {
|
|
819
|
+
if (m_LDLT) {
|
|
820
|
+
return Base::m_diag.prod();
|
|
821
|
+
} else {
|
|
822
|
+
Scalar detL = Diagonal<const CholMatrixType>(Base::m_matrix).prod();
|
|
823
|
+
return numext::abs2(detL);
|
|
643
824
|
}
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
protected:
|
|
828
|
+
bool m_LDLT;
|
|
647
829
|
};
|
|
648
830
|
|
|
649
|
-
template<typename Derived>
|
|
650
|
-
|
|
651
|
-
{
|
|
652
|
-
eigen_assert(a.rows()==a.cols());
|
|
831
|
+
template <typename Derived>
|
|
832
|
+
template <bool NonHermitian>
|
|
833
|
+
void SimplicialCholeskyBase<Derived>::ordering(const MatrixType& a, ConstCholMatrixPtr& pmat, CholMatrixType& ap) {
|
|
834
|
+
eigen_assert(a.rows() == a.cols());
|
|
653
835
|
const Index size = a.rows();
|
|
654
836
|
pmat = ≈
|
|
655
837
|
// Note that ordering methods compute the inverse permutation
|
|
656
|
-
if(!internal::is_same<OrderingType,NaturalOrdering<
|
|
657
|
-
{
|
|
838
|
+
if (!internal::is_same<OrderingType, NaturalOrdering<StorageIndex> >::value) {
|
|
658
839
|
{
|
|
659
840
|
CholMatrixType C;
|
|
660
|
-
|
|
661
|
-
|
|
841
|
+
internal::permute_symm_to_fullsymm<UpLo, NonHermitian>(a, C, NULL);
|
|
842
|
+
|
|
662
843
|
OrderingType ordering;
|
|
663
|
-
ordering(C,m_Pinv);
|
|
844
|
+
ordering(C, m_Pinv);
|
|
664
845
|
}
|
|
665
846
|
|
|
666
|
-
if(m_Pinv.size()>0)
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
{
|
|
847
|
+
if (m_Pinv.size() > 0)
|
|
848
|
+
m_P = m_Pinv.inverse();
|
|
849
|
+
else
|
|
850
|
+
m_P.resize(0);
|
|
851
|
+
|
|
852
|
+
ap.resize(size, size);
|
|
853
|
+
internal::permute_symm_to_symm<UpLo, Upper, NonHermitian>(a, ap, m_P.indices().data());
|
|
854
|
+
} else {
|
|
674
855
|
m_Pinv.resize(0);
|
|
675
856
|
m_P.resize(0);
|
|
676
|
-
if(int(UpLo)==int(Lower) || MatrixType::IsRowMajor)
|
|
677
|
-
{
|
|
857
|
+
if (int(UpLo) == int(Lower) || MatrixType::IsRowMajor) {
|
|
678
858
|
// we have to transpose the lower part to to the upper one
|
|
679
|
-
ap.resize(size,size);
|
|
680
|
-
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
}
|
|
859
|
+
ap.resize(size, size);
|
|
860
|
+
internal::permute_symm_to_symm<UpLo, Upper, NonHermitian>(a, ap, NULL);
|
|
861
|
+
} else
|
|
862
|
+
internal::simplicial_cholesky_grab_input<CholMatrixType, MatrixType>::run(a, pmat, ap);
|
|
863
|
+
}
|
|
685
864
|
}
|
|
686
865
|
|
|
687
|
-
}
|
|
866
|
+
} // end namespace Eigen
|
|
688
867
|
|
|
689
|
-
#endif
|
|
868
|
+
#endif // EIGEN_SIMPLICIAL_CHOLESKY_H
|