@smake/eigen 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/eigen/Eigen/AccelerateSupport +52 -0
- package/eigen/Eigen/Cholesky +18 -20
- package/eigen/Eigen/CholmodSupport +28 -28
- package/eigen/Eigen/Core +187 -120
- package/eigen/Eigen/Eigenvalues +16 -13
- package/eigen/Eigen/Geometry +18 -18
- package/eigen/Eigen/Householder +9 -7
- package/eigen/Eigen/IterativeLinearSolvers +8 -4
- package/eigen/Eigen/Jacobi +14 -13
- package/eigen/Eigen/KLUSupport +23 -21
- package/eigen/Eigen/LU +15 -16
- package/eigen/Eigen/MetisSupport +12 -12
- package/eigen/Eigen/OrderingMethods +54 -51
- package/eigen/Eigen/PaStiXSupport +23 -21
- package/eigen/Eigen/PardisoSupport +17 -14
- package/eigen/Eigen/QR +18 -20
- package/eigen/Eigen/QtAlignedMalloc +5 -12
- package/eigen/Eigen/SPQRSupport +21 -14
- package/eigen/Eigen/SVD +23 -17
- package/eigen/Eigen/Sparse +1 -2
- package/eigen/Eigen/SparseCholesky +18 -15
- package/eigen/Eigen/SparseCore +18 -17
- package/eigen/Eigen/SparseLU +9 -9
- package/eigen/Eigen/SparseQR +16 -14
- package/eigen/Eigen/StdDeque +5 -2
- package/eigen/Eigen/StdList +5 -2
- package/eigen/Eigen/StdVector +5 -2
- package/eigen/Eigen/SuperLUSupport +30 -24
- package/eigen/Eigen/ThreadPool +80 -0
- package/eigen/Eigen/UmfPackSupport +19 -17
- package/eigen/Eigen/Version +14 -0
- package/eigen/Eigen/src/AccelerateSupport/AccelerateSupport.h +423 -0
- package/eigen/Eigen/src/AccelerateSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Cholesky/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Cholesky/LDLT.h +366 -405
- package/eigen/Eigen/src/Cholesky/LLT.h +323 -367
- package/eigen/Eigen/src/Cholesky/LLT_LAPACKE.h +81 -56
- package/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +585 -529
- package/eigen/Eigen/src/CholmodSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Core/ArithmeticSequence.h +143 -317
- package/eigen/Eigen/src/Core/Array.h +329 -370
- package/eigen/Eigen/src/Core/ArrayBase.h +190 -203
- package/eigen/Eigen/src/Core/ArrayWrapper.h +126 -170
- package/eigen/Eigen/src/Core/Assign.h +30 -40
- package/eigen/Eigen/src/Core/AssignEvaluator.h +651 -604
- package/eigen/Eigen/src/Core/Assign_MKL.h +125 -120
- package/eigen/Eigen/src/Core/BandMatrix.h +267 -282
- package/eigen/Eigen/src/Core/Block.h +371 -390
- package/eigen/Eigen/src/Core/CommaInitializer.h +85 -100
- package/eigen/Eigen/src/Core/ConditionEstimator.h +51 -53
- package/eigen/Eigen/src/Core/CoreEvaluators.h +1214 -937
- package/eigen/Eigen/src/Core/CoreIterators.h +72 -63
- package/eigen/Eigen/src/Core/CwiseBinaryOp.h +112 -129
- package/eigen/Eigen/src/Core/CwiseNullaryOp.h +676 -702
- package/eigen/Eigen/src/Core/CwiseTernaryOp.h +77 -103
- package/eigen/Eigen/src/Core/CwiseUnaryOp.h +55 -67
- package/eigen/Eigen/src/Core/CwiseUnaryView.h +127 -92
- package/eigen/Eigen/src/Core/DenseBase.h +630 -658
- package/eigen/Eigen/src/Core/DenseCoeffsBase.h +511 -628
- package/eigen/Eigen/src/Core/DenseStorage.h +511 -590
- package/eigen/Eigen/src/Core/DeviceWrapper.h +153 -0
- package/eigen/Eigen/src/Core/Diagonal.h +168 -207
- package/eigen/Eigen/src/Core/DiagonalMatrix.h +346 -317
- package/eigen/Eigen/src/Core/DiagonalProduct.h +12 -10
- package/eigen/Eigen/src/Core/Dot.h +167 -217
- package/eigen/Eigen/src/Core/EigenBase.h +74 -85
- package/eigen/Eigen/src/Core/Fill.h +138 -0
- package/eigen/Eigen/src/Core/FindCoeff.h +464 -0
- package/eigen/Eigen/src/Core/ForceAlignedAccess.h +90 -113
- package/eigen/Eigen/src/Core/Fuzzy.h +82 -105
- package/eigen/Eigen/src/Core/GeneralProduct.h +315 -261
- package/eigen/Eigen/src/Core/GenericPacketMath.h +1182 -520
- package/eigen/Eigen/src/Core/GlobalFunctions.h +193 -157
- package/eigen/Eigen/src/Core/IO.h +131 -156
- package/eigen/Eigen/src/Core/IndexedView.h +209 -125
- package/eigen/Eigen/src/Core/InnerProduct.h +260 -0
- package/eigen/Eigen/src/Core/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Core/Inverse.h +50 -59
- package/eigen/Eigen/src/Core/Map.h +123 -141
- package/eigen/Eigen/src/Core/MapBase.h +255 -282
- package/eigen/Eigen/src/Core/MathFunctions.h +1247 -1201
- package/eigen/Eigen/src/Core/MathFunctionsImpl.h +162 -99
- package/eigen/Eigen/src/Core/Matrix.h +463 -494
- package/eigen/Eigen/src/Core/MatrixBase.h +468 -470
- package/eigen/Eigen/src/Core/NestByValue.h +58 -52
- package/eigen/Eigen/src/Core/NoAlias.h +79 -86
- package/eigen/Eigen/src/Core/NumTraits.h +206 -206
- package/eigen/Eigen/src/Core/PartialReduxEvaluator.h +163 -142
- package/eigen/Eigen/src/Core/PermutationMatrix.h +461 -511
- package/eigen/Eigen/src/Core/PlainObjectBase.h +858 -972
- package/eigen/Eigen/src/Core/Product.h +246 -130
- package/eigen/Eigen/src/Core/ProductEvaluators.h +779 -671
- package/eigen/Eigen/src/Core/Random.h +153 -164
- package/eigen/Eigen/src/Core/RandomImpl.h +262 -0
- package/eigen/Eigen/src/Core/RealView.h +250 -0
- package/eigen/Eigen/src/Core/Redux.h +334 -314
- package/eigen/Eigen/src/Core/Ref.h +259 -257
- package/eigen/Eigen/src/Core/Replicate.h +92 -104
- package/eigen/Eigen/src/Core/Reshaped.h +215 -271
- package/eigen/Eigen/src/Core/ReturnByValue.h +47 -55
- package/eigen/Eigen/src/Core/Reverse.h +133 -148
- package/eigen/Eigen/src/Core/Select.h +68 -140
- package/eigen/Eigen/src/Core/SelfAdjointView.h +254 -290
- package/eigen/Eigen/src/Core/SelfCwiseBinaryOp.h +23 -20
- package/eigen/Eigen/src/Core/SkewSymmetricMatrix3.h +382 -0
- package/eigen/Eigen/src/Core/Solve.h +88 -102
- package/eigen/Eigen/src/Core/SolveTriangular.h +126 -124
- package/eigen/Eigen/src/Core/SolverBase.h +132 -133
- package/eigen/Eigen/src/Core/StableNorm.h +113 -147
- package/eigen/Eigen/src/Core/StlIterators.h +404 -248
- package/eigen/Eigen/src/Core/Stride.h +90 -92
- package/eigen/Eigen/src/Core/Swap.h +70 -39
- package/eigen/Eigen/src/Core/Transpose.h +258 -295
- package/eigen/Eigen/src/Core/Transpositions.h +270 -333
- package/eigen/Eigen/src/Core/TriangularMatrix.h +642 -743
- package/eigen/Eigen/src/Core/VectorBlock.h +59 -72
- package/eigen/Eigen/src/Core/VectorwiseOp.h +653 -704
- package/eigen/Eigen/src/Core/Visitor.h +464 -308
- package/eigen/Eigen/src/Core/arch/AVX/Complex.h +380 -187
- package/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +65 -163
- package/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +2145 -638
- package/eigen/Eigen/src/Core/arch/AVX/Reductions.h +353 -0
- package/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +253 -60
- package/eigen/Eigen/src/Core/arch/AVX512/Complex.h +278 -228
- package/eigen/Eigen/src/Core/arch/AVX512/GemmKernel.h +1245 -0
- package/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +48 -269
- package/eigen/Eigen/src/Core/arch/AVX512/MathFunctionsFP16.h +75 -0
- package/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +1597 -754
- package/eigen/Eigen/src/Core/arch/AVX512/PacketMathFP16.h +1413 -0
- package/eigen/Eigen/src/Core/arch/AVX512/Reductions.h +297 -0
- package/eigen/Eigen/src/Core/arch/AVX512/TrsmKernel.h +1167 -0
- package/eigen/Eigen/src/Core/arch/AVX512/TrsmUnrolls.inc +1219 -0
- package/eigen/Eigen/src/Core/arch/AVX512/TypeCasting.h +229 -41
- package/eigen/Eigen/src/Core/arch/AVX512/TypeCastingFP16.h +130 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +420 -184
- package/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +40 -49
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +2962 -2213
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +196 -212
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +713 -441
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMAbfloat16.h +742 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixVectorProduct.inc +2818 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h +2380 -1362
- package/eigen/Eigen/src/Core/arch/AltiVec/TypeCasting.h +153 -0
- package/eigen/Eigen/src/Core/arch/Default/BFloat16.h +390 -224
- package/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +78 -67
- package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +1784 -799
- package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +167 -50
- package/eigen/Eigen/src/Core/arch/Default/Half.h +528 -379
- package/eigen/Eigen/src/Core/arch/Default/Settings.h +10 -12
- package/eigen/Eigen/src/Core/arch/GPU/Complex.h +244 -0
- package/eigen/Eigen/src/Core/arch/GPU/MathFunctions.h +41 -40
- package/eigen/Eigen/src/Core/arch/GPU/PacketMath.h +550 -523
- package/eigen/Eigen/src/Core/arch/GPU/Tuple.h +268 -0
- package/eigen/Eigen/src/Core/arch/GPU/TypeCasting.h +27 -30
- package/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h +8 -8
- package/eigen/Eigen/src/Core/arch/HVX/PacketMath.h +1088 -0
- package/eigen/Eigen/src/Core/arch/LSX/Complex.h +520 -0
- package/eigen/Eigen/src/Core/arch/LSX/GeneralBlockPanelKernel.h +23 -0
- package/eigen/Eigen/src/Core/arch/LSX/MathFunctions.h +43 -0
- package/eigen/Eigen/src/Core/arch/LSX/PacketMath.h +2866 -0
- package/eigen/Eigen/src/Core/arch/LSX/TypeCasting.h +526 -0
- package/eigen/Eigen/src/Core/arch/MSA/Complex.h +54 -82
- package/eigen/Eigen/src/Core/arch/MSA/MathFunctions.h +84 -92
- package/eigen/Eigen/src/Core/arch/MSA/PacketMath.h +51 -47
- package/eigen/Eigen/src/Core/arch/NEON/Complex.h +454 -306
- package/eigen/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +175 -115
- package/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +23 -30
- package/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +4366 -2857
- package/eigen/Eigen/src/Core/arch/NEON/TypeCasting.h +616 -393
- package/eigen/Eigen/src/Core/arch/NEON/UnaryFunctors.h +57 -0
- package/eigen/Eigen/src/Core/arch/SSE/Complex.h +350 -198
- package/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +38 -149
- package/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +1791 -912
- package/eigen/Eigen/src/Core/arch/SSE/Reductions.h +324 -0
- package/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +128 -40
- package/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h +10 -6
- package/eigen/Eigen/src/Core/arch/SVE/PacketMath.h +156 -234
- package/eigen/Eigen/src/Core/arch/SVE/TypeCasting.h +6 -3
- package/eigen/Eigen/src/Core/arch/SYCL/InteropHeaders.h +27 -32
- package/eigen/Eigen/src/Core/arch/SYCL/MathFunctions.h +119 -117
- package/eigen/Eigen/src/Core/arch/SYCL/PacketMath.h +325 -419
- package/eigen/Eigen/src/Core/arch/SYCL/TypeCasting.h +15 -17
- package/eigen/Eigen/src/Core/arch/ZVector/Complex.h +325 -181
- package/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +94 -83
- package/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +811 -458
- package/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +121 -124
- package/eigen/Eigen/src/Core/functors/BinaryFunctors.h +576 -370
- package/eigen/Eigen/src/Core/functors/NullaryFunctors.h +194 -109
- package/eigen/Eigen/src/Core/functors/StlFunctors.h +95 -112
- package/eigen/Eigen/src/Core/functors/TernaryFunctors.h +34 -7
- package/eigen/Eigen/src/Core/functors/UnaryFunctors.h +1038 -749
- package/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +1883 -1375
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +312 -370
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +189 -176
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +84 -81
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +154 -73
- package/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +292 -337
- package/eigen/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +80 -77
- package/eigen/Eigen/src/Core/products/Parallelizer.h +207 -105
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +327 -388
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +206 -224
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +138 -147
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h +58 -61
- package/eigen/Eigen/src/Core/products/SelfadjointProduct.h +71 -71
- package/eigen/Eigen/src/Core/products/SelfadjointRank2Update.h +48 -47
- package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix.h +294 -369
- package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +246 -238
- package/eigen/Eigen/src/Core/products/TriangularMatrixVector.h +244 -247
- package/eigen/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h +212 -192
- package/eigen/Eigen/src/Core/products/TriangularSolverMatrix.h +328 -277
- package/eigen/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +108 -109
- package/eigen/Eigen/src/Core/products/TriangularSolverVector.h +68 -94
- package/eigen/Eigen/src/Core/util/Assert.h +158 -0
- package/eigen/Eigen/src/Core/util/BlasUtil.h +342 -303
- package/eigen/Eigen/src/Core/util/ConfigureVectorization.h +348 -317
- package/eigen/Eigen/src/Core/util/Constants.h +297 -262
- package/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +130 -90
- package/eigen/Eigen/src/Core/util/EmulateArray.h +270 -0
- package/eigen/Eigen/src/Core/util/ForwardDeclarations.h +449 -247
- package/eigen/Eigen/src/Core/util/GpuHipCudaDefines.inc +101 -0
- package/eigen/Eigen/src/Core/util/GpuHipCudaUndefines.inc +45 -0
- package/eigen/Eigen/src/Core/util/IndexedViewHelper.h +417 -116
- package/eigen/Eigen/src/Core/util/IntegralConstant.h +211 -204
- package/eigen/Eigen/src/Core/util/MKL_support.h +39 -37
- package/eigen/Eigen/src/Core/util/Macros.h +655 -773
- package/eigen/Eigen/src/Core/util/MaxSizeVector.h +139 -0
- package/eigen/Eigen/src/Core/util/Memory.h +970 -748
- package/eigen/Eigen/src/Core/util/Meta.h +581 -633
- package/eigen/Eigen/src/Core/util/MoreMeta.h +638 -0
- package/eigen/Eigen/src/Core/util/ReenableStupidWarnings.h +32 -19
- package/eigen/Eigen/src/Core/util/ReshapedHelper.h +17 -17
- package/eigen/Eigen/src/Core/util/Serializer.h +209 -0
- package/eigen/Eigen/src/Core/util/StaticAssert.h +50 -166
- package/eigen/Eigen/src/Core/util/SymbolicIndex.h +377 -225
- package/eigen/Eigen/src/Core/util/XprHelper.h +784 -547
- package/eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h +246 -277
- package/eigen/Eigen/src/Eigenvalues/ComplexSchur.h +299 -319
- package/eigen/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h +52 -48
- package/eigen/Eigen/src/Eigenvalues/EigenSolver.h +413 -456
- package/eigen/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +309 -325
- package/eigen/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +157 -171
- package/eigen/Eigen/src/Eigenvalues/HessenbergDecomposition.h +292 -310
- package/eigen/Eigen/src/Eigenvalues/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +89 -105
- package/eigen/Eigen/src/Eigenvalues/RealQZ.h +537 -607
- package/eigen/Eigen/src/Eigenvalues/RealSchur.h +342 -381
- package/eigen/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +41 -35
- package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +541 -595
- package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +47 -44
- package/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +430 -462
- package/eigen/Eigen/src/Geometry/AlignedBox.h +226 -227
- package/eigen/Eigen/src/Geometry/AngleAxis.h +131 -133
- package/eigen/Eigen/src/Geometry/EulerAngles.h +163 -74
- package/eigen/Eigen/src/Geometry/Homogeneous.h +285 -333
- package/eigen/Eigen/src/Geometry/Hyperplane.h +151 -160
- package/eigen/Eigen/src/Geometry/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Geometry/OrthoMethods.h +168 -146
- package/eigen/Eigen/src/Geometry/ParametrizedLine.h +127 -127
- package/eigen/Eigen/src/Geometry/Quaternion.h +566 -506
- package/eigen/Eigen/src/Geometry/Rotation2D.h +107 -105
- package/eigen/Eigen/src/Geometry/RotationBase.h +148 -145
- package/eigen/Eigen/src/Geometry/Scaling.h +113 -106
- package/eigen/Eigen/src/Geometry/Transform.h +858 -936
- package/eigen/Eigen/src/Geometry/Translation.h +94 -92
- package/eigen/Eigen/src/Geometry/Umeyama.h +79 -84
- package/eigen/Eigen/src/Geometry/arch/Geometry_SIMD.h +90 -104
- package/eigen/Eigen/src/Householder/BlockHouseholder.h +51 -46
- package/eigen/Eigen/src/Householder/Householder.h +102 -124
- package/eigen/Eigen/src/Householder/HouseholderSequence.h +412 -453
- package/eigen/Eigen/src/Householder/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +149 -162
- package/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +124 -119
- package/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +92 -104
- package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +251 -243
- package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +224 -228
- package/eigen/Eigen/src/IterativeLinearSolvers/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +178 -227
- package/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +79 -84
- package/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +54 -60
- package/eigen/Eigen/src/Jacobi/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Jacobi/Jacobi.h +252 -308
- package/eigen/Eigen/src/KLUSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/KLUSupport/KLUSupport.h +208 -227
- package/eigen/Eigen/src/LU/Determinant.h +50 -69
- package/eigen/Eigen/src/LU/FullPivLU.h +545 -596
- package/eigen/Eigen/src/LU/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/LU/InverseImpl.h +206 -285
- package/eigen/Eigen/src/LU/PartialPivLU.h +390 -428
- package/eigen/Eigen/src/LU/PartialPivLU_LAPACKE.h +54 -40
- package/eigen/Eigen/src/LU/arch/InverseSize4.h +72 -70
- package/eigen/Eigen/src/MetisSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/MetisSupport/MetisSupport.h +81 -93
- package/eigen/Eigen/src/OrderingMethods/Amd.h +243 -265
- package/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +831 -1004
- package/eigen/Eigen/src/OrderingMethods/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/OrderingMethods/Ordering.h +112 -119
- package/eigen/Eigen/src/PaStiXSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h +524 -570
- package/eigen/Eigen/src/PardisoSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/PardisoSupport/PardisoSupport.h +385 -430
- package/eigen/Eigen/src/QR/ColPivHouseholderQR.h +479 -479
- package/eigen/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +120 -56
- package/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +166 -153
- package/eigen/Eigen/src/QR/FullPivHouseholderQR.h +495 -475
- package/eigen/Eigen/src/QR/HouseholderQR.h +394 -285
- package/eigen/Eigen/src/QR/HouseholderQR_LAPACKE.h +32 -23
- package/eigen/Eigen/src/QR/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SPQRSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +244 -264
- package/eigen/Eigen/src/SVD/BDCSVD.h +817 -713
- package/eigen/Eigen/src/SVD/BDCSVD_LAPACKE.h +174 -0
- package/eigen/Eigen/src/SVD/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SVD/JacobiSVD.h +577 -543
- package/eigen/Eigen/src/SVD/JacobiSVD_LAPACKE.h +85 -49
- package/eigen/Eigen/src/SVD/SVDBase.h +242 -182
- package/eigen/Eigen/src/SVD/UpperBidiagonalization.h +200 -235
- package/eigen/Eigen/src/SparseCholesky/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +765 -594
- package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +308 -94
- package/eigen/Eigen/src/SparseCore/AmbiVector.h +202 -251
- package/eigen/Eigen/src/SparseCore/CompressedStorage.h +184 -252
- package/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +134 -178
- package/eigen/Eigen/src/SparseCore/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseCore/SparseAssign.h +149 -140
- package/eigen/Eigen/src/SparseCore/SparseBlock.h +403 -440
- package/eigen/Eigen/src/SparseCore/SparseColEtree.h +100 -112
- package/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +525 -303
- package/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +555 -339
- package/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +100 -108
- package/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +169 -197
- package/eigen/Eigen/src/SparseCore/SparseDiagonalProduct.h +71 -71
- package/eigen/Eigen/src/SparseCore/SparseDot.h +49 -47
- package/eigen/Eigen/src/SparseCore/SparseFuzzy.h +13 -11
- package/eigen/Eigen/src/SparseCore/SparseMap.h +243 -253
- package/eigen/Eigen/src/SparseCore/SparseMatrix.h +1603 -1245
- package/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +403 -350
- package/eigen/Eigen/src/SparseCore/SparsePermutation.h +186 -115
- package/eigen/Eigen/src/SparseCore/SparseProduct.h +94 -97
- package/eigen/Eigen/src/SparseCore/SparseRedux.h +22 -24
- package/eigen/Eigen/src/SparseCore/SparseRef.h +268 -295
- package/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h +370 -416
- package/eigen/Eigen/src/SparseCore/SparseSolverBase.h +78 -87
- package/eigen/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +81 -95
- package/eigen/Eigen/src/SparseCore/SparseTranspose.h +62 -71
- package/eigen/Eigen/src/SparseCore/SparseTriangularView.h +132 -144
- package/eigen/Eigen/src/SparseCore/SparseUtil.h +138 -115
- package/eigen/Eigen/src/SparseCore/SparseVector.h +426 -372
- package/eigen/Eigen/src/SparseCore/SparseView.h +164 -193
- package/eigen/Eigen/src/SparseCore/TriangularSolver.h +129 -170
- package/eigen/Eigen/src/SparseLU/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseLU/SparseLU.h +756 -710
- package/eigen/Eigen/src/SparseLU/SparseLUImpl.h +61 -48
- package/eigen/Eigen/src/SparseLU/SparseLU_Memory.h +102 -118
- package/eigen/Eigen/src/SparseLU/SparseLU_Structs.h +38 -35
- package/eigen/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +245 -301
- package/eigen/Eigen/src/SparseLU/SparseLU_Utils.h +44 -49
- package/eigen/Eigen/src/SparseLU/SparseLU_column_bmod.h +104 -108
- package/eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h +89 -100
- package/eigen/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +57 -58
- package/eigen/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +43 -55
- package/eigen/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +74 -71
- package/eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h +124 -132
- package/eigen/Eigen/src/SparseLU/SparseLU_panel_dfs.h +136 -159
- package/eigen/Eigen/src/SparseLU/SparseLU_pivotL.h +51 -52
- package/eigen/Eigen/src/SparseLU/SparseLU_pruneL.h +67 -73
- package/eigen/Eigen/src/SparseLU/SparseLU_relax_snode.h +24 -26
- package/eigen/Eigen/src/SparseQR/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseQR/SparseQR.h +450 -502
- package/eigen/Eigen/src/StlSupport/StdDeque.h +28 -93
- package/eigen/Eigen/src/StlSupport/StdList.h +28 -84
- package/eigen/Eigen/src/StlSupport/StdVector.h +28 -108
- package/eigen/Eigen/src/StlSupport/details.h +48 -50
- package/eigen/Eigen/src/SuperLUSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SuperLUSupport/SuperLUSupport.h +634 -730
- package/eigen/Eigen/src/ThreadPool/Barrier.h +70 -0
- package/eigen/Eigen/src/ThreadPool/CoreThreadPoolDevice.h +336 -0
- package/eigen/Eigen/src/ThreadPool/EventCount.h +241 -0
- package/eigen/Eigen/src/ThreadPool/ForkJoin.h +140 -0
- package/eigen/Eigen/src/ThreadPool/InternalHeaderCheck.h +4 -0
- package/eigen/Eigen/src/ThreadPool/NonBlockingThreadPool.h +587 -0
- package/eigen/Eigen/src/ThreadPool/RunQueue.h +230 -0
- package/eigen/Eigen/src/ThreadPool/ThreadCancel.h +21 -0
- package/eigen/Eigen/src/ThreadPool/ThreadEnvironment.h +43 -0
- package/eigen/Eigen/src/ThreadPool/ThreadLocal.h +289 -0
- package/eigen/Eigen/src/ThreadPool/ThreadPoolInterface.h +50 -0
- package/eigen/Eigen/src/ThreadPool/ThreadYield.h +16 -0
- package/eigen/Eigen/src/UmfPackSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/UmfPackSupport/UmfPackSupport.h +428 -464
- package/eigen/Eigen/src/misc/Image.h +41 -43
- package/eigen/Eigen/src/misc/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/misc/Kernel.h +39 -41
- package/eigen/Eigen/src/misc/RealSvd2x2.h +19 -21
- package/eigen/Eigen/src/misc/blas.h +83 -426
- package/eigen/Eigen/src/misc/lapacke.h +9972 -16179
- package/eigen/Eigen/src/misc/lapacke_helpers.h +163 -0
- package/eigen/Eigen/src/misc/lapacke_mangling.h +4 -5
- package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.inc +344 -0
- package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.inc +544 -0
- package/eigen/Eigen/src/plugins/{BlockMethods.h → BlockMethods.inc} +434 -506
- package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.inc +116 -0
- package/eigen/Eigen/src/plugins/{CommonCwiseUnaryOps.h → CommonCwiseUnaryOps.inc} +58 -68
- package/eigen/Eigen/src/plugins/IndexedViewMethods.inc +192 -0
- package/eigen/Eigen/src/plugins/InternalHeaderCheck.inc +3 -0
- package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.inc +331 -0
- package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.inc +118 -0
- package/eigen/Eigen/src/plugins/ReshapedMethods.inc +133 -0
- package/package.json +1 -1
- package/eigen/COPYING.APACHE +0 -203
- package/eigen/COPYING.BSD +0 -26
- package/eigen/COPYING.GPL +0 -674
- package/eigen/COPYING.LGPL +0 -502
- package/eigen/COPYING.MINPACK +0 -51
- package/eigen/COPYING.MPL2 +0 -373
- package/eigen/COPYING.README +0 -18
- package/eigen/Eigen/src/Core/BooleanRedux.h +0 -162
- package/eigen/Eigen/src/Core/arch/CUDA/Complex.h +0 -258
- package/eigen/Eigen/src/Core/arch/Default/TypeCasting.h +0 -120
- package/eigen/Eigen/src/Core/arch/SYCL/SyclMemoryModel.h +0 -694
- package/eigen/Eigen/src/Core/util/NonMPL2.h +0 -3
- package/eigen/Eigen/src/SparseCore/MappedSparseMatrix.h +0 -67
- package/eigen/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +0 -280
- package/eigen/Eigen/src/misc/lapack.h +0 -152
- package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.h +0 -358
- package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h +0 -696
- package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.h +0 -115
- package/eigen/Eigen/src/plugins/IndexedViewMethods.h +0 -262
- package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h +0 -152
- package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h +0 -95
- package/eigen/Eigen/src/plugins/ReshapedMethods.h +0 -149
- package/eigen/README.md +0 -5
|
@@ -10,7 +10,10 @@
|
|
|
10
10
|
#ifndef EIGEN_SPARSE_CWISE_BINARY_OP_H
|
|
11
11
|
#define EIGEN_SPARSE_CWISE_BINARY_OP_H
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
// IWYU pragma: private
|
|
14
|
+
#include "./InternalHeaderCheck.h"
|
|
15
|
+
|
|
16
|
+
namespace Eigen {
|
|
14
17
|
|
|
15
18
|
// Here we have to handle 3 cases:
|
|
16
19
|
// 1 - sparse op dense
|
|
@@ -32,76 +35,68 @@ namespace Eigen {
|
|
|
32
35
|
// TODO to ease compiler job, we could specialize product/quotient with a scalar
|
|
33
36
|
// and fallback to cwise-unary evaluator using bind1st_op and bind2nd_op.
|
|
34
37
|
|
|
35
|
-
template<typename BinaryOp, typename Lhs, typename Rhs>
|
|
36
|
-
class CwiseBinaryOpImpl<BinaryOp, Lhs, Rhs, Sparse>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
(!internal::is_same<typename internal::traits<Lhs>::StorageKind,
|
|
47
|
-
typename internal::traits<Rhs>::StorageKind>::value)
|
|
48
|
-
|| ((internal::evaluator<Lhs>::Flags&RowMajorBit) == (internal::evaluator<Rhs>::Flags&RowMajorBit))),
|
|
49
|
-
THE_STORAGE_ORDER_OF_BOTH_SIDES_MUST_MATCH);
|
|
50
|
-
}
|
|
38
|
+
template <typename BinaryOp, typename Lhs, typename Rhs>
|
|
39
|
+
class CwiseBinaryOpImpl<BinaryOp, Lhs, Rhs, Sparse> : public SparseMatrixBase<CwiseBinaryOp<BinaryOp, Lhs, Rhs> > {
|
|
40
|
+
public:
|
|
41
|
+
typedef CwiseBinaryOp<BinaryOp, Lhs, Rhs> Derived;
|
|
42
|
+
typedef SparseMatrixBase<Derived> Base;
|
|
43
|
+
EIGEN_SPARSE_PUBLIC_INTERFACE(Derived)
|
|
44
|
+
EIGEN_STATIC_ASSERT(((!internal::is_same<typename internal::traits<Lhs>::StorageKind,
|
|
45
|
+
typename internal::traits<Rhs>::StorageKind>::value) ||
|
|
46
|
+
((internal::evaluator<Lhs>::Flags & RowMajorBit) ==
|
|
47
|
+
(internal::evaluator<Rhs>::Flags & RowMajorBit))),
|
|
48
|
+
THE_STORAGE_ORDER_OF_BOTH_SIDES_MUST_MATCH)
|
|
51
49
|
};
|
|
52
50
|
|
|
53
51
|
namespace internal {
|
|
54
52
|
|
|
55
|
-
|
|
53
|
+
// The default evaluator performs an "arithmetic" operation on two input arrays.
|
|
54
|
+
// Given input arrays 'lhs' and 'rhs' and binary functor 'func',
|
|
55
|
+
// the sparse destination array 'dst' is evaluated as follows:
|
|
56
|
+
// if lhs(i,j) and rhs(i,j) are present, dst(i,j) = func(lhs(i,j), rhs(i,j))
|
|
57
|
+
// if lhs(i,j) is present and rhs(i,j) is null, dst(i,j) = func(lhs(i,j), 0)
|
|
58
|
+
// if lhs(i,j) is null and rhs(i,j) is present, dst(i,j) = func(0, rhs(i,j))
|
|
59
|
+
|
|
56
60
|
// Generic "sparse OP sparse"
|
|
57
|
-
template<typename XprType>
|
|
61
|
+
template <typename XprType>
|
|
62
|
+
struct binary_sparse_evaluator;
|
|
58
63
|
|
|
59
|
-
template<typename BinaryOp, typename Lhs, typename Rhs>
|
|
64
|
+
template <typename BinaryOp, typename Lhs, typename Rhs>
|
|
60
65
|
struct binary_evaluator<CwiseBinaryOp<BinaryOp, Lhs, Rhs>, IteratorBased, IteratorBased>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
typedef typename evaluator<
|
|
65
|
-
typedef typename evaluator<Rhs>::InnerIterator RhsIterator;
|
|
66
|
+
: evaluator_base<CwiseBinaryOp<BinaryOp, Lhs, Rhs> > {
|
|
67
|
+
protected:
|
|
68
|
+
typedef typename evaluator<Lhs>::InnerIterator LhsIterator;
|
|
69
|
+
typedef typename evaluator<Rhs>::InnerIterator RhsIterator;
|
|
66
70
|
typedef CwiseBinaryOp<BinaryOp, Lhs, Rhs> XprType;
|
|
67
71
|
typedef typename traits<XprType>::Scalar Scalar;
|
|
68
72
|
typedef typename XprType::StorageIndex StorageIndex;
|
|
69
|
-
public:
|
|
70
73
|
|
|
71
|
-
|
|
72
|
-
{
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
public:
|
|
75
|
+
class InnerIterator {
|
|
76
|
+
public:
|
|
75
77
|
EIGEN_STRONG_INLINE InnerIterator(const binary_evaluator& aEval, Index outer)
|
|
76
|
-
|
|
77
|
-
|
|
78
|
+
: m_lhsIter(aEval.m_lhsImpl, outer),
|
|
79
|
+
m_rhsIter(aEval.m_rhsImpl, outer),
|
|
80
|
+
m_functor(aEval.m_functor),
|
|
81
|
+
m_value(Scalar(0)) {
|
|
78
82
|
this->operator++();
|
|
79
83
|
}
|
|
80
84
|
|
|
81
|
-
EIGEN_STRONG_INLINE InnerIterator& operator++()
|
|
82
|
-
|
|
83
|
-
if (m_lhsIter && m_rhsIter && (m_lhsIter.index() == m_rhsIter.index()))
|
|
84
|
-
{
|
|
85
|
+
EIGEN_STRONG_INLINE InnerIterator& operator++() {
|
|
86
|
+
if (m_lhsIter && m_rhsIter && (m_lhsIter.index() == m_rhsIter.index())) {
|
|
85
87
|
m_id = m_lhsIter.index();
|
|
86
88
|
m_value = m_functor(m_lhsIter.value(), m_rhsIter.value());
|
|
87
89
|
++m_lhsIter;
|
|
88
90
|
++m_rhsIter;
|
|
89
|
-
}
|
|
90
|
-
else if (m_lhsIter && (!m_rhsIter || (m_lhsIter.index() < m_rhsIter.index())))
|
|
91
|
-
{
|
|
91
|
+
} else if (m_lhsIter && (!m_rhsIter || (m_lhsIter.index() < m_rhsIter.index()))) {
|
|
92
92
|
m_id = m_lhsIter.index();
|
|
93
93
|
m_value = m_functor(m_lhsIter.value(), Scalar(0));
|
|
94
94
|
++m_lhsIter;
|
|
95
|
-
}
|
|
96
|
-
else if (m_rhsIter && (!m_lhsIter || (m_lhsIter.index() > m_rhsIter.index())))
|
|
97
|
-
{
|
|
95
|
+
} else if (m_rhsIter && (!m_lhsIter || (m_lhsIter.index() > m_rhsIter.index()))) {
|
|
98
96
|
m_id = m_rhsIter.index();
|
|
99
97
|
m_value = m_functor(Scalar(0), m_rhsIter.value());
|
|
100
98
|
++m_rhsIter;
|
|
101
|
-
}
|
|
102
|
-
else
|
|
103
|
-
{
|
|
104
|
-
m_value = Scalar(0); // this is to avoid a compilation warning
|
|
99
|
+
} else {
|
|
105
100
|
m_id = -1;
|
|
106
101
|
}
|
|
107
102
|
return *this;
|
|
@@ -114,94 +109,88 @@ public:
|
|
|
114
109
|
EIGEN_STRONG_INLINE Index row() const { return Lhs::IsRowMajor ? m_lhsIter.row() : index(); }
|
|
115
110
|
EIGEN_STRONG_INLINE Index col() const { return Lhs::IsRowMajor ? index() : m_lhsIter.col(); }
|
|
116
111
|
|
|
117
|
-
EIGEN_STRONG_INLINE operator bool() const { return m_id>=0; }
|
|
112
|
+
EIGEN_STRONG_INLINE operator bool() const { return m_id >= 0; }
|
|
118
113
|
|
|
119
|
-
|
|
114
|
+
protected:
|
|
120
115
|
LhsIterator m_lhsIter;
|
|
121
116
|
RhsIterator m_rhsIter;
|
|
122
117
|
const BinaryOp& m_functor;
|
|
123
118
|
Scalar m_value;
|
|
124
119
|
StorageIndex m_id;
|
|
125
120
|
};
|
|
126
|
-
|
|
127
|
-
|
|
121
|
+
|
|
128
122
|
enum {
|
|
129
|
-
CoeffReadCost =
|
|
123
|
+
CoeffReadCost =
|
|
124
|
+
int(evaluator<Lhs>::CoeffReadCost) + int(evaluator<Rhs>::CoeffReadCost) + int(functor_traits<BinaryOp>::Cost),
|
|
130
125
|
Flags = XprType::Flags
|
|
131
126
|
};
|
|
132
|
-
|
|
133
|
-
explicit binary_evaluator(const XprType& xpr)
|
|
134
|
-
: m_functor(xpr.functor()),
|
|
135
|
-
m_lhsImpl(xpr.lhs()),
|
|
136
|
-
m_rhsImpl(xpr.rhs())
|
|
137
|
-
{
|
|
127
|
+
|
|
128
|
+
explicit binary_evaluator(const XprType& xpr) : m_functor(xpr.functor()), m_lhsImpl(xpr.lhs()), m_rhsImpl(xpr.rhs()) {
|
|
138
129
|
EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<BinaryOp>::Cost);
|
|
139
130
|
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
|
140
131
|
}
|
|
141
|
-
|
|
142
|
-
inline Index nonZerosEstimate() const {
|
|
143
|
-
return m_lhsImpl.nonZerosEstimate() + m_rhsImpl.nonZerosEstimate();
|
|
144
|
-
}
|
|
145
132
|
|
|
146
|
-
|
|
133
|
+
inline Index nonZerosEstimate() const { return m_lhsImpl.nonZerosEstimate() + m_rhsImpl.nonZerosEstimate(); }
|
|
134
|
+
|
|
135
|
+
protected:
|
|
147
136
|
const BinaryOp m_functor;
|
|
148
137
|
evaluator<Lhs> m_lhsImpl;
|
|
149
138
|
evaluator<Rhs> m_rhsImpl;
|
|
150
139
|
};
|
|
151
140
|
|
|
152
141
|
// dense op sparse
|
|
153
|
-
template<typename BinaryOp, typename Lhs, typename Rhs>
|
|
142
|
+
template <typename BinaryOp, typename Lhs, typename Rhs>
|
|
154
143
|
struct binary_evaluator<CwiseBinaryOp<BinaryOp, Lhs, Rhs>, IndexBased, IteratorBased>
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
typedef typename evaluator<Rhs>::InnerIterator RhsIterator;
|
|
144
|
+
: evaluator_base<CwiseBinaryOp<BinaryOp, Lhs, Rhs> > {
|
|
145
|
+
protected:
|
|
146
|
+
typedef typename evaluator<Rhs>::InnerIterator RhsIterator;
|
|
159
147
|
typedef CwiseBinaryOp<BinaryOp, Lhs, Rhs> XprType;
|
|
160
148
|
typedef typename traits<XprType>::Scalar Scalar;
|
|
161
149
|
typedef typename XprType::StorageIndex StorageIndex;
|
|
162
|
-
public:
|
|
163
150
|
|
|
164
|
-
|
|
165
|
-
{
|
|
166
|
-
enum { IsRowMajor = (int(Rhs::Flags)&RowMajorBit)==RowMajorBit };
|
|
167
|
-
public:
|
|
151
|
+
public:
|
|
152
|
+
class InnerIterator {
|
|
153
|
+
enum { IsRowMajor = (int(Rhs::Flags) & RowMajorBit) == RowMajorBit };
|
|
168
154
|
|
|
155
|
+
public:
|
|
169
156
|
EIGEN_STRONG_INLINE InnerIterator(const binary_evaluator& aEval, Index outer)
|
|
170
|
-
|
|
171
|
-
|
|
157
|
+
: m_lhsEval(aEval.m_lhsImpl),
|
|
158
|
+
m_rhsIter(aEval.m_rhsImpl, outer),
|
|
159
|
+
m_functor(aEval.m_functor),
|
|
160
|
+
m_value(0),
|
|
161
|
+
m_id(-1),
|
|
162
|
+
m_innerSize(aEval.m_expr.rhs().innerSize()) {
|
|
172
163
|
this->operator++();
|
|
173
164
|
}
|
|
174
165
|
|
|
175
|
-
EIGEN_STRONG_INLINE InnerIterator& operator++()
|
|
176
|
-
{
|
|
166
|
+
EIGEN_STRONG_INLINE InnerIterator& operator++() {
|
|
177
167
|
++m_id;
|
|
178
|
-
if(m_id<m_innerSize)
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
IsRowMajor?m_id:m_rhsIter.outer());
|
|
182
|
-
if(m_rhsIter && m_rhsIter.index()==m_id)
|
|
183
|
-
{
|
|
168
|
+
if (m_id < m_innerSize) {
|
|
169
|
+
Scalar lhsVal = m_lhsEval.coeff(IsRowMajor ? m_rhsIter.outer() : m_id, IsRowMajor ? m_id : m_rhsIter.outer());
|
|
170
|
+
if (m_rhsIter && m_rhsIter.index() == m_id) {
|
|
184
171
|
m_value = m_functor(lhsVal, m_rhsIter.value());
|
|
185
172
|
++m_rhsIter;
|
|
186
|
-
}
|
|
187
|
-
else
|
|
173
|
+
} else
|
|
188
174
|
m_value = m_functor(lhsVal, Scalar(0));
|
|
189
175
|
}
|
|
190
176
|
|
|
191
177
|
return *this;
|
|
192
178
|
}
|
|
193
179
|
|
|
194
|
-
EIGEN_STRONG_INLINE Scalar value() const {
|
|
180
|
+
EIGEN_STRONG_INLINE Scalar value() const {
|
|
181
|
+
eigen_internal_assert(m_id < m_innerSize);
|
|
182
|
+
return m_value;
|
|
183
|
+
}
|
|
195
184
|
|
|
196
185
|
EIGEN_STRONG_INLINE StorageIndex index() const { return m_id; }
|
|
197
186
|
EIGEN_STRONG_INLINE Index outer() const { return m_rhsIter.outer(); }
|
|
198
187
|
EIGEN_STRONG_INLINE Index row() const { return IsRowMajor ? m_rhsIter.outer() : m_id; }
|
|
199
188
|
EIGEN_STRONG_INLINE Index col() const { return IsRowMajor ? m_id : m_rhsIter.outer(); }
|
|
200
189
|
|
|
201
|
-
EIGEN_STRONG_INLINE operator bool() const { return m_id<m_innerSize; }
|
|
190
|
+
EIGEN_STRONG_INLINE operator bool() const { return m_id < m_innerSize; }
|
|
202
191
|
|
|
203
|
-
|
|
204
|
-
const evaluator<Lhs
|
|
192
|
+
protected:
|
|
193
|
+
const evaluator<Lhs>& m_lhsEval;
|
|
205
194
|
RhsIterator m_rhsIter;
|
|
206
195
|
const BinaryOp& m_functor;
|
|
207
196
|
Scalar m_value;
|
|
@@ -209,216 +198,198 @@ public:
|
|
|
209
198
|
StorageIndex m_innerSize;
|
|
210
199
|
};
|
|
211
200
|
|
|
212
|
-
|
|
213
201
|
enum {
|
|
214
|
-
CoeffReadCost =
|
|
202
|
+
CoeffReadCost =
|
|
203
|
+
int(evaluator<Lhs>::CoeffReadCost) + int(evaluator<Rhs>::CoeffReadCost) + int(functor_traits<BinaryOp>::Cost),
|
|
215
204
|
Flags = XprType::Flags
|
|
216
205
|
};
|
|
217
206
|
|
|
218
207
|
explicit binary_evaluator(const XprType& xpr)
|
|
219
|
-
|
|
220
|
-
m_lhsImpl(xpr.lhs()),
|
|
221
|
-
m_rhsImpl(xpr.rhs()),
|
|
222
|
-
m_expr(xpr)
|
|
223
|
-
{
|
|
208
|
+
: m_functor(xpr.functor()), m_lhsImpl(xpr.lhs()), m_rhsImpl(xpr.rhs()), m_expr(xpr) {
|
|
224
209
|
EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<BinaryOp>::Cost);
|
|
225
210
|
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
|
226
211
|
}
|
|
227
212
|
|
|
228
|
-
inline Index nonZerosEstimate() const {
|
|
229
|
-
return m_expr.size();
|
|
230
|
-
}
|
|
213
|
+
inline Index nonZerosEstimate() const { return m_expr.size(); }
|
|
231
214
|
|
|
232
|
-
protected:
|
|
215
|
+
protected:
|
|
233
216
|
const BinaryOp m_functor;
|
|
234
217
|
evaluator<Lhs> m_lhsImpl;
|
|
235
218
|
evaluator<Rhs> m_rhsImpl;
|
|
236
|
-
const XprType
|
|
219
|
+
const XprType& m_expr;
|
|
237
220
|
};
|
|
238
221
|
|
|
239
222
|
// sparse op dense
|
|
240
|
-
template<typename BinaryOp, typename Lhs, typename Rhs>
|
|
223
|
+
template <typename BinaryOp, typename Lhs, typename Rhs>
|
|
241
224
|
struct binary_evaluator<CwiseBinaryOp<BinaryOp, Lhs, Rhs>, IteratorBased, IndexBased>
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
typedef typename evaluator<Lhs>::InnerIterator LhsIterator;
|
|
225
|
+
: evaluator_base<CwiseBinaryOp<BinaryOp, Lhs, Rhs> > {
|
|
226
|
+
protected:
|
|
227
|
+
typedef typename evaluator<Lhs>::InnerIterator LhsIterator;
|
|
246
228
|
typedef CwiseBinaryOp<BinaryOp, Lhs, Rhs> XprType;
|
|
247
229
|
typedef typename traits<XprType>::Scalar Scalar;
|
|
248
230
|
typedef typename XprType::StorageIndex StorageIndex;
|
|
249
|
-
public:
|
|
250
231
|
|
|
251
|
-
|
|
252
|
-
{
|
|
253
|
-
enum { IsRowMajor = (int(Lhs::Flags)&RowMajorBit)==RowMajorBit };
|
|
254
|
-
public:
|
|
232
|
+
public:
|
|
233
|
+
class InnerIterator {
|
|
234
|
+
enum { IsRowMajor = (int(Lhs::Flags) & RowMajorBit) == RowMajorBit };
|
|
255
235
|
|
|
236
|
+
public:
|
|
256
237
|
EIGEN_STRONG_INLINE InnerIterator(const binary_evaluator& aEval, Index outer)
|
|
257
|
-
|
|
258
|
-
|
|
238
|
+
: m_lhsIter(aEval.m_lhsImpl, outer),
|
|
239
|
+
m_rhsEval(aEval.m_rhsImpl),
|
|
240
|
+
m_functor(aEval.m_functor),
|
|
241
|
+
m_value(0),
|
|
242
|
+
m_id(-1),
|
|
243
|
+
m_innerSize(aEval.m_expr.lhs().innerSize()) {
|
|
259
244
|
this->operator++();
|
|
260
245
|
}
|
|
261
246
|
|
|
262
|
-
EIGEN_STRONG_INLINE InnerIterator& operator++()
|
|
263
|
-
{
|
|
247
|
+
EIGEN_STRONG_INLINE InnerIterator& operator++() {
|
|
264
248
|
++m_id;
|
|
265
|
-
if(m_id<m_innerSize)
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
IsRowMajor?m_id:m_lhsIter.outer());
|
|
269
|
-
if(m_lhsIter && m_lhsIter.index()==m_id)
|
|
270
|
-
{
|
|
249
|
+
if (m_id < m_innerSize) {
|
|
250
|
+
Scalar rhsVal = m_rhsEval.coeff(IsRowMajor ? m_lhsIter.outer() : m_id, IsRowMajor ? m_id : m_lhsIter.outer());
|
|
251
|
+
if (m_lhsIter && m_lhsIter.index() == m_id) {
|
|
271
252
|
m_value = m_functor(m_lhsIter.value(), rhsVal);
|
|
272
253
|
++m_lhsIter;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
m_value = m_functor(Scalar(0),rhsVal);
|
|
254
|
+
} else
|
|
255
|
+
m_value = m_functor(Scalar(0), rhsVal);
|
|
276
256
|
}
|
|
277
257
|
|
|
278
258
|
return *this;
|
|
279
259
|
}
|
|
280
260
|
|
|
281
|
-
EIGEN_STRONG_INLINE Scalar value() const {
|
|
261
|
+
EIGEN_STRONG_INLINE Scalar value() const {
|
|
262
|
+
eigen_internal_assert(m_id < m_innerSize);
|
|
263
|
+
return m_value;
|
|
264
|
+
}
|
|
282
265
|
|
|
283
266
|
EIGEN_STRONG_INLINE StorageIndex index() const { return m_id; }
|
|
284
267
|
EIGEN_STRONG_INLINE Index outer() const { return m_lhsIter.outer(); }
|
|
285
268
|
EIGEN_STRONG_INLINE Index row() const { return IsRowMajor ? m_lhsIter.outer() : m_id; }
|
|
286
269
|
EIGEN_STRONG_INLINE Index col() const { return IsRowMajor ? m_id : m_lhsIter.outer(); }
|
|
287
270
|
|
|
288
|
-
EIGEN_STRONG_INLINE operator bool() const { return m_id<m_innerSize; }
|
|
271
|
+
EIGEN_STRONG_INLINE operator bool() const { return m_id < m_innerSize; }
|
|
289
272
|
|
|
290
|
-
|
|
273
|
+
protected:
|
|
291
274
|
LhsIterator m_lhsIter;
|
|
292
|
-
const evaluator<Rhs
|
|
275
|
+
const evaluator<Rhs>& m_rhsEval;
|
|
293
276
|
const BinaryOp& m_functor;
|
|
294
277
|
Scalar m_value;
|
|
295
278
|
StorageIndex m_id;
|
|
296
279
|
StorageIndex m_innerSize;
|
|
297
280
|
};
|
|
298
281
|
|
|
299
|
-
|
|
300
282
|
enum {
|
|
301
|
-
CoeffReadCost =
|
|
283
|
+
CoeffReadCost =
|
|
284
|
+
int(evaluator<Lhs>::CoeffReadCost) + int(evaluator<Rhs>::CoeffReadCost) + int(functor_traits<BinaryOp>::Cost),
|
|
302
285
|
Flags = XprType::Flags
|
|
303
286
|
};
|
|
304
287
|
|
|
305
288
|
explicit binary_evaluator(const XprType& xpr)
|
|
306
|
-
|
|
307
|
-
m_lhsImpl(xpr.lhs()),
|
|
308
|
-
m_rhsImpl(xpr.rhs()),
|
|
309
|
-
m_expr(xpr)
|
|
310
|
-
{
|
|
289
|
+
: m_functor(xpr.functor()), m_lhsImpl(xpr.lhs()), m_rhsImpl(xpr.rhs()), m_expr(xpr) {
|
|
311
290
|
EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<BinaryOp>::Cost);
|
|
312
291
|
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
|
313
292
|
}
|
|
314
293
|
|
|
315
|
-
inline Index nonZerosEstimate() const {
|
|
316
|
-
return m_expr.size();
|
|
317
|
-
}
|
|
294
|
+
inline Index nonZerosEstimate() const { return m_expr.size(); }
|
|
318
295
|
|
|
319
|
-
protected:
|
|
296
|
+
protected:
|
|
320
297
|
const BinaryOp m_functor;
|
|
321
298
|
evaluator<Lhs> m_lhsImpl;
|
|
322
299
|
evaluator<Rhs> m_rhsImpl;
|
|
323
|
-
const XprType
|
|
300
|
+
const XprType& m_expr;
|
|
324
301
|
};
|
|
325
302
|
|
|
326
|
-
template<typename T,
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
303
|
+
template <typename T, typename LhsKind = typename evaluator_traits<typename T::Lhs>::Kind,
|
|
304
|
+
typename RhsKind = typename evaluator_traits<typename T::Rhs>::Kind,
|
|
305
|
+
typename LhsScalar = typename traits<typename T::Lhs>::Scalar,
|
|
306
|
+
typename RhsScalar = typename traits<typename T::Rhs>::Scalar>
|
|
307
|
+
struct sparse_conjunction_evaluator;
|
|
331
308
|
|
|
332
309
|
// "sparse .* sparse"
|
|
333
|
-
template<typename T1, typename T2, typename Lhs, typename Rhs>
|
|
334
|
-
struct binary_evaluator<CwiseBinaryOp<scalar_product_op<T1,T2>, Lhs, Rhs>, IteratorBased, IteratorBased>
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
typedef CwiseBinaryOp<scalar_product_op<T1,T2>, Lhs, Rhs> XprType;
|
|
310
|
+
template <typename T1, typename T2, typename Lhs, typename Rhs>
|
|
311
|
+
struct binary_evaluator<CwiseBinaryOp<scalar_product_op<T1, T2>, Lhs, Rhs>, IteratorBased, IteratorBased>
|
|
312
|
+
: sparse_conjunction_evaluator<CwiseBinaryOp<scalar_product_op<T1, T2>, Lhs, Rhs> > {
|
|
313
|
+
typedef CwiseBinaryOp<scalar_product_op<T1, T2>, Lhs, Rhs> XprType;
|
|
338
314
|
typedef sparse_conjunction_evaluator<XprType> Base;
|
|
339
315
|
explicit binary_evaluator(const XprType& xpr) : Base(xpr) {}
|
|
340
316
|
};
|
|
341
317
|
// "dense .* sparse"
|
|
342
|
-
template<typename T1, typename T2, typename Lhs, typename Rhs>
|
|
343
|
-
struct binary_evaluator<CwiseBinaryOp<scalar_product_op<T1,T2>, Lhs, Rhs>, IndexBased, IteratorBased>
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
typedef CwiseBinaryOp<scalar_product_op<T1,T2>, Lhs, Rhs> XprType;
|
|
318
|
+
template <typename T1, typename T2, typename Lhs, typename Rhs>
|
|
319
|
+
struct binary_evaluator<CwiseBinaryOp<scalar_product_op<T1, T2>, Lhs, Rhs>, IndexBased, IteratorBased>
|
|
320
|
+
: sparse_conjunction_evaluator<CwiseBinaryOp<scalar_product_op<T1, T2>, Lhs, Rhs> > {
|
|
321
|
+
typedef CwiseBinaryOp<scalar_product_op<T1, T2>, Lhs, Rhs> XprType;
|
|
347
322
|
typedef sparse_conjunction_evaluator<XprType> Base;
|
|
348
323
|
explicit binary_evaluator(const XprType& xpr) : Base(xpr) {}
|
|
349
324
|
};
|
|
350
325
|
// "sparse .* dense"
|
|
351
|
-
template<typename T1, typename T2, typename Lhs, typename Rhs>
|
|
352
|
-
struct binary_evaluator<CwiseBinaryOp<scalar_product_op<T1,T2>, Lhs, Rhs>, IteratorBased, IndexBased>
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
typedef CwiseBinaryOp<scalar_product_op<T1,T2>, Lhs, Rhs> XprType;
|
|
326
|
+
template <typename T1, typename T2, typename Lhs, typename Rhs>
|
|
327
|
+
struct binary_evaluator<CwiseBinaryOp<scalar_product_op<T1, T2>, Lhs, Rhs>, IteratorBased, IndexBased>
|
|
328
|
+
: sparse_conjunction_evaluator<CwiseBinaryOp<scalar_product_op<T1, T2>, Lhs, Rhs> > {
|
|
329
|
+
typedef CwiseBinaryOp<scalar_product_op<T1, T2>, Lhs, Rhs> XprType;
|
|
356
330
|
typedef sparse_conjunction_evaluator<XprType> Base;
|
|
357
331
|
explicit binary_evaluator(const XprType& xpr) : Base(xpr) {}
|
|
358
332
|
};
|
|
359
333
|
|
|
360
334
|
// "sparse ./ dense"
|
|
361
|
-
template<typename T1, typename T2, typename Lhs, typename Rhs>
|
|
362
|
-
struct binary_evaluator<CwiseBinaryOp<scalar_quotient_op<T1,T2>, Lhs, Rhs>, IteratorBased, IndexBased>
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
typedef CwiseBinaryOp<scalar_quotient_op<T1,T2>, Lhs, Rhs> XprType;
|
|
335
|
+
template <typename T1, typename T2, typename Lhs, typename Rhs>
|
|
336
|
+
struct binary_evaluator<CwiseBinaryOp<scalar_quotient_op<T1, T2>, Lhs, Rhs>, IteratorBased, IndexBased>
|
|
337
|
+
: sparse_conjunction_evaluator<CwiseBinaryOp<scalar_quotient_op<T1, T2>, Lhs, Rhs> > {
|
|
338
|
+
typedef CwiseBinaryOp<scalar_quotient_op<T1, T2>, Lhs, Rhs> XprType;
|
|
366
339
|
typedef sparse_conjunction_evaluator<XprType> Base;
|
|
367
340
|
explicit binary_evaluator(const XprType& xpr) : Base(xpr) {}
|
|
368
341
|
};
|
|
369
342
|
|
|
370
343
|
// "sparse && sparse"
|
|
371
|
-
template<typename Lhs, typename Rhs>
|
|
372
|
-
struct binary_evaluator<CwiseBinaryOp<scalar_boolean_and_op
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
typedef CwiseBinaryOp<scalar_boolean_and_op, Lhs, Rhs> XprType;
|
|
344
|
+
template <typename Lhs, typename Rhs>
|
|
345
|
+
struct binary_evaluator<CwiseBinaryOp<scalar_boolean_and_op<bool>, Lhs, Rhs>, IteratorBased, IteratorBased>
|
|
346
|
+
: sparse_conjunction_evaluator<CwiseBinaryOp<scalar_boolean_and_op<bool>, Lhs, Rhs> > {
|
|
347
|
+
typedef CwiseBinaryOp<scalar_boolean_and_op<bool>, Lhs, Rhs> XprType;
|
|
376
348
|
typedef sparse_conjunction_evaluator<XprType> Base;
|
|
377
349
|
explicit binary_evaluator(const XprType& xpr) : Base(xpr) {}
|
|
378
350
|
};
|
|
379
351
|
// "dense && sparse"
|
|
380
|
-
template<typename Lhs, typename Rhs>
|
|
381
|
-
struct binary_evaluator<CwiseBinaryOp<scalar_boolean_and_op
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
typedef CwiseBinaryOp<scalar_boolean_and_op, Lhs, Rhs> XprType;
|
|
352
|
+
template <typename Lhs, typename Rhs>
|
|
353
|
+
struct binary_evaluator<CwiseBinaryOp<scalar_boolean_and_op<bool>, Lhs, Rhs>, IndexBased, IteratorBased>
|
|
354
|
+
: sparse_conjunction_evaluator<CwiseBinaryOp<scalar_boolean_and_op<bool>, Lhs, Rhs> > {
|
|
355
|
+
typedef CwiseBinaryOp<scalar_boolean_and_op<bool>, Lhs, Rhs> XprType;
|
|
385
356
|
typedef sparse_conjunction_evaluator<XprType> Base;
|
|
386
357
|
explicit binary_evaluator(const XprType& xpr) : Base(xpr) {}
|
|
387
358
|
};
|
|
388
359
|
// "sparse && dense"
|
|
389
|
-
template<typename Lhs, typename Rhs>
|
|
390
|
-
struct binary_evaluator<CwiseBinaryOp<scalar_boolean_and_op
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
typedef CwiseBinaryOp<scalar_boolean_and_op, Lhs, Rhs> XprType;
|
|
360
|
+
template <typename Lhs, typename Rhs>
|
|
361
|
+
struct binary_evaluator<CwiseBinaryOp<scalar_boolean_and_op<bool>, Lhs, Rhs>, IteratorBased, IndexBased>
|
|
362
|
+
: sparse_conjunction_evaluator<CwiseBinaryOp<scalar_boolean_and_op<bool>, Lhs, Rhs> > {
|
|
363
|
+
typedef CwiseBinaryOp<scalar_boolean_and_op<bool>, Lhs, Rhs> XprType;
|
|
394
364
|
typedef sparse_conjunction_evaluator<XprType> Base;
|
|
395
365
|
explicit binary_evaluator(const XprType& xpr) : Base(xpr) {}
|
|
396
366
|
};
|
|
397
367
|
|
|
368
|
+
// The conjunction "^" evaluator performs a logical "and" or set "intersection" operation on two input arrays.
|
|
369
|
+
// Given input arrays 'lhs' and 'rhs' and binary functor 'func',
|
|
370
|
+
// the sparse destination array 'dst' is evaluated as follows:
|
|
371
|
+
// if lhs(i,j) and rhs(i,j) are present, dst(i,j) = func(lhs(i,j), rhs(i,j))
|
|
372
|
+
// if lhs(i,j) is present and rhs(i,j) is null, dst(i,j) is null
|
|
373
|
+
// if lhs(i,j) is null and rhs(i,j) is present, dst(i,j) is null
|
|
374
|
+
|
|
398
375
|
// "sparse ^ sparse"
|
|
399
|
-
template<typename XprType>
|
|
400
|
-
struct sparse_conjunction_evaluator<XprType, IteratorBased, IteratorBased>
|
|
401
|
-
|
|
402
|
-
{
|
|
403
|
-
protected:
|
|
376
|
+
template <typename XprType>
|
|
377
|
+
struct sparse_conjunction_evaluator<XprType, IteratorBased, IteratorBased> : evaluator_base<XprType> {
|
|
378
|
+
protected:
|
|
404
379
|
typedef typename XprType::Functor BinaryOp;
|
|
405
380
|
typedef typename XprType::Lhs LhsArg;
|
|
406
381
|
typedef typename XprType::Rhs RhsArg;
|
|
407
|
-
typedef typename evaluator<LhsArg>::InnerIterator
|
|
408
|
-
typedef typename evaluator<RhsArg>::InnerIterator
|
|
382
|
+
typedef typename evaluator<LhsArg>::InnerIterator LhsIterator;
|
|
383
|
+
typedef typename evaluator<RhsArg>::InnerIterator RhsIterator;
|
|
409
384
|
typedef typename XprType::StorageIndex StorageIndex;
|
|
410
385
|
typedef typename traits<XprType>::Scalar Scalar;
|
|
411
|
-
public:
|
|
412
386
|
|
|
413
|
-
|
|
414
|
-
{
|
|
415
|
-
|
|
416
|
-
|
|
387
|
+
public:
|
|
388
|
+
class InnerIterator {
|
|
389
|
+
public:
|
|
417
390
|
EIGEN_STRONG_INLINE InnerIterator(const sparse_conjunction_evaluator& aEval, Index outer)
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
while (m_lhsIter && m_rhsIter && (m_lhsIter.index() != m_rhsIter.index()))
|
|
421
|
-
{
|
|
391
|
+
: m_lhsIter(aEval.m_lhsImpl, outer), m_rhsIter(aEval.m_rhsImpl, outer), m_functor(aEval.m_functor) {
|
|
392
|
+
while (m_lhsIter && m_rhsIter && (m_lhsIter.index() != m_rhsIter.index())) {
|
|
422
393
|
if (m_lhsIter.index() < m_rhsIter.index())
|
|
423
394
|
++m_lhsIter;
|
|
424
395
|
else
|
|
@@ -426,12 +397,10 @@ public:
|
|
|
426
397
|
}
|
|
427
398
|
}
|
|
428
399
|
|
|
429
|
-
EIGEN_STRONG_INLINE InnerIterator& operator++()
|
|
430
|
-
{
|
|
400
|
+
EIGEN_STRONG_INLINE InnerIterator& operator++() {
|
|
431
401
|
++m_lhsIter;
|
|
432
402
|
++m_rhsIter;
|
|
433
|
-
while (m_lhsIter && m_rhsIter && (m_lhsIter.index() != m_rhsIter.index()))
|
|
434
|
-
{
|
|
403
|
+
while (m_lhsIter && m_rhsIter && (m_lhsIter.index() != m_rhsIter.index())) {
|
|
435
404
|
if (m_lhsIter.index() < m_rhsIter.index())
|
|
436
405
|
++m_lhsIter;
|
|
437
406
|
else
|
|
@@ -439,7 +408,7 @@ public:
|
|
|
439
408
|
}
|
|
440
409
|
return *this;
|
|
441
410
|
}
|
|
442
|
-
|
|
411
|
+
|
|
443
412
|
EIGEN_STRONG_INLINE Scalar value() const { return m_functor(m_lhsIter.value(), m_rhsIter.value()); }
|
|
444
413
|
|
|
445
414
|
EIGEN_STRONG_INLINE StorageIndex index() const { return m_lhsIter.index(); }
|
|
@@ -449,70 +418,64 @@ public:
|
|
|
449
418
|
|
|
450
419
|
EIGEN_STRONG_INLINE operator bool() const { return (m_lhsIter && m_rhsIter); }
|
|
451
420
|
|
|
452
|
-
|
|
421
|
+
protected:
|
|
453
422
|
LhsIterator m_lhsIter;
|
|
454
423
|
RhsIterator m_rhsIter;
|
|
455
424
|
const BinaryOp& m_functor;
|
|
456
425
|
};
|
|
457
|
-
|
|
458
|
-
|
|
426
|
+
|
|
459
427
|
enum {
|
|
460
|
-
CoeffReadCost = int(evaluator<LhsArg>::CoeffReadCost) + int(evaluator<RhsArg>::CoeffReadCost) +
|
|
428
|
+
CoeffReadCost = int(evaluator<LhsArg>::CoeffReadCost) + int(evaluator<RhsArg>::CoeffReadCost) +
|
|
429
|
+
int(functor_traits<BinaryOp>::Cost),
|
|
461
430
|
Flags = XprType::Flags
|
|
462
431
|
};
|
|
463
|
-
|
|
432
|
+
|
|
464
433
|
explicit sparse_conjunction_evaluator(const XprType& xpr)
|
|
465
|
-
|
|
466
|
-
m_lhsImpl(xpr.lhs()),
|
|
467
|
-
m_rhsImpl(xpr.rhs())
|
|
468
|
-
{
|
|
434
|
+
: m_functor(xpr.functor()), m_lhsImpl(xpr.lhs()), m_rhsImpl(xpr.rhs()) {
|
|
469
435
|
EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<BinaryOp>::Cost);
|
|
470
436
|
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
|
471
437
|
}
|
|
472
|
-
|
|
438
|
+
|
|
473
439
|
inline Index nonZerosEstimate() const {
|
|
474
440
|
return (std::min)(m_lhsImpl.nonZerosEstimate(), m_rhsImpl.nonZerosEstimate());
|
|
475
441
|
}
|
|
476
442
|
|
|
477
|
-
protected:
|
|
443
|
+
protected:
|
|
478
444
|
const BinaryOp m_functor;
|
|
479
445
|
evaluator<LhsArg> m_lhsImpl;
|
|
480
446
|
evaluator<RhsArg> m_rhsImpl;
|
|
481
447
|
};
|
|
482
448
|
|
|
483
449
|
// "dense ^ sparse"
|
|
484
|
-
template<typename XprType>
|
|
485
|
-
struct sparse_conjunction_evaluator<XprType, IndexBased, IteratorBased>
|
|
486
|
-
|
|
487
|
-
{
|
|
488
|
-
protected:
|
|
450
|
+
template <typename XprType>
|
|
451
|
+
struct sparse_conjunction_evaluator<XprType, IndexBased, IteratorBased> : evaluator_base<XprType> {
|
|
452
|
+
protected:
|
|
489
453
|
typedef typename XprType::Functor BinaryOp;
|
|
490
454
|
typedef typename XprType::Lhs LhsArg;
|
|
491
455
|
typedef typename XprType::Rhs RhsArg;
|
|
492
456
|
typedef evaluator<LhsArg> LhsEvaluator;
|
|
493
|
-
typedef typename evaluator<RhsArg>::InnerIterator
|
|
457
|
+
typedef typename evaluator<RhsArg>::InnerIterator RhsIterator;
|
|
494
458
|
typedef typename XprType::StorageIndex StorageIndex;
|
|
495
459
|
typedef typename traits<XprType>::Scalar Scalar;
|
|
496
|
-
public:
|
|
497
460
|
|
|
498
|
-
|
|
499
|
-
{
|
|
500
|
-
enum { IsRowMajor = (int(RhsArg::Flags)&RowMajorBit)==RowMajorBit };
|
|
461
|
+
public:
|
|
462
|
+
class InnerIterator {
|
|
463
|
+
enum { IsRowMajor = (int(RhsArg::Flags) & RowMajorBit) == RowMajorBit };
|
|
501
464
|
|
|
502
|
-
|
|
503
|
-
|
|
465
|
+
public:
|
|
504
466
|
EIGEN_STRONG_INLINE InnerIterator(const sparse_conjunction_evaluator& aEval, Index outer)
|
|
505
|
-
|
|
506
|
-
{}
|
|
467
|
+
: m_lhsEval(aEval.m_lhsImpl), m_rhsIter(aEval.m_rhsImpl, outer), m_functor(aEval.m_functor), m_outer(outer) {}
|
|
507
468
|
|
|
508
|
-
EIGEN_STRONG_INLINE InnerIterator& operator++()
|
|
509
|
-
{
|
|
469
|
+
EIGEN_STRONG_INLINE InnerIterator& operator++() {
|
|
510
470
|
++m_rhsIter;
|
|
511
471
|
return *this;
|
|
512
472
|
}
|
|
513
473
|
|
|
514
|
-
EIGEN_STRONG_INLINE Scalar value() const
|
|
515
|
-
|
|
474
|
+
EIGEN_STRONG_INLINE Scalar value() const {
|
|
475
|
+
return m_functor(
|
|
476
|
+
m_lhsEval.coeff(IsRowMajor ? m_outer : m_rhsIter.index(), IsRowMajor ? m_rhsIter.index() : m_outer),
|
|
477
|
+
m_rhsIter.value());
|
|
478
|
+
}
|
|
516
479
|
|
|
517
480
|
EIGEN_STRONG_INLINE StorageIndex index() const { return m_rhsIter.index(); }
|
|
518
481
|
EIGEN_STRONG_INLINE Index outer() const { return m_rhsIter.outer(); }
|
|
@@ -520,45 +483,38 @@ public:
|
|
|
520
483
|
EIGEN_STRONG_INLINE Index col() const { return m_rhsIter.col(); }
|
|
521
484
|
|
|
522
485
|
EIGEN_STRONG_INLINE operator bool() const { return m_rhsIter; }
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
const LhsEvaluator
|
|
486
|
+
|
|
487
|
+
protected:
|
|
488
|
+
const LhsEvaluator& m_lhsEval;
|
|
526
489
|
RhsIterator m_rhsIter;
|
|
527
490
|
const BinaryOp& m_functor;
|
|
528
491
|
const Index m_outer;
|
|
529
492
|
};
|
|
530
|
-
|
|
531
|
-
|
|
493
|
+
|
|
532
494
|
enum {
|
|
533
|
-
CoeffReadCost = int(evaluator<LhsArg>::CoeffReadCost) + int(evaluator<RhsArg>::CoeffReadCost) +
|
|
495
|
+
CoeffReadCost = int(evaluator<LhsArg>::CoeffReadCost) + int(evaluator<RhsArg>::CoeffReadCost) +
|
|
496
|
+
int(functor_traits<BinaryOp>::Cost),
|
|
534
497
|
Flags = XprType::Flags
|
|
535
498
|
};
|
|
536
|
-
|
|
499
|
+
|
|
537
500
|
explicit sparse_conjunction_evaluator(const XprType& xpr)
|
|
538
|
-
|
|
539
|
-
m_lhsImpl(xpr.lhs()),
|
|
540
|
-
m_rhsImpl(xpr.rhs())
|
|
541
|
-
{
|
|
501
|
+
: m_functor(xpr.functor()), m_lhsImpl(xpr.lhs()), m_rhsImpl(xpr.rhs()) {
|
|
542
502
|
EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<BinaryOp>::Cost);
|
|
543
503
|
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
|
544
504
|
}
|
|
545
|
-
|
|
546
|
-
inline Index nonZerosEstimate() const {
|
|
547
|
-
return m_rhsImpl.nonZerosEstimate();
|
|
548
|
-
}
|
|
549
505
|
|
|
550
|
-
|
|
506
|
+
inline Index nonZerosEstimate() const { return m_rhsImpl.nonZerosEstimate(); }
|
|
507
|
+
|
|
508
|
+
protected:
|
|
551
509
|
const BinaryOp m_functor;
|
|
552
510
|
evaluator<LhsArg> m_lhsImpl;
|
|
553
511
|
evaluator<RhsArg> m_rhsImpl;
|
|
554
512
|
};
|
|
555
513
|
|
|
556
514
|
// "sparse ^ dense"
|
|
557
|
-
template<typename XprType>
|
|
558
|
-
struct sparse_conjunction_evaluator<XprType, IteratorBased, IndexBased>
|
|
559
|
-
|
|
560
|
-
{
|
|
561
|
-
protected:
|
|
515
|
+
template <typename XprType>
|
|
516
|
+
struct sparse_conjunction_evaluator<XprType, IteratorBased, IndexBased> : evaluator_base<XprType> {
|
|
517
|
+
protected:
|
|
562
518
|
typedef typename XprType::Functor BinaryOp;
|
|
563
519
|
typedef typename XprType::Lhs LhsArg;
|
|
564
520
|
typedef typename XprType::Rhs RhsArg;
|
|
@@ -566,27 +522,24 @@ protected:
|
|
|
566
522
|
typedef evaluator<RhsArg> RhsEvaluator;
|
|
567
523
|
typedef typename XprType::StorageIndex StorageIndex;
|
|
568
524
|
typedef typename traits<XprType>::Scalar Scalar;
|
|
569
|
-
public:
|
|
570
525
|
|
|
571
|
-
|
|
572
|
-
{
|
|
573
|
-
enum { IsRowMajor = (int(LhsArg::Flags)&RowMajorBit)==RowMajorBit };
|
|
526
|
+
public:
|
|
527
|
+
class InnerIterator {
|
|
528
|
+
enum { IsRowMajor = (int(LhsArg::Flags) & RowMajorBit) == RowMajorBit };
|
|
574
529
|
|
|
575
|
-
|
|
576
|
-
|
|
530
|
+
public:
|
|
577
531
|
EIGEN_STRONG_INLINE InnerIterator(const sparse_conjunction_evaluator& aEval, Index outer)
|
|
578
|
-
|
|
579
|
-
{}
|
|
532
|
+
: m_lhsIter(aEval.m_lhsImpl, outer), m_rhsEval(aEval.m_rhsImpl), m_functor(aEval.m_functor), m_outer(outer) {}
|
|
580
533
|
|
|
581
|
-
EIGEN_STRONG_INLINE InnerIterator& operator++()
|
|
582
|
-
{
|
|
534
|
+
EIGEN_STRONG_INLINE InnerIterator& operator++() {
|
|
583
535
|
++m_lhsIter;
|
|
584
536
|
return *this;
|
|
585
537
|
}
|
|
586
538
|
|
|
587
|
-
EIGEN_STRONG_INLINE Scalar value() const
|
|
588
|
-
|
|
589
|
-
|
|
539
|
+
EIGEN_STRONG_INLINE Scalar value() const {
|
|
540
|
+
return m_functor(m_lhsIter.value(), m_rhsEval.coeff(IsRowMajor ? m_outer : m_lhsIter.index(),
|
|
541
|
+
IsRowMajor ? m_lhsIter.index() : m_outer));
|
|
542
|
+
}
|
|
590
543
|
|
|
591
544
|
EIGEN_STRONG_INLINE StorageIndex index() const { return m_lhsIter.index(); }
|
|
592
545
|
EIGEN_STRONG_INLINE Index outer() const { return m_lhsIter.outer(); }
|
|
@@ -594,129 +547,392 @@ public:
|
|
|
594
547
|
EIGEN_STRONG_INLINE Index col() const { return m_lhsIter.col(); }
|
|
595
548
|
|
|
596
549
|
EIGEN_STRONG_INLINE operator bool() const { return m_lhsIter; }
|
|
597
|
-
|
|
598
|
-
|
|
550
|
+
|
|
551
|
+
protected:
|
|
599
552
|
LhsIterator m_lhsIter;
|
|
600
|
-
const evaluator<RhsArg
|
|
553
|
+
const evaluator<RhsArg>& m_rhsEval;
|
|
601
554
|
const BinaryOp& m_functor;
|
|
602
555
|
const Index m_outer;
|
|
603
556
|
};
|
|
604
|
-
|
|
605
|
-
|
|
557
|
+
|
|
606
558
|
enum {
|
|
607
|
-
CoeffReadCost = int(evaluator<LhsArg>::CoeffReadCost) + int(evaluator<RhsArg>::CoeffReadCost) +
|
|
559
|
+
CoeffReadCost = int(evaluator<LhsArg>::CoeffReadCost) + int(evaluator<RhsArg>::CoeffReadCost) +
|
|
560
|
+
int(functor_traits<BinaryOp>::Cost),
|
|
608
561
|
Flags = XprType::Flags
|
|
609
562
|
};
|
|
610
|
-
|
|
563
|
+
|
|
611
564
|
explicit sparse_conjunction_evaluator(const XprType& xpr)
|
|
612
|
-
|
|
613
|
-
m_lhsImpl(xpr.lhs()),
|
|
614
|
-
m_rhsImpl(xpr.rhs())
|
|
615
|
-
{
|
|
565
|
+
: m_functor(xpr.functor()), m_lhsImpl(xpr.lhs()), m_rhsImpl(xpr.rhs()) {
|
|
616
566
|
EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<BinaryOp>::Cost);
|
|
617
567
|
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
|
618
568
|
}
|
|
619
|
-
|
|
620
|
-
inline Index nonZerosEstimate() const {
|
|
621
|
-
|
|
569
|
+
|
|
570
|
+
inline Index nonZerosEstimate() const { return m_lhsImpl.nonZerosEstimate(); }
|
|
571
|
+
|
|
572
|
+
protected:
|
|
573
|
+
const BinaryOp m_functor;
|
|
574
|
+
evaluator<LhsArg> m_lhsImpl;
|
|
575
|
+
evaluator<RhsArg> m_rhsImpl;
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
template <typename T, typename LhsKind = typename evaluator_traits<typename T::Lhs>::Kind,
|
|
579
|
+
typename RhsKind = typename evaluator_traits<typename T::Rhs>::Kind,
|
|
580
|
+
typename LhsScalar = typename traits<typename T::Lhs>::Scalar,
|
|
581
|
+
typename RhsScalar = typename traits<typename T::Rhs>::Scalar>
|
|
582
|
+
struct sparse_disjunction_evaluator;
|
|
583
|
+
|
|
584
|
+
// The disjunction "v" evaluator performs a logical "or" or set "union" operation on two input arrays.
|
|
585
|
+
// Given input arrays 'lhs' and 'rhs' and binary functor 'func',
|
|
586
|
+
// the sparse destination array 'dst' is evaluated as follows:
|
|
587
|
+
// if lhs(i,j) and rhs(i,j) are present, dst(i,j) = func(lhs(i,j), rhs(i,j))
|
|
588
|
+
// if lhs(i,j) is present and rhs(i,j) is null, dst(i,j) = lhs(i,j)
|
|
589
|
+
// if lhs(i,j) is null and rhs(i,j) is present, dst(i,j) = rhs(i,j)
|
|
590
|
+
|
|
591
|
+
// "sparse v sparse"
|
|
592
|
+
template <typename XprType>
|
|
593
|
+
struct sparse_disjunction_evaluator<XprType, IteratorBased, IteratorBased> : evaluator_base<XprType> {
|
|
594
|
+
protected:
|
|
595
|
+
typedef typename XprType::Functor BinaryOp;
|
|
596
|
+
typedef typename XprType::Lhs LhsArg;
|
|
597
|
+
typedef typename XprType::Rhs RhsArg;
|
|
598
|
+
typedef typename evaluator<LhsArg>::InnerIterator LhsIterator;
|
|
599
|
+
typedef typename evaluator<RhsArg>::InnerIterator RhsIterator;
|
|
600
|
+
typedef typename XprType::StorageIndex StorageIndex;
|
|
601
|
+
typedef typename traits<XprType>::Scalar Scalar;
|
|
602
|
+
|
|
603
|
+
public:
|
|
604
|
+
class InnerIterator {
|
|
605
|
+
public:
|
|
606
|
+
EIGEN_STRONG_INLINE InnerIterator(const sparse_disjunction_evaluator& aEval, Index outer)
|
|
607
|
+
: m_lhsIter(aEval.m_lhsImpl, outer),
|
|
608
|
+
m_rhsIter(aEval.m_rhsImpl, outer),
|
|
609
|
+
m_functor(aEval.m_functor),
|
|
610
|
+
m_value(Scalar(0)) {
|
|
611
|
+
this->operator++();
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
EIGEN_STRONG_INLINE InnerIterator& operator++() {
|
|
615
|
+
if (m_lhsIter && m_rhsIter && (m_lhsIter.index() == m_rhsIter.index())) {
|
|
616
|
+
m_id = m_lhsIter.index();
|
|
617
|
+
m_value = m_functor(m_lhsIter.value(), m_rhsIter.value());
|
|
618
|
+
++m_lhsIter;
|
|
619
|
+
++m_rhsIter;
|
|
620
|
+
} else if (m_lhsIter && (!m_rhsIter || (m_lhsIter.index() < m_rhsIter.index()))) {
|
|
621
|
+
m_id = m_lhsIter.index();
|
|
622
|
+
m_value = m_lhsIter.value();
|
|
623
|
+
++m_lhsIter;
|
|
624
|
+
} else if (m_rhsIter && (!m_lhsIter || (m_lhsIter.index() > m_rhsIter.index()))) {
|
|
625
|
+
m_id = m_rhsIter.index();
|
|
626
|
+
m_value = m_rhsIter.value();
|
|
627
|
+
++m_rhsIter;
|
|
628
|
+
} else {
|
|
629
|
+
m_id = -1;
|
|
630
|
+
}
|
|
631
|
+
return *this;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
EIGEN_STRONG_INLINE Scalar value() const { return m_value; }
|
|
635
|
+
|
|
636
|
+
EIGEN_STRONG_INLINE StorageIndex index() const { return m_id; }
|
|
637
|
+
EIGEN_STRONG_INLINE Index outer() const { return m_lhsIter.outer(); }
|
|
638
|
+
EIGEN_STRONG_INLINE Index row() const { return LhsArg::IsRowMajor ? m_lhsIter.row() : index(); }
|
|
639
|
+
EIGEN_STRONG_INLINE Index col() const { return LhsArg::IsRowMajor ? index() : m_lhsIter.col(); }
|
|
640
|
+
|
|
641
|
+
EIGEN_STRONG_INLINE operator bool() const { return m_id >= 0; }
|
|
642
|
+
|
|
643
|
+
protected:
|
|
644
|
+
LhsIterator m_lhsIter;
|
|
645
|
+
RhsIterator m_rhsIter;
|
|
646
|
+
const BinaryOp& m_functor;
|
|
647
|
+
Scalar m_value;
|
|
648
|
+
StorageIndex m_id;
|
|
649
|
+
};
|
|
650
|
+
|
|
651
|
+
enum {
|
|
652
|
+
CoeffReadCost = int(evaluator<LhsArg>::CoeffReadCost) + int(evaluator<RhsArg>::CoeffReadCost) +
|
|
653
|
+
int(functor_traits<BinaryOp>::Cost),
|
|
654
|
+
Flags = XprType::Flags
|
|
655
|
+
};
|
|
656
|
+
|
|
657
|
+
explicit sparse_disjunction_evaluator(const XprType& xpr)
|
|
658
|
+
: m_functor(xpr.functor()), m_lhsImpl(xpr.lhs()), m_rhsImpl(xpr.rhs()) {
|
|
659
|
+
EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<BinaryOp>::Cost);
|
|
660
|
+
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
|
622
661
|
}
|
|
623
662
|
|
|
624
|
-
|
|
663
|
+
inline Index nonZerosEstimate() const { return m_lhsImpl.nonZerosEstimate() + m_rhsImpl.nonZerosEstimate(); }
|
|
664
|
+
|
|
665
|
+
protected:
|
|
625
666
|
const BinaryOp m_functor;
|
|
626
667
|
evaluator<LhsArg> m_lhsImpl;
|
|
627
668
|
evaluator<RhsArg> m_rhsImpl;
|
|
628
669
|
};
|
|
629
670
|
|
|
630
|
-
|
|
671
|
+
// "dense v sparse"
|
|
672
|
+
template <typename XprType>
|
|
673
|
+
struct sparse_disjunction_evaluator<XprType, IndexBased, IteratorBased> : evaluator_base<XprType> {
|
|
674
|
+
protected:
|
|
675
|
+
typedef typename XprType::Functor BinaryOp;
|
|
676
|
+
typedef typename XprType::Lhs LhsArg;
|
|
677
|
+
typedef typename XprType::Rhs RhsArg;
|
|
678
|
+
typedef evaluator<LhsArg> LhsEvaluator;
|
|
679
|
+
typedef typename evaluator<RhsArg>::InnerIterator RhsIterator;
|
|
680
|
+
typedef typename XprType::StorageIndex StorageIndex;
|
|
681
|
+
typedef typename traits<XprType>::Scalar Scalar;
|
|
682
|
+
|
|
683
|
+
public:
|
|
684
|
+
class InnerIterator {
|
|
685
|
+
enum { IsRowMajor = (int(RhsArg::Flags) & RowMajorBit) == RowMajorBit };
|
|
686
|
+
|
|
687
|
+
public:
|
|
688
|
+
EIGEN_STRONG_INLINE InnerIterator(const sparse_disjunction_evaluator& aEval, Index outer)
|
|
689
|
+
: m_lhsEval(aEval.m_lhsImpl),
|
|
690
|
+
m_rhsIter(aEval.m_rhsImpl, outer),
|
|
691
|
+
m_functor(aEval.m_functor),
|
|
692
|
+
m_value(0),
|
|
693
|
+
m_id(-1),
|
|
694
|
+
m_innerSize(aEval.m_expr.rhs().innerSize()) {
|
|
695
|
+
this->operator++();
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
EIGEN_STRONG_INLINE InnerIterator& operator++() {
|
|
699
|
+
++m_id;
|
|
700
|
+
if (m_id < m_innerSize) {
|
|
701
|
+
Scalar lhsVal = m_lhsEval.coeff(IsRowMajor ? m_rhsIter.outer() : m_id, IsRowMajor ? m_id : m_rhsIter.outer());
|
|
702
|
+
if (m_rhsIter && m_rhsIter.index() == m_id) {
|
|
703
|
+
m_value = m_functor(lhsVal, m_rhsIter.value());
|
|
704
|
+
++m_rhsIter;
|
|
705
|
+
} else
|
|
706
|
+
m_value = lhsVal;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
return *this;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
EIGEN_STRONG_INLINE Scalar value() const {
|
|
713
|
+
eigen_internal_assert(m_id < m_innerSize);
|
|
714
|
+
return m_value;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
EIGEN_STRONG_INLINE StorageIndex index() const { return m_id; }
|
|
718
|
+
EIGEN_STRONG_INLINE Index outer() const { return m_rhsIter.outer(); }
|
|
719
|
+
EIGEN_STRONG_INLINE Index row() const { return IsRowMajor ? m_rhsIter.outer() : m_id; }
|
|
720
|
+
EIGEN_STRONG_INLINE Index col() const { return IsRowMajor ? m_id : m_rhsIter.outer(); }
|
|
721
|
+
|
|
722
|
+
EIGEN_STRONG_INLINE operator bool() const { return m_id < m_innerSize; }
|
|
723
|
+
|
|
724
|
+
protected:
|
|
725
|
+
const evaluator<LhsArg>& m_lhsEval;
|
|
726
|
+
RhsIterator m_rhsIter;
|
|
727
|
+
const BinaryOp& m_functor;
|
|
728
|
+
Scalar m_value;
|
|
729
|
+
StorageIndex m_id;
|
|
730
|
+
StorageIndex m_innerSize;
|
|
731
|
+
};
|
|
732
|
+
|
|
733
|
+
enum {
|
|
734
|
+
CoeffReadCost = int(evaluator<LhsArg>::CoeffReadCost) + int(evaluator<RhsArg>::CoeffReadCost) +
|
|
735
|
+
int(functor_traits<BinaryOp>::Cost),
|
|
736
|
+
Flags = XprType::Flags
|
|
737
|
+
};
|
|
738
|
+
|
|
739
|
+
explicit sparse_disjunction_evaluator(const XprType& xpr)
|
|
740
|
+
: m_functor(xpr.functor()), m_lhsImpl(xpr.lhs()), m_rhsImpl(xpr.rhs()), m_expr(xpr) {
|
|
741
|
+
EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<BinaryOp>::Cost);
|
|
742
|
+
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
inline Index nonZerosEstimate() const { return m_expr.size(); }
|
|
746
|
+
|
|
747
|
+
protected:
|
|
748
|
+
const BinaryOp m_functor;
|
|
749
|
+
evaluator<LhsArg> m_lhsImpl;
|
|
750
|
+
evaluator<RhsArg> m_rhsImpl;
|
|
751
|
+
const XprType& m_expr;
|
|
752
|
+
};
|
|
753
|
+
|
|
754
|
+
// "sparse v dense"
|
|
755
|
+
template <typename XprType>
|
|
756
|
+
struct sparse_disjunction_evaluator<XprType, IteratorBased, IndexBased> : evaluator_base<XprType> {
|
|
757
|
+
protected:
|
|
758
|
+
typedef typename XprType::Functor BinaryOp;
|
|
759
|
+
typedef typename XprType::Lhs LhsArg;
|
|
760
|
+
typedef typename XprType::Rhs RhsArg;
|
|
761
|
+
typedef typename evaluator<LhsArg>::InnerIterator LhsIterator;
|
|
762
|
+
typedef evaluator<RhsArg> RhsEvaluator;
|
|
763
|
+
typedef typename XprType::StorageIndex StorageIndex;
|
|
764
|
+
typedef typename traits<XprType>::Scalar Scalar;
|
|
765
|
+
|
|
766
|
+
public:
|
|
767
|
+
class InnerIterator {
|
|
768
|
+
enum { IsRowMajor = (int(LhsArg::Flags) & RowMajorBit) == RowMajorBit };
|
|
769
|
+
|
|
770
|
+
public:
|
|
771
|
+
EIGEN_STRONG_INLINE InnerIterator(const sparse_disjunction_evaluator& aEval, Index outer)
|
|
772
|
+
: m_lhsIter(aEval.m_lhsImpl, outer),
|
|
773
|
+
m_rhsEval(aEval.m_rhsImpl),
|
|
774
|
+
m_functor(aEval.m_functor),
|
|
775
|
+
m_value(0),
|
|
776
|
+
m_id(-1),
|
|
777
|
+
m_innerSize(aEval.m_expr.lhs().innerSize()) {
|
|
778
|
+
this->operator++();
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
EIGEN_STRONG_INLINE InnerIterator& operator++() {
|
|
782
|
+
++m_id;
|
|
783
|
+
if (m_id < m_innerSize) {
|
|
784
|
+
Scalar rhsVal = m_rhsEval.coeff(IsRowMajor ? m_lhsIter.outer() : m_id, IsRowMajor ? m_id : m_lhsIter.outer());
|
|
785
|
+
if (m_lhsIter && m_lhsIter.index() == m_id) {
|
|
786
|
+
m_value = m_functor(m_lhsIter.value(), rhsVal);
|
|
787
|
+
++m_lhsIter;
|
|
788
|
+
} else
|
|
789
|
+
m_value = rhsVal;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
return *this;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
EIGEN_STRONG_INLINE Scalar value() const {
|
|
796
|
+
eigen_internal_assert(m_id < m_innerSize);
|
|
797
|
+
return m_value;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
EIGEN_STRONG_INLINE StorageIndex index() const { return m_id; }
|
|
801
|
+
EIGEN_STRONG_INLINE Index outer() const { return m_lhsIter.outer(); }
|
|
802
|
+
EIGEN_STRONG_INLINE Index row() const { return IsRowMajor ? m_lhsIter.outer() : m_id; }
|
|
803
|
+
EIGEN_STRONG_INLINE Index col() const { return IsRowMajor ? m_id : m_lhsIter.outer(); }
|
|
804
|
+
|
|
805
|
+
EIGEN_STRONG_INLINE operator bool() const { return m_id < m_innerSize; }
|
|
806
|
+
|
|
807
|
+
protected:
|
|
808
|
+
LhsIterator m_lhsIter;
|
|
809
|
+
const evaluator<RhsArg>& m_rhsEval;
|
|
810
|
+
const BinaryOp& m_functor;
|
|
811
|
+
Scalar m_value;
|
|
812
|
+
StorageIndex m_id;
|
|
813
|
+
StorageIndex m_innerSize;
|
|
814
|
+
};
|
|
815
|
+
|
|
816
|
+
enum {
|
|
817
|
+
CoeffReadCost = int(evaluator<LhsArg>::CoeffReadCost) + int(evaluator<RhsArg>::CoeffReadCost) +
|
|
818
|
+
int(functor_traits<BinaryOp>::Cost),
|
|
819
|
+
Flags = XprType::Flags
|
|
820
|
+
};
|
|
821
|
+
|
|
822
|
+
explicit sparse_disjunction_evaluator(const XprType& xpr)
|
|
823
|
+
: m_functor(xpr.functor()), m_lhsImpl(xpr.lhs()), m_rhsImpl(xpr.rhs()), m_expr(xpr) {
|
|
824
|
+
EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<BinaryOp>::Cost);
|
|
825
|
+
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
inline Index nonZerosEstimate() const { return m_expr.size(); }
|
|
829
|
+
|
|
830
|
+
protected:
|
|
831
|
+
const BinaryOp m_functor;
|
|
832
|
+
evaluator<LhsArg> m_lhsImpl;
|
|
833
|
+
evaluator<RhsArg> m_rhsImpl;
|
|
834
|
+
const XprType& m_expr;
|
|
835
|
+
};
|
|
836
|
+
|
|
837
|
+
// when DupFunc is wrapped with scalar_dup_op, use disjunction evaluator
|
|
838
|
+
template <typename T1, typename T2, typename DupFunc, typename Lhs, typename Rhs>
|
|
839
|
+
struct binary_evaluator<CwiseBinaryOp<scalar_disjunction_op<DupFunc, T1, T2>, Lhs, Rhs>, IteratorBased, IteratorBased>
|
|
840
|
+
: sparse_disjunction_evaluator<CwiseBinaryOp<scalar_disjunction_op<DupFunc, T1, T2>, Lhs, Rhs> > {
|
|
841
|
+
typedef CwiseBinaryOp<scalar_disjunction_op<DupFunc, T1, T2>, Lhs, Rhs> XprType;
|
|
842
|
+
typedef sparse_disjunction_evaluator<XprType> Base;
|
|
843
|
+
explicit binary_evaluator(const XprType& xpr) : Base(xpr) {}
|
|
844
|
+
};
|
|
845
|
+
} // namespace internal
|
|
631
846
|
|
|
632
847
|
/***************************************************************************
|
|
633
|
-
* Implementation of SparseMatrixBase and SparseCwise functions/operators
|
|
634
|
-
***************************************************************************/
|
|
635
|
-
|
|
636
|
-
template<typename Derived>
|
|
637
|
-
template<typename OtherDerived>
|
|
638
|
-
Derived& SparseMatrixBase<Derived>::operator+=(const EigenBase<OtherDerived
|
|
639
|
-
|
|
640
|
-
call_assignment(derived(), other.derived(), internal::add_assign_op<Scalar,typename OtherDerived::Scalar>());
|
|
848
|
+
* Implementation of SparseMatrixBase and SparseCwise functions/operators
|
|
849
|
+
***************************************************************************/
|
|
850
|
+
|
|
851
|
+
template <typename Derived>
|
|
852
|
+
template <typename OtherDerived>
|
|
853
|
+
Derived& SparseMatrixBase<Derived>::operator+=(const EigenBase<OtherDerived>& other) {
|
|
854
|
+
call_assignment(derived(), other.derived(), internal::add_assign_op<Scalar, typename OtherDerived::Scalar>());
|
|
641
855
|
return derived();
|
|
642
856
|
}
|
|
643
857
|
|
|
644
|
-
template<typename Derived>
|
|
645
|
-
template<typename OtherDerived>
|
|
646
|
-
Derived& SparseMatrixBase<Derived>::operator-=(const EigenBase<OtherDerived
|
|
647
|
-
|
|
648
|
-
call_assignment(derived(), other.derived(), internal::assign_op<Scalar,typename OtherDerived::Scalar>());
|
|
858
|
+
template <typename Derived>
|
|
859
|
+
template <typename OtherDerived>
|
|
860
|
+
Derived& SparseMatrixBase<Derived>::operator-=(const EigenBase<OtherDerived>& other) {
|
|
861
|
+
call_assignment(derived(), other.derived(), internal::assign_op<Scalar, typename OtherDerived::Scalar>());
|
|
649
862
|
return derived();
|
|
650
863
|
}
|
|
651
864
|
|
|
652
|
-
template<typename Derived>
|
|
653
|
-
template<typename OtherDerived>
|
|
654
|
-
EIGEN_STRONG_INLINE Derived
|
|
655
|
-
SparseMatrixBase<Derived>::operator-=(const SparseMatrixBase<OtherDerived> &other)
|
|
656
|
-
{
|
|
865
|
+
template <typename Derived>
|
|
866
|
+
template <typename OtherDerived>
|
|
867
|
+
EIGEN_STRONG_INLINE Derived& SparseMatrixBase<Derived>::operator-=(const SparseMatrixBase<OtherDerived>& other) {
|
|
657
868
|
return derived() = derived() - other.derived();
|
|
658
869
|
}
|
|
659
870
|
|
|
660
|
-
template<typename Derived>
|
|
661
|
-
template<typename OtherDerived>
|
|
662
|
-
EIGEN_STRONG_INLINE Derived
|
|
663
|
-
SparseMatrixBase<Derived>::operator+=(const SparseMatrixBase<OtherDerived>& other)
|
|
664
|
-
{
|
|
871
|
+
template <typename Derived>
|
|
872
|
+
template <typename OtherDerived>
|
|
873
|
+
EIGEN_STRONG_INLINE Derived& SparseMatrixBase<Derived>::operator+=(const SparseMatrixBase<OtherDerived>& other) {
|
|
665
874
|
return derived() = derived() + other.derived();
|
|
666
875
|
}
|
|
667
876
|
|
|
668
|
-
template<typename Derived>
|
|
669
|
-
template<typename OtherDerived>
|
|
670
|
-
Derived& SparseMatrixBase<Derived>::operator+=(const DiagonalBase<OtherDerived>& other)
|
|
671
|
-
|
|
672
|
-
|
|
877
|
+
template <typename Derived>
|
|
878
|
+
template <typename OtherDerived>
|
|
879
|
+
Derived& SparseMatrixBase<Derived>::operator+=(const DiagonalBase<OtherDerived>& other) {
|
|
880
|
+
call_assignment_no_alias(derived(), other.derived(),
|
|
881
|
+
internal::add_assign_op<Scalar, typename OtherDerived::Scalar>());
|
|
673
882
|
return derived();
|
|
674
883
|
}
|
|
675
884
|
|
|
676
|
-
template<typename Derived>
|
|
677
|
-
template<typename OtherDerived>
|
|
678
|
-
Derived& SparseMatrixBase<Derived>::operator-=(const DiagonalBase<OtherDerived>& other)
|
|
679
|
-
|
|
680
|
-
|
|
885
|
+
template <typename Derived>
|
|
886
|
+
template <typename OtherDerived>
|
|
887
|
+
Derived& SparseMatrixBase<Derived>::operator-=(const DiagonalBase<OtherDerived>& other) {
|
|
888
|
+
call_assignment_no_alias(derived(), other.derived(),
|
|
889
|
+
internal::sub_assign_op<Scalar, typename OtherDerived::Scalar>());
|
|
681
890
|
return derived();
|
|
682
891
|
}
|
|
683
|
-
|
|
684
|
-
template<typename Derived>
|
|
685
|
-
template<typename OtherDerived>
|
|
892
|
+
|
|
893
|
+
template <typename Derived>
|
|
894
|
+
template <typename OtherDerived>
|
|
686
895
|
EIGEN_STRONG_INLINE const typename SparseMatrixBase<Derived>::template CwiseProductDenseReturnType<OtherDerived>::Type
|
|
687
|
-
SparseMatrixBase<Derived>::cwiseProduct(const MatrixBase<OtherDerived
|
|
688
|
-
{
|
|
896
|
+
SparseMatrixBase<Derived>::cwiseProduct(const MatrixBase<OtherDerived>& other) const {
|
|
689
897
|
return typename CwiseProductDenseReturnType<OtherDerived>::Type(derived(), other.derived());
|
|
690
898
|
}
|
|
691
899
|
|
|
692
|
-
template<typename DenseDerived, typename SparseDerived>
|
|
693
|
-
EIGEN_STRONG_INLINE const
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
900
|
+
template <typename DenseDerived, typename SparseDerived>
|
|
901
|
+
EIGEN_STRONG_INLINE const
|
|
902
|
+
CwiseBinaryOp<internal::scalar_sum_op<typename DenseDerived::Scalar, typename SparseDerived::Scalar>,
|
|
903
|
+
const DenseDerived, const SparseDerived>
|
|
904
|
+
operator+(const MatrixBase<DenseDerived>& a, const SparseMatrixBase<SparseDerived>& b) {
|
|
905
|
+
return CwiseBinaryOp<internal::scalar_sum_op<typename DenseDerived::Scalar, typename SparseDerived::Scalar>,
|
|
906
|
+
const DenseDerived, const SparseDerived>(a.derived(), b.derived());
|
|
697
907
|
}
|
|
698
908
|
|
|
699
|
-
template<typename SparseDerived, typename DenseDerived>
|
|
700
|
-
EIGEN_STRONG_INLINE const
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
909
|
+
template <typename SparseDerived, typename DenseDerived>
|
|
910
|
+
EIGEN_STRONG_INLINE const
|
|
911
|
+
CwiseBinaryOp<internal::scalar_sum_op<typename SparseDerived::Scalar, typename DenseDerived::Scalar>,
|
|
912
|
+
const SparseDerived, const DenseDerived>
|
|
913
|
+
operator+(const SparseMatrixBase<SparseDerived>& a, const MatrixBase<DenseDerived>& b) {
|
|
914
|
+
return CwiseBinaryOp<internal::scalar_sum_op<typename SparseDerived::Scalar, typename DenseDerived::Scalar>,
|
|
915
|
+
const SparseDerived, const DenseDerived>(a.derived(), b.derived());
|
|
704
916
|
}
|
|
705
917
|
|
|
706
|
-
template<typename DenseDerived, typename SparseDerived>
|
|
707
|
-
EIGEN_STRONG_INLINE const
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
918
|
+
template <typename DenseDerived, typename SparseDerived>
|
|
919
|
+
EIGEN_STRONG_INLINE const
|
|
920
|
+
CwiseBinaryOp<internal::scalar_difference_op<typename DenseDerived::Scalar, typename SparseDerived::Scalar>,
|
|
921
|
+
const DenseDerived, const SparseDerived>
|
|
922
|
+
operator-(const MatrixBase<DenseDerived>& a, const SparseMatrixBase<SparseDerived>& b) {
|
|
923
|
+
return CwiseBinaryOp<internal::scalar_difference_op<typename DenseDerived::Scalar, typename SparseDerived::Scalar>,
|
|
924
|
+
const DenseDerived, const SparseDerived>(a.derived(), b.derived());
|
|
711
925
|
}
|
|
712
926
|
|
|
713
|
-
template<typename SparseDerived, typename DenseDerived>
|
|
714
|
-
EIGEN_STRONG_INLINE const
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
927
|
+
template <typename SparseDerived, typename DenseDerived>
|
|
928
|
+
EIGEN_STRONG_INLINE const
|
|
929
|
+
CwiseBinaryOp<internal::scalar_difference_op<typename SparseDerived::Scalar, typename DenseDerived::Scalar>,
|
|
930
|
+
const SparseDerived, const DenseDerived>
|
|
931
|
+
operator-(const SparseMatrixBase<SparseDerived>& a, const MatrixBase<DenseDerived>& b) {
|
|
932
|
+
return CwiseBinaryOp<internal::scalar_difference_op<typename SparseDerived::Scalar, typename DenseDerived::Scalar>,
|
|
933
|
+
const SparseDerived, const DenseDerived>(a.derived(), b.derived());
|
|
718
934
|
}
|
|
719
935
|
|
|
720
|
-
}
|
|
936
|
+
} // end namespace Eigen
|
|
721
937
|
|
|
722
|
-
#endif
|
|
938
|
+
#endif // EIGEN_SPARSE_CWISE_BINARY_OP_H
|