@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
|
@@ -11,428 +11,402 @@
|
|
|
11
11
|
#ifndef EIGEN_PARTIALLU_H
|
|
12
12
|
#define EIGEN_PARTIALLU_H
|
|
13
13
|
|
|
14
|
+
// IWYU pragma: private
|
|
15
|
+
#include "./InternalHeaderCheck.h"
|
|
16
|
+
|
|
14
17
|
namespace Eigen {
|
|
15
18
|
|
|
16
19
|
namespace internal {
|
|
17
|
-
template<typename
|
|
18
|
-
: traits<
|
|
19
|
-
{
|
|
20
|
+
template <typename MatrixType_, typename PermutationIndex_>
|
|
21
|
+
struct traits<PartialPivLU<MatrixType_, PermutationIndex_> > : traits<MatrixType_> {
|
|
20
22
|
typedef MatrixXpr XprKind;
|
|
21
23
|
typedef SolverStorage StorageKind;
|
|
22
|
-
typedef
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
CoeffReadCost = Dynamic
|
|
26
|
-
};
|
|
24
|
+
typedef PermutationIndex_ StorageIndex;
|
|
25
|
+
typedef traits<MatrixType_> BaseTraits;
|
|
26
|
+
enum { Flags = BaseTraits::Flags & RowMajorBit, CoeffReadCost = Dynamic };
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
template<typename T,typename Derived>
|
|
29
|
+
template <typename T, typename Derived>
|
|
30
30
|
struct enable_if_ref;
|
|
31
31
|
// {
|
|
32
32
|
// typedef Derived type;
|
|
33
33
|
// };
|
|
34
34
|
|
|
35
|
-
template<typename T,typename Derived>
|
|
36
|
-
struct enable_if_ref<Ref<T>,Derived> {
|
|
35
|
+
template <typename T, typename Derived>
|
|
36
|
+
struct enable_if_ref<Ref<T>, Derived> {
|
|
37
37
|
typedef Derived type;
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
}
|
|
40
|
+
} // end namespace internal
|
|
41
41
|
|
|
42
42
|
/** \ingroup LU_Module
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
{
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
* according to the specified problem \a size.
|
|
104
|
-
* \sa PartialPivLU()
|
|
105
|
-
*/
|
|
106
|
-
explicit PartialPivLU(Index size);
|
|
107
|
-
|
|
108
|
-
/** Constructor.
|
|
109
|
-
*
|
|
110
|
-
* \param matrix the matrix of which to compute the LU decomposition.
|
|
111
|
-
*
|
|
112
|
-
* \warning The matrix should have full rank (e.g. if it's square, it should be invertible).
|
|
113
|
-
* If you need to deal with non-full rank, use class FullPivLU instead.
|
|
114
|
-
*/
|
|
115
|
-
template<typename InputType>
|
|
116
|
-
explicit PartialPivLU(const EigenBase<InputType>& matrix);
|
|
117
|
-
|
|
118
|
-
/** Constructor for \link InplaceDecomposition inplace decomposition \endlink
|
|
119
|
-
*
|
|
120
|
-
* \param matrix the matrix of which to compute the LU decomposition.
|
|
121
|
-
*
|
|
122
|
-
* \warning The matrix should have full rank (e.g. if it's square, it should be invertible).
|
|
123
|
-
* If you need to deal with non-full rank, use class FullPivLU instead.
|
|
124
|
-
*/
|
|
125
|
-
template<typename InputType>
|
|
126
|
-
explicit PartialPivLU(EigenBase<InputType>& matrix);
|
|
127
|
-
|
|
128
|
-
template<typename InputType>
|
|
129
|
-
PartialPivLU& compute(const EigenBase<InputType>& matrix) {
|
|
130
|
-
m_lu = matrix.derived();
|
|
131
|
-
compute();
|
|
132
|
-
return *this;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/** \returns the LU decomposition matrix: the upper-triangular part is U, the
|
|
136
|
-
* unit-lower-triangular part is L (at least for square matrices; in the non-square
|
|
137
|
-
* case, special care is needed, see the documentation of class FullPivLU).
|
|
138
|
-
*
|
|
139
|
-
* \sa matrixL(), matrixU()
|
|
140
|
-
*/
|
|
141
|
-
inline const MatrixType& matrixLU() const
|
|
142
|
-
{
|
|
143
|
-
eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
|
|
144
|
-
return m_lu;
|
|
145
|
-
}
|
|
43
|
+
*
|
|
44
|
+
* \class PartialPivLU
|
|
45
|
+
*
|
|
46
|
+
* \brief LU decomposition of a matrix with partial pivoting, and related features
|
|
47
|
+
*
|
|
48
|
+
* \tparam MatrixType_ the type of the matrix of which we are computing the LU decomposition
|
|
49
|
+
*
|
|
50
|
+
* This class represents a LU decomposition of a \b square \b invertible matrix, with partial pivoting: the matrix A
|
|
51
|
+
* is decomposed as A = PLU where L is unit-lower-triangular, U is upper-triangular, and P
|
|
52
|
+
* is a permutation matrix.
|
|
53
|
+
*
|
|
54
|
+
* Typically, partial pivoting LU decomposition is only considered numerically stable for square invertible
|
|
55
|
+
* matrices. Thus LAPACK's dgesv and dgesvx require the matrix to be square and invertible. The present class
|
|
56
|
+
* does the same. It will assert that the matrix is square, but it won't (actually it can't) check that the
|
|
57
|
+
* matrix is invertible: it is your task to check that you only use this decomposition on invertible matrices.
|
|
58
|
+
*
|
|
59
|
+
* The guaranteed safe alternative, working for all matrices, is the full pivoting LU decomposition, provided
|
|
60
|
+
* by class FullPivLU.
|
|
61
|
+
*
|
|
62
|
+
* This is \b not a rank-revealing LU decomposition. Many features are intentionally absent from this class,
|
|
63
|
+
* such as rank computation. If you need these features, use class FullPivLU.
|
|
64
|
+
*
|
|
65
|
+
* This LU decomposition is suitable to invert invertible matrices. It is what MatrixBase::inverse() uses
|
|
66
|
+
* in the general case.
|
|
67
|
+
* On the other hand, it is \b not suitable to determine whether a given matrix is invertible.
|
|
68
|
+
*
|
|
69
|
+
* The data of the LU decomposition can be directly accessed through the methods matrixLU(), permutationP().
|
|
70
|
+
*
|
|
71
|
+
* This class supports the \link InplaceDecomposition inplace decomposition \endlink mechanism.
|
|
72
|
+
*
|
|
73
|
+
* \sa MatrixBase::partialPivLu(), MatrixBase::determinant(), MatrixBase::inverse(), MatrixBase::computeInverse(), class
|
|
74
|
+
* FullPivLU
|
|
75
|
+
*/
|
|
76
|
+
template <typename MatrixType_, typename PermutationIndex_>
|
|
77
|
+
class PartialPivLU : public SolverBase<PartialPivLU<MatrixType_, PermutationIndex_> > {
|
|
78
|
+
public:
|
|
79
|
+
typedef MatrixType_ MatrixType;
|
|
80
|
+
typedef SolverBase<PartialPivLU> Base;
|
|
81
|
+
friend class SolverBase<PartialPivLU>;
|
|
82
|
+
|
|
83
|
+
EIGEN_GENERIC_PUBLIC_INTERFACE(PartialPivLU)
|
|
84
|
+
enum {
|
|
85
|
+
MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
|
|
86
|
+
MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
|
|
87
|
+
};
|
|
88
|
+
using PermutationIndex = PermutationIndex_;
|
|
89
|
+
typedef PermutationMatrix<RowsAtCompileTime, MaxRowsAtCompileTime, PermutationIndex> PermutationType;
|
|
90
|
+
typedef Transpositions<RowsAtCompileTime, MaxRowsAtCompileTime, PermutationIndex> TranspositionType;
|
|
91
|
+
typedef typename MatrixType::PlainObject PlainObject;
|
|
92
|
+
|
|
93
|
+
/** \brief Reports whether the LU factorization was successful.
|
|
94
|
+
*
|
|
95
|
+
* \note This function always returns \c Success. It is provided for compatibility
|
|
96
|
+
* with other factorization routines.
|
|
97
|
+
* \returns \c Success
|
|
98
|
+
*/
|
|
99
|
+
ComputationInfo info() const {
|
|
100
|
+
eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
|
|
101
|
+
return Success;
|
|
102
|
+
}
|
|
146
103
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
104
|
+
/**
|
|
105
|
+
* \brief Default Constructor.
|
|
106
|
+
*
|
|
107
|
+
* The default constructor is useful in cases in which the user intends to
|
|
108
|
+
* perform decompositions via PartialPivLU::compute(const MatrixType&).
|
|
109
|
+
*/
|
|
110
|
+
PartialPivLU();
|
|
111
|
+
|
|
112
|
+
/** \brief Default Constructor with memory preallocation
|
|
113
|
+
*
|
|
114
|
+
* Like the default constructor but with preallocation of the internal data
|
|
115
|
+
* according to the specified problem \a size.
|
|
116
|
+
* \sa PartialPivLU()
|
|
117
|
+
*/
|
|
118
|
+
explicit PartialPivLU(Index size);
|
|
119
|
+
|
|
120
|
+
/** Constructor.
|
|
121
|
+
*
|
|
122
|
+
* \param matrix the matrix of which to compute the LU decomposition.
|
|
123
|
+
*
|
|
124
|
+
* \warning The matrix should have full rank (e.g. if it's square, it should be invertible).
|
|
125
|
+
* If you need to deal with non-full rank, use class FullPivLU instead.
|
|
126
|
+
*/
|
|
127
|
+
template <typename InputType>
|
|
128
|
+
explicit PartialPivLU(const EigenBase<InputType>& matrix);
|
|
129
|
+
|
|
130
|
+
/** Constructor for \link InplaceDecomposition inplace decomposition \endlink
|
|
131
|
+
*
|
|
132
|
+
* \param matrix the matrix of which to compute the LU decomposition.
|
|
133
|
+
*
|
|
134
|
+
* \warning The matrix should have full rank (e.g. if it's square, it should be invertible).
|
|
135
|
+
* If you need to deal with non-full rank, use class FullPivLU instead.
|
|
136
|
+
*/
|
|
137
|
+
template <typename InputType>
|
|
138
|
+
explicit PartialPivLU(EigenBase<InputType>& matrix);
|
|
139
|
+
|
|
140
|
+
template <typename InputType>
|
|
141
|
+
PartialPivLU& compute(const EigenBase<InputType>& matrix) {
|
|
142
|
+
m_lu = matrix.derived();
|
|
143
|
+
compute();
|
|
144
|
+
return *this;
|
|
145
|
+
}
|
|
154
146
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
* Output: \verbinclude PartialPivLU_solve.out
|
|
166
|
-
*
|
|
167
|
-
* Since this PartialPivLU class assumes anyway that the matrix A is invertible, the solution
|
|
168
|
-
* theoretically exists and is unique regardless of b.
|
|
169
|
-
*
|
|
170
|
-
* \sa TriangularView::solve(), inverse(), computeInverse()
|
|
171
|
-
*/
|
|
172
|
-
// FIXME this is a copy-paste of the base-class member to add the isInitialized assertion.
|
|
173
|
-
template<typename Rhs>
|
|
174
|
-
inline const Solve<PartialPivLU, Rhs>
|
|
175
|
-
solve(const MatrixBase<Rhs>& b) const
|
|
176
|
-
{
|
|
177
|
-
eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
|
|
178
|
-
return Solve<PartialPivLU, Rhs>(*this, b.derived());
|
|
179
|
-
}
|
|
147
|
+
/** \returns the LU decomposition matrix: the upper-triangular part is U, the
|
|
148
|
+
* unit-lower-triangular part is L (at least for square matrices; in the non-square
|
|
149
|
+
* case, special care is needed, see the documentation of class FullPivLU).
|
|
150
|
+
*
|
|
151
|
+
* \sa matrixL(), matrixU()
|
|
152
|
+
*/
|
|
153
|
+
inline const MatrixType& matrixLU() const {
|
|
154
|
+
eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
|
|
155
|
+
return m_lu;
|
|
156
|
+
}
|
|
180
157
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
return internal::rcond_estimate_helper(m_l1_norm, *this);
|
|
188
|
-
}
|
|
158
|
+
/** \returns the permutation matrix P.
|
|
159
|
+
*/
|
|
160
|
+
inline const PermutationType& permutationP() const {
|
|
161
|
+
eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
|
|
162
|
+
return m_p;
|
|
163
|
+
}
|
|
189
164
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
165
|
+
#ifdef EIGEN_PARSED_BY_DOXYGEN
|
|
166
|
+
/** This method returns the solution x to the equation Ax=b, where A is the matrix of which
|
|
167
|
+
* *this is the LU decomposition.
|
|
168
|
+
*
|
|
169
|
+
* \param b the right-hand-side of the equation to solve. Can be a vector or a matrix,
|
|
170
|
+
* the only requirement in order for the equation to make sense is that
|
|
171
|
+
* b.rows()==A.rows(), where A is the matrix of which *this is the LU decomposition.
|
|
172
|
+
*
|
|
173
|
+
* \returns the solution.
|
|
174
|
+
*
|
|
175
|
+
* Example: \include PartialPivLU_solve.cpp
|
|
176
|
+
* Output: \verbinclude PartialPivLU_solve.out
|
|
177
|
+
*
|
|
178
|
+
* Since this PartialPivLU class assumes anyway that the matrix A is invertible, the solution
|
|
179
|
+
* theoretically exists and is unique regardless of b.
|
|
180
|
+
*
|
|
181
|
+
* \sa TriangularView::solve(), inverse(), computeInverse()
|
|
182
|
+
*/
|
|
183
|
+
template <typename Rhs>
|
|
184
|
+
inline const Solve<PartialPivLU, Rhs> solve(const MatrixBase<Rhs>& b) const;
|
|
185
|
+
#endif
|
|
186
|
+
|
|
187
|
+
/** \returns an estimate of the reciprocal condition number of the matrix of which \c *this is
|
|
188
|
+
the LU decomposition.
|
|
189
|
+
*/
|
|
190
|
+
inline RealScalar rcond() const {
|
|
191
|
+
eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
|
|
192
|
+
return internal::rcond_estimate_helper(m_l1_norm, *this);
|
|
193
|
+
}
|
|
202
194
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
* \sa MatrixBase::determinant()
|
|
215
|
-
*/
|
|
216
|
-
Scalar determinant() const;
|
|
217
|
-
|
|
218
|
-
MatrixType reconstructedMatrix() const;
|
|
219
|
-
|
|
220
|
-
inline Index rows() const { return m_lu.rows(); }
|
|
221
|
-
inline Index cols() const { return m_lu.cols(); }
|
|
222
|
-
|
|
223
|
-
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
|
224
|
-
template<typename RhsType, typename DstType>
|
|
225
|
-
EIGEN_DEVICE_FUNC
|
|
226
|
-
void _solve_impl(const RhsType &rhs, DstType &dst) const {
|
|
227
|
-
/* The decomposition PA = LU can be rewritten as A = P^{-1} L U.
|
|
228
|
-
* So we proceed as follows:
|
|
229
|
-
* Step 1: compute c = Pb.
|
|
230
|
-
* Step 2: replace c by the solution x to Lx = c.
|
|
231
|
-
* Step 3: replace c by the solution x to Ux = c.
|
|
232
|
-
*/
|
|
233
|
-
|
|
234
|
-
eigen_assert(rhs.rows() == m_lu.rows());
|
|
235
|
-
|
|
236
|
-
// Step 1
|
|
237
|
-
dst = permutationP() * rhs;
|
|
238
|
-
|
|
239
|
-
// Step 2
|
|
240
|
-
m_lu.template triangularView<UnitLower>().solveInPlace(dst);
|
|
241
|
-
|
|
242
|
-
// Step 3
|
|
243
|
-
m_lu.template triangularView<Upper>().solveInPlace(dst);
|
|
244
|
-
}
|
|
195
|
+
/** \returns the inverse of the matrix of which *this is the LU decomposition.
|
|
196
|
+
*
|
|
197
|
+
* \warning The matrix being decomposed here is assumed to be invertible. If you need to check for
|
|
198
|
+
* invertibility, use class FullPivLU instead.
|
|
199
|
+
*
|
|
200
|
+
* \sa MatrixBase::inverse(), LU::inverse()
|
|
201
|
+
*/
|
|
202
|
+
inline const Inverse<PartialPivLU> inverse() const {
|
|
203
|
+
eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
|
|
204
|
+
return Inverse<PartialPivLU>(*this);
|
|
205
|
+
}
|
|
245
206
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
207
|
+
/** \returns the determinant of the matrix of which
|
|
208
|
+
* *this is the LU decomposition. It has only linear complexity
|
|
209
|
+
* (that is, O(n) where n is the dimension of the square matrix)
|
|
210
|
+
* as the LU decomposition has already been computed.
|
|
211
|
+
*
|
|
212
|
+
* \note For fixed-size matrices of size up to 4, MatrixBase::determinant() offers
|
|
213
|
+
* optimized paths.
|
|
214
|
+
*
|
|
215
|
+
* \warning a determinant can be very big or small, so for matrices
|
|
216
|
+
* of large enough dimension, there is a risk of overflow/underflow.
|
|
217
|
+
*
|
|
218
|
+
* \sa MatrixBase::determinant()
|
|
219
|
+
*/
|
|
220
|
+
Scalar determinant() const;
|
|
221
|
+
|
|
222
|
+
MatrixType reconstructedMatrix() const;
|
|
223
|
+
|
|
224
|
+
constexpr Index rows() const noexcept { return m_lu.rows(); }
|
|
225
|
+
constexpr Index cols() const noexcept { return m_lu.cols(); }
|
|
226
|
+
|
|
227
|
+
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
|
228
|
+
template <typename RhsType, typename DstType>
|
|
229
|
+
EIGEN_DEVICE_FUNC void _solve_impl(const RhsType& rhs, DstType& dst) const {
|
|
230
|
+
/* The decomposition PA = LU can be rewritten as A = P^{-1} L U.
|
|
231
|
+
* So we proceed as follows:
|
|
232
|
+
* Step 1: compute c = Pb.
|
|
233
|
+
* Step 2: replace c by the solution x to Lx = c.
|
|
234
|
+
* Step 3: replace c by the solution x to Ux = c.
|
|
235
|
+
*/
|
|
236
|
+
|
|
237
|
+
// Step 1
|
|
238
|
+
dst = permutationP() * rhs;
|
|
239
|
+
|
|
240
|
+
// Step 2
|
|
241
|
+
m_lu.template triangularView<UnitLower>().solveInPlace(dst);
|
|
242
|
+
|
|
243
|
+
// Step 3
|
|
244
|
+
m_lu.template triangularView<Upper>().solveInPlace(dst);
|
|
245
|
+
}
|
|
273
246
|
|
|
274
|
-
|
|
247
|
+
template <bool Conjugate, typename RhsType, typename DstType>
|
|
248
|
+
EIGEN_DEVICE_FUNC void _solve_impl_transposed(const RhsType& rhs, DstType& dst) const {
|
|
249
|
+
/* The decomposition PA = LU can be rewritten as A^T = U^T L^T P.
|
|
250
|
+
* So we proceed as follows:
|
|
251
|
+
* Step 1: compute c as the solution to L^T c = b
|
|
252
|
+
* Step 2: replace c by the solution x to U^T x = c.
|
|
253
|
+
* Step 3: update c = P^-1 c.
|
|
254
|
+
*/
|
|
255
|
+
|
|
256
|
+
eigen_assert(rhs.rows() == m_lu.cols());
|
|
257
|
+
|
|
258
|
+
// Step 1
|
|
259
|
+
dst = m_lu.template triangularView<Upper>().transpose().template conjugateIf<Conjugate>().solve(rhs);
|
|
260
|
+
// Step 2
|
|
261
|
+
m_lu.template triangularView<UnitLower>().transpose().template conjugateIf<Conjugate>().solveInPlace(dst);
|
|
262
|
+
// Step 3
|
|
263
|
+
dst = permutationP().transpose() * dst;
|
|
264
|
+
}
|
|
265
|
+
#endif
|
|
275
266
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar);
|
|
279
|
-
}
|
|
267
|
+
protected:
|
|
268
|
+
EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar)
|
|
280
269
|
|
|
281
|
-
|
|
270
|
+
void compute();
|
|
282
271
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
272
|
+
MatrixType m_lu;
|
|
273
|
+
PermutationType m_p;
|
|
274
|
+
TranspositionType m_rowsTranspositions;
|
|
275
|
+
RealScalar m_l1_norm;
|
|
276
|
+
signed char m_det_p;
|
|
277
|
+
bool m_isInitialized;
|
|
289
278
|
};
|
|
290
279
|
|
|
291
|
-
template<typename MatrixType>
|
|
292
|
-
PartialPivLU<MatrixType>::PartialPivLU()
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
m_det_p(0),
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
m_det_p(0),
|
|
309
|
-
m_isInitialized(false)
|
|
310
|
-
{
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
template<typename MatrixType>
|
|
314
|
-
template<typename InputType>
|
|
315
|
-
PartialPivLU<MatrixType>::PartialPivLU(const EigenBase<InputType>& matrix)
|
|
316
|
-
: m_lu(matrix.rows(),matrix.cols()),
|
|
317
|
-
m_p(matrix.rows()),
|
|
318
|
-
m_rowsTranspositions(matrix.rows()),
|
|
319
|
-
m_l1_norm(0),
|
|
320
|
-
m_det_p(0),
|
|
321
|
-
m_isInitialized(false)
|
|
322
|
-
{
|
|
280
|
+
template <typename MatrixType, typename PermutationIndex>
|
|
281
|
+
PartialPivLU<MatrixType, PermutationIndex>::PartialPivLU()
|
|
282
|
+
: m_lu(), m_p(), m_rowsTranspositions(), m_l1_norm(0), m_det_p(0), m_isInitialized(false) {}
|
|
283
|
+
|
|
284
|
+
template <typename MatrixType, typename PermutationIndex>
|
|
285
|
+
PartialPivLU<MatrixType, PermutationIndex>::PartialPivLU(Index size)
|
|
286
|
+
: m_lu(size, size), m_p(size), m_rowsTranspositions(size), m_l1_norm(0), m_det_p(0), m_isInitialized(false) {}
|
|
287
|
+
|
|
288
|
+
template <typename MatrixType, typename PermutationIndex>
|
|
289
|
+
template <typename InputType>
|
|
290
|
+
PartialPivLU<MatrixType, PermutationIndex>::PartialPivLU(const EigenBase<InputType>& matrix)
|
|
291
|
+
: m_lu(matrix.rows(), matrix.cols()),
|
|
292
|
+
m_p(matrix.rows()),
|
|
293
|
+
m_rowsTranspositions(matrix.rows()),
|
|
294
|
+
m_l1_norm(0),
|
|
295
|
+
m_det_p(0),
|
|
296
|
+
m_isInitialized(false) {
|
|
323
297
|
compute(matrix.derived());
|
|
324
298
|
}
|
|
325
299
|
|
|
326
|
-
template<typename MatrixType>
|
|
327
|
-
template<typename InputType>
|
|
328
|
-
PartialPivLU<MatrixType>::PartialPivLU(EigenBase<InputType>& matrix)
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
{
|
|
300
|
+
template <typename MatrixType, typename PermutationIndex>
|
|
301
|
+
template <typename InputType>
|
|
302
|
+
PartialPivLU<MatrixType, PermutationIndex>::PartialPivLU(EigenBase<InputType>& matrix)
|
|
303
|
+
: m_lu(matrix.derived()),
|
|
304
|
+
m_p(matrix.rows()),
|
|
305
|
+
m_rowsTranspositions(matrix.rows()),
|
|
306
|
+
m_l1_norm(0),
|
|
307
|
+
m_det_p(0),
|
|
308
|
+
m_isInitialized(false) {
|
|
336
309
|
compute();
|
|
337
310
|
}
|
|
338
311
|
|
|
339
312
|
namespace internal {
|
|
340
313
|
|
|
341
314
|
/** \internal This is the blocked version of fullpivlu_unblocked() */
|
|
342
|
-
template<typename Scalar, int StorageOrder, typename PivIndex>
|
|
343
|
-
struct partial_lu_impl
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
//
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
typedef
|
|
351
|
-
typedef
|
|
352
|
-
typedef
|
|
315
|
+
template <typename Scalar, int StorageOrder, typename PivIndex, int SizeAtCompileTime = Dynamic>
|
|
316
|
+
struct partial_lu_impl {
|
|
317
|
+
static constexpr int UnBlockedBound = 16;
|
|
318
|
+
static constexpr bool UnBlockedAtCompileTime = SizeAtCompileTime != Dynamic && SizeAtCompileTime <= UnBlockedBound;
|
|
319
|
+
static constexpr int ActualSizeAtCompileTime = UnBlockedAtCompileTime ? SizeAtCompileTime : Dynamic;
|
|
320
|
+
// Remaining rows and columns at compile-time:
|
|
321
|
+
static constexpr int RRows = SizeAtCompileTime == 2 ? 1 : Dynamic;
|
|
322
|
+
static constexpr int RCols = SizeAtCompileTime == 2 ? 1 : Dynamic;
|
|
323
|
+
typedef Matrix<Scalar, ActualSizeAtCompileTime, ActualSizeAtCompileTime, StorageOrder> MatrixType;
|
|
324
|
+
typedef Ref<MatrixType> MatrixTypeRef;
|
|
325
|
+
typedef Ref<Matrix<Scalar, Dynamic, Dynamic, StorageOrder> > BlockType;
|
|
353
326
|
typedef typename MatrixType::RealScalar RealScalar;
|
|
354
327
|
|
|
355
328
|
/** \internal performs the LU decomposition in-place of the matrix \a lu
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
static Index unblocked_lu(
|
|
366
|
-
{
|
|
329
|
+
* using an unblocked algorithm.
|
|
330
|
+
*
|
|
331
|
+
* In addition, this function returns the row transpositions in the
|
|
332
|
+
* vector \a row_transpositions which must have a size equal to the number
|
|
333
|
+
* of columns of the matrix \a lu, and an integer \a nb_transpositions
|
|
334
|
+
* which returns the actual number of transpositions.
|
|
335
|
+
*
|
|
336
|
+
* \returns The index of the first pivot which is exactly zero if any, or a negative number otherwise.
|
|
337
|
+
*/
|
|
338
|
+
static Index unblocked_lu(MatrixTypeRef& lu, PivIndex* row_transpositions, PivIndex& nb_transpositions) {
|
|
367
339
|
typedef scalar_score_coeff_op<Scalar> Scoring;
|
|
368
340
|
typedef typename Scoring::result_type Score;
|
|
369
341
|
const Index rows = lu.rows();
|
|
370
342
|
const Index cols = lu.cols();
|
|
371
|
-
const Index size = (std::min)(rows,cols);
|
|
343
|
+
const Index size = (std::min)(rows, cols);
|
|
344
|
+
// For small compile-time matrices it is worth processing the last row separately:
|
|
345
|
+
// speedup: +100% for 2x2, +10% for others.
|
|
346
|
+
const Index endk = UnBlockedAtCompileTime ? size - 1 : size;
|
|
372
347
|
nb_transpositions = 0;
|
|
373
348
|
Index first_zero_pivot = -1;
|
|
374
|
-
for(Index k = 0; k <
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
Index rcols = cols-k-1;
|
|
349
|
+
for (Index k = 0; k < endk; ++k) {
|
|
350
|
+
int rrows = internal::convert_index<int>(rows - k - 1);
|
|
351
|
+
int rcols = internal::convert_index<int>(cols - k - 1);
|
|
378
352
|
|
|
379
353
|
Index row_of_biggest_in_col;
|
|
380
|
-
Score biggest_in_corner
|
|
381
|
-
= lu.col(k).tail(rows-k).unaryExpr(Scoring()).maxCoeff(&row_of_biggest_in_col);
|
|
354
|
+
Score biggest_in_corner = lu.col(k).tail(rows - k).unaryExpr(Scoring()).maxCoeff(&row_of_biggest_in_col);
|
|
382
355
|
row_of_biggest_in_col += k;
|
|
383
356
|
|
|
384
357
|
row_transpositions[k] = PivIndex(row_of_biggest_in_col);
|
|
385
358
|
|
|
386
|
-
if(biggest_in_corner
|
|
387
|
-
|
|
388
|
-
if(k != row_of_biggest_in_col)
|
|
389
|
-
{
|
|
359
|
+
if (!numext::is_exactly_zero(biggest_in_corner)) {
|
|
360
|
+
if (k != row_of_biggest_in_col) {
|
|
390
361
|
lu.row(k).swap(lu.row(row_of_biggest_in_col));
|
|
391
362
|
++nb_transpositions;
|
|
392
363
|
}
|
|
393
364
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
lu.col(k).tail(rrows) /= lu.coeff(k,k);
|
|
397
|
-
}
|
|
398
|
-
else if(first_zero_pivot==-1)
|
|
399
|
-
{
|
|
365
|
+
lu.col(k).tail(fix<RRows>(rrows)) /= lu.coeff(k, k);
|
|
366
|
+
} else if (first_zero_pivot == -1) {
|
|
400
367
|
// the pivot is exactly zero, we record the index of the first pivot which is exactly 0,
|
|
401
368
|
// and continue the factorization such we still have A = PLU
|
|
402
369
|
first_zero_pivot = k;
|
|
403
370
|
}
|
|
404
371
|
|
|
405
|
-
if(k<rows-1)
|
|
406
|
-
lu.bottomRightCorner(rrows,rcols).noalias() -=
|
|
372
|
+
if (k < rows - 1)
|
|
373
|
+
lu.bottomRightCorner(fix<RRows>(rrows), fix<RCols>(rcols)).noalias() -=
|
|
374
|
+
lu.col(k).tail(fix<RRows>(rrows)) * lu.row(k).tail(fix<RCols>(rcols));
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
// special handling of the last entry
|
|
378
|
+
if (UnBlockedAtCompileTime) {
|
|
379
|
+
Index k = endk;
|
|
380
|
+
row_transpositions[k] = PivIndex(k);
|
|
381
|
+
if (numext::is_exactly_zero(Scoring()(lu(k, k))) && first_zero_pivot == -1) first_zero_pivot = k;
|
|
407
382
|
}
|
|
383
|
+
|
|
408
384
|
return first_zero_pivot;
|
|
409
385
|
}
|
|
410
386
|
|
|
411
387
|
/** \internal performs the LU decomposition in-place of the matrix represented
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
static Index blocked_lu(Index rows, Index cols, Scalar* lu_data, Index luStride, PivIndex* row_transpositions,
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
const Index size = (std::min)(rows,cols);
|
|
388
|
+
* by the variables \a rows, \a cols, \a lu_data, and \a lu_stride using a
|
|
389
|
+
* recursive, blocked algorithm.
|
|
390
|
+
*
|
|
391
|
+
* In addition, this function returns the row transpositions in the
|
|
392
|
+
* vector \a row_transpositions which must have a size equal to the number
|
|
393
|
+
* of columns of the matrix \a lu, and an integer \a nb_transpositions
|
|
394
|
+
* which returns the actual number of transpositions.
|
|
395
|
+
*
|
|
396
|
+
* \returns The index of the first pivot which is exactly zero if any, or a negative number otherwise.
|
|
397
|
+
*
|
|
398
|
+
* \note This very low level interface using pointers, etc. is to:
|
|
399
|
+
* 1 - reduce the number of instantiations to the strict minimum
|
|
400
|
+
* 2 - avoid infinite recursion of the instantiations with Block<Block<Block<...> > >
|
|
401
|
+
*/
|
|
402
|
+
static Index blocked_lu(Index rows, Index cols, Scalar* lu_data, Index luStride, PivIndex* row_transpositions,
|
|
403
|
+
PivIndex& nb_transpositions, Index maxBlockSize = 256) {
|
|
404
|
+
MatrixTypeRef lu = MatrixType::Map(lu_data, rows, cols, OuterStride<>(luStride));
|
|
405
|
+
|
|
406
|
+
const Index size = (std::min)(rows, cols);
|
|
432
407
|
|
|
433
408
|
// if the matrix is too small, no blocking:
|
|
434
|
-
if(size<=
|
|
435
|
-
{
|
|
409
|
+
if (UnBlockedAtCompileTime || size <= UnBlockedBound) {
|
|
436
410
|
return unblocked_lu(lu, row_transpositions, nb_transpositions);
|
|
437
411
|
}
|
|
438
412
|
|
|
@@ -440,51 +414,46 @@ struct partial_lu_impl
|
|
|
440
414
|
// of the matrix so that there is enough sub blocks:
|
|
441
415
|
Index blockSize;
|
|
442
416
|
{
|
|
443
|
-
blockSize = size/8;
|
|
444
|
-
blockSize = (blockSize/16)*16;
|
|
445
|
-
blockSize = (std::min)((std::max)(blockSize,Index(8)), maxBlockSize);
|
|
417
|
+
blockSize = size / 8;
|
|
418
|
+
blockSize = (blockSize / 16) * 16;
|
|
419
|
+
blockSize = (std::min)((std::max)(blockSize, Index(8)), maxBlockSize);
|
|
446
420
|
}
|
|
447
421
|
|
|
448
422
|
nb_transpositions = 0;
|
|
449
423
|
Index first_zero_pivot = -1;
|
|
450
|
-
for(Index k = 0; k < size; k+=blockSize)
|
|
451
|
-
|
|
452
|
-
Index
|
|
453
|
-
Index
|
|
454
|
-
Index tsize = size - k - bs; // trailing size
|
|
424
|
+
for (Index k = 0; k < size; k += blockSize) {
|
|
425
|
+
Index bs = (std::min)(size - k, blockSize); // actual size of the block
|
|
426
|
+
Index trows = rows - k - bs; // trailing rows
|
|
427
|
+
Index tsize = size - k - bs; // trailing size
|
|
455
428
|
|
|
456
429
|
// partition the matrix:
|
|
457
430
|
// A00 | A01 | A02
|
|
458
431
|
// lu = A_0 | A_1 | A_2 = A10 | A11 | A12
|
|
459
432
|
// A20 | A21 | A22
|
|
460
|
-
BlockType A_0(
|
|
461
|
-
BlockType A_2(
|
|
462
|
-
BlockType A11(
|
|
463
|
-
BlockType A12(
|
|
464
|
-
BlockType A21(
|
|
465
|
-
BlockType A22(
|
|
433
|
+
BlockType A_0 = lu.block(0, 0, rows, k);
|
|
434
|
+
BlockType A_2 = lu.block(0, k + bs, rows, tsize);
|
|
435
|
+
BlockType A11 = lu.block(k, k, bs, bs);
|
|
436
|
+
BlockType A12 = lu.block(k, k + bs, bs, tsize);
|
|
437
|
+
BlockType A21 = lu.block(k + bs, k, trows, bs);
|
|
438
|
+
BlockType A22 = lu.block(k + bs, k + bs, trows, tsize);
|
|
466
439
|
|
|
467
440
|
PivIndex nb_transpositions_in_panel;
|
|
468
441
|
// recursively call the blocked LU algorithm on [A11^T A21^T]^T
|
|
469
442
|
// with a very small blocking size:
|
|
470
|
-
Index ret = blocked_lu(trows+bs, bs, &lu.coeffRef(k,k), luStride,
|
|
471
|
-
|
|
472
|
-
if(ret>=0 && first_zero_pivot
|
|
473
|
-
first_zero_pivot = k+ret;
|
|
443
|
+
Index ret = blocked_lu(trows + bs, bs, &lu.coeffRef(k, k), luStride, row_transpositions + k,
|
|
444
|
+
nb_transpositions_in_panel, 16);
|
|
445
|
+
if (ret >= 0 && first_zero_pivot == -1) first_zero_pivot = k + ret;
|
|
474
446
|
|
|
475
447
|
nb_transpositions += nb_transpositions_in_panel;
|
|
476
448
|
// update permutations and apply them to A_0
|
|
477
|
-
for(Index i=k; i<k+bs; ++i)
|
|
478
|
-
{
|
|
449
|
+
for (Index i = k; i < k + bs; ++i) {
|
|
479
450
|
Index piv = (row_transpositions[i] += internal::convert_index<PivIndex>(k));
|
|
480
451
|
A_0.row(i).swap(A_0.row(piv));
|
|
481
452
|
}
|
|
482
453
|
|
|
483
|
-
if(trows)
|
|
484
|
-
{
|
|
454
|
+
if (trows) {
|
|
485
455
|
// apply permutations to A_2
|
|
486
|
-
for(Index i=k;i<k+bs; ++i)
|
|
487
|
-
A_2.row(i).swap(A_2.row(row_transpositions[i]));
|
|
456
|
+
for (Index i = k; i < k + bs; ++i) A_2.row(i).swap(A_2.row(row_transpositions[i]));
|
|
488
457
|
|
|
489
458
|
// A12 = A11^-1 A12
|
|
490
459
|
A11.template triangularView<UnitLower>().solveInPlace(A12);
|
|
@@ -497,29 +466,33 @@ struct partial_lu_impl
|
|
|
497
466
|
};
|
|
498
467
|
|
|
499
468
|
/** \internal performs the LU decomposition with partial pivoting in-place.
|
|
500
|
-
|
|
501
|
-
template<typename MatrixType, typename TranspositionType>
|
|
502
|
-
void partial_lu_inplace(MatrixType& lu, TranspositionType& row_transpositions,
|
|
503
|
-
{
|
|
469
|
+
*/
|
|
470
|
+
template <typename MatrixType, typename TranspositionType>
|
|
471
|
+
void partial_lu_inplace(MatrixType& lu, TranspositionType& row_transpositions,
|
|
472
|
+
typename TranspositionType::StorageIndex& nb_transpositions) {
|
|
473
|
+
// Special-case of zero matrix.
|
|
474
|
+
if (lu.rows() == 0 || lu.cols() == 0) {
|
|
475
|
+
nb_transpositions = 0;
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
504
478
|
eigen_assert(lu.cols() == row_transpositions.size());
|
|
505
|
-
eigen_assert(
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
479
|
+
eigen_assert(row_transpositions.size() < 2 ||
|
|
480
|
+
(&row_transpositions.coeffRef(1) - &row_transpositions.coeffRef(0)) == 1);
|
|
481
|
+
|
|
482
|
+
partial_lu_impl<typename MatrixType::Scalar, MatrixType::Flags & RowMajorBit ? RowMajor : ColMajor,
|
|
483
|
+
typename TranspositionType::StorageIndex,
|
|
484
|
+
internal::min_size_prefer_fixed(MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime)>::
|
|
485
|
+
blocked_lu(lu.rows(), lu.cols(), &lu.coeffRef(0, 0), lu.outerStride(), &row_transpositions.coeffRef(0),
|
|
486
|
+
nb_transpositions);
|
|
510
487
|
}
|
|
511
488
|
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
template<typename MatrixType>
|
|
515
|
-
void PartialPivLU<MatrixType>::compute()
|
|
516
|
-
{
|
|
517
|
-
check_template_parameters();
|
|
489
|
+
} // end namespace internal
|
|
518
490
|
|
|
519
|
-
|
|
520
|
-
|
|
491
|
+
template <typename MatrixType, typename PermutationIndex>
|
|
492
|
+
void PartialPivLU<MatrixType, PermutationIndex>::compute() {
|
|
493
|
+
eigen_assert(m_lu.rows() < NumTraits<PermutationIndex>::highest());
|
|
521
494
|
|
|
522
|
-
if(m_lu.cols()>0)
|
|
495
|
+
if (m_lu.cols() > 0)
|
|
523
496
|
m_l1_norm = m_lu.cwiseAbs().colwise().sum().maxCoeff();
|
|
524
497
|
else
|
|
525
498
|
m_l1_norm = RealScalar(0);
|
|
@@ -531,16 +504,16 @@ void PartialPivLU<MatrixType>::compute()
|
|
|
531
504
|
|
|
532
505
|
typename TranspositionType::StorageIndex nb_transpositions;
|
|
533
506
|
internal::partial_lu_inplace(m_lu, m_rowsTranspositions, nb_transpositions);
|
|
534
|
-
m_det_p = (nb_transpositions%2) ? -1 : 1;
|
|
507
|
+
m_det_p = (nb_transpositions % 2) ? -1 : 1;
|
|
535
508
|
|
|
536
509
|
m_p = m_rowsTranspositions;
|
|
537
510
|
|
|
538
511
|
m_isInitialized = true;
|
|
539
512
|
}
|
|
540
513
|
|
|
541
|
-
template<typename MatrixType>
|
|
542
|
-
typename PartialPivLU<MatrixType>::Scalar PartialPivLU<MatrixType>::determinant()
|
|
543
|
-
{
|
|
514
|
+
template <typename MatrixType, typename PermutationIndex>
|
|
515
|
+
typename PartialPivLU<MatrixType, PermutationIndex>::Scalar PartialPivLU<MatrixType, PermutationIndex>::determinant()
|
|
516
|
+
const {
|
|
544
517
|
eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
|
|
545
518
|
return Scalar(m_det_p) * m_lu.diagonal().prod();
|
|
546
519
|
}
|
|
@@ -548,13 +521,11 @@ typename PartialPivLU<MatrixType>::Scalar PartialPivLU<MatrixType>::determinant(
|
|
|
548
521
|
/** \returns the matrix represented by the decomposition,
|
|
549
522
|
* i.e., it returns the product: P^{-1} L U.
|
|
550
523
|
* This function is provided for debug purpose. */
|
|
551
|
-
template<typename MatrixType>
|
|
552
|
-
MatrixType PartialPivLU<MatrixType>::reconstructedMatrix() const
|
|
553
|
-
{
|
|
524
|
+
template <typename MatrixType, typename PermutationIndex>
|
|
525
|
+
MatrixType PartialPivLU<MatrixType, PermutationIndex>::reconstructedMatrix() const {
|
|
554
526
|
eigen_assert(m_isInitialized && "LU is not initialized.");
|
|
555
527
|
// LU
|
|
556
|
-
MatrixType res = m_lu.template triangularView<UnitLower>().toDenseMatrix()
|
|
557
|
-
* m_lu.template triangularView<Upper>();
|
|
528
|
+
MatrixType res = m_lu.template triangularView<UnitLower>().toDenseMatrix() * m_lu.template triangularView<Upper>();
|
|
558
529
|
|
|
559
530
|
// P^{-1}(LU)
|
|
560
531
|
res = m_p.inverse() * res;
|
|
@@ -567,48 +538,49 @@ MatrixType PartialPivLU<MatrixType>::reconstructedMatrix() const
|
|
|
567
538
|
namespace internal {
|
|
568
539
|
|
|
569
540
|
/***** Implementation of inverse() *****************************************************/
|
|
570
|
-
template<typename DstXprType, typename MatrixType>
|
|
571
|
-
struct Assignment<
|
|
572
|
-
|
|
573
|
-
|
|
541
|
+
template <typename DstXprType, typename MatrixType, typename PermutationIndex>
|
|
542
|
+
struct Assignment<
|
|
543
|
+
DstXprType, Inverse<PartialPivLU<MatrixType, PermutationIndex> >,
|
|
544
|
+
internal::assign_op<typename DstXprType::Scalar, typename PartialPivLU<MatrixType, PermutationIndex>::Scalar>,
|
|
545
|
+
Dense2Dense> {
|
|
546
|
+
typedef PartialPivLU<MatrixType, PermutationIndex> LuType;
|
|
574
547
|
typedef Inverse<LuType> SrcXprType;
|
|
575
|
-
static void run(DstXprType
|
|
576
|
-
|
|
548
|
+
static void run(DstXprType& dst, const SrcXprType& src,
|
|
549
|
+
const internal::assign_op<typename DstXprType::Scalar, typename LuType::Scalar>&) {
|
|
577
550
|
dst = src.nestedExpression().solve(MatrixType::Identity(src.rows(), src.cols()));
|
|
578
551
|
}
|
|
579
552
|
};
|
|
580
|
-
}
|
|
553
|
+
} // end namespace internal
|
|
581
554
|
|
|
582
555
|
/******** MatrixBase methods *******/
|
|
583
556
|
|
|
584
557
|
/** \lu_module
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
template<typename Derived>
|
|
591
|
-
|
|
592
|
-
MatrixBase<Derived>::
|
|
593
|
-
{
|
|
594
|
-
return PartialPivLU<PlainObject>(eval());
|
|
558
|
+
*
|
|
559
|
+
* \return the partial-pivoting LU decomposition of \c *this.
|
|
560
|
+
*
|
|
561
|
+
* \sa class PartialPivLU
|
|
562
|
+
*/
|
|
563
|
+
template <typename Derived>
|
|
564
|
+
template <typename PermutationIndex>
|
|
565
|
+
inline const PartialPivLU<typename MatrixBase<Derived>::PlainObject, PermutationIndex>
|
|
566
|
+
MatrixBase<Derived>::partialPivLu() const {
|
|
567
|
+
return PartialPivLU<PlainObject, PermutationIndex>(eval());
|
|
595
568
|
}
|
|
596
569
|
|
|
597
570
|
/** \lu_module
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
template<typename Derived>
|
|
606
|
-
|
|
607
|
-
MatrixBase<Derived>::lu() const
|
|
608
|
-
|
|
609
|
-
return PartialPivLU<PlainObject>(eval());
|
|
571
|
+
*
|
|
572
|
+
* Synonym of partialPivLu().
|
|
573
|
+
*
|
|
574
|
+
* \return the partial-pivoting LU decomposition of \c *this.
|
|
575
|
+
*
|
|
576
|
+
* \sa class PartialPivLU
|
|
577
|
+
*/
|
|
578
|
+
template <typename Derived>
|
|
579
|
+
template <typename PermutationIndex>
|
|
580
|
+
inline const PartialPivLU<typename MatrixBase<Derived>::PlainObject, PermutationIndex> MatrixBase<Derived>::lu() const {
|
|
581
|
+
return PartialPivLU<PlainObject, PermutationIndex>(eval());
|
|
610
582
|
}
|
|
611
583
|
|
|
612
|
-
}
|
|
584
|
+
} // end namespace Eigen
|
|
613
585
|
|
|
614
|
-
#endif
|
|
586
|
+
#endif // EIGEN_PARTIALLU_H
|