@smake/eigen 1.1.0 → 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 -20
- package/eigen/Eigen/CholmodSupport +28 -28
- package/eigen/Eigen/Core +187 -120
- package/eigen/Eigen/Eigenvalues +16 -13
- package/eigen/Eigen/Geometry +18 -18
- package/eigen/Eigen/Householder +9 -7
- package/eigen/Eigen/IterativeLinearSolvers +8 -4
- package/eigen/Eigen/Jacobi +14 -13
- package/eigen/Eigen/KLUSupport +23 -21
- package/eigen/Eigen/LU +15 -16
- package/eigen/Eigen/MetisSupport +12 -12
- package/eigen/Eigen/OrderingMethods +54 -51
- package/eigen/Eigen/PaStiXSupport +23 -21
- package/eigen/Eigen/PardisoSupport +17 -14
- package/eigen/Eigen/QR +18 -20
- package/eigen/Eigen/QtAlignedMalloc +5 -12
- package/eigen/Eigen/SPQRSupport +21 -14
- package/eigen/Eigen/SVD +23 -17
- package/eigen/Eigen/Sparse +1 -2
- package/eigen/Eigen/SparseCholesky +18 -15
- package/eigen/Eigen/SparseCore +18 -17
- package/eigen/Eigen/SparseLU +9 -9
- 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 +366 -405
- package/eigen/Eigen/src/Cholesky/LLT.h +323 -367
- package/eigen/Eigen/src/Cholesky/LLT_LAPACKE.h +81 -56
- package/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +585 -529
- package/eigen/Eigen/src/CholmodSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Core/ArithmeticSequence.h +143 -317
- package/eigen/Eigen/src/Core/Array.h +329 -370
- package/eigen/Eigen/src/Core/ArrayBase.h +190 -203
- package/eigen/Eigen/src/Core/ArrayWrapper.h +126 -170
- package/eigen/Eigen/src/Core/Assign.h +30 -40
- package/eigen/Eigen/src/Core/AssignEvaluator.h +651 -604
- package/eigen/Eigen/src/Core/Assign_MKL.h +125 -120
- package/eigen/Eigen/src/Core/BandMatrix.h +267 -282
- package/eigen/Eigen/src/Core/Block.h +371 -390
- package/eigen/Eigen/src/Core/CommaInitializer.h +85 -100
- package/eigen/Eigen/src/Core/ConditionEstimator.h +51 -53
- package/eigen/Eigen/src/Core/CoreEvaluators.h +1214 -937
- package/eigen/Eigen/src/Core/CoreIterators.h +72 -63
- package/eigen/Eigen/src/Core/CwiseBinaryOp.h +112 -129
- package/eigen/Eigen/src/Core/CwiseNullaryOp.h +676 -702
- package/eigen/Eigen/src/Core/CwiseTernaryOp.h +77 -103
- package/eigen/Eigen/src/Core/CwiseUnaryOp.h +55 -67
- package/eigen/Eigen/src/Core/CwiseUnaryView.h +127 -92
- package/eigen/Eigen/src/Core/DenseBase.h +630 -658
- package/eigen/Eigen/src/Core/DenseCoeffsBase.h +511 -628
- package/eigen/Eigen/src/Core/DenseStorage.h +511 -590
- package/eigen/Eigen/src/Core/DeviceWrapper.h +153 -0
- package/eigen/Eigen/src/Core/Diagonal.h +168 -207
- package/eigen/Eigen/src/Core/DiagonalMatrix.h +346 -317
- package/eigen/Eigen/src/Core/DiagonalProduct.h +12 -10
- package/eigen/Eigen/src/Core/Dot.h +167 -217
- package/eigen/Eigen/src/Core/EigenBase.h +74 -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 -113
- package/eigen/Eigen/src/Core/Fuzzy.h +82 -105
- package/eigen/Eigen/src/Core/GeneralProduct.h +315 -261
- package/eigen/Eigen/src/Core/GenericPacketMath.h +1182 -520
- package/eigen/Eigen/src/Core/GlobalFunctions.h +193 -157
- package/eigen/Eigen/src/Core/IO.h +131 -156
- package/eigen/Eigen/src/Core/IndexedView.h +209 -125
- 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 +50 -59
- package/eigen/Eigen/src/Core/Map.h +123 -141
- package/eigen/Eigen/src/Core/MapBase.h +255 -282
- package/eigen/Eigen/src/Core/MathFunctions.h +1247 -1201
- package/eigen/Eigen/src/Core/MathFunctionsImpl.h +162 -99
- package/eigen/Eigen/src/Core/Matrix.h +463 -494
- package/eigen/Eigen/src/Core/MatrixBase.h +468 -470
- package/eigen/Eigen/src/Core/NestByValue.h +58 -52
- package/eigen/Eigen/src/Core/NoAlias.h +79 -86
- package/eigen/Eigen/src/Core/NumTraits.h +206 -206
- package/eigen/Eigen/src/Core/PartialReduxEvaluator.h +163 -142
- package/eigen/Eigen/src/Core/PermutationMatrix.h +461 -511
- package/eigen/Eigen/src/Core/PlainObjectBase.h +858 -972
- package/eigen/Eigen/src/Core/Product.h +246 -130
- package/eigen/Eigen/src/Core/ProductEvaluators.h +779 -671
- package/eigen/Eigen/src/Core/Random.h +153 -164
- 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 +334 -314
- package/eigen/Eigen/src/Core/Ref.h +259 -257
- package/eigen/Eigen/src/Core/Replicate.h +92 -104
- package/eigen/Eigen/src/Core/Reshaped.h +215 -271
- package/eigen/Eigen/src/Core/ReturnByValue.h +47 -55
- package/eigen/Eigen/src/Core/Reverse.h +133 -148
- package/eigen/Eigen/src/Core/Select.h +68 -140
- package/eigen/Eigen/src/Core/SelfAdjointView.h +254 -290
- 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 +88 -102
- package/eigen/Eigen/src/Core/SolveTriangular.h +126 -124
- package/eigen/Eigen/src/Core/SolverBase.h +132 -133
- package/eigen/Eigen/src/Core/StableNorm.h +113 -147
- package/eigen/Eigen/src/Core/StlIterators.h +404 -248
- package/eigen/Eigen/src/Core/Stride.h +90 -92
- package/eigen/Eigen/src/Core/Swap.h +70 -39
- package/eigen/Eigen/src/Core/Transpose.h +258 -295
- package/eigen/Eigen/src/Core/Transpositions.h +270 -333
- package/eigen/Eigen/src/Core/TriangularMatrix.h +642 -743
- package/eigen/Eigen/src/Core/VectorBlock.h +59 -72
- package/eigen/Eigen/src/Core/VectorwiseOp.h +653 -704
- package/eigen/Eigen/src/Core/Visitor.h +464 -308
- package/eigen/Eigen/src/Core/arch/AVX/Complex.h +380 -187
- package/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +65 -163
- package/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +2145 -638
- package/eigen/Eigen/src/Core/arch/AVX/Reductions.h +353 -0
- package/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +253 -60
- package/eigen/Eigen/src/Core/arch/AVX512/Complex.h +278 -228
- package/eigen/Eigen/src/Core/arch/AVX512/GemmKernel.h +1245 -0
- package/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +48 -269
- package/eigen/Eigen/src/Core/arch/AVX512/MathFunctionsFP16.h +75 -0
- package/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +1597 -754
- 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 +229 -41
- package/eigen/Eigen/src/Core/arch/AVX512/TypeCastingFP16.h +130 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +420 -184
- package/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +40 -49
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +2962 -2213
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +196 -212
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +713 -441
- 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 +2380 -1362
- package/eigen/Eigen/src/Core/arch/AltiVec/TypeCasting.h +153 -0
- package/eigen/Eigen/src/Core/arch/Default/BFloat16.h +390 -224
- package/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +78 -67
- package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +1784 -799
- package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +167 -50
- package/eigen/Eigen/src/Core/arch/Default/Half.h +528 -379
- package/eigen/Eigen/src/Core/arch/Default/Settings.h +10 -12
- package/eigen/Eigen/src/Core/arch/GPU/Complex.h +244 -0
- package/eigen/Eigen/src/Core/arch/GPU/MathFunctions.h +41 -40
- package/eigen/Eigen/src/Core/arch/GPU/PacketMath.h +550 -523
- package/eigen/Eigen/src/Core/arch/GPU/Tuple.h +268 -0
- package/eigen/Eigen/src/Core/arch/GPU/TypeCasting.h +27 -30
- package/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h +8 -8
- 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 +54 -82
- package/eigen/Eigen/src/Core/arch/MSA/MathFunctions.h +84 -92
- package/eigen/Eigen/src/Core/arch/MSA/PacketMath.h +51 -47
- package/eigen/Eigen/src/Core/arch/NEON/Complex.h +454 -306
- package/eigen/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +175 -115
- package/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +23 -30
- package/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +4366 -2857
- package/eigen/Eigen/src/Core/arch/NEON/TypeCasting.h +616 -393
- package/eigen/Eigen/src/Core/arch/NEON/UnaryFunctors.h +57 -0
- package/eigen/Eigen/src/Core/arch/SSE/Complex.h +350 -198
- package/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +38 -149
- package/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +1791 -912
- package/eigen/Eigen/src/Core/arch/SSE/Reductions.h +324 -0
- package/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +128 -40
- package/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h +10 -6
- package/eigen/Eigen/src/Core/arch/SVE/PacketMath.h +156 -234
- package/eigen/Eigen/src/Core/arch/SVE/TypeCasting.h +6 -3
- package/eigen/Eigen/src/Core/arch/SYCL/InteropHeaders.h +27 -32
- package/eigen/Eigen/src/Core/arch/SYCL/MathFunctions.h +119 -117
- package/eigen/Eigen/src/Core/arch/SYCL/PacketMath.h +325 -419
- package/eigen/Eigen/src/Core/arch/SYCL/TypeCasting.h +15 -17
- package/eigen/Eigen/src/Core/arch/ZVector/Complex.h +325 -181
- package/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +94 -83
- package/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +811 -458
- package/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +121 -124
- package/eigen/Eigen/src/Core/functors/BinaryFunctors.h +576 -370
- package/eigen/Eigen/src/Core/functors/NullaryFunctors.h +194 -109
- package/eigen/Eigen/src/Core/functors/StlFunctors.h +95 -112
- package/eigen/Eigen/src/Core/functors/TernaryFunctors.h +34 -7
- package/eigen/Eigen/src/Core/functors/UnaryFunctors.h +1038 -749
- package/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +1883 -1375
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +312 -370
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +189 -176
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +84 -81
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +154 -73
- package/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +292 -337
- package/eigen/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +80 -77
- package/eigen/Eigen/src/Core/products/Parallelizer.h +207 -105
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +327 -388
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +206 -224
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +138 -147
- 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 -47
- 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 -277
- package/eigen/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +108 -109
- package/eigen/Eigen/src/Core/products/TriangularSolverVector.h +68 -94
- package/eigen/Eigen/src/Core/util/Assert.h +158 -0
- package/eigen/Eigen/src/Core/util/BlasUtil.h +342 -303
- package/eigen/Eigen/src/Core/util/ConfigureVectorization.h +348 -317
- package/eigen/Eigen/src/Core/util/Constants.h +297 -262
- package/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +130 -90
- package/eigen/Eigen/src/Core/util/EmulateArray.h +270 -0
- package/eigen/Eigen/src/Core/util/ForwardDeclarations.h +449 -247
- 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 +417 -116
- package/eigen/Eigen/src/Core/util/IntegralConstant.h +211 -204
- package/eigen/Eigen/src/Core/util/MKL_support.h +39 -37
- package/eigen/Eigen/src/Core/util/Macros.h +655 -773
- package/eigen/Eigen/src/Core/util/MaxSizeVector.h +139 -0
- package/eigen/Eigen/src/Core/util/Memory.h +970 -748
- package/eigen/Eigen/src/Core/util/Meta.h +581 -633
- 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 +17 -17
- package/eigen/Eigen/src/Core/util/Serializer.h +209 -0
- package/eigen/Eigen/src/Core/util/StaticAssert.h +50 -166
- package/eigen/Eigen/src/Core/util/SymbolicIndex.h +377 -225
- package/eigen/Eigen/src/Core/util/XprHelper.h +784 -547
- 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 +89 -105
- package/eigen/Eigen/src/Eigenvalues/RealQZ.h +537 -607
- package/eigen/Eigen/src/Eigenvalues/RealSchur.h +342 -381
- package/eigen/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +41 -35
- package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +541 -595
- package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +47 -44
- package/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +430 -462
- package/eigen/Eigen/src/Geometry/AlignedBox.h +226 -227
- package/eigen/Eigen/src/Geometry/AngleAxis.h +131 -133
- package/eigen/Eigen/src/Geometry/EulerAngles.h +163 -74
- package/eigen/Eigen/src/Geometry/Homogeneous.h +285 -333
- package/eigen/Eigen/src/Geometry/Hyperplane.h +151 -160
- package/eigen/Eigen/src/Geometry/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Geometry/OrthoMethods.h +168 -146
- package/eigen/Eigen/src/Geometry/ParametrizedLine.h +127 -127
- package/eigen/Eigen/src/Geometry/Quaternion.h +566 -506
- package/eigen/Eigen/src/Geometry/Rotation2D.h +107 -105
- package/eigen/Eigen/src/Geometry/RotationBase.h +148 -145
- package/eigen/Eigen/src/Geometry/Scaling.h +113 -106
- package/eigen/Eigen/src/Geometry/Transform.h +858 -936
- package/eigen/Eigen/src/Geometry/Translation.h +94 -92
- package/eigen/Eigen/src/Geometry/Umeyama.h +79 -84
- package/eigen/Eigen/src/Geometry/arch/Geometry_SIMD.h +90 -104
- package/eigen/Eigen/src/Householder/BlockHouseholder.h +51 -46
- package/eigen/Eigen/src/Householder/Householder.h +102 -124
- package/eigen/Eigen/src/Householder/HouseholderSequence.h +412 -453
- package/eigen/Eigen/src/Householder/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +149 -162
- package/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +124 -119
- package/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +92 -104
- package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +251 -243
- package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +224 -228
- package/eigen/Eigen/src/IterativeLinearSolvers/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +178 -227
- package/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +79 -84
- package/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +54 -60
- package/eigen/Eigen/src/Jacobi/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Jacobi/Jacobi.h +252 -308
- package/eigen/Eigen/src/KLUSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/KLUSupport/KLUSupport.h +208 -227
- package/eigen/Eigen/src/LU/Determinant.h +50 -69
- package/eigen/Eigen/src/LU/FullPivLU.h +545 -596
- package/eigen/Eigen/src/LU/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/LU/InverseImpl.h +206 -285
- package/eigen/Eigen/src/LU/PartialPivLU.h +390 -428
- package/eigen/Eigen/src/LU/PartialPivLU_LAPACKE.h +54 -40
- package/eigen/Eigen/src/LU/arch/InverseSize4.h +72 -70
- 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 +243 -265
- package/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +831 -1004
- package/eigen/Eigen/src/OrderingMethods/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/OrderingMethods/Ordering.h +112 -119
- 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 -430
- package/eigen/Eigen/src/QR/ColPivHouseholderQR.h +479 -479
- package/eigen/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +120 -56
- package/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +166 -153
- package/eigen/Eigen/src/QR/FullPivHouseholderQR.h +495 -475
- package/eigen/Eigen/src/QR/HouseholderQR.h +394 -285
- 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 +244 -264
- package/eigen/Eigen/src/SVD/BDCSVD.h +817 -713
- 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 +577 -543
- package/eigen/Eigen/src/SVD/JacobiSVD_LAPACKE.h +85 -49
- package/eigen/Eigen/src/SVD/SVDBase.h +242 -182
- package/eigen/Eigen/src/SVD/UpperBidiagonalization.h +200 -235
- package/eigen/Eigen/src/SparseCholesky/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +765 -594
- package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +308 -94
- package/eigen/Eigen/src/SparseCore/AmbiVector.h +202 -251
- package/eigen/Eigen/src/SparseCore/CompressedStorage.h +184 -252
- package/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +134 -178
- package/eigen/Eigen/src/SparseCore/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseCore/SparseAssign.h +149 -140
- package/eigen/Eigen/src/SparseCore/SparseBlock.h +403 -440
- package/eigen/Eigen/src/SparseCore/SparseColEtree.h +100 -112
- package/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +525 -303
- package/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +555 -339
- package/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +100 -108
- package/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +169 -197
- 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 +1603 -1245
- package/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +403 -350
- package/eigen/Eigen/src/SparseCore/SparsePermutation.h +186 -115
- package/eigen/Eigen/src/SparseCore/SparseProduct.h +94 -97
- 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 +370 -416
- 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 +138 -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 +756 -710
- 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 +245 -301
- 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 +89 -100
- 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 +124 -132
- 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 +450 -502
- package/eigen/Eigen/src/StlSupport/StdDeque.h +28 -93
- 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 -730
- 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 +428 -464
- 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 +9972 -16179
- 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.h → BlockMethods.inc} +434 -506
- package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.inc +116 -0
- package/eigen/Eigen/src/plugins/{CommonCwiseUnaryOps.h → CommonCwiseUnaryOps.inc} +58 -68
- 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/package.json +1 -1
- package/eigen/COPYING.APACHE +0 -203
- package/eigen/COPYING.BSD +0 -26
- package/eigen/COPYING.GPL +0 -674
- package/eigen/COPYING.LGPL +0 -502
- package/eigen/COPYING.MINPACK +0 -51
- package/eigen/COPYING.MPL2 +0 -373
- package/eigen/COPYING.README +0 -18
- package/eigen/Eigen/src/Core/BooleanRedux.h +0 -162
- package/eigen/Eigen/src/Core/arch/CUDA/Complex.h +0 -258
- package/eigen/Eigen/src/Core/arch/Default/TypeCasting.h +0 -120
- package/eigen/Eigen/src/Core/arch/SYCL/SyclMemoryModel.h +0 -694
- package/eigen/Eigen/src/Core/util/NonMPL2.h +0 -3
- 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 -358
- package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h +0 -696
- package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.h +0 -115
- package/eigen/Eigen/src/plugins/IndexedViewMethods.h +0 -262
- package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h +0 -152
- package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h +0 -95
- package/eigen/Eigen/src/plugins/ReshapedMethods.h +0 -149
- package/eigen/README.md +0 -5
|
@@ -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 (int(MatrixType::Flags) & int(Upper))
|
|
221
|
-
|
|
222
|
-
if (int(MatrixType::Flags) & int(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(((int(MatrixType::Flags) & int(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 successful,
|
|
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,55 +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
598
|
const Index rhsCols = b.cols();
|
|
654
|
-
eigen_assert(m_matrix.rows()==b.rows());
|
|
599
|
+
eigen_assert(m_matrix.rows() == b.rows());
|
|
655
600
|
|
|
656
601
|
m_sluOptions.Trans = NOTRANS;
|
|
657
602
|
m_sluOptions.Fact = FACTORED;
|
|
658
603
|
m_sluOptions.IterRefine = NOREFINE;
|
|
659
|
-
|
|
660
604
|
|
|
661
605
|
m_sluFerr.resize(rhsCols);
|
|
662
606
|
m_sluBerr.resize(rhsCols);
|
|
663
|
-
|
|
664
|
-
Ref<const Matrix<typename Rhs::Scalar,Dynamic,Dynamic,ColMajor> > b_ref(b);
|
|
665
|
-
Ref<const Matrix<typename Dest::Scalar,Dynamic,Dynamic,ColMajor> > x_ref(x);
|
|
666
|
-
|
|
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
|
+
|
|
667
611
|
m_sluB = SluMatrix::Map(b_ref.const_cast_derived());
|
|
668
612
|
m_sluX = SluMatrix::Map(x_ref.const_cast_derived());
|
|
669
|
-
|
|
613
|
+
|
|
670
614
|
typename Rhs::PlainObject b_cpy;
|
|
671
|
-
if(m_sluEqued!='N')
|
|
672
|
-
{
|
|
615
|
+
if (m_sluEqued != 'N') {
|
|
673
616
|
b_cpy = b;
|
|
674
|
-
m_sluB = SluMatrix::Map(b_cpy.const_cast_derived());
|
|
617
|
+
m_sluB = SluMatrix::Map(b_cpy.const_cast_derived());
|
|
675
618
|
}
|
|
676
619
|
|
|
677
620
|
StatInit(&m_sluStat);
|
|
678
621
|
int info = 0;
|
|
679
622
|
RealScalar recip_pivot_growth, rcond;
|
|
680
|
-
SuperLU_gssvx(&m_sluOptions, &m_sluA,
|
|
681
|
-
|
|
682
|
-
&
|
|
683
|
-
&m_sluRscale[0], &m_sluCscale[0],
|
|
684
|
-
&m_sluL, &m_sluU,
|
|
685
|
-
NULL, 0,
|
|
686
|
-
&m_sluB, &m_sluX,
|
|
687
|
-
&recip_pivot_growth, &rcond,
|
|
688
|
-
&m_sluFerr[0], &m_sluBerr[0],
|
|
689
|
-
&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());
|
|
690
626
|
StatFree(&m_sluStat);
|
|
691
|
-
|
|
692
|
-
if(x.derived().data() != x_ref.data())
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
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;
|
|
696
631
|
}
|
|
697
632
|
|
|
698
633
|
// the code of this extractData() function has been adapted from the SuperLU's Matlab support code,
|
|
@@ -702,78 +637,70 @@ void SuperLU<MatrixType>::_solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest>
|
|
|
702
637
|
// THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
|
|
703
638
|
// EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
|
|
704
639
|
//
|
|
705
|
-
template<typename MatrixType, typename Derived>
|
|
706
|
-
void SuperLUBase<MatrixType,Derived>::extractData() const
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
{
|
|
711
|
-
int
|
|
712
|
-
int
|
|
713
|
-
int
|
|
714
|
-
SCformat
|
|
715
|
-
NCformat
|
|
716
|
-
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;
|
|
717
652
|
|
|
718
653
|
const Index size = m_matrix.rows();
|
|
719
|
-
m_l.resize(size,size);
|
|
654
|
+
m_l.resize(size, size);
|
|
720
655
|
m_l.resizeNonZeros(Lstore->nnz);
|
|
721
|
-
m_u.resize(size,size);
|
|
656
|
+
m_u.resize(size, size);
|
|
722
657
|
m_u.resizeNonZeros(Ustore->nnz);
|
|
723
658
|
|
|
724
|
-
int*
|
|
725
|
-
int*
|
|
726
|
-
Scalar*
|
|
659
|
+
int *Lcol = m_l.outerIndexPtr();
|
|
660
|
+
int *Lrow = m_l.innerIndexPtr();
|
|
661
|
+
Scalar *Lval = m_l.valuePtr();
|
|
727
662
|
|
|
728
|
-
int*
|
|
729
|
-
int*
|
|
730
|
-
Scalar*
|
|
663
|
+
int *Ucol = m_u.outerIndexPtr();
|
|
664
|
+
int *Urow = m_u.innerIndexPtr();
|
|
665
|
+
Scalar *Uval = m_u.valuePtr();
|
|
731
666
|
|
|
732
667
|
Ucol[0] = 0;
|
|
733
668
|
Ucol[0] = 0;
|
|
734
669
|
|
|
735
670
|
/* for each supernode */
|
|
736
|
-
for (int k = 0; k <= Lstore->nsuper; ++k)
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
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;
|
|
742
676
|
|
|
743
677
|
/* for each column in the supernode */
|
|
744
|
-
for (int j = fsupc; j < L_FST_SUPC(k+1); ++j)
|
|
745
|
-
|
|
746
|
-
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)];
|
|
747
680
|
|
|
748
681
|
/* Extract U */
|
|
749
|
-
for (int i = U_NZ_START(j); i < U_NZ_START(j+1); ++i)
|
|
750
|
-
|
|
751
|
-
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];
|
|
752
684
|
/* Matlab doesn't like explicit zero. */
|
|
753
|
-
if (Uval[lastu] != 0.0)
|
|
754
|
-
Urow[lastu++] = U_SUB(i);
|
|
685
|
+
if (Uval[lastu] != 0.0) Urow[lastu++] = U_SUB(i);
|
|
755
686
|
}
|
|
756
|
-
for (int i = 0; i < upper; ++i)
|
|
757
|
-
{
|
|
687
|
+
for (int i = 0; i < upper; ++i) {
|
|
758
688
|
/* upper triangle in the supernode */
|
|
759
689
|
Uval[lastu] = SNptr[i];
|
|
760
690
|
/* Matlab doesn't like explicit zero. */
|
|
761
|
-
if (Uval[lastu] != 0.0)
|
|
762
|
-
Urow[lastu++] = L_SUB(istart+i);
|
|
691
|
+
if (Uval[lastu] != 0.0) Urow[lastu++] = L_SUB(istart + i);
|
|
763
692
|
}
|
|
764
|
-
Ucol[j+1] = lastu;
|
|
693
|
+
Ucol[j + 1] = lastu;
|
|
765
694
|
|
|
766
695
|
/* Extract L */
|
|
767
696
|
Lval[lastl] = 1.0; /* unit diagonal */
|
|
768
697
|
Lrow[lastl++] = L_SUB(istart + upper - 1);
|
|
769
|
-
for (int i = upper; i < nsupr; ++i)
|
|
770
|
-
{
|
|
698
|
+
for (int i = upper; i < nsupr; ++i) {
|
|
771
699
|
Lval[lastl] = SNptr[i];
|
|
772
700
|
/* Matlab doesn't like explicit zero. */
|
|
773
|
-
if (Lval[lastl] != 0.0)
|
|
774
|
-
Lrow[lastl++] = L_SUB(istart+i);
|
|
701
|
+
if (Lval[lastl] != 0.0) Lrow[lastl++] = L_SUB(istart + i);
|
|
775
702
|
}
|
|
776
|
-
Lcol[j+1] = lastl;
|
|
703
|
+
Lcol[j + 1] = lastl;
|
|
777
704
|
|
|
778
705
|
++upper;
|
|
779
706
|
} /* for j ... */
|
|
@@ -788,29 +715,26 @@ void SuperLUBase<MatrixType,Derived>::extractData() const
|
|
|
788
715
|
}
|
|
789
716
|
}
|
|
790
717
|
|
|
791
|
-
template<typename MatrixType>
|
|
792
|
-
typename SuperLU<MatrixType>::Scalar SuperLU<MatrixType>::determinant() const
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
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();
|
|
798
725
|
|
|
799
726
|
Scalar det = Scalar(1);
|
|
800
|
-
for (int j=0; j<m_u.cols(); ++j)
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
eigen_assert(m_u.innerIndexPtr()[lastId]<=j);
|
|
806
|
-
if (m_u.innerIndexPtr()[lastId]==j)
|
|
807
|
-
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];
|
|
808
732
|
}
|
|
809
733
|
}
|
|
810
|
-
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)
|
|
811
735
|
det = -det;
|
|
812
|
-
if(m_sluEqued!='N')
|
|
813
|
-
return det/m_sluRscale.prod()/m_sluCscale.prod();
|
|
736
|
+
if (m_sluEqued != 'N')
|
|
737
|
+
return det / m_sluRscale.prod() / m_sluCscale.prod();
|
|
814
738
|
else
|
|
815
739
|
return det;
|
|
816
740
|
}
|
|
@@ -822,143 +746,130 @@ typename SuperLU<MatrixType>::Scalar SuperLU<MatrixType>::determinant() const
|
|
|
822
746
|
#ifdef EIGEN_SUPERLU_HAS_ILU
|
|
823
747
|
|
|
824
748
|
/** \ingroup SuperLUSupport_Module
|
|
825
|
-
|
|
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
|
-
}
|
|
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
|
+
}
|
|
859
782
|
|
|
860
|
-
|
|
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
|
-
m_sluOptions.ILU_DropRule = DROP_BASIC;
|
|
932
|
-
m_sluOptions.ILU_DropTol = NumTraits<Scalar>::dummy_precision()*10;
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
private:
|
|
936
|
-
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 &) {}
|
|
937
854
|
};
|
|
938
855
|
|
|
939
|
-
template<typename MatrixType>
|
|
940
|
-
void SuperILU<MatrixType>::factorize(const MatrixType&
|
|
941
|
-
{
|
|
856
|
+
template <typename MatrixType>
|
|
857
|
+
void SuperILU<MatrixType>::factorize(const MatrixType &a) {
|
|
942
858
|
eigen_assert(m_analysisIsOk && "You must first call analyzePattern()");
|
|
943
|
-
if(!m_analysisIsOk)
|
|
944
|
-
{
|
|
859
|
+
if (!m_analysisIsOk) {
|
|
945
860
|
m_info = InvalidInput;
|
|
946
861
|
return;
|
|
947
862
|
}
|
|
948
|
-
|
|
863
|
+
|
|
949
864
|
this->initFactorization(a);
|
|
950
865
|
|
|
951
866
|
int info = 0;
|
|
952
867
|
RealScalar recip_pivot_growth, rcond;
|
|
953
868
|
|
|
954
869
|
StatInit(&m_sluStat);
|
|
955
|
-
SuperLU_gsisx(&m_sluOptions, &m_sluA, m_q.data(), m_p.data(), &m_sluEtree[0],
|
|
956
|
-
&
|
|
957
|
-
&
|
|
958
|
-
NULL, 0,
|
|
959
|
-
&m_sluB, &m_sluX,
|
|
960
|
-
&recip_pivot_growth, &rcond,
|
|
961
|
-
&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());
|
|
962
873
|
StatFree(&m_sluStat);
|
|
963
874
|
|
|
964
875
|
// FIXME how to better check for errors ???
|
|
@@ -967,14 +878,15 @@ void SuperILU<MatrixType>::factorize(const MatrixType& a)
|
|
|
967
878
|
}
|
|
968
879
|
|
|
969
880
|
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
|
970
|
-
template<typename MatrixType>
|
|
971
|
-
template<typename Rhs,typename Dest>
|
|
972
|
-
void SuperILU<MatrixType>::_solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest
|
|
973
|
-
|
|
974
|
-
|
|
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()");
|
|
975
887
|
|
|
976
888
|
const int rhsCols = b.cols();
|
|
977
|
-
eigen_assert(m_matrix.rows()==b.rows());
|
|
889
|
+
eigen_assert(m_matrix.rows() == b.rows());
|
|
978
890
|
|
|
979
891
|
m_sluOptions.Trans = NOTRANS;
|
|
980
892
|
m_sluOptions.Fact = FACTORED;
|
|
@@ -982,44 +894,36 @@ void SuperILU<MatrixType>::_solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest
|
|
|
982
894
|
|
|
983
895
|
m_sluFerr.resize(rhsCols);
|
|
984
896
|
m_sluBerr.resize(rhsCols);
|
|
985
|
-
|
|
986
|
-
Ref<const Matrix<typename Rhs::Scalar,Dynamic,Dynamic,ColMajor> > b_ref(b);
|
|
987
|
-
Ref<const Matrix<typename Dest::Scalar,Dynamic,Dynamic,ColMajor> > x_ref(x);
|
|
988
|
-
|
|
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
|
+
|
|
989
901
|
m_sluB = SluMatrix::Map(b_ref.const_cast_derived());
|
|
990
902
|
m_sluX = SluMatrix::Map(x_ref.const_cast_derived());
|
|
991
903
|
|
|
992
904
|
typename Rhs::PlainObject b_cpy;
|
|
993
|
-
if(m_sluEqued!='N')
|
|
994
|
-
{
|
|
905
|
+
if (m_sluEqued != 'N') {
|
|
995
906
|
b_cpy = b;
|
|
996
|
-
m_sluB = SluMatrix::Map(b_cpy.const_cast_derived());
|
|
907
|
+
m_sluB = SluMatrix::Map(b_cpy.const_cast_derived());
|
|
997
908
|
}
|
|
998
|
-
|
|
909
|
+
|
|
999
910
|
int info = 0;
|
|
1000
911
|
RealScalar recip_pivot_growth, rcond;
|
|
1001
912
|
|
|
1002
913
|
StatInit(&m_sluStat);
|
|
1003
|
-
SuperLU_gsisx(&m_sluOptions, &m_sluA,
|
|
1004
|
-
|
|
1005
|
-
&
|
|
1006
|
-
&m_sluRscale[0], &m_sluCscale[0],
|
|
1007
|
-
&m_sluL, &m_sluU,
|
|
1008
|
-
NULL, 0,
|
|
1009
|
-
&m_sluB, &m_sluX,
|
|
1010
|
-
&recip_pivot_growth, &rcond,
|
|
1011
|
-
&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());
|
|
1012
917
|
StatFree(&m_sluStat);
|
|
1013
|
-
|
|
1014
|
-
if(x.derived().data() != x_ref.data())
|
|
1015
|
-
x = x_ref;
|
|
1016
918
|
|
|
1017
|
-
|
|
919
|
+
if (x.derived().data() != x_ref.data()) x = x_ref;
|
|
920
|
+
|
|
921
|
+
m_info = info == 0 ? Success : NumericalIssue;
|
|
1018
922
|
}
|
|
1019
923
|
#endif
|
|
1020
924
|
|
|
1021
925
|
#endif
|
|
1022
926
|
|
|
1023
|
-
}
|
|
927
|
+
} // end namespace Eigen
|
|
1024
928
|
|
|
1025
|
-
#endif
|
|
929
|
+
#endif // EIGEN_SUPERLUSUPPORT_H
|