@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
|
@@ -11,702 +11,615 @@
|
|
|
11
11
|
#ifndef EIGEN_TRIANGULARMATRIX_H
|
|
12
12
|
#define EIGEN_TRIANGULARMATRIX_H
|
|
13
13
|
|
|
14
|
+
// IWYU pragma: private
|
|
15
|
+
#include "./InternalHeaderCheck.h"
|
|
16
|
+
|
|
14
17
|
namespace Eigen {
|
|
15
18
|
|
|
16
19
|
namespace internal {
|
|
17
20
|
|
|
18
|
-
template<int Side, typename TriangularType, typename Rhs>
|
|
21
|
+
template <int Side, typename TriangularType, typename Rhs>
|
|
22
|
+
struct triangular_solve_retval;
|
|
19
23
|
|
|
20
24
|
}
|
|
21
25
|
|
|
22
26
|
/** \class TriangularBase
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
template<typename Derived>
|
|
28
|
-
{
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
MaxColsAtCompileTime = internal::traits<Derived>::MaxColsAtCompileTime,
|
|
37
|
-
|
|
38
|
-
SizeAtCompileTime = (internal::size_at_compile_time<internal::traits<Derived>::RowsAtCompileTime,
|
|
39
|
-
internal::traits<Derived>::ColsAtCompileTime>::ret),
|
|
40
|
-
/**< This is equal to the number of coefficients, i.e. the number of
|
|
41
|
-
* rows times the number of columns, or to \a Dynamic if this is not
|
|
42
|
-
* known at compile-time. \sa RowsAtCompileTime, ColsAtCompileTime */
|
|
43
|
-
|
|
44
|
-
MaxSizeAtCompileTime = (internal::size_at_compile_time<internal::traits<Derived>::MaxRowsAtCompileTime,
|
|
45
|
-
internal::traits<Derived>::MaxColsAtCompileTime>::ret)
|
|
46
|
-
|
|
47
|
-
};
|
|
48
|
-
typedef typename internal::traits<Derived>::Scalar Scalar;
|
|
49
|
-
typedef typename internal::traits<Derived>::StorageKind StorageKind;
|
|
50
|
-
typedef typename internal::traits<Derived>::StorageIndex StorageIndex;
|
|
51
|
-
typedef typename internal::traits<Derived>::FullMatrixType DenseMatrixType;
|
|
52
|
-
typedef DenseMatrixType DenseType;
|
|
53
|
-
typedef Derived const& Nested;
|
|
54
|
-
|
|
55
|
-
EIGEN_DEVICE_FUNC
|
|
56
|
-
inline TriangularBase() { eigen_assert(!((int(Mode) & int(UnitDiag)) && (int(Mode) & int(ZeroDiag)))); }
|
|
57
|
-
|
|
58
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
59
|
-
inline Index rows() const EIGEN_NOEXCEPT { return derived().rows(); }
|
|
60
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
61
|
-
inline Index cols() const EIGEN_NOEXCEPT { return derived().cols(); }
|
|
62
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
63
|
-
inline Index outerStride() const EIGEN_NOEXCEPT { return derived().outerStride(); }
|
|
64
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
65
|
-
inline Index innerStride() const EIGEN_NOEXCEPT { return derived().innerStride(); }
|
|
66
|
-
|
|
67
|
-
// dummy resize function
|
|
68
|
-
EIGEN_DEVICE_FUNC
|
|
69
|
-
void resize(Index rows, Index cols)
|
|
70
|
-
{
|
|
71
|
-
EIGEN_UNUSED_VARIABLE(rows);
|
|
72
|
-
EIGEN_UNUSED_VARIABLE(cols);
|
|
73
|
-
eigen_assert(rows==this->rows() && cols==this->cols());
|
|
74
|
-
}
|
|
27
|
+
* \ingroup Core_Module
|
|
28
|
+
*
|
|
29
|
+
* \brief Base class for triangular part in a matrix
|
|
30
|
+
*/
|
|
31
|
+
template <typename Derived>
|
|
32
|
+
class TriangularBase : public EigenBase<Derived> {
|
|
33
|
+
public:
|
|
34
|
+
enum {
|
|
35
|
+
Mode = internal::traits<Derived>::Mode,
|
|
36
|
+
RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime,
|
|
37
|
+
ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime,
|
|
38
|
+
MaxRowsAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime,
|
|
39
|
+
MaxColsAtCompileTime = internal::traits<Derived>::MaxColsAtCompileTime,
|
|
75
40
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
/** \see MatrixBase::copyCoeff(row,col)
|
|
82
|
-
*/
|
|
83
|
-
template<typename Other>
|
|
84
|
-
EIGEN_DEVICE_FUNC
|
|
85
|
-
EIGEN_STRONG_INLINE void copyCoeff(Index row, Index col, Other& other)
|
|
86
|
-
{
|
|
87
|
-
derived().coeffRef(row, col) = other.coeff(row, col);
|
|
88
|
-
}
|
|
41
|
+
SizeAtCompileTime = (internal::size_of_xpr_at_compile_time<Derived>::ret),
|
|
42
|
+
/**< This is equal to the number of coefficients, i.e. the number of
|
|
43
|
+
* rows times the number of columns, or to \a Dynamic if this is not
|
|
44
|
+
* known at compile-time. \sa RowsAtCompileTime, ColsAtCompileTime */
|
|
89
45
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
{
|
|
93
|
-
check_coordinates(row, col);
|
|
94
|
-
return coeff(row,col);
|
|
95
|
-
}
|
|
96
|
-
EIGEN_DEVICE_FUNC
|
|
97
|
-
inline Scalar& operator()(Index row, Index col)
|
|
98
|
-
{
|
|
99
|
-
check_coordinates(row, col);
|
|
100
|
-
return coeffRef(row,col);
|
|
101
|
-
}
|
|
46
|
+
MaxSizeAtCompileTime = internal::size_at_compile_time(internal::traits<Derived>::MaxRowsAtCompileTime,
|
|
47
|
+
internal::traits<Derived>::MaxColsAtCompileTime)
|
|
102
48
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
EIGEN_DEVICE_FUNC
|
|
115
|
-
void evalToLazy(MatrixBase<DenseDerived> &other) const;
|
|
116
|
-
|
|
117
|
-
EIGEN_DEVICE_FUNC
|
|
118
|
-
DenseMatrixType toDenseMatrix() const
|
|
119
|
-
{
|
|
120
|
-
DenseMatrixType res(rows(), cols());
|
|
121
|
-
evalToLazy(res);
|
|
122
|
-
return res;
|
|
123
|
-
}
|
|
49
|
+
};
|
|
50
|
+
typedef typename internal::traits<Derived>::Scalar Scalar;
|
|
51
|
+
typedef typename internal::traits<Derived>::StorageKind StorageKind;
|
|
52
|
+
typedef typename internal::traits<Derived>::StorageIndex StorageIndex;
|
|
53
|
+
typedef typename internal::traits<Derived>::FullMatrixType DenseMatrixType;
|
|
54
|
+
typedef DenseMatrixType DenseType;
|
|
55
|
+
typedef Derived const& Nested;
|
|
56
|
+
|
|
57
|
+
EIGEN_DEVICE_FUNC inline TriangularBase() {
|
|
58
|
+
eigen_assert(!((int(Mode) & int(UnitDiag)) && (int(Mode) & int(ZeroDiag))));
|
|
59
|
+
}
|
|
124
60
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
EIGEN_ONLY_USED_FOR_DEBUG(row);
|
|
130
|
-
EIGEN_ONLY_USED_FOR_DEBUG(col);
|
|
131
|
-
eigen_assert(col>=0 && col<cols() && row>=0 && row<rows());
|
|
132
|
-
const int mode = int(Mode) & ~SelfAdjoint;
|
|
133
|
-
EIGEN_ONLY_USED_FOR_DEBUG(mode);
|
|
134
|
-
eigen_assert((mode==Upper && col>=row)
|
|
135
|
-
|| (mode==Lower && col<=row)
|
|
136
|
-
|| ((mode==StrictlyUpper || mode==UnitUpper) && col>row)
|
|
137
|
-
|| ((mode==StrictlyLower || mode==UnitLower) && col<row));
|
|
138
|
-
}
|
|
61
|
+
EIGEN_DEVICE_FUNC constexpr Index rows() const noexcept { return derived().rows(); }
|
|
62
|
+
EIGEN_DEVICE_FUNC constexpr Index cols() const noexcept { return derived().cols(); }
|
|
63
|
+
EIGEN_DEVICE_FUNC constexpr Index outerStride() const noexcept { return derived().outerStride(); }
|
|
64
|
+
EIGEN_DEVICE_FUNC constexpr Index innerStride() const noexcept { return derived().innerStride(); }
|
|
139
65
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
66
|
+
// dummy resize function
|
|
67
|
+
EIGEN_DEVICE_FUNC void resize(Index rows, Index cols) {
|
|
68
|
+
EIGEN_UNUSED_VARIABLE(rows);
|
|
69
|
+
EIGEN_UNUSED_VARIABLE(cols);
|
|
70
|
+
eigen_assert(rows == this->rows() && cols == this->cols());
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
EIGEN_DEVICE_FUNC inline Scalar coeff(Index row, Index col) const { return derived().coeff(row, col); }
|
|
74
|
+
EIGEN_DEVICE_FUNC inline Scalar& coeffRef(Index row, Index col) { return derived().coeffRef(row, col); }
|
|
75
|
+
|
|
76
|
+
/** \see MatrixBase::copyCoeff(row,col)
|
|
77
|
+
*/
|
|
78
|
+
template <typename Other>
|
|
79
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void copyCoeff(Index row, Index col, Other& other) {
|
|
80
|
+
derived().coeffRef(row, col) = other.coeff(row, col);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
EIGEN_DEVICE_FUNC inline Scalar operator()(Index row, Index col) const {
|
|
84
|
+
check_coordinates(row, col);
|
|
85
|
+
return coeff(row, col);
|
|
86
|
+
}
|
|
87
|
+
EIGEN_DEVICE_FUNC inline Scalar& operator()(Index row, Index col) {
|
|
88
|
+
check_coordinates(row, col);
|
|
89
|
+
return coeffRef(row, col);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
|
93
|
+
EIGEN_DEVICE_FUNC inline const Derived& derived() const { return *static_cast<const Derived*>(this); }
|
|
94
|
+
EIGEN_DEVICE_FUNC inline Derived& derived() { return *static_cast<Derived*>(this); }
|
|
95
|
+
#endif // not EIGEN_PARSED_BY_DOXYGEN
|
|
96
|
+
|
|
97
|
+
template <typename DenseDerived>
|
|
98
|
+
EIGEN_DEVICE_FUNC void evalTo(MatrixBase<DenseDerived>& other) const;
|
|
99
|
+
template <typename DenseDerived>
|
|
100
|
+
EIGEN_DEVICE_FUNC void evalToLazy(MatrixBase<DenseDerived>& other) const;
|
|
101
|
+
|
|
102
|
+
EIGEN_DEVICE_FUNC DenseMatrixType toDenseMatrix() const {
|
|
103
|
+
DenseMatrixType res(rows(), cols());
|
|
104
|
+
evalToLazy(res);
|
|
105
|
+
return res;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
protected:
|
|
109
|
+
void check_coordinates(Index row, Index col) const {
|
|
110
|
+
EIGEN_ONLY_USED_FOR_DEBUG(row);
|
|
111
|
+
EIGEN_ONLY_USED_FOR_DEBUG(col);
|
|
112
|
+
eigen_assert(col >= 0 && col < cols() && row >= 0 && row < rows());
|
|
113
|
+
const int mode = int(Mode) & ~SelfAdjoint;
|
|
114
|
+
EIGEN_ONLY_USED_FOR_DEBUG(mode);
|
|
115
|
+
eigen_assert((mode == Upper && col >= row) || (mode == Lower && col <= row) ||
|
|
116
|
+
((mode == StrictlyUpper || mode == UnitUpper) && col > row) ||
|
|
117
|
+
((mode == StrictlyLower || mode == UnitLower) && col < row));
|
|
118
|
+
}
|
|
148
119
|
|
|
120
|
+
#ifdef EIGEN_INTERNAL_DEBUGGING
|
|
121
|
+
void check_coordinates_internal(Index row, Index col) const { check_coordinates(row, col); }
|
|
122
|
+
#else
|
|
123
|
+
void check_coordinates_internal(Index, Index) const {}
|
|
124
|
+
#endif
|
|
149
125
|
};
|
|
150
126
|
|
|
151
127
|
/** \class TriangularView
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
128
|
+
* \ingroup Core_Module
|
|
129
|
+
*
|
|
130
|
+
* \brief Expression of a triangular part in a matrix
|
|
131
|
+
*
|
|
132
|
+
* \tparam MatrixType the type of the object in which we are taking the triangular part
|
|
133
|
+
* \tparam Mode the kind of triangular matrix expression to construct. Can be #Upper,
|
|
134
|
+
* #Lower, #UnitUpper, #UnitLower, #StrictlyUpper, or #StrictlyLower.
|
|
135
|
+
* This is in fact a bit field; it must have either #Upper or #Lower,
|
|
136
|
+
* and additionally it may have #UnitDiag or #ZeroDiag or neither.
|
|
137
|
+
*
|
|
138
|
+
* This class represents a triangular part of a matrix, not necessarily square. Strictly speaking, for rectangular
|
|
139
|
+
* matrices one should speak of "trapezoid" parts. This class is the return type
|
|
140
|
+
* of MatrixBase::triangularView() and SparseMatrixBase::triangularView(), and most of the time this is the only way it
|
|
141
|
+
* is used.
|
|
142
|
+
*
|
|
143
|
+
* \sa MatrixBase::triangularView()
|
|
144
|
+
*/
|
|
168
145
|
namespace internal {
|
|
169
|
-
template<typename MatrixType, unsigned int
|
|
170
|
-
struct traits<TriangularView<MatrixType,
|
|
171
|
-
{
|
|
146
|
+
template <typename MatrixType, unsigned int Mode_>
|
|
147
|
+
struct traits<TriangularView<MatrixType, Mode_>> : traits<MatrixType> {
|
|
172
148
|
typedef typename ref_selector<MatrixType>::non_const_type MatrixTypeNested;
|
|
173
|
-
typedef
|
|
174
|
-
typedef
|
|
149
|
+
typedef std::remove_reference_t<MatrixTypeNested> MatrixTypeNestedNonRef;
|
|
150
|
+
typedef remove_all_t<MatrixTypeNested> MatrixTypeNestedCleaned;
|
|
175
151
|
typedef typename MatrixType::PlainObject FullMatrixType;
|
|
176
152
|
typedef MatrixType ExpressionType;
|
|
177
153
|
enum {
|
|
178
|
-
Mode =
|
|
154
|
+
Mode = Mode_,
|
|
179
155
|
FlagsLvalueBit = is_lvalue<MatrixType>::value ? LvalueBit : 0,
|
|
180
|
-
Flags = (MatrixTypeNestedCleaned::Flags & (HereditaryBits | FlagsLvalueBit) &
|
|
156
|
+
Flags = (MatrixTypeNestedCleaned::Flags & (HereditaryBits | FlagsLvalueBit) &
|
|
157
|
+
(~(PacketAccessBit | DirectAccessBit | LinearAccessBit)))
|
|
181
158
|
};
|
|
182
159
|
};
|
|
183
|
-
}
|
|
160
|
+
} // namespace internal
|
|
184
161
|
|
|
185
|
-
template<typename
|
|
186
|
-
|
|
187
|
-
template<typename _MatrixType, unsigned int _Mode> class TriangularView
|
|
188
|
-
: public TriangularViewImpl<_MatrixType, _Mode, typename internal::traits<_MatrixType>::StorageKind >
|
|
189
|
-
{
|
|
190
|
-
public:
|
|
191
|
-
|
|
192
|
-
typedef TriangularViewImpl<_MatrixType, _Mode, typename internal::traits<_MatrixType>::StorageKind > Base;
|
|
193
|
-
typedef typename internal::traits<TriangularView>::Scalar Scalar;
|
|
194
|
-
typedef _MatrixType MatrixType;
|
|
195
|
-
|
|
196
|
-
protected:
|
|
197
|
-
typedef typename internal::traits<TriangularView>::MatrixTypeNested MatrixTypeNested;
|
|
198
|
-
typedef typename internal::traits<TriangularView>::MatrixTypeNestedNonRef MatrixTypeNestedNonRef;
|
|
199
|
-
|
|
200
|
-
typedef typename internal::remove_all<typename MatrixType::ConjugateReturnType>::type MatrixConjugateReturnType;
|
|
201
|
-
typedef TriangularView<typename internal::add_const<MatrixType>::type, _Mode> ConstTriangularView;
|
|
202
|
-
|
|
203
|
-
public:
|
|
204
|
-
|
|
205
|
-
typedef typename internal::traits<TriangularView>::StorageKind StorageKind;
|
|
206
|
-
typedef typename internal::traits<TriangularView>::MatrixTypeNestedCleaned NestedExpression;
|
|
207
|
-
|
|
208
|
-
enum {
|
|
209
|
-
Mode = _Mode,
|
|
210
|
-
Flags = internal::traits<TriangularView>::Flags,
|
|
211
|
-
TransposeMode = (Mode & Upper ? Lower : 0)
|
|
212
|
-
| (Mode & Lower ? Upper : 0)
|
|
213
|
-
| (Mode & (UnitDiag))
|
|
214
|
-
| (Mode & (ZeroDiag)),
|
|
215
|
-
IsVectorAtCompileTime = false
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
EIGEN_DEVICE_FUNC
|
|
219
|
-
explicit inline TriangularView(MatrixType& matrix) : m_matrix(matrix)
|
|
220
|
-
{}
|
|
221
|
-
|
|
222
|
-
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(TriangularView)
|
|
223
|
-
|
|
224
|
-
/** \copydoc EigenBase::rows() */
|
|
225
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
226
|
-
inline Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); }
|
|
227
|
-
/** \copydoc EigenBase::cols() */
|
|
228
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
229
|
-
inline Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); }
|
|
230
|
-
|
|
231
|
-
/** \returns a const reference to the nested expression */
|
|
232
|
-
EIGEN_DEVICE_FUNC
|
|
233
|
-
const NestedExpression& nestedExpression() const { return m_matrix; }
|
|
234
|
-
|
|
235
|
-
/** \returns a reference to the nested expression */
|
|
236
|
-
EIGEN_DEVICE_FUNC
|
|
237
|
-
NestedExpression& nestedExpression() { return m_matrix; }
|
|
238
|
-
|
|
239
|
-
typedef TriangularView<const MatrixConjugateReturnType,Mode> ConjugateReturnType;
|
|
240
|
-
/** \sa MatrixBase::conjugate() const */
|
|
241
|
-
EIGEN_DEVICE_FUNC
|
|
242
|
-
inline const ConjugateReturnType conjugate() const
|
|
243
|
-
{ return ConjugateReturnType(m_matrix.conjugate()); }
|
|
244
|
-
|
|
245
|
-
/** \returns an expression of the complex conjugate of \c *this if Cond==true,
|
|
246
|
-
* returns \c *this otherwise.
|
|
247
|
-
*/
|
|
248
|
-
template<bool Cond>
|
|
249
|
-
EIGEN_DEVICE_FUNC
|
|
250
|
-
inline typename internal::conditional<Cond,ConjugateReturnType,ConstTriangularView>::type
|
|
251
|
-
conjugateIf() const
|
|
252
|
-
{
|
|
253
|
-
typedef typename internal::conditional<Cond,ConjugateReturnType,ConstTriangularView>::type ReturnType;
|
|
254
|
-
return ReturnType(m_matrix.template conjugateIf<Cond>());
|
|
255
|
-
}
|
|
162
|
+
template <typename MatrixType_, unsigned int Mode_, typename StorageKind>
|
|
163
|
+
class TriangularViewImpl;
|
|
256
164
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
/** \sa MatrixBase::transpose() */
|
|
265
|
-
EIGEN_DEVICE_FUNC
|
|
266
|
-
inline TransposeReturnType transpose()
|
|
267
|
-
{
|
|
268
|
-
EIGEN_STATIC_ASSERT_LVALUE(MatrixType)
|
|
269
|
-
typename MatrixType::TransposeReturnType tmp(m_matrix);
|
|
270
|
-
return TransposeReturnType(tmp);
|
|
271
|
-
}
|
|
165
|
+
template <typename MatrixType_, unsigned int Mode_>
|
|
166
|
+
class TriangularView
|
|
167
|
+
: public TriangularViewImpl<MatrixType_, Mode_, typename internal::traits<MatrixType_>::StorageKind> {
|
|
168
|
+
public:
|
|
169
|
+
typedef TriangularViewImpl<MatrixType_, Mode_, typename internal::traits<MatrixType_>::StorageKind> Base;
|
|
170
|
+
typedef typename internal::traits<TriangularView>::Scalar Scalar;
|
|
171
|
+
typedef MatrixType_ MatrixType;
|
|
272
172
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
inline const ConstTransposeReturnType transpose() const
|
|
277
|
-
{
|
|
278
|
-
return ConstTransposeReturnType(m_matrix.transpose());
|
|
279
|
-
}
|
|
173
|
+
protected:
|
|
174
|
+
typedef typename internal::traits<TriangularView>::MatrixTypeNested MatrixTypeNested;
|
|
175
|
+
typedef typename internal::traits<TriangularView>::MatrixTypeNestedNonRef MatrixTypeNestedNonRef;
|
|
280
176
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
inline const Solve<TriangularView, Other>
|
|
284
|
-
solve(const MatrixBase<Other>& other) const
|
|
285
|
-
{ return Solve<TriangularView, Other>(*this, other.derived()); }
|
|
286
|
-
|
|
287
|
-
// workaround MSVC ICE
|
|
288
|
-
#if EIGEN_COMP_MSVC
|
|
289
|
-
template<int Side, typename Other>
|
|
290
|
-
EIGEN_DEVICE_FUNC
|
|
291
|
-
inline const internal::triangular_solve_retval<Side,TriangularView, Other>
|
|
292
|
-
solve(const MatrixBase<Other>& other) const
|
|
293
|
-
{ return Base::template solve<Side>(other); }
|
|
294
|
-
#else
|
|
295
|
-
using Base::solve;
|
|
296
|
-
#endif
|
|
297
|
-
|
|
298
|
-
/** \returns a selfadjoint view of the referenced triangular part which must be either \c #Upper or \c #Lower.
|
|
299
|
-
*
|
|
300
|
-
* This is a shortcut for \code this->nestedExpression().selfadjointView<(*this)::Mode>() \endcode
|
|
301
|
-
* \sa MatrixBase::selfadjointView() */
|
|
302
|
-
EIGEN_DEVICE_FUNC
|
|
303
|
-
SelfAdjointView<MatrixTypeNestedNonRef,Mode> selfadjointView()
|
|
304
|
-
{
|
|
305
|
-
EIGEN_STATIC_ASSERT((Mode&(UnitDiag|ZeroDiag))==0,PROGRAMMING_ERROR);
|
|
306
|
-
return SelfAdjointView<MatrixTypeNestedNonRef,Mode>(m_matrix);
|
|
307
|
-
}
|
|
177
|
+
typedef internal::remove_all_t<typename MatrixType::ConjugateReturnType> MatrixConjugateReturnType;
|
|
178
|
+
typedef TriangularView<std::add_const_t<MatrixType>, Mode_> ConstTriangularView;
|
|
308
179
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
{
|
|
313
|
-
EIGEN_STATIC_ASSERT((Mode&(UnitDiag|ZeroDiag))==0,PROGRAMMING_ERROR);
|
|
314
|
-
return SelfAdjointView<MatrixTypeNestedNonRef,Mode>(m_matrix);
|
|
315
|
-
}
|
|
180
|
+
public:
|
|
181
|
+
typedef typename internal::traits<TriangularView>::StorageKind StorageKind;
|
|
182
|
+
typedef typename internal::traits<TriangularView>::MatrixTypeNestedCleaned NestedExpression;
|
|
316
183
|
|
|
184
|
+
enum {
|
|
185
|
+
Mode = Mode_,
|
|
186
|
+
Flags = internal::traits<TriangularView>::Flags,
|
|
187
|
+
TransposeMode = (int(Mode) & int(Upper) ? Lower : 0) | (int(Mode) & int(Lower) ? Upper : 0) |
|
|
188
|
+
(int(Mode) & int(UnitDiag)) | (int(Mode) & int(ZeroDiag)),
|
|
189
|
+
IsVectorAtCompileTime = false
|
|
190
|
+
};
|
|
317
191
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
192
|
+
EIGEN_DEVICE_FUNC explicit inline TriangularView(MatrixType& matrix) : m_matrix(matrix) {}
|
|
193
|
+
|
|
194
|
+
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(TriangularView)
|
|
195
|
+
|
|
196
|
+
/** \copydoc EigenBase::rows() */
|
|
197
|
+
EIGEN_DEVICE_FUNC constexpr Index rows() const noexcept { return m_matrix.rows(); }
|
|
198
|
+
/** \copydoc EigenBase::cols() */
|
|
199
|
+
EIGEN_DEVICE_FUNC constexpr Index cols() const noexcept { return m_matrix.cols(); }
|
|
200
|
+
|
|
201
|
+
/** \returns a const reference to the nested expression */
|
|
202
|
+
EIGEN_DEVICE_FUNC const NestedExpression& nestedExpression() const { return m_matrix; }
|
|
203
|
+
|
|
204
|
+
/** \returns a reference to the nested expression */
|
|
205
|
+
EIGEN_DEVICE_FUNC NestedExpression& nestedExpression() { return m_matrix; }
|
|
206
|
+
|
|
207
|
+
typedef TriangularView<const MatrixConjugateReturnType, Mode> ConjugateReturnType;
|
|
208
|
+
/** \sa MatrixBase::conjugate() const */
|
|
209
|
+
EIGEN_DEVICE_FUNC inline const ConjugateReturnType conjugate() const {
|
|
210
|
+
return ConjugateReturnType(m_matrix.conjugate());
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/** \returns an expression of the complex conjugate of \c *this if Cond==true,
|
|
214
|
+
* returns \c *this otherwise.
|
|
215
|
+
*/
|
|
216
|
+
template <bool Cond>
|
|
217
|
+
EIGEN_DEVICE_FUNC inline std::conditional_t<Cond, ConjugateReturnType, ConstTriangularView> conjugateIf() const {
|
|
218
|
+
typedef std::conditional_t<Cond, ConjugateReturnType, ConstTriangularView> ReturnType;
|
|
219
|
+
return ReturnType(m_matrix.template conjugateIf<Cond>());
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
typedef TriangularView<const typename MatrixType::AdjointReturnType, TransposeMode> AdjointReturnType;
|
|
223
|
+
/** \sa MatrixBase::adjoint() const */
|
|
224
|
+
EIGEN_DEVICE_FUNC inline const AdjointReturnType adjoint() const { return AdjointReturnType(m_matrix.adjoint()); }
|
|
225
|
+
|
|
226
|
+
typedef TriangularView<typename MatrixType::TransposeReturnType, TransposeMode> TransposeReturnType;
|
|
227
|
+
/** \sa MatrixBase::transpose() */
|
|
228
|
+
template <class Dummy = int>
|
|
229
|
+
EIGEN_DEVICE_FUNC inline TransposeReturnType transpose(
|
|
230
|
+
std::enable_if_t<Eigen::internal::is_lvalue<MatrixType>::value, Dummy*> = nullptr) {
|
|
231
|
+
typename MatrixType::TransposeReturnType tmp(m_matrix);
|
|
232
|
+
return TransposeReturnType(tmp);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
typedef TriangularView<const typename MatrixType::ConstTransposeReturnType, TransposeMode> ConstTransposeReturnType;
|
|
236
|
+
/** \sa MatrixBase::transpose() const */
|
|
237
|
+
EIGEN_DEVICE_FUNC inline const ConstTransposeReturnType transpose() const {
|
|
238
|
+
return ConstTransposeReturnType(m_matrix.transpose());
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
template <typename Other>
|
|
242
|
+
EIGEN_DEVICE_FUNC inline const Solve<TriangularView, Other> solve(const MatrixBase<Other>& other) const {
|
|
243
|
+
return Solve<TriangularView, Other>(*this, other.derived());
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// workaround MSVC ICE
|
|
247
|
+
#if EIGEN_COMP_MSVC
|
|
248
|
+
template <int Side, typename Other>
|
|
249
|
+
EIGEN_DEVICE_FUNC inline const internal::triangular_solve_retval<Side, TriangularView, Other> solve(
|
|
250
|
+
const MatrixBase<Other>& other) const {
|
|
251
|
+
return Base::template solve<Side>(other);
|
|
252
|
+
}
|
|
253
|
+
#else
|
|
254
|
+
using Base::solve;
|
|
255
|
+
#endif
|
|
256
|
+
|
|
257
|
+
/** \returns a selfadjoint view of the referenced triangular part which must be either \c #Upper or \c #Lower.
|
|
258
|
+
*
|
|
259
|
+
* This is a shortcut for \code this->nestedExpression().selfadjointView<(*this)::Mode>() \endcode
|
|
260
|
+
* \sa MatrixBase::selfadjointView() */
|
|
261
|
+
EIGEN_DEVICE_FUNC SelfAdjointView<MatrixTypeNestedNonRef, Mode> selfadjointView() {
|
|
262
|
+
EIGEN_STATIC_ASSERT((Mode & (UnitDiag | ZeroDiag)) == 0, PROGRAMMING_ERROR);
|
|
263
|
+
return SelfAdjointView<MatrixTypeNestedNonRef, Mode>(m_matrix);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/** This is the const version of selfadjointView() */
|
|
267
|
+
EIGEN_DEVICE_FUNC const SelfAdjointView<MatrixTypeNestedNonRef, Mode> selfadjointView() const {
|
|
268
|
+
EIGEN_STATIC_ASSERT((Mode & (UnitDiag | ZeroDiag)) == 0, PROGRAMMING_ERROR);
|
|
269
|
+
return SelfAdjointView<MatrixTypeNestedNonRef, Mode>(m_matrix);
|
|
270
|
+
}
|
|
330
271
|
|
|
331
|
-
|
|
272
|
+
/** \returns the determinant of the triangular matrix
|
|
273
|
+
* \sa MatrixBase::determinant() */
|
|
274
|
+
EIGEN_DEVICE_FUNC Scalar determinant() const {
|
|
275
|
+
if (Mode & UnitDiag)
|
|
276
|
+
return 1;
|
|
277
|
+
else if (Mode & ZeroDiag)
|
|
278
|
+
return 0;
|
|
279
|
+
else
|
|
280
|
+
return m_matrix.diagonal().prod();
|
|
281
|
+
}
|
|
332
282
|
|
|
333
|
-
|
|
283
|
+
protected:
|
|
284
|
+
MatrixTypeNested m_matrix;
|
|
334
285
|
};
|
|
335
286
|
|
|
336
287
|
/** \ingroup Core_Module
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
template<typename
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
template<typename Other>
|
|
387
|
-
EIGEN_DEVICE_FUNC
|
|
388
|
-
TriangularViewType& operator-=(const DenseBase<Other>& other) {
|
|
389
|
-
internal::call_assignment_no_alias(derived(), other.derived(), internal::sub_assign_op<Scalar,typename Other::Scalar>());
|
|
390
|
-
return derived();
|
|
391
|
-
}
|
|
288
|
+
*
|
|
289
|
+
* \brief Base class for a triangular part in a \b dense matrix
|
|
290
|
+
*
|
|
291
|
+
* This class is an abstract base class of class TriangularView, and objects of type TriangularViewImpl cannot be
|
|
292
|
+
* instantiated. It extends class TriangularView with additional methods which available for dense expressions only.
|
|
293
|
+
*
|
|
294
|
+
* \sa class TriangularView, MatrixBase::triangularView()
|
|
295
|
+
*/
|
|
296
|
+
template <typename MatrixType_, unsigned int Mode_>
|
|
297
|
+
class TriangularViewImpl<MatrixType_, Mode_, Dense> : public TriangularBase<TriangularView<MatrixType_, Mode_>> {
|
|
298
|
+
public:
|
|
299
|
+
typedef TriangularView<MatrixType_, Mode_> TriangularViewType;
|
|
300
|
+
|
|
301
|
+
typedef TriangularBase<TriangularViewType> Base;
|
|
302
|
+
typedef typename internal::traits<TriangularViewType>::Scalar Scalar;
|
|
303
|
+
|
|
304
|
+
typedef MatrixType_ MatrixType;
|
|
305
|
+
typedef typename MatrixType::PlainObject DenseMatrixType;
|
|
306
|
+
typedef DenseMatrixType PlainObject;
|
|
307
|
+
|
|
308
|
+
public:
|
|
309
|
+
using Base::derived;
|
|
310
|
+
using Base::evalToLazy;
|
|
311
|
+
|
|
312
|
+
typedef typename internal::traits<TriangularViewType>::StorageKind StorageKind;
|
|
313
|
+
|
|
314
|
+
enum { Mode = Mode_, Flags = internal::traits<TriangularViewType>::Flags };
|
|
315
|
+
|
|
316
|
+
/** \returns the outer-stride of the underlying dense matrix
|
|
317
|
+
* \sa DenseCoeffsBase::outerStride() */
|
|
318
|
+
EIGEN_DEVICE_FUNC inline Index outerStride() const { return derived().nestedExpression().outerStride(); }
|
|
319
|
+
/** \returns the inner-stride of the underlying dense matrix
|
|
320
|
+
* \sa DenseCoeffsBase::innerStride() */
|
|
321
|
+
EIGEN_DEVICE_FUNC inline Index innerStride() const { return derived().nestedExpression().innerStride(); }
|
|
322
|
+
|
|
323
|
+
/** \sa MatrixBase::operator+=() */
|
|
324
|
+
template <typename Other>
|
|
325
|
+
EIGEN_DEVICE_FUNC TriangularViewType& operator+=(const DenseBase<Other>& other) {
|
|
326
|
+
internal::call_assignment_no_alias(derived(), other.derived(),
|
|
327
|
+
internal::add_assign_op<Scalar, typename Other::Scalar>());
|
|
328
|
+
return derived();
|
|
329
|
+
}
|
|
330
|
+
/** \sa MatrixBase::operator-=() */
|
|
331
|
+
template <typename Other>
|
|
332
|
+
EIGEN_DEVICE_FUNC TriangularViewType& operator-=(const DenseBase<Other>& other) {
|
|
333
|
+
internal::call_assignment_no_alias(derived(), other.derived(),
|
|
334
|
+
internal::sub_assign_op<Scalar, typename Other::Scalar>());
|
|
335
|
+
return derived();
|
|
336
|
+
}
|
|
392
337
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
EIGEN_DEVICE_FUNC
|
|
402
|
-
void fill(const Scalar& value) { setConstant(value); }
|
|
403
|
-
/** \sa MatrixBase::setConstant() */
|
|
404
|
-
EIGEN_DEVICE_FUNC
|
|
405
|
-
TriangularViewType& setConstant(const Scalar& value)
|
|
406
|
-
{ return *this = MatrixType::Constant(derived().rows(), derived().cols(), value); }
|
|
407
|
-
/** \sa MatrixBase::setZero() */
|
|
408
|
-
EIGEN_DEVICE_FUNC
|
|
409
|
-
TriangularViewType& setZero() { return setConstant(Scalar(0)); }
|
|
410
|
-
/** \sa MatrixBase::setOnes() */
|
|
411
|
-
EIGEN_DEVICE_FUNC
|
|
412
|
-
TriangularViewType& setOnes() { return setConstant(Scalar(1)); }
|
|
413
|
-
|
|
414
|
-
/** \sa MatrixBase::coeff()
|
|
415
|
-
* \warning the coordinates must fit into the referenced triangular part
|
|
416
|
-
*/
|
|
417
|
-
EIGEN_DEVICE_FUNC
|
|
418
|
-
inline Scalar coeff(Index row, Index col) const
|
|
419
|
-
{
|
|
420
|
-
Base::check_coordinates_internal(row, col);
|
|
421
|
-
return derived().nestedExpression().coeff(row, col);
|
|
422
|
-
}
|
|
338
|
+
/** \sa MatrixBase::operator*=() */
|
|
339
|
+
EIGEN_DEVICE_FUNC TriangularViewType& operator*=(const typename internal::traits<MatrixType>::Scalar& other) {
|
|
340
|
+
return *this = derived().nestedExpression() * other;
|
|
341
|
+
}
|
|
342
|
+
/** \sa DenseBase::operator/=() */
|
|
343
|
+
EIGEN_DEVICE_FUNC TriangularViewType& operator/=(const typename internal::traits<MatrixType>::Scalar& other) {
|
|
344
|
+
return *this = derived().nestedExpression() / other;
|
|
345
|
+
}
|
|
423
346
|
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
347
|
+
/** \sa MatrixBase::fill() */
|
|
348
|
+
EIGEN_DEVICE_FUNC void fill(const Scalar& value) { setConstant(value); }
|
|
349
|
+
/** \sa MatrixBase::setConstant() */
|
|
350
|
+
EIGEN_DEVICE_FUNC TriangularViewType& setConstant(const Scalar& value) {
|
|
351
|
+
return *this = MatrixType::Constant(derived().rows(), derived().cols(), value);
|
|
352
|
+
}
|
|
353
|
+
/** \sa MatrixBase::setZero() */
|
|
354
|
+
EIGEN_DEVICE_FUNC TriangularViewType& setZero() { return setConstant(Scalar(0)); }
|
|
355
|
+
/** \sa MatrixBase::setOnes() */
|
|
356
|
+
EIGEN_DEVICE_FUNC TriangularViewType& setOnes() { return setConstant(Scalar(1)); }
|
|
357
|
+
|
|
358
|
+
/** \sa MatrixBase::coeff()
|
|
359
|
+
* \warning the coordinates must fit into the referenced triangular part
|
|
360
|
+
*/
|
|
361
|
+
EIGEN_DEVICE_FUNC inline Scalar coeff(Index row, Index col) const {
|
|
362
|
+
Base::check_coordinates_internal(row, col);
|
|
363
|
+
return derived().nestedExpression().coeff(row, col);
|
|
364
|
+
}
|
|
434
365
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
366
|
+
/** \sa MatrixBase::coeffRef()
|
|
367
|
+
* \warning the coordinates must fit into the referenced triangular part
|
|
368
|
+
*/
|
|
369
|
+
EIGEN_DEVICE_FUNC inline Scalar& coeffRef(Index row, Index col) {
|
|
370
|
+
EIGEN_STATIC_ASSERT_LVALUE(TriangularViewType);
|
|
371
|
+
Base::check_coordinates_internal(row, col);
|
|
372
|
+
return derived().nestedExpression().coeffRef(row, col);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/** Assigns a triangular matrix to a triangular part of a dense matrix */
|
|
376
|
+
template <typename OtherDerived>
|
|
377
|
+
EIGEN_DEVICE_FUNC TriangularViewType& operator=(const TriangularBase<OtherDerived>& other);
|
|
439
378
|
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
TriangularViewType& operator=(const MatrixBase<OtherDerived>& other);
|
|
379
|
+
/** Shortcut for\code *this = other.other.triangularView<(*this)::Mode>() \endcode */
|
|
380
|
+
template <typename OtherDerived>
|
|
381
|
+
EIGEN_DEVICE_FUNC TriangularViewType& operator=(const MatrixBase<OtherDerived>& other);
|
|
444
382
|
|
|
445
383
|
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
EIGEN_DEPRECATED EIGEN_DEVICE_FUNC
|
|
458
|
-
void lazyAssign(const MatrixBase<OtherDerived>& other);
|
|
384
|
+
EIGEN_DEVICE_FUNC TriangularViewType& operator=(const TriangularViewImpl& other) {
|
|
385
|
+
return *this = other.derived().nestedExpression();
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
template <typename OtherDerived>
|
|
389
|
+
/** \deprecated */
|
|
390
|
+
EIGEN_DEPRECATED EIGEN_DEVICE_FUNC void lazyAssign(const TriangularBase<OtherDerived>& other);
|
|
391
|
+
|
|
392
|
+
template <typename OtherDerived>
|
|
393
|
+
/** \deprecated */
|
|
394
|
+
EIGEN_DEPRECATED EIGEN_DEVICE_FUNC void lazyAssign(const MatrixBase<OtherDerived>& other);
|
|
459
395
|
#endif
|
|
460
396
|
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
return Product<TriangularViewType,OtherDerived>(derived(), rhs.derived());
|
|
468
|
-
}
|
|
397
|
+
/** Efficient triangular matrix times vector/matrix product */
|
|
398
|
+
template <typename OtherDerived>
|
|
399
|
+
EIGEN_DEVICE_FUNC const Product<TriangularViewType, OtherDerived> operator*(
|
|
400
|
+
const MatrixBase<OtherDerived>& rhs) const {
|
|
401
|
+
return Product<TriangularViewType, OtherDerived>(derived(), rhs.derived());
|
|
402
|
+
}
|
|
469
403
|
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
404
|
+
/** Efficient vector/matrix times triangular matrix product */
|
|
405
|
+
template <typename OtherDerived>
|
|
406
|
+
friend EIGEN_DEVICE_FUNC const Product<OtherDerived, TriangularViewType> operator*(
|
|
407
|
+
const MatrixBase<OtherDerived>& lhs, const TriangularViewImpl& rhs) {
|
|
408
|
+
return Product<OtherDerived, TriangularViewType>(lhs.derived(), rhs.derived());
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/** \returns the product of the inverse of \c *this with \a other, \a *this being triangular.
|
|
412
|
+
*
|
|
413
|
+
* This function computes the inverse-matrix matrix product inverse(\c *this) * \a other if
|
|
414
|
+
* \a Side==OnTheLeft (the default), or the right-inverse-multiply \a other * inverse(\c *this) if
|
|
415
|
+
* \a Side==OnTheRight.
|
|
416
|
+
*
|
|
417
|
+
* Note that the template parameter \c Side can be omitted, in which case \c Side==OnTheLeft
|
|
418
|
+
*
|
|
419
|
+
* The matrix \c *this must be triangular and invertible (i.e., all the coefficients of the
|
|
420
|
+
* diagonal must be non zero). It works as a forward (resp. backward) substitution if \c *this
|
|
421
|
+
* is an upper (resp. lower) triangular matrix.
|
|
422
|
+
*
|
|
423
|
+
* Example: \include Triangular_solve.cpp
|
|
424
|
+
* Output: \verbinclude Triangular_solve.out
|
|
425
|
+
*
|
|
426
|
+
* This function returns an expression of the inverse-multiply and can works in-place if it is assigned
|
|
427
|
+
* to the same matrix or vector \a other.
|
|
428
|
+
*
|
|
429
|
+
* For users coming from BLAS, this function (and more specifically solveInPlace()) offer
|
|
430
|
+
* all the operations supported by the \c *TRSV and \c *TRSM BLAS routines.
|
|
431
|
+
*
|
|
432
|
+
* \sa TriangularView::solveInPlace()
|
|
433
|
+
*/
|
|
434
|
+
template <int Side, typename Other>
|
|
435
|
+
inline const internal::triangular_solve_retval<Side, TriangularViewType, Other> solve(
|
|
436
|
+
const MatrixBase<Other>& other) const;
|
|
437
|
+
|
|
438
|
+
/** "in-place" version of TriangularView::solve() where the result is written in \a other
|
|
439
|
+
*
|
|
440
|
+
* \warning The parameter is only marked 'const' to make the C++ compiler accept a temporary expression here.
|
|
441
|
+
* This function will const_cast it, so constness isn't honored here.
|
|
442
|
+
*
|
|
443
|
+
* Note that the template parameter \c Side can be omitted, in which case \c Side==OnTheLeft
|
|
444
|
+
*
|
|
445
|
+
* See TriangularView:solve() for the details.
|
|
446
|
+
*/
|
|
447
|
+
template <int Side, typename OtherDerived>
|
|
448
|
+
EIGEN_DEVICE_FUNC void solveInPlace(const MatrixBase<OtherDerived>& other) const;
|
|
449
|
+
|
|
450
|
+
template <typename OtherDerived>
|
|
451
|
+
EIGEN_DEVICE_FUNC void solveInPlace(const MatrixBase<OtherDerived>& other) const {
|
|
452
|
+
return solveInPlace<OnTheLeft>(other);
|
|
453
|
+
}
|
|
478
454
|
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
* \a Side==OnTheLeft (the default), or the right-inverse-multiply \a other * inverse(\c *this) if
|
|
483
|
-
* \a Side==OnTheRight.
|
|
484
|
-
*
|
|
485
|
-
* Note that the template parameter \c Side can be omitted, in which case \c Side==OnTheLeft
|
|
486
|
-
*
|
|
487
|
-
* The matrix \c *this must be triangular and invertible (i.e., all the coefficients of the
|
|
488
|
-
* diagonal must be non zero). It works as a forward (resp. backward) substitution if \c *this
|
|
489
|
-
* is an upper (resp. lower) triangular matrix.
|
|
490
|
-
*
|
|
491
|
-
* Example: \include Triangular_solve.cpp
|
|
492
|
-
* Output: \verbinclude Triangular_solve.out
|
|
493
|
-
*
|
|
494
|
-
* This function returns an expression of the inverse-multiply and can works in-place if it is assigned
|
|
495
|
-
* to the same matrix or vector \a other.
|
|
496
|
-
*
|
|
497
|
-
* For users coming from BLAS, this function (and more specifically solveInPlace()) offer
|
|
498
|
-
* all the operations supported by the \c *TRSV and \c *TRSM BLAS routines.
|
|
499
|
-
*
|
|
500
|
-
* \sa TriangularView::solveInPlace()
|
|
501
|
-
*/
|
|
502
|
-
template<int Side, typename Other>
|
|
503
|
-
inline const internal::triangular_solve_retval<Side,TriangularViewType, Other>
|
|
504
|
-
solve(const MatrixBase<Other>& other) const;
|
|
505
|
-
|
|
506
|
-
/** "in-place" version of TriangularView::solve() where the result is written in \a other
|
|
507
|
-
*
|
|
508
|
-
* \warning The parameter is only marked 'const' to make the C++ compiler accept a temporary expression here.
|
|
509
|
-
* This function will const_cast it, so constness isn't honored here.
|
|
510
|
-
*
|
|
511
|
-
* Note that the template parameter \c Side can be omitted, in which case \c Side==OnTheLeft
|
|
512
|
-
*
|
|
513
|
-
* See TriangularView:solve() for the details.
|
|
514
|
-
*/
|
|
515
|
-
template<int Side, typename OtherDerived>
|
|
516
|
-
EIGEN_DEVICE_FUNC
|
|
517
|
-
void solveInPlace(const MatrixBase<OtherDerived>& other) const;
|
|
518
|
-
|
|
519
|
-
template<typename OtherDerived>
|
|
520
|
-
EIGEN_DEVICE_FUNC
|
|
521
|
-
void solveInPlace(const MatrixBase<OtherDerived>& other) const
|
|
522
|
-
{ return solveInPlace<OnTheLeft>(other); }
|
|
523
|
-
|
|
524
|
-
/** Swaps the coefficients of the common triangular parts of two matrices */
|
|
525
|
-
template<typename OtherDerived>
|
|
526
|
-
EIGEN_DEVICE_FUNC
|
|
455
|
+
/** Swaps the coefficients of the common triangular parts of two matrices */
|
|
456
|
+
template <typename OtherDerived>
|
|
457
|
+
EIGEN_DEVICE_FUNC
|
|
527
458
|
#ifdef EIGEN_PARSED_BY_DOXYGEN
|
|
528
|
-
|
|
459
|
+
void
|
|
460
|
+
swap(TriangularBase<OtherDerived>& other)
|
|
529
461
|
#else
|
|
530
|
-
|
|
462
|
+
void
|
|
463
|
+
swap(TriangularBase<OtherDerived> const& other)
|
|
531
464
|
#endif
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
465
|
+
{
|
|
466
|
+
EIGEN_STATIC_ASSERT_LVALUE(OtherDerived);
|
|
467
|
+
call_assignment(derived(), other.const_cast_derived(), internal::swap_assign_op<Scalar>());
|
|
468
|
+
}
|
|
536
469
|
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
call_assignment(derived(), other.const_cast_derived(), internal::swap_assign_op<Scalar>());
|
|
545
|
-
}
|
|
470
|
+
/** Shortcut for \code (*this).swap(other.triangularView<(*this)::Mode>()) \endcode */
|
|
471
|
+
template <typename OtherDerived>
|
|
472
|
+
/** \deprecated */
|
|
473
|
+
EIGEN_DEPRECATED EIGEN_DEVICE_FUNC void swap(MatrixBase<OtherDerived> const& other) {
|
|
474
|
+
EIGEN_STATIC_ASSERT_LVALUE(OtherDerived);
|
|
475
|
+
call_assignment(derived(), other.const_cast_derived(), internal::swap_assign_op<Scalar>());
|
|
476
|
+
}
|
|
546
477
|
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
this->solveInPlace(dst);
|
|
553
|
-
}
|
|
478
|
+
template <typename RhsType, typename DstType>
|
|
479
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _solve_impl(const RhsType& rhs, DstType& dst) const {
|
|
480
|
+
if (!internal::is_same_dense(dst, rhs)) dst = rhs;
|
|
481
|
+
this->solveInPlace(dst);
|
|
482
|
+
}
|
|
554
483
|
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
protected:
|
|
559
|
-
EIGEN_DEFAULT_COPY_CONSTRUCTOR(TriangularViewImpl)
|
|
560
|
-
EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(TriangularViewImpl)
|
|
484
|
+
template <typename ProductType>
|
|
485
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TriangularViewType& _assignProduct(const ProductType& prod, const Scalar& alpha,
|
|
486
|
+
bool beta);
|
|
561
487
|
|
|
488
|
+
protected:
|
|
489
|
+
EIGEN_DEFAULT_COPY_CONSTRUCTOR(TriangularViewImpl)
|
|
490
|
+
EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(TriangularViewImpl)
|
|
562
491
|
};
|
|
563
492
|
|
|
564
493
|
/***************************************************************************
|
|
565
|
-
* Implementation of triangular evaluation/assignment
|
|
566
|
-
***************************************************************************/
|
|
494
|
+
* Implementation of triangular evaluation/assignment
|
|
495
|
+
***************************************************************************/
|
|
567
496
|
|
|
568
497
|
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
|
569
498
|
// FIXME should we keep that possibility
|
|
570
|
-
template<typename MatrixType, unsigned int Mode>
|
|
571
|
-
template<typename OtherDerived>
|
|
572
|
-
EIGEN_DEVICE_FUNC inline TriangularView<MatrixType, Mode>&
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
499
|
+
template <typename MatrixType, unsigned int Mode>
|
|
500
|
+
template <typename OtherDerived>
|
|
501
|
+
EIGEN_DEVICE_FUNC inline TriangularView<MatrixType, Mode>& TriangularViewImpl<MatrixType, Mode, Dense>::operator=(
|
|
502
|
+
const MatrixBase<OtherDerived>& other) {
|
|
503
|
+
internal::call_assignment_no_alias(derived(), other.derived(),
|
|
504
|
+
internal::assign_op<Scalar, typename OtherDerived::Scalar>());
|
|
576
505
|
return derived();
|
|
577
506
|
}
|
|
578
507
|
|
|
579
508
|
// FIXME should we keep that possibility
|
|
580
|
-
template<typename MatrixType, unsigned int Mode>
|
|
581
|
-
template<typename OtherDerived>
|
|
582
|
-
EIGEN_DEVICE_FUNC void TriangularViewImpl<MatrixType, Mode, Dense>::lazyAssign(const MatrixBase<OtherDerived>& other)
|
|
583
|
-
{
|
|
509
|
+
template <typename MatrixType, unsigned int Mode>
|
|
510
|
+
template <typename OtherDerived>
|
|
511
|
+
EIGEN_DEVICE_FUNC void TriangularViewImpl<MatrixType, Mode, Dense>::lazyAssign(const MatrixBase<OtherDerived>& other) {
|
|
584
512
|
internal::call_assignment_no_alias(derived(), other.template triangularView<Mode>());
|
|
585
513
|
}
|
|
586
514
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
EIGEN_DEVICE_FUNC inline TriangularView<MatrixType, Mode>&
|
|
592
|
-
TriangularViewImpl<MatrixType, Mode, Dense>::operator=(const TriangularBase<OtherDerived>& other)
|
|
593
|
-
{
|
|
515
|
+
template <typename MatrixType, unsigned int Mode>
|
|
516
|
+
template <typename OtherDerived>
|
|
517
|
+
EIGEN_DEVICE_FUNC inline TriangularView<MatrixType, Mode>& TriangularViewImpl<MatrixType, Mode, Dense>::operator=(
|
|
518
|
+
const TriangularBase<OtherDerived>& other) {
|
|
594
519
|
eigen_assert(Mode == int(OtherDerived::Mode));
|
|
595
520
|
internal::call_assignment(derived(), other.derived());
|
|
596
521
|
return derived();
|
|
597
522
|
}
|
|
598
523
|
|
|
599
|
-
template<typename MatrixType, unsigned int Mode>
|
|
600
|
-
template<typename OtherDerived>
|
|
601
|
-
EIGEN_DEVICE_FUNC void TriangularViewImpl<MatrixType, Mode, Dense>::lazyAssign(
|
|
602
|
-
{
|
|
524
|
+
template <typename MatrixType, unsigned int Mode>
|
|
525
|
+
template <typename OtherDerived>
|
|
526
|
+
EIGEN_DEVICE_FUNC void TriangularViewImpl<MatrixType, Mode, Dense>::lazyAssign(
|
|
527
|
+
const TriangularBase<OtherDerived>& other) {
|
|
603
528
|
eigen_assert(Mode == int(OtherDerived::Mode));
|
|
604
529
|
internal::call_assignment_no_alias(derived(), other.derived());
|
|
605
530
|
}
|
|
606
531
|
#endif
|
|
607
532
|
|
|
608
533
|
/***************************************************************************
|
|
609
|
-
* Implementation of TriangularBase methods
|
|
610
|
-
***************************************************************************/
|
|
534
|
+
* Implementation of TriangularBase methods
|
|
535
|
+
***************************************************************************/
|
|
611
536
|
|
|
612
537
|
/** Assigns a triangular or selfadjoint matrix to a dense matrix.
|
|
613
|
-
|
|
614
|
-
template<typename Derived>
|
|
615
|
-
template<typename DenseDerived>
|
|
616
|
-
EIGEN_DEVICE_FUNC void TriangularBase<Derived>::evalTo(MatrixBase<DenseDerived
|
|
617
|
-
{
|
|
538
|
+
* If the matrix is triangular, the opposite part is set to zero. */
|
|
539
|
+
template <typename Derived>
|
|
540
|
+
template <typename DenseDerived>
|
|
541
|
+
EIGEN_DEVICE_FUNC void TriangularBase<Derived>::evalTo(MatrixBase<DenseDerived>& other) const {
|
|
618
542
|
evalToLazy(other.derived());
|
|
619
543
|
}
|
|
620
544
|
|
|
621
545
|
/***************************************************************************
|
|
622
|
-
* Implementation of TriangularView methods
|
|
623
|
-
***************************************************************************/
|
|
546
|
+
* Implementation of TriangularView methods
|
|
547
|
+
***************************************************************************/
|
|
624
548
|
|
|
625
549
|
/***************************************************************************
|
|
626
|
-
* Implementation of MatrixBase methods
|
|
627
|
-
***************************************************************************/
|
|
550
|
+
* Implementation of MatrixBase methods
|
|
551
|
+
***************************************************************************/
|
|
628
552
|
|
|
629
553
|
/**
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
template<typename Derived>
|
|
641
|
-
template<unsigned int Mode>
|
|
642
|
-
EIGEN_DEVICE_FUNC
|
|
643
|
-
|
|
644
|
-
MatrixBase<Derived>::triangularView()
|
|
645
|
-
{
|
|
554
|
+
* \returns an expression of a triangular view extracted from the current matrix
|
|
555
|
+
*
|
|
556
|
+
* The parameter \a Mode can have the following values: \c #Upper, \c #StrictlyUpper, \c #UnitUpper,
|
|
557
|
+
* \c #Lower, \c #StrictlyLower, \c #UnitLower.
|
|
558
|
+
*
|
|
559
|
+
* Example: \include MatrixBase_triangularView.cpp
|
|
560
|
+
* Output: \verbinclude MatrixBase_triangularView.out
|
|
561
|
+
*
|
|
562
|
+
* \sa class TriangularView
|
|
563
|
+
*/
|
|
564
|
+
template <typename Derived>
|
|
565
|
+
template <unsigned int Mode>
|
|
566
|
+
EIGEN_DEVICE_FUNC typename MatrixBase<Derived>::template TriangularViewReturnType<Mode>::Type
|
|
567
|
+
MatrixBase<Derived>::triangularView() {
|
|
646
568
|
return typename TriangularViewReturnType<Mode>::Type(derived());
|
|
647
569
|
}
|
|
648
570
|
|
|
649
571
|
/** This is the const version of MatrixBase::triangularView() */
|
|
650
|
-
template<typename Derived>
|
|
651
|
-
template<unsigned int Mode>
|
|
652
|
-
EIGEN_DEVICE_FUNC
|
|
653
|
-
|
|
654
|
-
MatrixBase<Derived>::triangularView() const
|
|
655
|
-
{
|
|
572
|
+
template <typename Derived>
|
|
573
|
+
template <unsigned int Mode>
|
|
574
|
+
EIGEN_DEVICE_FUNC typename MatrixBase<Derived>::template ConstTriangularViewReturnType<Mode>::Type
|
|
575
|
+
MatrixBase<Derived>::triangularView() const {
|
|
656
576
|
return typename ConstTriangularViewReturnType<Mode>::Type(derived());
|
|
657
577
|
}
|
|
658
578
|
|
|
659
579
|
/** \returns true if *this is approximately equal to an upper triangular matrix,
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
template<typename Derived>
|
|
665
|
-
bool MatrixBase<Derived>::isUpperTriangular(const RealScalar& prec) const
|
|
666
|
-
{
|
|
580
|
+
* within the precision given by \a prec.
|
|
581
|
+
*
|
|
582
|
+
* \sa isLowerTriangular()
|
|
583
|
+
*/
|
|
584
|
+
template <typename Derived>
|
|
585
|
+
bool MatrixBase<Derived>::isUpperTriangular(const RealScalar& prec) const {
|
|
667
586
|
RealScalar maxAbsOnUpperPart = static_cast<RealScalar>(-1);
|
|
668
|
-
for(Index j = 0; j < cols(); ++j)
|
|
669
|
-
|
|
670
|
-
Index
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
RealScalar absValue = numext::abs(coeff(i,j));
|
|
674
|
-
if(absValue > maxAbsOnUpperPart) maxAbsOnUpperPart = absValue;
|
|
587
|
+
for (Index j = 0; j < cols(); ++j) {
|
|
588
|
+
Index maxi = numext::mini(j, rows() - 1);
|
|
589
|
+
for (Index i = 0; i <= maxi; ++i) {
|
|
590
|
+
RealScalar absValue = numext::abs(coeff(i, j));
|
|
591
|
+
if (absValue > maxAbsOnUpperPart) maxAbsOnUpperPart = absValue;
|
|
675
592
|
}
|
|
676
593
|
}
|
|
677
594
|
RealScalar threshold = maxAbsOnUpperPart * prec;
|
|
678
|
-
for(Index j = 0; j < cols(); ++j)
|
|
679
|
-
for(Index i = j+1; i < rows(); ++i)
|
|
680
|
-
if(numext::abs(coeff(i, j)) > threshold) return false;
|
|
595
|
+
for (Index j = 0; j < cols(); ++j)
|
|
596
|
+
for (Index i = j + 1; i < rows(); ++i)
|
|
597
|
+
if (numext::abs(coeff(i, j)) > threshold) return false;
|
|
681
598
|
return true;
|
|
682
599
|
}
|
|
683
600
|
|
|
684
601
|
/** \returns true if *this is approximately equal to a lower triangular matrix,
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
template<typename Derived>
|
|
690
|
-
bool MatrixBase<Derived>::isLowerTriangular(const RealScalar& prec) const
|
|
691
|
-
{
|
|
602
|
+
* within the precision given by \a prec.
|
|
603
|
+
*
|
|
604
|
+
* \sa isUpperTriangular()
|
|
605
|
+
*/
|
|
606
|
+
template <typename Derived>
|
|
607
|
+
bool MatrixBase<Derived>::isLowerTriangular(const RealScalar& prec) const {
|
|
692
608
|
RealScalar maxAbsOnLowerPart = static_cast<RealScalar>(-1);
|
|
693
|
-
for(Index j = 0; j < cols(); ++j)
|
|
694
|
-
for(Index i = j; i < rows(); ++i)
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
if(absValue > maxAbsOnLowerPart) maxAbsOnLowerPart = absValue;
|
|
609
|
+
for (Index j = 0; j < cols(); ++j)
|
|
610
|
+
for (Index i = j; i < rows(); ++i) {
|
|
611
|
+
RealScalar absValue = numext::abs(coeff(i, j));
|
|
612
|
+
if (absValue > maxAbsOnLowerPart) maxAbsOnLowerPart = absValue;
|
|
698
613
|
}
|
|
699
614
|
RealScalar threshold = maxAbsOnLowerPart * prec;
|
|
700
|
-
for(Index j = 1; j < cols(); ++j)
|
|
701
|
-
|
|
702
|
-
Index
|
|
703
|
-
|
|
704
|
-
if(numext::abs(coeff(i, j)) > threshold) return false;
|
|
615
|
+
for (Index j = 1; j < cols(); ++j) {
|
|
616
|
+
Index maxi = numext::mini(j, rows() - 1);
|
|
617
|
+
for (Index i = 0; i < maxi; ++i)
|
|
618
|
+
if (numext::abs(coeff(i, j)) > threshold) return false;
|
|
705
619
|
}
|
|
706
620
|
return true;
|
|
707
621
|
}
|
|
708
622
|
|
|
709
|
-
|
|
710
623
|
/***************************************************************************
|
|
711
624
|
****************************************************************************
|
|
712
625
|
* Evaluators and Assignment of triangular expressions
|
|
@@ -715,92 +628,85 @@ bool MatrixBase<Derived>::isLowerTriangular(const RealScalar& prec) const
|
|
|
715
628
|
|
|
716
629
|
namespace internal {
|
|
717
630
|
|
|
718
|
-
|
|
719
631
|
// TODO currently a triangular expression has the form TriangularView<.,.>
|
|
720
632
|
// in the future triangular-ness should be defined by the expression traits
|
|
721
|
-
// such that Transpose<TriangularView<.,.> > is valid. (currently TriangularBase::transpose() is overloaded to make
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
{
|
|
633
|
+
// such that Transpose<TriangularView<.,.> > is valid. (currently TriangularBase::transpose() is overloaded to make
|
|
634
|
+
// it work)
|
|
635
|
+
template <typename MatrixType, unsigned int Mode>
|
|
636
|
+
struct evaluator_traits<TriangularView<MatrixType, Mode>> {
|
|
725
637
|
typedef typename storage_kind_to_evaluator_kind<typename MatrixType::StorageKind>::Kind Kind;
|
|
726
638
|
typedef typename glue_shapes<typename evaluator_traits<MatrixType>::Shape, TriangularShape>::type Shape;
|
|
727
639
|
};
|
|
728
640
|
|
|
729
|
-
template<typename MatrixType, unsigned int Mode>
|
|
730
|
-
struct unary_evaluator<TriangularView<MatrixType,Mode>, IndexBased>
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
typedef evaluator<typename internal::remove_all<MatrixType>::type> Base;
|
|
735
|
-
EIGEN_DEVICE_FUNC
|
|
736
|
-
unary_evaluator(const XprType &xpr) : Base(xpr.nestedExpression()) {}
|
|
641
|
+
template <typename MatrixType, unsigned int Mode>
|
|
642
|
+
struct unary_evaluator<TriangularView<MatrixType, Mode>, IndexBased> : evaluator<internal::remove_all_t<MatrixType>> {
|
|
643
|
+
typedef TriangularView<MatrixType, Mode> XprType;
|
|
644
|
+
typedef evaluator<internal::remove_all_t<MatrixType>> Base;
|
|
645
|
+
EIGEN_DEVICE_FUNC unary_evaluator(const XprType& xpr) : Base(xpr.nestedExpression()) {}
|
|
737
646
|
};
|
|
738
647
|
|
|
739
648
|
// Additional assignment kinds:
|
|
740
|
-
struct Triangular2Triangular
|
|
741
|
-
struct Triangular2Dense
|
|
742
|
-
struct Dense2Triangular
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
template<typename Kernel, unsigned int Mode, int UnrollCount, bool ClearOpposite> struct triangular_assignment_loop;
|
|
649
|
+
struct Triangular2Triangular {};
|
|
650
|
+
struct Triangular2Dense {};
|
|
651
|
+
struct Dense2Triangular {};
|
|
746
652
|
|
|
653
|
+
template <typename Kernel, unsigned int Mode, int UnrollCount, bool ClearOpposite>
|
|
654
|
+
struct triangular_assignment_loop;
|
|
747
655
|
|
|
748
656
|
/** \internal Specialization of the dense assignment kernel for triangular matrices.
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
template<int UpLo, int Mode, int SetOpposite, typename DstEvaluatorTypeT, typename SrcEvaluatorTypeT, typename Functor,
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
657
|
+
* The main difference is that the triangular, diagonal, and opposite parts are processed through three different
|
|
658
|
+
* functions. \tparam UpLo must be either Lower or Upper \tparam Mode must be either 0, UnitDiag, ZeroDiag, or
|
|
659
|
+
* SelfAdjoint
|
|
660
|
+
*/
|
|
661
|
+
template <int UpLo, int Mode, int SetOpposite, typename DstEvaluatorTypeT, typename SrcEvaluatorTypeT, typename Functor,
|
|
662
|
+
int Version = Specialized>
|
|
663
|
+
class triangular_dense_assignment_kernel
|
|
664
|
+
: public generic_dense_assignment_kernel<DstEvaluatorTypeT, SrcEvaluatorTypeT, Functor, Version> {
|
|
665
|
+
protected:
|
|
757
666
|
typedef generic_dense_assignment_kernel<DstEvaluatorTypeT, SrcEvaluatorTypeT, Functor, Version> Base;
|
|
758
667
|
typedef typename Base::DstXprType DstXprType;
|
|
759
668
|
typedef typename Base::SrcXprType SrcXprType;
|
|
760
669
|
using Base::m_dst;
|
|
761
|
-
using Base::m_src;
|
|
762
670
|
using Base::m_functor;
|
|
763
|
-
|
|
671
|
+
using Base::m_src;
|
|
764
672
|
|
|
673
|
+
public:
|
|
765
674
|
typedef typename Base::DstEvaluatorType DstEvaluatorType;
|
|
766
675
|
typedef typename Base::SrcEvaluatorType SrcEvaluatorType;
|
|
767
676
|
typedef typename Base::Scalar Scalar;
|
|
768
677
|
typedef typename Base::AssignmentTraits AssignmentTraits;
|
|
769
678
|
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
{}
|
|
679
|
+
EIGEN_DEVICE_FUNC triangular_dense_assignment_kernel(DstEvaluatorType& dst, const SrcEvaluatorType& src,
|
|
680
|
+
const Functor& func, DstXprType& dstExpr)
|
|
681
|
+
: Base(dst, src, func, dstExpr) {}
|
|
774
682
|
|
|
775
683
|
#ifdef EIGEN_INTERNAL_DEBUGGING
|
|
776
|
-
EIGEN_DEVICE_FUNC void assignCoeff(Index row, Index col)
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
Base::assignCoeff(row,col);
|
|
684
|
+
EIGEN_DEVICE_FUNC void assignCoeff(Index row, Index col) {
|
|
685
|
+
eigen_internal_assert(row != col);
|
|
686
|
+
Base::assignCoeff(row, col);
|
|
780
687
|
}
|
|
781
688
|
#else
|
|
782
689
|
using Base::assignCoeff;
|
|
783
690
|
#endif
|
|
784
691
|
|
|
785
|
-
EIGEN_DEVICE_FUNC void assignDiagonalCoeff(Index id)
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
else if(Mode==ZeroDiag && SetOpposite)
|
|
789
|
-
|
|
692
|
+
EIGEN_DEVICE_FUNC void assignDiagonalCoeff(Index id) {
|
|
693
|
+
if (Mode == UnitDiag && SetOpposite)
|
|
694
|
+
m_functor.assignCoeff(m_dst.coeffRef(id, id), Scalar(1));
|
|
695
|
+
else if (Mode == ZeroDiag && SetOpposite)
|
|
696
|
+
m_functor.assignCoeff(m_dst.coeffRef(id, id), Scalar(0));
|
|
697
|
+
else if (Mode == 0)
|
|
698
|
+
Base::assignCoeff(id, id);
|
|
790
699
|
}
|
|
791
700
|
|
|
792
|
-
EIGEN_DEVICE_FUNC void assignOppositeCoeff(Index row, Index col)
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
if(SetOpposite)
|
|
796
|
-
m_functor.assignCoeff(m_dst.coeffRef(row,col), Scalar(0));
|
|
701
|
+
EIGEN_DEVICE_FUNC void assignOppositeCoeff(Index row, Index col) {
|
|
702
|
+
eigen_internal_assert(row != col);
|
|
703
|
+
if (SetOpposite) m_functor.assignCoeff(m_dst.coeffRef(row, col), Scalar(0));
|
|
797
704
|
}
|
|
798
705
|
};
|
|
799
706
|
|
|
800
|
-
template<int Mode, bool SetOpposite, typename DstXprType, typename SrcXprType, typename Functor>
|
|
801
|
-
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
802
|
-
|
|
803
|
-
{
|
|
707
|
+
template <int Mode, bool SetOpposite, typename DstXprType, typename SrcXprType, typename Functor>
|
|
708
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_triangular_assignment_loop(DstXprType& dst, const SrcXprType& src,
|
|
709
|
+
const Functor& func) {
|
|
804
710
|
typedef evaluator<DstXprType> DstEvaluatorType;
|
|
805
711
|
typedef evaluator<SrcXprType> SrcEvaluatorType;
|
|
806
712
|
|
|
@@ -808,194 +714,187 @@ void call_triangular_assignment_loop(DstXprType& dst, const SrcXprType& src, con
|
|
|
808
714
|
|
|
809
715
|
Index dstRows = src.rows();
|
|
810
716
|
Index dstCols = src.cols();
|
|
811
|
-
if((dst.rows()!=dstRows) || (dst.cols()!=dstCols))
|
|
812
|
-
dst.resize(dstRows, dstCols);
|
|
717
|
+
if ((dst.rows() != dstRows) || (dst.cols() != dstCols)) dst.resize(dstRows, dstCols);
|
|
813
718
|
DstEvaluatorType dstEvaluator(dst);
|
|
814
719
|
|
|
815
|
-
typedef triangular_dense_assignment_kernel<
|
|
816
|
-
|
|
720
|
+
typedef triangular_dense_assignment_kernel<Mode&(Lower | Upper), Mode&(UnitDiag | ZeroDiag | SelfAdjoint),
|
|
721
|
+
SetOpposite, DstEvaluatorType, SrcEvaluatorType, Functor>
|
|
722
|
+
Kernel;
|
|
817
723
|
Kernel kernel(dstEvaluator, srcEvaluator, func, dst.const_cast_derived());
|
|
818
724
|
|
|
819
725
|
enum {
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
726
|
+
unroll = DstXprType::SizeAtCompileTime != Dynamic && SrcEvaluatorType::CoeffReadCost < HugeCost &&
|
|
727
|
+
DstXprType::SizeAtCompileTime *
|
|
728
|
+
(int(DstEvaluatorType::CoeffReadCost) + int(SrcEvaluatorType::CoeffReadCost)) / 2 <=
|
|
729
|
+
EIGEN_UNROLLING_LIMIT
|
|
730
|
+
};
|
|
824
731
|
|
|
825
|
-
triangular_assignment_loop<Kernel, Mode, unroll ? int(DstXprType::SizeAtCompileTime) : Dynamic, SetOpposite>::run(
|
|
732
|
+
triangular_assignment_loop<Kernel, Mode, unroll ? int(DstXprType::SizeAtCompileTime) : Dynamic, SetOpposite>::run(
|
|
733
|
+
kernel);
|
|
826
734
|
}
|
|
827
735
|
|
|
828
|
-
template<int Mode, bool SetOpposite, typename DstXprType, typename SrcXprType>
|
|
829
|
-
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
call_triangular_assignment_loop<Mode,SetOpposite>(dst, src, internal::assign_op<typename DstXprType::Scalar,typename SrcXprType::Scalar>());
|
|
736
|
+
template <int Mode, bool SetOpposite, typename DstXprType, typename SrcXprType>
|
|
737
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_triangular_assignment_loop(DstXprType& dst, const SrcXprType& src) {
|
|
738
|
+
call_triangular_assignment_loop<Mode, SetOpposite>(
|
|
739
|
+
dst, src, internal::assign_op<typename DstXprType::Scalar, typename SrcXprType::Scalar>());
|
|
833
740
|
}
|
|
834
741
|
|
|
835
|
-
template<>
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
742
|
+
template <>
|
|
743
|
+
struct AssignmentKind<TriangularShape, TriangularShape> {
|
|
744
|
+
typedef Triangular2Triangular Kind;
|
|
745
|
+
};
|
|
746
|
+
template <>
|
|
747
|
+
struct AssignmentKind<DenseShape, TriangularShape> {
|
|
748
|
+
typedef Triangular2Dense Kind;
|
|
749
|
+
};
|
|
750
|
+
template <>
|
|
751
|
+
struct AssignmentKind<TriangularShape, DenseShape> {
|
|
752
|
+
typedef Dense2Triangular Kind;
|
|
753
|
+
};
|
|
839
754
|
|
|
840
|
-
template<
|
|
841
|
-
struct Assignment<DstXprType, SrcXprType, Functor, Triangular2Triangular>
|
|
842
|
-
{
|
|
843
|
-
EIGEN_DEVICE_FUNC static void run(DstXprType &dst, const SrcXprType &src, const Functor &func)
|
|
844
|
-
{
|
|
755
|
+
template <typename DstXprType, typename SrcXprType, typename Functor>
|
|
756
|
+
struct Assignment<DstXprType, SrcXprType, Functor, Triangular2Triangular> {
|
|
757
|
+
EIGEN_DEVICE_FUNC static void run(DstXprType& dst, const SrcXprType& src, const Functor& func) {
|
|
845
758
|
eigen_assert(int(DstXprType::Mode) == int(SrcXprType::Mode));
|
|
846
759
|
|
|
847
760
|
call_triangular_assignment_loop<DstXprType::Mode, false>(dst, src, func);
|
|
848
761
|
}
|
|
849
762
|
};
|
|
850
763
|
|
|
851
|
-
template<
|
|
852
|
-
struct Assignment<DstXprType, SrcXprType, Functor, Triangular2Dense>
|
|
853
|
-
{
|
|
854
|
-
EIGEN_DEVICE_FUNC static void run(DstXprType &dst, const SrcXprType &src, const Functor &func)
|
|
855
|
-
{
|
|
764
|
+
template <typename DstXprType, typename SrcXprType, typename Functor>
|
|
765
|
+
struct Assignment<DstXprType, SrcXprType, Functor, Triangular2Dense> {
|
|
766
|
+
EIGEN_DEVICE_FUNC static void run(DstXprType& dst, const SrcXprType& src, const Functor& func) {
|
|
856
767
|
call_triangular_assignment_loop<SrcXprType::Mode, (int(SrcXprType::Mode) & int(SelfAdjoint)) == 0>(dst, src, func);
|
|
857
768
|
}
|
|
858
769
|
};
|
|
859
770
|
|
|
860
|
-
template<
|
|
861
|
-
struct Assignment<DstXprType, SrcXprType, Functor, Dense2Triangular>
|
|
862
|
-
{
|
|
863
|
-
EIGEN_DEVICE_FUNC static void run(DstXprType &dst, const SrcXprType &src, const Functor &func)
|
|
864
|
-
{
|
|
771
|
+
template <typename DstXprType, typename SrcXprType, typename Functor>
|
|
772
|
+
struct Assignment<DstXprType, SrcXprType, Functor, Dense2Triangular> {
|
|
773
|
+
EIGEN_DEVICE_FUNC static void run(DstXprType& dst, const SrcXprType& src, const Functor& func) {
|
|
865
774
|
call_triangular_assignment_loop<DstXprType::Mode, false>(dst, src, func);
|
|
866
775
|
}
|
|
867
776
|
};
|
|
868
777
|
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
struct triangular_assignment_loop
|
|
872
|
-
{
|
|
778
|
+
template <typename Kernel, unsigned int Mode, int UnrollCount, bool SetOpposite>
|
|
779
|
+
struct triangular_assignment_loop {
|
|
873
780
|
// FIXME: this is not very clean, perhaps this information should be provided by the kernel?
|
|
874
781
|
typedef typename Kernel::DstEvaluatorType DstEvaluatorType;
|
|
875
782
|
typedef typename DstEvaluatorType::XprType DstXprType;
|
|
876
783
|
|
|
877
784
|
enum {
|
|
878
|
-
col = (UnrollCount-1) / DstXprType::RowsAtCompileTime,
|
|
879
|
-
row = (UnrollCount-1) % DstXprType::RowsAtCompileTime
|
|
785
|
+
col = (UnrollCount - 1) / DstXprType::RowsAtCompileTime,
|
|
786
|
+
row = (UnrollCount - 1) % DstXprType::RowsAtCompileTime
|
|
880
787
|
};
|
|
881
788
|
|
|
882
789
|
typedef typename Kernel::Scalar Scalar;
|
|
883
790
|
|
|
884
|
-
EIGEN_DEVICE_FUNC
|
|
885
|
-
|
|
886
|
-
{
|
|
887
|
-
triangular_assignment_loop<Kernel, Mode, UnrollCount-1, SetOpposite>::run(kernel);
|
|
791
|
+
EIGEN_DEVICE_FUNC static inline void run(Kernel& kernel) {
|
|
792
|
+
triangular_assignment_loop<Kernel, Mode, UnrollCount - 1, SetOpposite>::run(kernel);
|
|
888
793
|
|
|
889
|
-
if(row==col)
|
|
794
|
+
if (row == col)
|
|
890
795
|
kernel.assignDiagonalCoeff(row);
|
|
891
|
-
else if
|
|
892
|
-
kernel.assignCoeff(row,col);
|
|
893
|
-
else if(SetOpposite)
|
|
894
|
-
kernel.assignOppositeCoeff(row,col);
|
|
796
|
+
else if (((Mode & Lower) && row > col) || ((Mode & Upper) && row < col))
|
|
797
|
+
kernel.assignCoeff(row, col);
|
|
798
|
+
else if (SetOpposite)
|
|
799
|
+
kernel.assignOppositeCoeff(row, col);
|
|
895
800
|
}
|
|
896
801
|
};
|
|
897
802
|
|
|
898
803
|
// prevent buggy user code from causing an infinite recursion
|
|
899
|
-
template<typename Kernel, unsigned int Mode, bool SetOpposite>
|
|
900
|
-
struct triangular_assignment_loop<Kernel, Mode, 0, SetOpposite>
|
|
901
|
-
{
|
|
902
|
-
EIGEN_DEVICE_FUNC
|
|
903
|
-
static inline void run(Kernel &) {}
|
|
804
|
+
template <typename Kernel, unsigned int Mode, bool SetOpposite>
|
|
805
|
+
struct triangular_assignment_loop<Kernel, Mode, 0, SetOpposite> {
|
|
806
|
+
EIGEN_DEVICE_FUNC static inline void run(Kernel&) {}
|
|
904
807
|
};
|
|
905
808
|
|
|
906
|
-
|
|
907
|
-
|
|
908
809
|
// TODO: experiment with a recursive assignment procedure splitting the current
|
|
909
810
|
// triangular part into one rectangular and two triangular parts.
|
|
910
811
|
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
struct triangular_assignment_loop<Kernel, Mode, Dynamic, SetOpposite>
|
|
914
|
-
{
|
|
812
|
+
template <typename Kernel, unsigned int Mode, bool SetOpposite>
|
|
813
|
+
struct triangular_assignment_loop<Kernel, Mode, Dynamic, SetOpposite> {
|
|
915
814
|
typedef typename Kernel::Scalar Scalar;
|
|
916
|
-
EIGEN_DEVICE_FUNC
|
|
917
|
-
|
|
918
|
-
{
|
|
919
|
-
for(Index j = 0; j < kernel.cols(); ++j)
|
|
920
|
-
{
|
|
815
|
+
EIGEN_DEVICE_FUNC static inline void run(Kernel& kernel) {
|
|
816
|
+
for (Index j = 0; j < kernel.cols(); ++j) {
|
|
921
817
|
Index maxi = numext::mini(j, kernel.rows());
|
|
922
818
|
Index i = 0;
|
|
923
|
-
if (((Mode&Lower) && SetOpposite) || (Mode&Upper))
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
else
|
|
928
|
-
|
|
929
|
-
else
|
|
819
|
+
if (((Mode & Lower) && SetOpposite) || (Mode & Upper)) {
|
|
820
|
+
for (; i < maxi; ++i)
|
|
821
|
+
if (Mode & Upper)
|
|
822
|
+
kernel.assignCoeff(i, j);
|
|
823
|
+
else
|
|
824
|
+
kernel.assignOppositeCoeff(i, j);
|
|
825
|
+
} else
|
|
930
826
|
i = maxi;
|
|
931
827
|
|
|
932
|
-
if(i<kernel.rows())
|
|
828
|
+
if (i < kernel.rows()) // then i==j
|
|
933
829
|
kernel.assignDiagonalCoeff(i++);
|
|
934
830
|
|
|
935
|
-
if (((Mode&Upper) && SetOpposite) || (Mode&Lower))
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
else
|
|
831
|
+
if (((Mode & Upper) && SetOpposite) || (Mode & Lower)) {
|
|
832
|
+
for (; i < kernel.rows(); ++i)
|
|
833
|
+
if (Mode & Lower)
|
|
834
|
+
kernel.assignCoeff(i, j);
|
|
835
|
+
else
|
|
836
|
+
kernel.assignOppositeCoeff(i, j);
|
|
940
837
|
}
|
|
941
838
|
}
|
|
942
839
|
}
|
|
943
840
|
};
|
|
944
841
|
|
|
945
|
-
}
|
|
842
|
+
} // end namespace internal
|
|
946
843
|
|
|
947
844
|
/** Assigns a triangular or selfadjoint matrix to a dense matrix.
|
|
948
|
-
|
|
949
|
-
template<typename Derived>
|
|
950
|
-
template<typename DenseDerived>
|
|
951
|
-
EIGEN_DEVICE_FUNC void TriangularBase<Derived>::evalToLazy(MatrixBase<DenseDerived
|
|
952
|
-
{
|
|
845
|
+
* If the matrix is triangular, the opposite part is set to zero. */
|
|
846
|
+
template <typename Derived>
|
|
847
|
+
template <typename DenseDerived>
|
|
848
|
+
EIGEN_DEVICE_FUNC void TriangularBase<Derived>::evalToLazy(MatrixBase<DenseDerived>& other) const {
|
|
953
849
|
other.derived().resize(this->rows(), this->cols());
|
|
954
|
-
internal::call_triangular_assignment_loop<Derived::Mode,
|
|
850
|
+
internal::call_triangular_assignment_loop<Derived::Mode,
|
|
851
|
+
(int(Derived::Mode) & int(SelfAdjoint)) == 0 /* SetOpposite */>(
|
|
852
|
+
other.derived(), derived().nestedExpression());
|
|
955
853
|
}
|
|
956
854
|
|
|
957
855
|
namespace internal {
|
|
958
856
|
|
|
959
857
|
// Triangular = Product
|
|
960
|
-
template<
|
|
961
|
-
struct Assignment<DstXprType, Product<Lhs,Rhs,
|
|
962
|
-
{
|
|
963
|
-
typedef Product<Lhs,Rhs,DefaultProduct> SrcXprType;
|
|
964
|
-
static void run(DstXprType
|
|
965
|
-
|
|
858
|
+
template <typename DstXprType, typename Lhs, typename Rhs, typename Scalar>
|
|
859
|
+
struct Assignment<DstXprType, Product<Lhs, Rhs, DefaultProduct>,
|
|
860
|
+
internal::assign_op<Scalar, typename Product<Lhs, Rhs, DefaultProduct>::Scalar>, Dense2Triangular> {
|
|
861
|
+
typedef Product<Lhs, Rhs, DefaultProduct> SrcXprType;
|
|
862
|
+
static void run(DstXprType& dst, const SrcXprType& src,
|
|
863
|
+
const internal::assign_op<Scalar, typename SrcXprType::Scalar>&) {
|
|
966
864
|
Index dstRows = src.rows();
|
|
967
865
|
Index dstCols = src.cols();
|
|
968
|
-
if((dst.rows()!=dstRows) || (dst.cols()!=dstCols))
|
|
969
|
-
dst.resize(dstRows, dstCols);
|
|
866
|
+
if ((dst.rows() != dstRows) || (dst.cols() != dstCols)) dst.resize(dstRows, dstCols);
|
|
970
867
|
|
|
971
868
|
dst._assignProduct(src, Scalar(1), false);
|
|
972
869
|
}
|
|
973
870
|
};
|
|
974
871
|
|
|
975
872
|
// Triangular += Product
|
|
976
|
-
template<
|
|
977
|
-
struct Assignment<DstXprType, Product<Lhs,Rhs,
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
873
|
+
template <typename DstXprType, typename Lhs, typename Rhs, typename Scalar>
|
|
874
|
+
struct Assignment<DstXprType, Product<Lhs, Rhs, DefaultProduct>,
|
|
875
|
+
internal::add_assign_op<Scalar, typename Product<Lhs, Rhs, DefaultProduct>::Scalar>,
|
|
876
|
+
Dense2Triangular> {
|
|
877
|
+
typedef Product<Lhs, Rhs, DefaultProduct> SrcXprType;
|
|
878
|
+
static void run(DstXprType& dst, const SrcXprType& src,
|
|
879
|
+
const internal::add_assign_op<Scalar, typename SrcXprType::Scalar>&) {
|
|
982
880
|
dst._assignProduct(src, Scalar(1), true);
|
|
983
881
|
}
|
|
984
882
|
};
|
|
985
883
|
|
|
986
884
|
// Triangular -= Product
|
|
987
|
-
template<
|
|
988
|
-
struct Assignment<DstXprType, Product<Lhs,Rhs,
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
885
|
+
template <typename DstXprType, typename Lhs, typename Rhs, typename Scalar>
|
|
886
|
+
struct Assignment<DstXprType, Product<Lhs, Rhs, DefaultProduct>,
|
|
887
|
+
internal::sub_assign_op<Scalar, typename Product<Lhs, Rhs, DefaultProduct>::Scalar>,
|
|
888
|
+
Dense2Triangular> {
|
|
889
|
+
typedef Product<Lhs, Rhs, DefaultProduct> SrcXprType;
|
|
890
|
+
static void run(DstXprType& dst, const SrcXprType& src,
|
|
891
|
+
const internal::sub_assign_op<Scalar, typename SrcXprType::Scalar>&) {
|
|
993
892
|
dst._assignProduct(src, Scalar(-1), true);
|
|
994
893
|
}
|
|
995
894
|
};
|
|
996
895
|
|
|
997
|
-
}
|
|
896
|
+
} // end namespace internal
|
|
998
897
|
|
|
999
|
-
}
|
|
898
|
+
} // end namespace Eigen
|
|
1000
899
|
|
|
1001
|
-
#endif
|
|
900
|
+
#endif // EIGEN_TRIANGULARMATRIX_H
|