@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,61 +10,53 @@
|
|
|
10
10
|
#ifndef EIGEN_SUPERLUSUPPORT_H
|
|
11
11
|
#define EIGEN_SUPERLUSUPPORT_H
|
|
12
12
|
|
|
13
|
+
// IWYU pragma: private
|
|
14
|
+
#include "./InternalHeaderCheck.h"
|
|
15
|
+
|
|
13
16
|
namespace Eigen {
|
|
14
17
|
|
|
15
18
|
#if defined(SUPERLU_MAJOR_VERSION) && (SUPERLU_MAJOR_VERSION >= 5)
|
|
16
|
-
#define DECL_GSSVX(PREFIX,FLOATTYPE,KEYTYPE)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
GlobalLU_t gLU; \
|
|
34
|
-
PREFIX##gssvx(options, A, perm_c, perm_r, etree, equed, R, C, L, \
|
|
35
|
-
U, work, lwork, B, X, recip_pivot_growth, rcond, \
|
|
36
|
-
ferr, berr, &gLU, &mem_usage, stats, info); \
|
|
37
|
-
return mem_usage.for_lu; /* bytes used by the factor storage */ \
|
|
19
|
+
#define DECL_GSSVX(PREFIX, FLOATTYPE, KEYTYPE) \
|
|
20
|
+
extern "C" { \
|
|
21
|
+
extern void PREFIX##gssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *, char *, FLOATTYPE *, FLOATTYPE *, \
|
|
22
|
+
SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *, SuperMatrix *, FLOATTYPE *, \
|
|
23
|
+
FLOATTYPE *, FLOATTYPE *, FLOATTYPE *, GlobalLU_t *, mem_usage_t *, SuperLUStat_t *, \
|
|
24
|
+
int *); \
|
|
25
|
+
} \
|
|
26
|
+
inline float SuperLU_gssvx(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, int *etree, \
|
|
27
|
+
char *equed, FLOATTYPE *R, FLOATTYPE *C, SuperMatrix *L, SuperMatrix *U, void *work, \
|
|
28
|
+
int lwork, SuperMatrix *B, SuperMatrix *X, FLOATTYPE *recip_pivot_growth, \
|
|
29
|
+
FLOATTYPE *rcond, FLOATTYPE *ferr, FLOATTYPE *berr, SuperLUStat_t *stats, int *info, \
|
|
30
|
+
KEYTYPE) { \
|
|
31
|
+
mem_usage_t mem_usage; \
|
|
32
|
+
GlobalLU_t gLU; \
|
|
33
|
+
PREFIX##gssvx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work, lwork, B, X, recip_pivot_growth, rcond, \
|
|
34
|
+
ferr, berr, &gLU, &mem_usage, stats, info); \
|
|
35
|
+
return mem_usage.for_lu; /* bytes used by the factor storage */ \
|
|
38
36
|
}
|
|
39
|
-
#else
|
|
40
|
-
#define DECL_GSSVX(PREFIX,FLOATTYPE,KEYTYPE)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
SuperLUStat_t *stats, int *info, KEYTYPE) { \
|
|
56
|
-
mem_usage_t mem_usage; \
|
|
57
|
-
PREFIX##gssvx(options, A, perm_c, perm_r, etree, equed, R, C, L, \
|
|
58
|
-
U, work, lwork, B, X, recip_pivot_growth, rcond, \
|
|
59
|
-
ferr, berr, &mem_usage, stats, info); \
|
|
60
|
-
return mem_usage.for_lu; /* bytes used by the factor storage */ \
|
|
37
|
+
#else // version < 5.0
|
|
38
|
+
#define DECL_GSSVX(PREFIX, FLOATTYPE, KEYTYPE) \
|
|
39
|
+
extern "C" { \
|
|
40
|
+
extern void PREFIX##gssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *, char *, FLOATTYPE *, FLOATTYPE *, \
|
|
41
|
+
SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *, SuperMatrix *, FLOATTYPE *, \
|
|
42
|
+
FLOATTYPE *, FLOATTYPE *, FLOATTYPE *, mem_usage_t *, SuperLUStat_t *, int *); \
|
|
43
|
+
} \
|
|
44
|
+
inline float SuperLU_gssvx(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, int *etree, \
|
|
45
|
+
char *equed, FLOATTYPE *R, FLOATTYPE *C, SuperMatrix *L, SuperMatrix *U, void *work, \
|
|
46
|
+
int lwork, SuperMatrix *B, SuperMatrix *X, FLOATTYPE *recip_pivot_growth, \
|
|
47
|
+
FLOATTYPE *rcond, FLOATTYPE *ferr, FLOATTYPE *berr, SuperLUStat_t *stats, int *info, \
|
|
48
|
+
KEYTYPE) { \
|
|
49
|
+
mem_usage_t mem_usage; \
|
|
50
|
+
PREFIX##gssvx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work, lwork, B, X, recip_pivot_growth, rcond, \
|
|
51
|
+
ferr, berr, &mem_usage, stats, info); \
|
|
52
|
+
return mem_usage.for_lu; /* bytes used by the factor storage */ \
|
|
61
53
|
}
|
|
62
54
|
#endif
|
|
63
55
|
|
|
64
|
-
DECL_GSSVX(s,float,float)
|
|
65
|
-
DECL_GSSVX(c,float,std::complex<float>)
|
|
66
|
-
DECL_GSSVX(d,double,double)
|
|
67
|
-
DECL_GSSVX(z,double,std::complex<double>)
|
|
56
|
+
DECL_GSSVX(s, float, float)
|
|
57
|
+
DECL_GSSVX(c, float, std::complex<float>)
|
|
58
|
+
DECL_GSSVX(d, double, double)
|
|
59
|
+
DECL_GSSVX(z, double, std::complex<double>)
|
|
68
60
|
|
|
69
61
|
#ifdef MILU_ALPHA
|
|
70
62
|
#define EIGEN_SUPERLU_HAS_ILU
|
|
@@ -73,567 +65,519 @@ DECL_GSSVX(z,double,std::complex<double>)
|
|
|
73
65
|
#ifdef EIGEN_SUPERLU_HAS_ILU
|
|
74
66
|
|
|
75
67
|
// similarly for the incomplete factorization using gsisx
|
|
76
|
-
#
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
68
|
+
#if defined(SUPERLU_MAJOR_VERSION) && (SUPERLU_MAJOR_VERSION >= 5)
|
|
69
|
+
#define DECL_GSISX(PREFIX, FLOATTYPE, KEYTYPE) \
|
|
70
|
+
extern "C" { \
|
|
71
|
+
extern void PREFIX##gsisx(superlu_options_t *, SuperMatrix *, int *, int *, int *, char *, FLOATTYPE *, FLOATTYPE *, \
|
|
72
|
+
SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *, SuperMatrix *, FLOATTYPE *, \
|
|
73
|
+
FLOATTYPE *, GlobalLU_t *, mem_usage_t *, SuperLUStat_t *, int *); \
|
|
74
|
+
} \
|
|
75
|
+
inline float SuperLU_gsisx(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, int *etree, \
|
|
76
|
+
char *equed, FLOATTYPE *R, FLOATTYPE *C, SuperMatrix *L, SuperMatrix *U, void *work, \
|
|
77
|
+
int lwork, SuperMatrix *B, SuperMatrix *X, FLOATTYPE *recip_pivot_growth, \
|
|
78
|
+
FLOATTYPE *rcond, SuperLUStat_t *stats, int *info, KEYTYPE) { \
|
|
79
|
+
mem_usage_t mem_usage; \
|
|
80
|
+
GlobalLU_t gLU; \
|
|
81
|
+
PREFIX##gsisx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work, lwork, B, X, recip_pivot_growth, rcond, \
|
|
82
|
+
&gLU, &mem_usage, stats, info); \
|
|
83
|
+
return mem_usage.for_lu; /* bytes used by the factor storage */ \
|
|
84
|
+
}
|
|
85
|
+
#else // version < 5.0
|
|
86
|
+
#define DECL_GSISX(PREFIX, FLOATTYPE, KEYTYPE) \
|
|
87
|
+
extern "C" { \
|
|
88
|
+
extern void PREFIX##gsisx(superlu_options_t *, SuperMatrix *, int *, int *, int *, char *, FLOATTYPE *, FLOATTYPE *, \
|
|
89
|
+
SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *, SuperMatrix *, FLOATTYPE *, \
|
|
90
|
+
FLOATTYPE *, mem_usage_t *, SuperLUStat_t *, int *); \
|
|
91
|
+
} \
|
|
92
|
+
inline float SuperLU_gsisx(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, int *etree, \
|
|
93
|
+
char *equed, FLOATTYPE *R, FLOATTYPE *C, SuperMatrix *L, SuperMatrix *U, void *work, \
|
|
94
|
+
int lwork, SuperMatrix *B, SuperMatrix *X, FLOATTYPE *recip_pivot_growth, \
|
|
95
|
+
FLOATTYPE *rcond, SuperLUStat_t *stats, int *info, KEYTYPE) { \
|
|
96
|
+
mem_usage_t mem_usage; \
|
|
97
|
+
PREFIX##gsisx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work, lwork, B, X, recip_pivot_growth, rcond, \
|
|
98
|
+
&mem_usage, stats, info); \
|
|
99
|
+
return mem_usage.for_lu; /* bytes used by the factor storage */ \
|
|
96
100
|
}
|
|
101
|
+
#endif
|
|
97
102
|
|
|
98
|
-
DECL_GSISX(s,float,float)
|
|
99
|
-
DECL_GSISX(c,float,std::complex<float>)
|
|
100
|
-
DECL_GSISX(d,double,double)
|
|
101
|
-
DECL_GSISX(z,double,std::complex<double>)
|
|
103
|
+
DECL_GSISX(s, float, float)
|
|
104
|
+
DECL_GSISX(c, float, std::complex<float>)
|
|
105
|
+
DECL_GSISX(d, double, double)
|
|
106
|
+
DECL_GSISX(z, double, std::complex<double>)
|
|
102
107
|
|
|
103
108
|
#endif
|
|
104
109
|
|
|
105
|
-
template<typename MatrixType>
|
|
110
|
+
template <typename MatrixType>
|
|
106
111
|
struct SluMatrixMapHelper;
|
|
107
112
|
|
|
108
113
|
/** \internal
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
struct SluMatrix : SuperMatrix
|
|
116
|
-
{
|
|
117
|
-
|
|
118
|
-
{
|
|
119
|
-
Store = &storage;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
SluMatrix(const SluMatrix& other)
|
|
123
|
-
: SuperMatrix(other)
|
|
124
|
-
{
|
|
114
|
+
*
|
|
115
|
+
* A wrapper class for SuperLU matrices. It supports only compressed sparse matrices
|
|
116
|
+
* and dense matrices. Supernodal and other fancy format are not supported by this wrapper.
|
|
117
|
+
*
|
|
118
|
+
* This wrapper class mainly aims to avoids the need of dynamic allocation of the storage structure.
|
|
119
|
+
*/
|
|
120
|
+
struct SluMatrix : SuperMatrix {
|
|
121
|
+
SluMatrix() { Store = &storage; }
|
|
122
|
+
|
|
123
|
+
SluMatrix(const SluMatrix &other) : SuperMatrix(other) {
|
|
125
124
|
Store = &storage;
|
|
126
125
|
storage = other.storage;
|
|
127
126
|
}
|
|
128
127
|
|
|
129
|
-
SluMatrix&
|
|
130
|
-
|
|
131
|
-
SuperMatrix::operator=(static_cast<const SuperMatrix&>(other));
|
|
128
|
+
SluMatrix &operator=(const SluMatrix &other) {
|
|
129
|
+
SuperMatrix::operator=(static_cast<const SuperMatrix &>(other));
|
|
132
130
|
Store = &storage;
|
|
133
131
|
storage = other.storage;
|
|
134
132
|
return *this;
|
|
135
133
|
}
|
|
136
134
|
|
|
137
|
-
struct
|
|
138
|
-
|
|
139
|
-
|
|
135
|
+
struct {
|
|
136
|
+
union {
|
|
137
|
+
int nnz;
|
|
138
|
+
int lda;
|
|
139
|
+
};
|
|
140
140
|
void *values;
|
|
141
141
|
int *innerInd;
|
|
142
142
|
int *outerInd;
|
|
143
143
|
} storage;
|
|
144
144
|
|
|
145
|
-
void setStorageType(Stype_t t)
|
|
146
|
-
{
|
|
145
|
+
void setStorageType(Stype_t t) {
|
|
147
146
|
Stype = t;
|
|
148
|
-
if (t==SLU_NC || t==SLU_NR || t==SLU_DN)
|
|
147
|
+
if (t == SLU_NC || t == SLU_NR || t == SLU_DN)
|
|
149
148
|
Store = &storage;
|
|
150
|
-
else
|
|
151
|
-
{
|
|
149
|
+
else {
|
|
152
150
|
eigen_assert(false && "storage type not supported");
|
|
153
151
|
Store = 0;
|
|
154
152
|
}
|
|
155
153
|
}
|
|
156
154
|
|
|
157
|
-
template<typename Scalar>
|
|
158
|
-
void setScalarType()
|
|
159
|
-
|
|
160
|
-
if (internal::is_same<Scalar,float>::value)
|
|
155
|
+
template <typename Scalar>
|
|
156
|
+
void setScalarType() {
|
|
157
|
+
if (internal::is_same<Scalar, float>::value)
|
|
161
158
|
Dtype = SLU_S;
|
|
162
|
-
else if (internal::is_same<Scalar,double>::value)
|
|
159
|
+
else if (internal::is_same<Scalar, double>::value)
|
|
163
160
|
Dtype = SLU_D;
|
|
164
|
-
else if (internal::is_same<Scalar,std::complex<float> >::value)
|
|
161
|
+
else if (internal::is_same<Scalar, std::complex<float> >::value)
|
|
165
162
|
Dtype = SLU_C;
|
|
166
|
-
else if (internal::is_same<Scalar,std::complex<double> >::value)
|
|
163
|
+
else if (internal::is_same<Scalar, std::complex<double> >::value)
|
|
167
164
|
Dtype = SLU_Z;
|
|
168
|
-
else
|
|
169
|
-
{
|
|
165
|
+
else {
|
|
170
166
|
eigen_assert(false && "Scalar type not supported by SuperLU");
|
|
171
167
|
}
|
|
172
168
|
}
|
|
173
169
|
|
|
174
|
-
template<typename MatrixType>
|
|
175
|
-
static SluMatrix Map(MatrixBase<MatrixType
|
|
176
|
-
|
|
177
|
-
MatrixType&
|
|
178
|
-
|
|
170
|
+
template <typename MatrixType>
|
|
171
|
+
static SluMatrix Map(MatrixBase<MatrixType> &_mat) {
|
|
172
|
+
MatrixType &mat(_mat.derived());
|
|
173
|
+
eigen_assert(((MatrixType::Flags & RowMajorBit) != RowMajorBit) &&
|
|
174
|
+
"row-major dense matrices are not supported by SuperLU");
|
|
179
175
|
SluMatrix res;
|
|
180
176
|
res.setStorageType(SLU_DN);
|
|
181
177
|
res.setScalarType<typename MatrixType::Scalar>();
|
|
182
|
-
res.Mtype
|
|
178
|
+
res.Mtype = SLU_GE;
|
|
183
179
|
|
|
184
|
-
res.nrow
|
|
185
|
-
res.ncol
|
|
180
|
+
res.nrow = internal::convert_index<int>(mat.rows());
|
|
181
|
+
res.ncol = internal::convert_index<int>(mat.cols());
|
|
186
182
|
|
|
187
|
-
res.storage.lda
|
|
188
|
-
res.storage.values
|
|
183
|
+
res.storage.lda = internal::convert_index<int>(MatrixType::IsVectorAtCompileTime ? mat.size() : mat.outerStride());
|
|
184
|
+
res.storage.values = (void *)(mat.data());
|
|
189
185
|
return res;
|
|
190
186
|
}
|
|
191
187
|
|
|
192
|
-
template<typename MatrixType>
|
|
193
|
-
static SluMatrix Map(SparseMatrixBase<MatrixType
|
|
194
|
-
{
|
|
188
|
+
template <typename MatrixType>
|
|
189
|
+
static SluMatrix Map(SparseMatrixBase<MatrixType> &a_mat) {
|
|
195
190
|
MatrixType &mat(a_mat.derived());
|
|
196
191
|
SluMatrix res;
|
|
197
|
-
if ((MatrixType::Flags&RowMajorBit)==RowMajorBit)
|
|
198
|
-
{
|
|
192
|
+
if ((MatrixType::Flags & RowMajorBit) == RowMajorBit) {
|
|
199
193
|
res.setStorageType(SLU_NR);
|
|
200
|
-
res.nrow
|
|
201
|
-
res.ncol
|
|
202
|
-
}
|
|
203
|
-
else
|
|
204
|
-
{
|
|
194
|
+
res.nrow = internal::convert_index<int>(mat.cols());
|
|
195
|
+
res.ncol = internal::convert_index<int>(mat.rows());
|
|
196
|
+
} else {
|
|
205
197
|
res.setStorageType(SLU_NC);
|
|
206
|
-
res.nrow
|
|
207
|
-
res.ncol
|
|
198
|
+
res.nrow = internal::convert_index<int>(mat.rows());
|
|
199
|
+
res.ncol = internal::convert_index<int>(mat.cols());
|
|
208
200
|
}
|
|
209
201
|
|
|
210
|
-
res.Mtype
|
|
202
|
+
res.Mtype = SLU_GE;
|
|
211
203
|
|
|
212
|
-
res.storage.nnz
|
|
213
|
-
res.storage.values
|
|
214
|
-
res.storage.innerInd
|
|
215
|
-
res.storage.outerInd
|
|
204
|
+
res.storage.nnz = internal::convert_index<int>(mat.nonZeros());
|
|
205
|
+
res.storage.values = mat.valuePtr();
|
|
206
|
+
res.storage.innerInd = mat.innerIndexPtr();
|
|
207
|
+
res.storage.outerInd = mat.outerIndexPtr();
|
|
216
208
|
|
|
217
209
|
res.setScalarType<typename MatrixType::Scalar>();
|
|
218
210
|
|
|
219
211
|
// FIXME the following is not very accurate
|
|
220
|
-
if (MatrixType::Flags & Upper)
|
|
221
|
-
|
|
222
|
-
if (MatrixType::Flags & Lower)
|
|
223
|
-
res.Mtype = SLU_TRL;
|
|
212
|
+
if (int(MatrixType::Flags) & int(Upper)) res.Mtype = SLU_TRU;
|
|
213
|
+
if (int(MatrixType::Flags) & int(Lower)) res.Mtype = SLU_TRL;
|
|
224
214
|
|
|
225
|
-
eigen_assert(((MatrixType::Flags & SelfAdjoint)==0) &&
|
|
215
|
+
eigen_assert(((int(MatrixType::Flags) & int(SelfAdjoint)) == 0) &&
|
|
216
|
+
"SelfAdjoint matrix shape not supported by SuperLU");
|
|
226
217
|
|
|
227
218
|
return res;
|
|
228
219
|
}
|
|
229
220
|
};
|
|
230
221
|
|
|
231
|
-
template<typename Scalar, int Rows, int Cols, int Options, int MRows, int MCols>
|
|
232
|
-
struct SluMatrixMapHelper<Matrix<Scalar,Rows,Cols,Options,MRows,MCols> >
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
{
|
|
237
|
-
eigen_assert( ((Options&RowMajor)!=RowMajor) && "row-major dense matrices is not supported by SuperLU");
|
|
222
|
+
template <typename Scalar, int Rows, int Cols, int Options, int MRows, int MCols>
|
|
223
|
+
struct SluMatrixMapHelper<Matrix<Scalar, Rows, Cols, Options, MRows, MCols> > {
|
|
224
|
+
typedef Matrix<Scalar, Rows, Cols, Options, MRows, MCols> MatrixType;
|
|
225
|
+
static void run(MatrixType &mat, SluMatrix &res) {
|
|
226
|
+
eigen_assert(((Options & RowMajor) != RowMajor) && "row-major dense matrices is not supported by SuperLU");
|
|
238
227
|
res.setStorageType(SLU_DN);
|
|
239
228
|
res.setScalarType<Scalar>();
|
|
240
|
-
res.Mtype
|
|
229
|
+
res.Mtype = SLU_GE;
|
|
241
230
|
|
|
242
|
-
res.nrow
|
|
243
|
-
res.ncol
|
|
231
|
+
res.nrow = mat.rows();
|
|
232
|
+
res.ncol = mat.cols();
|
|
244
233
|
|
|
245
|
-
res.storage.lda
|
|
246
|
-
res.storage.values
|
|
234
|
+
res.storage.lda = mat.outerStride();
|
|
235
|
+
res.storage.values = mat.data();
|
|
247
236
|
}
|
|
248
237
|
};
|
|
249
238
|
|
|
250
|
-
template<typename Derived>
|
|
251
|
-
struct SluMatrixMapHelper<SparseMatrixBase<Derived> >
|
|
252
|
-
{
|
|
239
|
+
template <typename Derived>
|
|
240
|
+
struct SluMatrixMapHelper<SparseMatrixBase<Derived> > {
|
|
253
241
|
typedef Derived MatrixType;
|
|
254
|
-
static void run(MatrixType&
|
|
255
|
-
|
|
256
|
-
if ((MatrixType::Flags&RowMajorBit)==RowMajorBit)
|
|
257
|
-
{
|
|
242
|
+
static void run(MatrixType &mat, SluMatrix &res) {
|
|
243
|
+
if ((MatrixType::Flags & RowMajorBit) == RowMajorBit) {
|
|
258
244
|
res.setStorageType(SLU_NR);
|
|
259
|
-
res.nrow
|
|
260
|
-
res.ncol
|
|
261
|
-
}
|
|
262
|
-
else
|
|
263
|
-
{
|
|
245
|
+
res.nrow = mat.cols();
|
|
246
|
+
res.ncol = mat.rows();
|
|
247
|
+
} else {
|
|
264
248
|
res.setStorageType(SLU_NC);
|
|
265
|
-
res.nrow
|
|
266
|
-
res.ncol
|
|
249
|
+
res.nrow = mat.rows();
|
|
250
|
+
res.ncol = mat.cols();
|
|
267
251
|
}
|
|
268
252
|
|
|
269
|
-
res.Mtype
|
|
253
|
+
res.Mtype = SLU_GE;
|
|
270
254
|
|
|
271
|
-
res.storage.nnz
|
|
272
|
-
res.storage.values
|
|
273
|
-
res.storage.innerInd
|
|
274
|
-
res.storage.outerInd
|
|
255
|
+
res.storage.nnz = mat.nonZeros();
|
|
256
|
+
res.storage.values = mat.valuePtr();
|
|
257
|
+
res.storage.innerInd = mat.innerIndexPtr();
|
|
258
|
+
res.storage.outerInd = mat.outerIndexPtr();
|
|
275
259
|
|
|
276
260
|
res.setScalarType<typename MatrixType::Scalar>();
|
|
277
261
|
|
|
278
262
|
// FIXME the following is not very accurate
|
|
279
|
-
if (MatrixType::Flags & Upper)
|
|
280
|
-
|
|
281
|
-
if (MatrixType::Flags & Lower)
|
|
282
|
-
res.Mtype = SLU_TRL;
|
|
263
|
+
if (MatrixType::Flags & Upper) res.Mtype = SLU_TRU;
|
|
264
|
+
if (MatrixType::Flags & Lower) res.Mtype = SLU_TRL;
|
|
283
265
|
|
|
284
|
-
eigen_assert(((MatrixType::Flags & SelfAdjoint)==0) && "SelfAdjoint matrix shape not supported by SuperLU");
|
|
266
|
+
eigen_assert(((MatrixType::Flags & SelfAdjoint) == 0) && "SelfAdjoint matrix shape not supported by SuperLU");
|
|
285
267
|
}
|
|
286
268
|
};
|
|
287
269
|
|
|
288
270
|
namespace internal {
|
|
289
271
|
|
|
290
|
-
template<typename MatrixType>
|
|
291
|
-
SluMatrix asSluMatrix(MatrixType&
|
|
292
|
-
{
|
|
272
|
+
template <typename MatrixType>
|
|
273
|
+
SluMatrix asSluMatrix(MatrixType &mat) {
|
|
293
274
|
return SluMatrix::Map(mat);
|
|
294
275
|
}
|
|
295
276
|
|
|
296
277
|
/** View a Super LU matrix as an Eigen expression */
|
|
297
|
-
template<typename Scalar, int Flags, typename Index>
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|| ((Flags&ColMajor)==ColMajor && sluMat.Stype == SLU_NC));
|
|
278
|
+
template <typename Scalar, int Flags, typename Index>
|
|
279
|
+
Map<SparseMatrix<Scalar, Flags, Index> > map_superlu(SluMatrix &sluMat) {
|
|
280
|
+
eigen_assert(((Flags & RowMajor) == RowMajor && sluMat.Stype == SLU_NR) ||
|
|
281
|
+
((Flags & ColMajor) == ColMajor && sluMat.Stype == SLU_NC));
|
|
302
282
|
|
|
303
|
-
Index outerSize = (Flags&RowMajor)==RowMajor ? sluMat.ncol : sluMat.nrow;
|
|
283
|
+
Index outerSize = (Flags & RowMajor) == RowMajor ? sluMat.ncol : sluMat.nrow;
|
|
304
284
|
|
|
305
|
-
return
|
|
306
|
-
|
|
307
|
-
|
|
285
|
+
return Map<SparseMatrix<Scalar, Flags, Index> >(sluMat.nrow, sluMat.ncol, sluMat.storage.outerInd[outerSize],
|
|
286
|
+
sluMat.storage.outerInd, sluMat.storage.innerInd,
|
|
287
|
+
reinterpret_cast<Scalar *>(sluMat.storage.values));
|
|
308
288
|
}
|
|
309
289
|
|
|
310
|
-
}
|
|
290
|
+
} // end namespace internal
|
|
311
291
|
|
|
312
292
|
/** \ingroup SuperLUSupport_Module
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
template<typename
|
|
317
|
-
class SuperLUBase : public SparseSolverBase<Derived>
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
293
|
+
* \class SuperLUBase
|
|
294
|
+
* \brief The base class for the direct and incomplete LU factorization of SuperLU
|
|
295
|
+
*/
|
|
296
|
+
template <typename MatrixType_, typename Derived>
|
|
297
|
+
class SuperLUBase : public SparseSolverBase<Derived> {
|
|
298
|
+
protected:
|
|
299
|
+
typedef SparseSolverBase<Derived> Base;
|
|
300
|
+
using Base::derived;
|
|
301
|
+
using Base::m_isInitialized;
|
|
302
|
+
|
|
303
|
+
public:
|
|
304
|
+
typedef MatrixType_ MatrixType;
|
|
305
|
+
typedef typename MatrixType::Scalar Scalar;
|
|
306
|
+
typedef typename MatrixType::RealScalar RealScalar;
|
|
307
|
+
typedef typename MatrixType::StorageIndex StorageIndex;
|
|
308
|
+
typedef Matrix<Scalar, Dynamic, 1> Vector;
|
|
309
|
+
typedef Matrix<int, 1, MatrixType::ColsAtCompileTime> IntRowVectorType;
|
|
310
|
+
typedef Matrix<int, MatrixType::RowsAtCompileTime, 1> IntColVectorType;
|
|
311
|
+
typedef Map<PermutationMatrix<Dynamic, Dynamic, int> > PermutationMap;
|
|
312
|
+
typedef SparseMatrix<Scalar> LUMatrixType;
|
|
313
|
+
enum { ColsAtCompileTime = MatrixType::ColsAtCompileTime, MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime };
|
|
314
|
+
|
|
315
|
+
public:
|
|
316
|
+
SuperLUBase() {}
|
|
317
|
+
|
|
318
|
+
~SuperLUBase() { clearFactors(); }
|
|
319
|
+
|
|
320
|
+
inline Index rows() const { return m_matrix.rows(); }
|
|
321
|
+
inline Index cols() const { return m_matrix.cols(); }
|
|
322
|
+
|
|
323
|
+
/** \returns a reference to the Super LU option object to configure the Super LU algorithms. */
|
|
324
|
+
inline superlu_options_t &options() { return m_sluOptions; }
|
|
325
|
+
|
|
326
|
+
/** \brief Reports whether previous computation was successful.
|
|
327
|
+
*
|
|
328
|
+
* \returns \c Success if computation was successful,
|
|
329
|
+
* \c NumericalIssue if the matrix.appears to be negative.
|
|
330
|
+
*/
|
|
331
|
+
ComputationInfo info() const {
|
|
332
|
+
eigen_assert(m_isInitialized && "Decomposition is not initialized.");
|
|
333
|
+
return m_info;
|
|
334
|
+
}
|
|
337
335
|
|
|
338
|
-
|
|
336
|
+
/** Computes the sparse Cholesky decomposition of \a matrix */
|
|
337
|
+
void compute(const MatrixType &matrix) {
|
|
338
|
+
derived().analyzePattern(matrix);
|
|
339
|
+
derived().factorize(matrix);
|
|
340
|
+
}
|
|
339
341
|
|
|
340
|
-
|
|
342
|
+
/** Performs a symbolic decomposition on the sparsity of \a matrix.
|
|
343
|
+
*
|
|
344
|
+
* This function is particularly useful when solving for several problems having the same structure.
|
|
345
|
+
*
|
|
346
|
+
* \sa factorize()
|
|
347
|
+
*/
|
|
348
|
+
void analyzePattern(const MatrixType & /*matrix*/) {
|
|
349
|
+
m_isInitialized = true;
|
|
350
|
+
m_info = Success;
|
|
351
|
+
m_analysisIsOk = true;
|
|
352
|
+
m_factorizationIsOk = false;
|
|
353
|
+
}
|
|
341
354
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
clearFactors();
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
inline Index rows() const { return m_matrix.rows(); }
|
|
348
|
-
inline Index cols() const { return m_matrix.cols(); }
|
|
349
|
-
|
|
350
|
-
/** \returns a reference to the Super LU option object to configure the Super LU algorithms. */
|
|
351
|
-
inline superlu_options_t& options() { return m_sluOptions; }
|
|
352
|
-
|
|
353
|
-
/** \brief Reports whether previous computation was successful.
|
|
354
|
-
*
|
|
355
|
-
* \returns \c Success if computation was succesful,
|
|
356
|
-
* \c NumericalIssue if the matrix.appears to be negative.
|
|
357
|
-
*/
|
|
358
|
-
ComputationInfo info() const
|
|
359
|
-
{
|
|
360
|
-
eigen_assert(m_isInitialized && "Decomposition is not initialized.");
|
|
361
|
-
return m_info;
|
|
362
|
-
}
|
|
355
|
+
template <typename Stream>
|
|
356
|
+
void dumpMemory(Stream & /*s*/) {}
|
|
363
357
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
derived().analyzePattern(matrix);
|
|
368
|
-
derived().factorize(matrix);
|
|
369
|
-
}
|
|
358
|
+
protected:
|
|
359
|
+
void initFactorization(const MatrixType &a) {
|
|
360
|
+
set_default_options(&this->m_sluOptions);
|
|
370
361
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
* This function is particularly useful when solving for several problems having the same structure.
|
|
374
|
-
*
|
|
375
|
-
* \sa factorize()
|
|
376
|
-
*/
|
|
377
|
-
void analyzePattern(const MatrixType& /*matrix*/)
|
|
378
|
-
{
|
|
379
|
-
m_isInitialized = true;
|
|
380
|
-
m_info = Success;
|
|
381
|
-
m_analysisIsOk = true;
|
|
382
|
-
m_factorizationIsOk = false;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
template<typename Stream>
|
|
386
|
-
void dumpMemory(Stream& /*s*/)
|
|
387
|
-
{}
|
|
388
|
-
|
|
389
|
-
protected:
|
|
390
|
-
|
|
391
|
-
void initFactorization(const MatrixType& a)
|
|
392
|
-
{
|
|
393
|
-
set_default_options(&this->m_sluOptions);
|
|
394
|
-
|
|
395
|
-
const Index size = a.rows();
|
|
396
|
-
m_matrix = a;
|
|
397
|
-
|
|
398
|
-
m_sluA = internal::asSluMatrix(m_matrix);
|
|
399
|
-
clearFactors();
|
|
400
|
-
|
|
401
|
-
m_p.resize(size);
|
|
402
|
-
m_q.resize(size);
|
|
403
|
-
m_sluRscale.resize(size);
|
|
404
|
-
m_sluCscale.resize(size);
|
|
405
|
-
m_sluEtree.resize(size);
|
|
406
|
-
|
|
407
|
-
// set empty B and X
|
|
408
|
-
m_sluB.setStorageType(SLU_DN);
|
|
409
|
-
m_sluB.setScalarType<Scalar>();
|
|
410
|
-
m_sluB.Mtype = SLU_GE;
|
|
411
|
-
m_sluB.storage.values = 0;
|
|
412
|
-
m_sluB.nrow = 0;
|
|
413
|
-
m_sluB.ncol = 0;
|
|
414
|
-
m_sluB.storage.lda = internal::convert_index<int>(size);
|
|
415
|
-
m_sluX = m_sluB;
|
|
416
|
-
|
|
417
|
-
m_extractedDataAreDirty = true;
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
void init()
|
|
421
|
-
{
|
|
422
|
-
m_info = InvalidInput;
|
|
423
|
-
m_isInitialized = false;
|
|
424
|
-
m_sluL.Store = 0;
|
|
425
|
-
m_sluU.Store = 0;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
void extractData() const;
|
|
362
|
+
const Index size = a.rows();
|
|
363
|
+
m_matrix = a;
|
|
429
364
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
if(m_sluL.Store)
|
|
433
|
-
Destroy_SuperNode_Matrix(&m_sluL);
|
|
434
|
-
if(m_sluU.Store)
|
|
435
|
-
Destroy_CompCol_Matrix(&m_sluU);
|
|
365
|
+
m_sluA = internal::asSluMatrix(m_matrix);
|
|
366
|
+
clearFactors();
|
|
436
367
|
|
|
437
|
-
|
|
438
|
-
|
|
368
|
+
m_p.resize(size);
|
|
369
|
+
m_q.resize(size);
|
|
370
|
+
m_sluRscale.resize(size);
|
|
371
|
+
m_sluCscale.resize(size);
|
|
372
|
+
m_sluEtree.resize(size);
|
|
439
373
|
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
374
|
+
// set empty B and X
|
|
375
|
+
m_sluB.setStorageType(SLU_DN);
|
|
376
|
+
m_sluB.setScalarType<Scalar>();
|
|
377
|
+
m_sluB.Mtype = SLU_GE;
|
|
378
|
+
m_sluB.storage.values = 0;
|
|
379
|
+
m_sluB.nrow = 0;
|
|
380
|
+
m_sluB.ncol = 0;
|
|
381
|
+
m_sluB.storage.lda = internal::convert_index<int>(size);
|
|
382
|
+
m_sluX = m_sluB;
|
|
443
383
|
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
private:
|
|
467
|
-
SuperLUBase(SuperLUBase& ) { }
|
|
468
|
-
};
|
|
384
|
+
m_extractedDataAreDirty = true;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
void init() {
|
|
388
|
+
m_info = InvalidInput;
|
|
389
|
+
m_isInitialized = false;
|
|
390
|
+
m_sluL.Store = 0;
|
|
391
|
+
m_sluU.Store = 0;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
void extractData() const;
|
|
395
|
+
|
|
396
|
+
void clearFactors() {
|
|
397
|
+
if (m_sluL.Store) Destroy_SuperNode_Matrix(&m_sluL);
|
|
398
|
+
if (m_sluU.Store) Destroy_CompCol_Matrix(&m_sluU);
|
|
399
|
+
|
|
400
|
+
m_sluL.Store = 0;
|
|
401
|
+
m_sluU.Store = 0;
|
|
402
|
+
|
|
403
|
+
memset(&m_sluL, 0, sizeof m_sluL);
|
|
404
|
+
memset(&m_sluU, 0, sizeof m_sluU);
|
|
405
|
+
}
|
|
469
406
|
|
|
407
|
+
// cached data to reduce reallocation, etc.
|
|
408
|
+
mutable LUMatrixType m_l;
|
|
409
|
+
mutable LUMatrixType m_u;
|
|
410
|
+
mutable IntColVectorType m_p;
|
|
411
|
+
mutable IntRowVectorType m_q;
|
|
412
|
+
|
|
413
|
+
mutable LUMatrixType m_matrix; // copy of the factorized matrix
|
|
414
|
+
mutable SluMatrix m_sluA;
|
|
415
|
+
mutable SuperMatrix m_sluL, m_sluU;
|
|
416
|
+
mutable SluMatrix m_sluB, m_sluX;
|
|
417
|
+
mutable SuperLUStat_t m_sluStat;
|
|
418
|
+
mutable superlu_options_t m_sluOptions;
|
|
419
|
+
mutable std::vector<int> m_sluEtree;
|
|
420
|
+
mutable Matrix<RealScalar, Dynamic, 1> m_sluRscale, m_sluCscale;
|
|
421
|
+
mutable Matrix<RealScalar, Dynamic, 1> m_sluFerr, m_sluBerr;
|
|
422
|
+
mutable char m_sluEqued;
|
|
423
|
+
|
|
424
|
+
mutable ComputationInfo m_info;
|
|
425
|
+
int m_factorizationIsOk;
|
|
426
|
+
int m_analysisIsOk;
|
|
427
|
+
mutable bool m_extractedDataAreDirty;
|
|
428
|
+
|
|
429
|
+
private:
|
|
430
|
+
SuperLUBase(SuperLUBase &) {}
|
|
431
|
+
};
|
|
470
432
|
|
|
471
433
|
/** \ingroup SuperLUSupport_Module
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
template<typename
|
|
488
|
-
class SuperLU : public SuperLUBase<
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
Base::compute(matrix);
|
|
512
|
-
}
|
|
434
|
+
* \class SuperLU
|
|
435
|
+
* \brief A sparse direct LU factorization and solver based on the SuperLU library
|
|
436
|
+
*
|
|
437
|
+
* This class allows to solve for A.X = B sparse linear problems via a direct LU factorization
|
|
438
|
+
* using the SuperLU library. The sparse matrix A must be squared and invertible. The vectors or matrices
|
|
439
|
+
* X and B can be either dense or sparse.
|
|
440
|
+
*
|
|
441
|
+
* \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
|
|
442
|
+
*
|
|
443
|
+
* \warning This class is only for the 4.x versions of SuperLU. The 3.x and 5.x versions are not supported.
|
|
444
|
+
*
|
|
445
|
+
* \implsparsesolverconcept
|
|
446
|
+
*
|
|
447
|
+
* \sa \ref TutorialSparseSolverConcept, class SparseLU
|
|
448
|
+
*/
|
|
449
|
+
template <typename MatrixType_>
|
|
450
|
+
class SuperLU : public SuperLUBase<MatrixType_, SuperLU<MatrixType_> > {
|
|
451
|
+
public:
|
|
452
|
+
typedef SuperLUBase<MatrixType_, SuperLU> Base;
|
|
453
|
+
typedef MatrixType_ MatrixType;
|
|
454
|
+
typedef typename Base::Scalar Scalar;
|
|
455
|
+
typedef typename Base::RealScalar RealScalar;
|
|
456
|
+
typedef typename Base::StorageIndex StorageIndex;
|
|
457
|
+
typedef typename Base::IntRowVectorType IntRowVectorType;
|
|
458
|
+
typedef typename Base::IntColVectorType IntColVectorType;
|
|
459
|
+
typedef typename Base::PermutationMap PermutationMap;
|
|
460
|
+
typedef typename Base::LUMatrixType LUMatrixType;
|
|
461
|
+
typedef TriangularView<LUMatrixType, Lower | UnitDiag> LMatrixType;
|
|
462
|
+
typedef TriangularView<LUMatrixType, Upper> UMatrixType;
|
|
463
|
+
|
|
464
|
+
public:
|
|
465
|
+
using Base::_solve_impl;
|
|
466
|
+
|
|
467
|
+
SuperLU() : Base() { init(); }
|
|
468
|
+
|
|
469
|
+
explicit SuperLU(const MatrixType &matrix) : Base() {
|
|
470
|
+
init();
|
|
471
|
+
Base::compute(matrix);
|
|
472
|
+
}
|
|
513
473
|
|
|
514
|
-
|
|
515
|
-
{
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
/** Performs a symbolic decomposition on the sparcity of \a matrix.
|
|
519
|
-
*
|
|
520
|
-
* This function is particularly useful when solving for several problems having the same structure.
|
|
521
|
-
*
|
|
522
|
-
* \sa factorize()
|
|
523
|
-
*/
|
|
524
|
-
void analyzePattern(const MatrixType& matrix)
|
|
525
|
-
{
|
|
526
|
-
m_info = InvalidInput;
|
|
527
|
-
m_isInitialized = false;
|
|
528
|
-
Base::analyzePattern(matrix);
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
/** Performs a numeric decomposition of \a matrix
|
|
532
|
-
*
|
|
533
|
-
* The given matrix must has the same sparcity than the matrix on which the symbolic decomposition has been performed.
|
|
534
|
-
*
|
|
535
|
-
* \sa analyzePattern()
|
|
536
|
-
*/
|
|
537
|
-
void factorize(const MatrixType& matrix);
|
|
538
|
-
|
|
539
|
-
/** \internal */
|
|
540
|
-
template<typename Rhs,typename Dest>
|
|
541
|
-
void _solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest> &dest) const;
|
|
542
|
-
|
|
543
|
-
inline const LMatrixType& matrixL() const
|
|
544
|
-
{
|
|
545
|
-
if (m_extractedDataAreDirty) this->extractData();
|
|
546
|
-
return m_l;
|
|
547
|
-
}
|
|
474
|
+
~SuperLU() {}
|
|
548
475
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
476
|
+
/** Performs a symbolic decomposition on the sparsity of \a matrix.
|
|
477
|
+
*
|
|
478
|
+
* This function is particularly useful when solving for several problems having the same structure.
|
|
479
|
+
*
|
|
480
|
+
* \sa factorize()
|
|
481
|
+
*/
|
|
482
|
+
void analyzePattern(const MatrixType &matrix) {
|
|
483
|
+
m_info = InvalidInput;
|
|
484
|
+
m_isInitialized = false;
|
|
485
|
+
Base::analyzePattern(matrix);
|
|
486
|
+
}
|
|
554
487
|
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
488
|
+
/** Performs a numeric decomposition of \a matrix
|
|
489
|
+
*
|
|
490
|
+
* The given matrix must have the same sparsity than the matrix on which the symbolic decomposition has been
|
|
491
|
+
* performed.
|
|
492
|
+
*
|
|
493
|
+
* \sa analyzePattern()
|
|
494
|
+
*/
|
|
495
|
+
void factorize(const MatrixType &matrix);
|
|
496
|
+
|
|
497
|
+
/** \internal */
|
|
498
|
+
template <typename Rhs, typename Dest>
|
|
499
|
+
void _solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest> &dest) const;
|
|
500
|
+
|
|
501
|
+
inline const LMatrixType &matrixL() const {
|
|
502
|
+
if (m_extractedDataAreDirty) this->extractData();
|
|
503
|
+
return m_l;
|
|
504
|
+
}
|
|
560
505
|
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
506
|
+
inline const UMatrixType &matrixU() const {
|
|
507
|
+
if (m_extractedDataAreDirty) this->extractData();
|
|
508
|
+
return m_u;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
inline const IntColVectorType &permutationP() const {
|
|
512
|
+
if (m_extractedDataAreDirty) this->extractData();
|
|
513
|
+
return m_p;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
inline const IntRowVectorType &permutationQ() const {
|
|
517
|
+
if (m_extractedDataAreDirty) this->extractData();
|
|
518
|
+
return m_q;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
Scalar determinant() const;
|
|
522
|
+
|
|
523
|
+
protected:
|
|
524
|
+
using Base::m_l;
|
|
525
|
+
using Base::m_matrix;
|
|
526
|
+
using Base::m_p;
|
|
527
|
+
using Base::m_q;
|
|
528
|
+
using Base::m_sluA;
|
|
529
|
+
using Base::m_sluB;
|
|
530
|
+
using Base::m_sluBerr;
|
|
531
|
+
using Base::m_sluCscale;
|
|
532
|
+
using Base::m_sluEqued;
|
|
533
|
+
using Base::m_sluEtree;
|
|
534
|
+
using Base::m_sluFerr;
|
|
535
|
+
using Base::m_sluL;
|
|
536
|
+
using Base::m_sluOptions;
|
|
537
|
+
using Base::m_sluRscale;
|
|
538
|
+
using Base::m_sluStat;
|
|
539
|
+
using Base::m_sluU;
|
|
540
|
+
using Base::m_sluX;
|
|
541
|
+
using Base::m_u;
|
|
542
|
+
|
|
543
|
+
using Base::m_analysisIsOk;
|
|
544
|
+
using Base::m_extractedDataAreDirty;
|
|
545
|
+
using Base::m_factorizationIsOk;
|
|
546
|
+
using Base::m_info;
|
|
547
|
+
using Base::m_isInitialized;
|
|
548
|
+
|
|
549
|
+
void init() {
|
|
550
|
+
Base::init();
|
|
551
|
+
|
|
552
|
+
set_default_options(&this->m_sluOptions);
|
|
553
|
+
m_sluOptions.PrintStat = NO;
|
|
554
|
+
m_sluOptions.ConditionNumber = NO;
|
|
555
|
+
m_sluOptions.Trans = NOTRANS;
|
|
556
|
+
m_sluOptions.ColPerm = COLAMD;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
private:
|
|
560
|
+
SuperLU(SuperLU &) {}
|
|
610
561
|
};
|
|
611
562
|
|
|
612
|
-
template<typename MatrixType>
|
|
613
|
-
void SuperLU<MatrixType>::factorize(const MatrixType&
|
|
614
|
-
{
|
|
563
|
+
template <typename MatrixType>
|
|
564
|
+
void SuperLU<MatrixType>::factorize(const MatrixType &a) {
|
|
615
565
|
eigen_assert(m_analysisIsOk && "You must first call analyzePattern()");
|
|
616
|
-
if(!m_analysisIsOk)
|
|
617
|
-
{
|
|
566
|
+
if (!m_analysisIsOk) {
|
|
618
567
|
m_info = InvalidInput;
|
|
619
568
|
return;
|
|
620
569
|
}
|
|
621
|
-
|
|
570
|
+
|
|
622
571
|
this->initFactorization(a);
|
|
623
|
-
|
|
572
|
+
|
|
624
573
|
m_sluOptions.ColPerm = COLAMD;
|
|
625
574
|
int info = 0;
|
|
626
575
|
RealScalar recip_pivot_growth, rcond;
|
|
627
576
|
RealScalar ferr, berr;
|
|
628
577
|
|
|
629
578
|
StatInit(&m_sluStat);
|
|
630
|
-
SuperLU_gssvx(&m_sluOptions, &m_sluA, m_q.data(), m_p.data(), &m_sluEtree[0],
|
|
631
|
-
&
|
|
632
|
-
&m_sluL, &m_sluU,
|
|
633
|
-
NULL, 0,
|
|
634
|
-
&m_sluB, &m_sluX,
|
|
635
|
-
&recip_pivot_growth, &rcond,
|
|
636
|
-
&ferr, &berr,
|
|
579
|
+
SuperLU_gssvx(&m_sluOptions, &m_sluA, m_q.data(), m_p.data(), &m_sluEtree[0], &m_sluEqued, &m_sluRscale[0],
|
|
580
|
+
&m_sluCscale[0], &m_sluL, &m_sluU, NULL, 0, &m_sluB, &m_sluX, &recip_pivot_growth, &rcond, &ferr, &berr,
|
|
637
581
|
&m_sluStat, &info, Scalar());
|
|
638
582
|
StatFree(&m_sluStat);
|
|
639
583
|
|
|
@@ -644,56 +588,46 @@ void SuperLU<MatrixType>::factorize(const MatrixType& a)
|
|
|
644
588
|
m_factorizationIsOk = true;
|
|
645
589
|
}
|
|
646
590
|
|
|
647
|
-
template<typename MatrixType>
|
|
648
|
-
template<typename Rhs,typename Dest>
|
|
649
|
-
void SuperLU<MatrixType>::_solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest
|
|
650
|
-
|
|
651
|
-
|
|
591
|
+
template <typename MatrixType>
|
|
592
|
+
template <typename Rhs, typename Dest>
|
|
593
|
+
void SuperLU<MatrixType>::_solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest> &x) const {
|
|
594
|
+
eigen_assert(m_factorizationIsOk &&
|
|
595
|
+
"The decomposition is not in a valid state for solving, you must first call either compute() or "
|
|
596
|
+
"analyzePattern()/factorize()");
|
|
652
597
|
|
|
653
|
-
const Index size = m_matrix.rows();
|
|
654
598
|
const Index rhsCols = b.cols();
|
|
655
|
-
eigen_assert(
|
|
599
|
+
eigen_assert(m_matrix.rows() == b.rows());
|
|
656
600
|
|
|
657
601
|
m_sluOptions.Trans = NOTRANS;
|
|
658
602
|
m_sluOptions.Fact = FACTORED;
|
|
659
603
|
m_sluOptions.IterRefine = NOREFINE;
|
|
660
|
-
|
|
661
604
|
|
|
662
605
|
m_sluFerr.resize(rhsCols);
|
|
663
606
|
m_sluBerr.resize(rhsCols);
|
|
664
|
-
|
|
665
|
-
Ref<const Matrix<typename Rhs::Scalar,Dynamic,Dynamic,ColMajor> > b_ref(b);
|
|
666
|
-
Ref<const Matrix<typename Dest::Scalar,Dynamic,Dynamic,ColMajor> > x_ref(x);
|
|
667
|
-
|
|
607
|
+
|
|
608
|
+
Ref<const Matrix<typename Rhs::Scalar, Dynamic, Dynamic, ColMajor> > b_ref(b);
|
|
609
|
+
Ref<const Matrix<typename Dest::Scalar, Dynamic, Dynamic, ColMajor> > x_ref(x);
|
|
610
|
+
|
|
668
611
|
m_sluB = SluMatrix::Map(b_ref.const_cast_derived());
|
|
669
612
|
m_sluX = SluMatrix::Map(x_ref.const_cast_derived());
|
|
670
|
-
|
|
613
|
+
|
|
671
614
|
typename Rhs::PlainObject b_cpy;
|
|
672
|
-
if(m_sluEqued!='N')
|
|
673
|
-
{
|
|
615
|
+
if (m_sluEqued != 'N') {
|
|
674
616
|
b_cpy = b;
|
|
675
|
-
m_sluB = SluMatrix::Map(b_cpy.const_cast_derived());
|
|
617
|
+
m_sluB = SluMatrix::Map(b_cpy.const_cast_derived());
|
|
676
618
|
}
|
|
677
619
|
|
|
678
620
|
StatInit(&m_sluStat);
|
|
679
621
|
int info = 0;
|
|
680
622
|
RealScalar recip_pivot_growth, rcond;
|
|
681
|
-
SuperLU_gssvx(&m_sluOptions, &m_sluA,
|
|
682
|
-
|
|
683
|
-
&
|
|
684
|
-
&m_sluRscale[0], &m_sluCscale[0],
|
|
685
|
-
&m_sluL, &m_sluU,
|
|
686
|
-
NULL, 0,
|
|
687
|
-
&m_sluB, &m_sluX,
|
|
688
|
-
&recip_pivot_growth, &rcond,
|
|
689
|
-
&m_sluFerr[0], &m_sluBerr[0],
|
|
690
|
-
&m_sluStat, &info, Scalar());
|
|
623
|
+
SuperLU_gssvx(&m_sluOptions, &m_sluA, m_q.data(), m_p.data(), &m_sluEtree[0], &m_sluEqued, &m_sluRscale[0],
|
|
624
|
+
&m_sluCscale[0], &m_sluL, &m_sluU, NULL, 0, &m_sluB, &m_sluX, &recip_pivot_growth, &rcond,
|
|
625
|
+
&m_sluFerr[0], &m_sluBerr[0], &m_sluStat, &info, Scalar());
|
|
691
626
|
StatFree(&m_sluStat);
|
|
692
|
-
|
|
693
|
-
if(x.derived().data() != x_ref.data())
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
m_info = info==0 ? Success : NumericalIssue;
|
|
627
|
+
|
|
628
|
+
if (x.derived().data() != x_ref.data()) x = x_ref;
|
|
629
|
+
|
|
630
|
+
m_info = info == 0 ? Success : NumericalIssue;
|
|
697
631
|
}
|
|
698
632
|
|
|
699
633
|
// the code of this extractData() function has been adapted from the SuperLU's Matlab support code,
|
|
@@ -703,78 +637,70 @@ void SuperLU<MatrixType>::_solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest>
|
|
|
703
637
|
// THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
|
|
704
638
|
// EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
|
|
705
639
|
//
|
|
706
|
-
template<typename MatrixType, typename Derived>
|
|
707
|
-
void SuperLUBase<MatrixType,Derived>::extractData() const
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
{
|
|
712
|
-
int
|
|
713
|
-
int
|
|
714
|
-
int
|
|
715
|
-
SCformat
|
|
716
|
-
NCformat
|
|
717
|
-
Scalar
|
|
640
|
+
template <typename MatrixType, typename Derived>
|
|
641
|
+
void SuperLUBase<MatrixType, Derived>::extractData() const {
|
|
642
|
+
eigen_assert(m_factorizationIsOk &&
|
|
643
|
+
"The decomposition is not in a valid state for extracting factors, you must first call either compute() "
|
|
644
|
+
"or analyzePattern()/factorize()");
|
|
645
|
+
if (m_extractedDataAreDirty) {
|
|
646
|
+
int upper;
|
|
647
|
+
int fsupc, istart, nsupr;
|
|
648
|
+
int lastl = 0, lastu = 0;
|
|
649
|
+
SCformat *Lstore = static_cast<SCformat *>(m_sluL.Store);
|
|
650
|
+
NCformat *Ustore = static_cast<NCformat *>(m_sluU.Store);
|
|
651
|
+
Scalar *SNptr;
|
|
718
652
|
|
|
719
653
|
const Index size = m_matrix.rows();
|
|
720
|
-
m_l.resize(size,size);
|
|
654
|
+
m_l.resize(size, size);
|
|
721
655
|
m_l.resizeNonZeros(Lstore->nnz);
|
|
722
|
-
m_u.resize(size,size);
|
|
656
|
+
m_u.resize(size, size);
|
|
723
657
|
m_u.resizeNonZeros(Ustore->nnz);
|
|
724
658
|
|
|
725
|
-
int*
|
|
726
|
-
int*
|
|
727
|
-
Scalar*
|
|
659
|
+
int *Lcol = m_l.outerIndexPtr();
|
|
660
|
+
int *Lrow = m_l.innerIndexPtr();
|
|
661
|
+
Scalar *Lval = m_l.valuePtr();
|
|
728
662
|
|
|
729
|
-
int*
|
|
730
|
-
int*
|
|
731
|
-
Scalar*
|
|
663
|
+
int *Ucol = m_u.outerIndexPtr();
|
|
664
|
+
int *Urow = m_u.innerIndexPtr();
|
|
665
|
+
Scalar *Uval = m_u.valuePtr();
|
|
732
666
|
|
|
733
667
|
Ucol[0] = 0;
|
|
734
668
|
Ucol[0] = 0;
|
|
735
669
|
|
|
736
670
|
/* for each supernode */
|
|
737
|
-
for (int k = 0; k <= Lstore->nsuper; ++k)
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
upper = 1;
|
|
671
|
+
for (int k = 0; k <= Lstore->nsuper; ++k) {
|
|
672
|
+
fsupc = L_FST_SUPC(k);
|
|
673
|
+
istart = L_SUB_START(fsupc);
|
|
674
|
+
nsupr = L_SUB_START(fsupc + 1) - istart;
|
|
675
|
+
upper = 1;
|
|
743
676
|
|
|
744
677
|
/* for each column in the supernode */
|
|
745
|
-
for (int j = fsupc; j < L_FST_SUPC(k+1); ++j)
|
|
746
|
-
|
|
747
|
-
SNptr = &((Scalar*)Lstore->nzval)[L_NZ_START(j)];
|
|
678
|
+
for (int j = fsupc; j < L_FST_SUPC(k + 1); ++j) {
|
|
679
|
+
SNptr = &((Scalar *)Lstore->nzval)[L_NZ_START(j)];
|
|
748
680
|
|
|
749
681
|
/* Extract U */
|
|
750
|
-
for (int i = U_NZ_START(j); i < U_NZ_START(j+1); ++i)
|
|
751
|
-
|
|
752
|
-
Uval[lastu] = ((Scalar*)Ustore->nzval)[i];
|
|
682
|
+
for (int i = U_NZ_START(j); i < U_NZ_START(j + 1); ++i) {
|
|
683
|
+
Uval[lastu] = ((Scalar *)Ustore->nzval)[i];
|
|
753
684
|
/* Matlab doesn't like explicit zero. */
|
|
754
|
-
if (Uval[lastu] != 0.0)
|
|
755
|
-
Urow[lastu++] = U_SUB(i);
|
|
685
|
+
if (Uval[lastu] != 0.0) Urow[lastu++] = U_SUB(i);
|
|
756
686
|
}
|
|
757
|
-
for (int i = 0; i < upper; ++i)
|
|
758
|
-
{
|
|
687
|
+
for (int i = 0; i < upper; ++i) {
|
|
759
688
|
/* upper triangle in the supernode */
|
|
760
689
|
Uval[lastu] = SNptr[i];
|
|
761
690
|
/* Matlab doesn't like explicit zero. */
|
|
762
|
-
if (Uval[lastu] != 0.0)
|
|
763
|
-
Urow[lastu++] = L_SUB(istart+i);
|
|
691
|
+
if (Uval[lastu] != 0.0) Urow[lastu++] = L_SUB(istart + i);
|
|
764
692
|
}
|
|
765
|
-
Ucol[j+1] = lastu;
|
|
693
|
+
Ucol[j + 1] = lastu;
|
|
766
694
|
|
|
767
695
|
/* Extract L */
|
|
768
696
|
Lval[lastl] = 1.0; /* unit diagonal */
|
|
769
697
|
Lrow[lastl++] = L_SUB(istart + upper - 1);
|
|
770
|
-
for (int i = upper; i < nsupr; ++i)
|
|
771
|
-
{
|
|
698
|
+
for (int i = upper; i < nsupr; ++i) {
|
|
772
699
|
Lval[lastl] = SNptr[i];
|
|
773
700
|
/* Matlab doesn't like explicit zero. */
|
|
774
|
-
if (Lval[lastl] != 0.0)
|
|
775
|
-
Lrow[lastl++] = L_SUB(istart+i);
|
|
701
|
+
if (Lval[lastl] != 0.0) Lrow[lastl++] = L_SUB(istart + i);
|
|
776
702
|
}
|
|
777
|
-
Lcol[j+1] = lastl;
|
|
703
|
+
Lcol[j + 1] = lastl;
|
|
778
704
|
|
|
779
705
|
++upper;
|
|
780
706
|
} /* for j ... */
|
|
@@ -789,29 +715,26 @@ void SuperLUBase<MatrixType,Derived>::extractData() const
|
|
|
789
715
|
}
|
|
790
716
|
}
|
|
791
717
|
|
|
792
|
-
template<typename MatrixType>
|
|
793
|
-
typename SuperLU<MatrixType>::Scalar SuperLU<MatrixType>::determinant() const
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
718
|
+
template <typename MatrixType>
|
|
719
|
+
typename SuperLU<MatrixType>::Scalar SuperLU<MatrixType>::determinant() const {
|
|
720
|
+
eigen_assert(m_factorizationIsOk &&
|
|
721
|
+
"The decomposition is not in a valid state for computing the determinant, you must first call either "
|
|
722
|
+
"compute() or analyzePattern()/factorize()");
|
|
723
|
+
|
|
724
|
+
if (m_extractedDataAreDirty) this->extractData();
|
|
799
725
|
|
|
800
726
|
Scalar det = Scalar(1);
|
|
801
|
-
for (int j=0; j<m_u.cols(); ++j)
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
eigen_assert(m_u.innerIndexPtr()[lastId]<=j);
|
|
807
|
-
if (m_u.innerIndexPtr()[lastId]==j)
|
|
808
|
-
det *= m_u.valuePtr()[lastId];
|
|
727
|
+
for (int j = 0; j < m_u.cols(); ++j) {
|
|
728
|
+
if (m_u.outerIndexPtr()[j + 1] - m_u.outerIndexPtr()[j] > 0) {
|
|
729
|
+
int lastId = m_u.outerIndexPtr()[j + 1] - 1;
|
|
730
|
+
eigen_assert(m_u.innerIndexPtr()[lastId] <= j);
|
|
731
|
+
if (m_u.innerIndexPtr()[lastId] == j) det *= m_u.valuePtr()[lastId];
|
|
809
732
|
}
|
|
810
733
|
}
|
|
811
|
-
if(PermutationMap(m_p.data(),m_p.size()).determinant()*PermutationMap(m_q.data(),m_q.size()).determinant()<0)
|
|
734
|
+
if (PermutationMap(m_p.data(), m_p.size()).determinant() * PermutationMap(m_q.data(), m_q.size()).determinant() < 0)
|
|
812
735
|
det = -det;
|
|
813
|
-
if(m_sluEqued!='N')
|
|
814
|
-
return det/m_sluRscale.prod()/m_sluCscale.prod();
|
|
736
|
+
if (m_sluEqued != 'N')
|
|
737
|
+
return det / m_sluRscale.prod() / m_sluCscale.prod();
|
|
815
738
|
else
|
|
816
739
|
return det;
|
|
817
740
|
}
|
|
@@ -823,143 +746,130 @@ typename SuperLU<MatrixType>::Scalar SuperLU<MatrixType>::determinant() const
|
|
|
823
746
|
#ifdef EIGEN_SUPERLU_HAS_ILU
|
|
824
747
|
|
|
825
748
|
/** \ingroup SuperLUSupport_Module
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
{
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
}
|
|
749
|
+
* \class SuperILU
|
|
750
|
+
* \brief A sparse direct \b incomplete LU factorization and solver based on the SuperLU library
|
|
751
|
+
*
|
|
752
|
+
* This class allows to solve for an approximate solution of A.X = B sparse linear problems via an incomplete LU
|
|
753
|
+
* factorization using the SuperLU library. This class is aimed to be used as a preconditioner of the iterative linear
|
|
754
|
+
* solvers.
|
|
755
|
+
*
|
|
756
|
+
* \warning This class is only for the 4.x versions of SuperLU. The 3.x and 5.x versions are not supported.
|
|
757
|
+
*
|
|
758
|
+
* \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
|
|
759
|
+
*
|
|
760
|
+
* \implsparsesolverconcept
|
|
761
|
+
*
|
|
762
|
+
* \sa \ref TutorialSparseSolverConcept, class IncompleteLUT, class ConjugateGradient, class BiCGSTAB
|
|
763
|
+
*/
|
|
764
|
+
|
|
765
|
+
template <typename MatrixType_>
|
|
766
|
+
class SuperILU : public SuperLUBase<MatrixType_, SuperILU<MatrixType_> > {
|
|
767
|
+
public:
|
|
768
|
+
typedef SuperLUBase<MatrixType_, SuperILU> Base;
|
|
769
|
+
typedef MatrixType_ MatrixType;
|
|
770
|
+
typedef typename Base::Scalar Scalar;
|
|
771
|
+
typedef typename Base::RealScalar RealScalar;
|
|
772
|
+
|
|
773
|
+
public:
|
|
774
|
+
using Base::_solve_impl;
|
|
775
|
+
|
|
776
|
+
SuperILU() : Base() { init(); }
|
|
777
|
+
|
|
778
|
+
SuperILU(const MatrixType &matrix) : Base() {
|
|
779
|
+
init();
|
|
780
|
+
Base::compute(matrix);
|
|
781
|
+
}
|
|
860
782
|
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
m_sluOptions.ILU_DropRule = DROP_BASIC;
|
|
933
|
-
m_sluOptions.ILU_DropTol = NumTraits<Scalar>::dummy_precision()*10;
|
|
934
|
-
}
|
|
935
|
-
|
|
936
|
-
private:
|
|
937
|
-
SuperILU(SuperILU& ) { }
|
|
783
|
+
~SuperILU() {}
|
|
784
|
+
|
|
785
|
+
/** Performs a symbolic decomposition on the sparsity of \a matrix.
|
|
786
|
+
*
|
|
787
|
+
* This function is particularly useful when solving for several problems having the same structure.
|
|
788
|
+
*
|
|
789
|
+
* \sa factorize()
|
|
790
|
+
*/
|
|
791
|
+
void analyzePattern(const MatrixType &matrix) { Base::analyzePattern(matrix); }
|
|
792
|
+
|
|
793
|
+
/** Performs a numeric decomposition of \a matrix
|
|
794
|
+
*
|
|
795
|
+
* The given matrix must have the same sparsity than the matrix on which the symbolic decomposition has been
|
|
796
|
+
* performed.
|
|
797
|
+
*
|
|
798
|
+
* \sa analyzePattern()
|
|
799
|
+
*/
|
|
800
|
+
void factorize(const MatrixType &matrix);
|
|
801
|
+
|
|
802
|
+
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
|
803
|
+
/** \internal */
|
|
804
|
+
template <typename Rhs, typename Dest>
|
|
805
|
+
void _solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest> &dest) const;
|
|
806
|
+
#endif // EIGEN_PARSED_BY_DOXYGEN
|
|
807
|
+
|
|
808
|
+
protected:
|
|
809
|
+
using Base::m_l;
|
|
810
|
+
using Base::m_matrix;
|
|
811
|
+
using Base::m_p;
|
|
812
|
+
using Base::m_q;
|
|
813
|
+
using Base::m_sluA;
|
|
814
|
+
using Base::m_sluB;
|
|
815
|
+
using Base::m_sluBerr;
|
|
816
|
+
using Base::m_sluCscale;
|
|
817
|
+
using Base::m_sluEqued;
|
|
818
|
+
using Base::m_sluEtree;
|
|
819
|
+
using Base::m_sluFerr;
|
|
820
|
+
using Base::m_sluL;
|
|
821
|
+
using Base::m_sluOptions;
|
|
822
|
+
using Base::m_sluRscale;
|
|
823
|
+
using Base::m_sluStat;
|
|
824
|
+
using Base::m_sluU;
|
|
825
|
+
using Base::m_sluX;
|
|
826
|
+
using Base::m_u;
|
|
827
|
+
|
|
828
|
+
using Base::m_analysisIsOk;
|
|
829
|
+
using Base::m_extractedDataAreDirty;
|
|
830
|
+
using Base::m_factorizationIsOk;
|
|
831
|
+
using Base::m_info;
|
|
832
|
+
using Base::m_isInitialized;
|
|
833
|
+
|
|
834
|
+
void init() {
|
|
835
|
+
Base::init();
|
|
836
|
+
|
|
837
|
+
ilu_set_default_options(&m_sluOptions);
|
|
838
|
+
m_sluOptions.PrintStat = NO;
|
|
839
|
+
m_sluOptions.ConditionNumber = NO;
|
|
840
|
+
m_sluOptions.Trans = NOTRANS;
|
|
841
|
+
m_sluOptions.ColPerm = MMD_AT_PLUS_A;
|
|
842
|
+
|
|
843
|
+
// no attempt to preserve column sum
|
|
844
|
+
m_sluOptions.ILU_MILU = SILU;
|
|
845
|
+
// only basic ILU(k) support -- no direct control over memory consumption
|
|
846
|
+
// better to use ILU_DropRule = DROP_BASIC | DROP_AREA
|
|
847
|
+
// and set ILU_FillFactor to max memory growth
|
|
848
|
+
m_sluOptions.ILU_DropRule = DROP_BASIC;
|
|
849
|
+
m_sluOptions.ILU_DropTol = NumTraits<Scalar>::dummy_precision() * 10;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
private:
|
|
853
|
+
SuperILU(SuperILU &) {}
|
|
938
854
|
};
|
|
939
855
|
|
|
940
|
-
template<typename MatrixType>
|
|
941
|
-
void SuperILU<MatrixType>::factorize(const MatrixType&
|
|
942
|
-
{
|
|
856
|
+
template <typename MatrixType>
|
|
857
|
+
void SuperILU<MatrixType>::factorize(const MatrixType &a) {
|
|
943
858
|
eigen_assert(m_analysisIsOk && "You must first call analyzePattern()");
|
|
944
|
-
if(!m_analysisIsOk)
|
|
945
|
-
{
|
|
859
|
+
if (!m_analysisIsOk) {
|
|
946
860
|
m_info = InvalidInput;
|
|
947
861
|
return;
|
|
948
862
|
}
|
|
949
|
-
|
|
863
|
+
|
|
950
864
|
this->initFactorization(a);
|
|
951
865
|
|
|
952
866
|
int info = 0;
|
|
953
867
|
RealScalar recip_pivot_growth, rcond;
|
|
954
868
|
|
|
955
869
|
StatInit(&m_sluStat);
|
|
956
|
-
SuperLU_gsisx(&m_sluOptions, &m_sluA, m_q.data(), m_p.data(), &m_sluEtree[0],
|
|
957
|
-
&
|
|
958
|
-
&
|
|
959
|
-
NULL, 0,
|
|
960
|
-
&m_sluB, &m_sluX,
|
|
961
|
-
&recip_pivot_growth, &rcond,
|
|
962
|
-
&m_sluStat, &info, Scalar());
|
|
870
|
+
SuperLU_gsisx(&m_sluOptions, &m_sluA, m_q.data(), m_p.data(), &m_sluEtree[0], &m_sluEqued, &m_sluRscale[0],
|
|
871
|
+
&m_sluCscale[0], &m_sluL, &m_sluU, NULL, 0, &m_sluB, &m_sluX, &recip_pivot_growth, &rcond, &m_sluStat,
|
|
872
|
+
&info, Scalar());
|
|
963
873
|
StatFree(&m_sluStat);
|
|
964
874
|
|
|
965
875
|
// FIXME how to better check for errors ???
|
|
@@ -968,15 +878,15 @@ void SuperILU<MatrixType>::factorize(const MatrixType& a)
|
|
|
968
878
|
}
|
|
969
879
|
|
|
970
880
|
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
|
971
|
-
template<typename MatrixType>
|
|
972
|
-
template<typename Rhs,typename Dest>
|
|
973
|
-
void SuperILU<MatrixType>::_solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest
|
|
974
|
-
|
|
975
|
-
|
|
881
|
+
template <typename MatrixType>
|
|
882
|
+
template <typename Rhs, typename Dest>
|
|
883
|
+
void SuperILU<MatrixType>::_solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest> &x) const {
|
|
884
|
+
eigen_assert(m_factorizationIsOk &&
|
|
885
|
+
"The decomposition is not in a valid state for solving, you must first call either compute() or "
|
|
886
|
+
"analyzePattern()/factorize()");
|
|
976
887
|
|
|
977
|
-
const int size = m_matrix.rows();
|
|
978
888
|
const int rhsCols = b.cols();
|
|
979
|
-
eigen_assert(
|
|
889
|
+
eigen_assert(m_matrix.rows() == b.rows());
|
|
980
890
|
|
|
981
891
|
m_sluOptions.Trans = NOTRANS;
|
|
982
892
|
m_sluOptions.Fact = FACTORED;
|
|
@@ -984,44 +894,36 @@ void SuperILU<MatrixType>::_solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest
|
|
|
984
894
|
|
|
985
895
|
m_sluFerr.resize(rhsCols);
|
|
986
896
|
m_sluBerr.resize(rhsCols);
|
|
987
|
-
|
|
988
|
-
Ref<const Matrix<typename Rhs::Scalar,Dynamic,Dynamic,ColMajor> > b_ref(b);
|
|
989
|
-
Ref<const Matrix<typename Dest::Scalar,Dynamic,Dynamic,ColMajor> > x_ref(x);
|
|
990
|
-
|
|
897
|
+
|
|
898
|
+
Ref<const Matrix<typename Rhs::Scalar, Dynamic, Dynamic, ColMajor> > b_ref(b);
|
|
899
|
+
Ref<const Matrix<typename Dest::Scalar, Dynamic, Dynamic, ColMajor> > x_ref(x);
|
|
900
|
+
|
|
991
901
|
m_sluB = SluMatrix::Map(b_ref.const_cast_derived());
|
|
992
902
|
m_sluX = SluMatrix::Map(x_ref.const_cast_derived());
|
|
993
903
|
|
|
994
904
|
typename Rhs::PlainObject b_cpy;
|
|
995
|
-
if(m_sluEqued!='N')
|
|
996
|
-
{
|
|
905
|
+
if (m_sluEqued != 'N') {
|
|
997
906
|
b_cpy = b;
|
|
998
|
-
m_sluB = SluMatrix::Map(b_cpy.const_cast_derived());
|
|
907
|
+
m_sluB = SluMatrix::Map(b_cpy.const_cast_derived());
|
|
999
908
|
}
|
|
1000
|
-
|
|
909
|
+
|
|
1001
910
|
int info = 0;
|
|
1002
911
|
RealScalar recip_pivot_growth, rcond;
|
|
1003
912
|
|
|
1004
913
|
StatInit(&m_sluStat);
|
|
1005
|
-
SuperLU_gsisx(&m_sluOptions, &m_sluA,
|
|
1006
|
-
|
|
1007
|
-
&
|
|
1008
|
-
&m_sluRscale[0], &m_sluCscale[0],
|
|
1009
|
-
&m_sluL, &m_sluU,
|
|
1010
|
-
NULL, 0,
|
|
1011
|
-
&m_sluB, &m_sluX,
|
|
1012
|
-
&recip_pivot_growth, &rcond,
|
|
1013
|
-
&m_sluStat, &info, Scalar());
|
|
914
|
+
SuperLU_gsisx(&m_sluOptions, &m_sluA, m_q.data(), m_p.data(), &m_sluEtree[0], &m_sluEqued, &m_sluRscale[0],
|
|
915
|
+
&m_sluCscale[0], &m_sluL, &m_sluU, NULL, 0, &m_sluB, &m_sluX, &recip_pivot_growth, &rcond, &m_sluStat,
|
|
916
|
+
&info, Scalar());
|
|
1014
917
|
StatFree(&m_sluStat);
|
|
1015
|
-
|
|
1016
|
-
if(x.derived().data() != x_ref.data())
|
|
1017
|
-
x = x_ref;
|
|
1018
918
|
|
|
1019
|
-
|
|
919
|
+
if (x.derived().data() != x_ref.data()) x = x_ref;
|
|
920
|
+
|
|
921
|
+
m_info = info == 0 ? Success : NumericalIssue;
|
|
1020
922
|
}
|
|
1021
923
|
#endif
|
|
1022
924
|
|
|
1023
925
|
#endif
|
|
1024
926
|
|
|
1025
|
-
}
|
|
927
|
+
} // end namespace Eigen
|
|
1026
928
|
|
|
1027
|
-
#endif
|
|
929
|
+
#endif // EIGEN_SUPERLUSUPPORT_H
|