@smake/eigen 1.0.2 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/eigen/Eigen/AccelerateSupport +52 -0
- package/eigen/Eigen/Cholesky +18 -21
- package/eigen/Eigen/CholmodSupport +28 -28
- package/eigen/Eigen/Core +235 -326
- package/eigen/Eigen/Eigenvalues +16 -14
- package/eigen/Eigen/Geometry +21 -24
- package/eigen/Eigen/Householder +9 -8
- package/eigen/Eigen/IterativeLinearSolvers +8 -4
- package/eigen/Eigen/Jacobi +14 -14
- package/eigen/Eigen/KLUSupport +43 -0
- package/eigen/Eigen/LU +16 -20
- package/eigen/Eigen/MetisSupport +12 -12
- package/eigen/Eigen/OrderingMethods +54 -54
- package/eigen/Eigen/PaStiXSupport +23 -20
- package/eigen/Eigen/PardisoSupport +17 -14
- package/eigen/Eigen/QR +18 -21
- package/eigen/Eigen/QtAlignedMalloc +5 -13
- package/eigen/Eigen/SPQRSupport +21 -14
- package/eigen/Eigen/SVD +23 -18
- package/eigen/Eigen/Sparse +1 -4
- package/eigen/Eigen/SparseCholesky +18 -23
- package/eigen/Eigen/SparseCore +18 -17
- package/eigen/Eigen/SparseLU +12 -8
- package/eigen/Eigen/SparseQR +16 -14
- package/eigen/Eigen/StdDeque +5 -2
- package/eigen/Eigen/StdList +5 -2
- package/eigen/Eigen/StdVector +5 -2
- package/eigen/Eigen/SuperLUSupport +30 -24
- package/eigen/Eigen/ThreadPool +80 -0
- package/eigen/Eigen/UmfPackSupport +19 -17
- package/eigen/Eigen/Version +14 -0
- package/eigen/Eigen/src/AccelerateSupport/AccelerateSupport.h +423 -0
- package/eigen/Eigen/src/AccelerateSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Cholesky/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Cholesky/LDLT.h +377 -401
- package/eigen/Eigen/src/Cholesky/LLT.h +332 -360
- package/eigen/Eigen/src/Cholesky/LLT_LAPACKE.h +81 -56
- package/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +620 -521
- package/eigen/Eigen/src/CholmodSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Core/ArithmeticSequence.h +239 -0
- package/eigen/Eigen/src/Core/Array.h +341 -294
- package/eigen/Eigen/src/Core/ArrayBase.h +190 -203
- package/eigen/Eigen/src/Core/ArrayWrapper.h +127 -171
- package/eigen/Eigen/src/Core/Assign.h +30 -40
- package/eigen/Eigen/src/Core/AssignEvaluator.h +711 -589
- package/eigen/Eigen/src/Core/Assign_MKL.h +130 -125
- package/eigen/Eigen/src/Core/BandMatrix.h +268 -283
- package/eigen/Eigen/src/Core/Block.h +375 -398
- package/eigen/Eigen/src/Core/CommaInitializer.h +86 -97
- package/eigen/Eigen/src/Core/ConditionEstimator.h +51 -53
- package/eigen/Eigen/src/Core/CoreEvaluators.h +1356 -1026
- package/eigen/Eigen/src/Core/CoreIterators.h +73 -59
- package/eigen/Eigen/src/Core/CwiseBinaryOp.h +114 -132
- package/eigen/Eigen/src/Core/CwiseNullaryOp.h +726 -617
- package/eigen/Eigen/src/Core/CwiseTernaryOp.h +77 -103
- package/eigen/Eigen/src/Core/CwiseUnaryOp.h +56 -68
- package/eigen/Eigen/src/Core/CwiseUnaryView.h +132 -95
- package/eigen/Eigen/src/Core/DenseBase.h +632 -571
- package/eigen/Eigen/src/Core/DenseCoeffsBase.h +511 -624
- package/eigen/Eigen/src/Core/DenseStorage.h +512 -509
- package/eigen/Eigen/src/Core/DeviceWrapper.h +153 -0
- package/eigen/Eigen/src/Core/Diagonal.h +169 -210
- package/eigen/Eigen/src/Core/DiagonalMatrix.h +351 -274
- package/eigen/Eigen/src/Core/DiagonalProduct.h +12 -10
- package/eigen/Eigen/src/Core/Dot.h +172 -222
- package/eigen/Eigen/src/Core/EigenBase.h +75 -85
- package/eigen/Eigen/src/Core/Fill.h +138 -0
- package/eigen/Eigen/src/Core/FindCoeff.h +464 -0
- package/eigen/Eigen/src/Core/ForceAlignedAccess.h +90 -109
- package/eigen/Eigen/src/Core/Fuzzy.h +82 -105
- package/eigen/Eigen/src/Core/GeneralProduct.h +327 -263
- package/eigen/Eigen/src/Core/GenericPacketMath.h +1472 -360
- package/eigen/Eigen/src/Core/GlobalFunctions.h +194 -151
- package/eigen/Eigen/src/Core/IO.h +147 -139
- package/eigen/Eigen/src/Core/IndexedView.h +321 -0
- package/eigen/Eigen/src/Core/InnerProduct.h +260 -0
- package/eigen/Eigen/src/Core/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Core/Inverse.h +56 -66
- package/eigen/Eigen/src/Core/Map.h +124 -142
- package/eigen/Eigen/src/Core/MapBase.h +256 -281
- package/eigen/Eigen/src/Core/MathFunctions.h +1620 -938
- package/eigen/Eigen/src/Core/MathFunctionsImpl.h +233 -71
- package/eigen/Eigen/src/Core/Matrix.h +491 -416
- package/eigen/Eigen/src/Core/MatrixBase.h +468 -453
- package/eigen/Eigen/src/Core/NestByValue.h +66 -85
- package/eigen/Eigen/src/Core/NoAlias.h +79 -85
- package/eigen/Eigen/src/Core/NumTraits.h +235 -148
- package/eigen/Eigen/src/Core/PartialReduxEvaluator.h +253 -0
- package/eigen/Eigen/src/Core/PermutationMatrix.h +461 -511
- package/eigen/Eigen/src/Core/PlainObjectBase.h +871 -894
- package/eigen/Eigen/src/Core/Product.h +260 -139
- package/eigen/Eigen/src/Core/ProductEvaluators.h +863 -714
- package/eigen/Eigen/src/Core/Random.h +161 -136
- package/eigen/Eigen/src/Core/RandomImpl.h +262 -0
- package/eigen/Eigen/src/Core/RealView.h +250 -0
- package/eigen/Eigen/src/Core/Redux.h +366 -336
- package/eigen/Eigen/src/Core/Ref.h +308 -209
- package/eigen/Eigen/src/Core/Replicate.h +94 -106
- package/eigen/Eigen/src/Core/Reshaped.h +398 -0
- package/eigen/Eigen/src/Core/ReturnByValue.h +49 -55
- package/eigen/Eigen/src/Core/Reverse.h +136 -145
- package/eigen/Eigen/src/Core/Select.h +70 -140
- package/eigen/Eigen/src/Core/SelfAdjointView.h +262 -285
- package/eigen/Eigen/src/Core/SelfCwiseBinaryOp.h +23 -20
- package/eigen/Eigen/src/Core/SkewSymmetricMatrix3.h +382 -0
- package/eigen/Eigen/src/Core/Solve.h +97 -111
- package/eigen/Eigen/src/Core/SolveTriangular.h +131 -129
- package/eigen/Eigen/src/Core/SolverBase.h +138 -101
- package/eigen/Eigen/src/Core/StableNorm.h +156 -160
- package/eigen/Eigen/src/Core/StlIterators.h +619 -0
- package/eigen/Eigen/src/Core/Stride.h +91 -88
- package/eigen/Eigen/src/Core/Swap.h +70 -38
- package/eigen/Eigen/src/Core/Transpose.h +295 -273
- package/eigen/Eigen/src/Core/Transpositions.h +272 -317
- package/eigen/Eigen/src/Core/TriangularMatrix.h +670 -755
- package/eigen/Eigen/src/Core/VectorBlock.h +59 -72
- package/eigen/Eigen/src/Core/VectorwiseOp.h +668 -630
- package/eigen/Eigen/src/Core/Visitor.h +480 -216
- package/eigen/Eigen/src/Core/arch/AVX/Complex.h +407 -293
- package/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +79 -388
- package/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +2935 -491
- package/eigen/Eigen/src/Core/arch/AVX/Reductions.h +353 -0
- package/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +279 -22
- package/eigen/Eigen/src/Core/arch/AVX512/Complex.h +472 -0
- package/eigen/Eigen/src/Core/arch/AVX512/GemmKernel.h +1245 -0
- package/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +85 -333
- package/eigen/Eigen/src/Core/arch/AVX512/MathFunctionsFP16.h +75 -0
- package/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +2490 -649
- package/eigen/Eigen/src/Core/arch/AVX512/PacketMathFP16.h +1413 -0
- package/eigen/Eigen/src/Core/arch/AVX512/Reductions.h +297 -0
- package/eigen/Eigen/src/Core/arch/AVX512/TrsmKernel.h +1167 -0
- package/eigen/Eigen/src/Core/arch/AVX512/TrsmUnrolls.inc +1219 -0
- package/eigen/Eigen/src/Core/arch/AVX512/TypeCasting.h +277 -0
- package/eigen/Eigen/src/Core/arch/AVX512/TypeCastingFP16.h +130 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +521 -298
- package/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +39 -280
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +3686 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +205 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +901 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMAbfloat16.h +742 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixVectorProduct.inc +2818 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h +3391 -723
- package/eigen/Eigen/src/Core/arch/AltiVec/TypeCasting.h +153 -0
- package/eigen/Eigen/src/Core/arch/Default/BFloat16.h +866 -0
- package/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +113 -14
- package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +2634 -0
- package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +227 -0
- package/eigen/Eigen/src/Core/arch/Default/Half.h +1091 -0
- package/eigen/Eigen/src/Core/arch/Default/Settings.h +11 -13
- package/eigen/Eigen/src/Core/arch/GPU/Complex.h +244 -0
- package/eigen/Eigen/src/Core/arch/GPU/MathFunctions.h +104 -0
- package/eigen/Eigen/src/Core/arch/GPU/PacketMath.h +1712 -0
- package/eigen/Eigen/src/Core/arch/GPU/Tuple.h +268 -0
- package/eigen/Eigen/src/Core/arch/GPU/TypeCasting.h +77 -0
- package/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h +23 -0
- package/eigen/Eigen/src/Core/arch/HVX/PacketMath.h +1088 -0
- package/eigen/Eigen/src/Core/arch/LSX/Complex.h +520 -0
- package/eigen/Eigen/src/Core/arch/LSX/GeneralBlockPanelKernel.h +23 -0
- package/eigen/Eigen/src/Core/arch/LSX/MathFunctions.h +43 -0
- package/eigen/Eigen/src/Core/arch/LSX/PacketMath.h +2866 -0
- package/eigen/Eigen/src/Core/arch/LSX/TypeCasting.h +526 -0
- package/eigen/Eigen/src/Core/arch/MSA/Complex.h +620 -0
- package/eigen/Eigen/src/Core/arch/MSA/MathFunctions.h +379 -0
- package/eigen/Eigen/src/Core/arch/MSA/PacketMath.h +1237 -0
- package/eigen/Eigen/src/Core/arch/NEON/Complex.h +531 -289
- package/eigen/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +243 -0
- package/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +50 -73
- package/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +5915 -579
- package/eigen/Eigen/src/Core/arch/NEON/TypeCasting.h +1642 -0
- package/eigen/Eigen/src/Core/arch/NEON/UnaryFunctors.h +57 -0
- package/eigen/Eigen/src/Core/arch/SSE/Complex.h +366 -334
- package/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +40 -514
- package/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +2164 -675
- package/eigen/Eigen/src/Core/arch/SSE/Reductions.h +324 -0
- package/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +188 -35
- package/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h +48 -0
- package/eigen/Eigen/src/Core/arch/SVE/PacketMath.h +674 -0
- package/eigen/Eigen/src/Core/arch/SVE/TypeCasting.h +52 -0
- package/eigen/Eigen/src/Core/arch/SYCL/InteropHeaders.h +227 -0
- package/eigen/Eigen/src/Core/arch/SYCL/MathFunctions.h +303 -0
- package/eigen/Eigen/src/Core/arch/SYCL/PacketMath.h +576 -0
- package/eigen/Eigen/src/Core/arch/SYCL/TypeCasting.h +83 -0
- package/eigen/Eigen/src/Core/arch/ZVector/Complex.h +434 -261
- package/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +160 -53
- package/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +1073 -605
- package/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +123 -117
- package/eigen/Eigen/src/Core/functors/BinaryFunctors.h +594 -322
- package/eigen/Eigen/src/Core/functors/NullaryFunctors.h +204 -118
- package/eigen/Eigen/src/Core/functors/StlFunctors.h +110 -97
- package/eigen/Eigen/src/Core/functors/TernaryFunctors.h +34 -7
- package/eigen/Eigen/src/Core/functors/UnaryFunctors.h +1158 -530
- package/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +2329 -1333
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +328 -364
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +191 -178
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +85 -82
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +154 -73
- package/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +396 -542
- package/eigen/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +80 -77
- package/eigen/Eigen/src/Core/products/Parallelizer.h +208 -92
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +331 -375
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +206 -224
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +139 -146
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h +58 -61
- package/eigen/Eigen/src/Core/products/SelfadjointProduct.h +71 -71
- package/eigen/Eigen/src/Core/products/SelfadjointRank2Update.h +48 -46
- package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix.h +294 -369
- package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +246 -238
- package/eigen/Eigen/src/Core/products/TriangularMatrixVector.h +244 -247
- package/eigen/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h +212 -192
- package/eigen/Eigen/src/Core/products/TriangularSolverMatrix.h +328 -275
- package/eigen/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +108 -109
- package/eigen/Eigen/src/Core/products/TriangularSolverVector.h +70 -93
- package/eigen/Eigen/src/Core/util/Assert.h +158 -0
- package/eigen/Eigen/src/Core/util/BlasUtil.h +413 -290
- package/eigen/Eigen/src/Core/util/ConfigureVectorization.h +543 -0
- package/eigen/Eigen/src/Core/util/Constants.h +314 -263
- package/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +130 -78
- package/eigen/Eigen/src/Core/util/EmulateArray.h +270 -0
- package/eigen/Eigen/src/Core/util/ForwardDeclarations.h +450 -224
- package/eigen/Eigen/src/Core/util/GpuHipCudaDefines.inc +101 -0
- package/eigen/Eigen/src/Core/util/GpuHipCudaUndefines.inc +45 -0
- package/eigen/Eigen/src/Core/util/IndexedViewHelper.h +487 -0
- package/eigen/Eigen/src/Core/util/IntegralConstant.h +279 -0
- package/eigen/Eigen/src/Core/util/MKL_support.h +39 -30
- package/eigen/Eigen/src/Core/util/Macros.h +939 -646
- package/eigen/Eigen/src/Core/util/MaxSizeVector.h +139 -0
- package/eigen/Eigen/src/Core/util/Memory.h +1042 -650
- package/eigen/Eigen/src/Core/util/Meta.h +618 -426
- package/eigen/Eigen/src/Core/util/MoreMeta.h +638 -0
- package/eigen/Eigen/src/Core/util/ReenableStupidWarnings.h +32 -19
- package/eigen/Eigen/src/Core/util/ReshapedHelper.h +51 -0
- package/eigen/Eigen/src/Core/util/Serializer.h +209 -0
- package/eigen/Eigen/src/Core/util/StaticAssert.h +51 -164
- package/eigen/Eigen/src/Core/util/SymbolicIndex.h +445 -0
- package/eigen/Eigen/src/Core/util/XprHelper.h +793 -538
- package/eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h +246 -277
- package/eigen/Eigen/src/Eigenvalues/ComplexSchur.h +299 -319
- package/eigen/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h +52 -48
- package/eigen/Eigen/src/Eigenvalues/EigenSolver.h +413 -456
- package/eigen/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +309 -325
- package/eigen/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +157 -171
- package/eigen/Eigen/src/Eigenvalues/HessenbergDecomposition.h +292 -310
- package/eigen/Eigen/src/Eigenvalues/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +91 -107
- package/eigen/Eigen/src/Eigenvalues/RealQZ.h +539 -606
- package/eigen/Eigen/src/Eigenvalues/RealSchur.h +348 -382
- package/eigen/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +41 -35
- package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +579 -600
- package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +47 -44
- package/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +434 -461
- package/eigen/Eigen/src/Geometry/AlignedBox.h +307 -214
- package/eigen/Eigen/src/Geometry/AngleAxis.h +135 -137
- package/eigen/Eigen/src/Geometry/EulerAngles.h +163 -74
- package/eigen/Eigen/src/Geometry/Homogeneous.h +289 -333
- package/eigen/Eigen/src/Geometry/Hyperplane.h +152 -161
- package/eigen/Eigen/src/Geometry/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Geometry/OrthoMethods.h +168 -145
- package/eigen/Eigen/src/Geometry/ParametrizedLine.h +141 -104
- package/eigen/Eigen/src/Geometry/Quaternion.h +595 -497
- package/eigen/Eigen/src/Geometry/Rotation2D.h +110 -108
- package/eigen/Eigen/src/Geometry/RotationBase.h +148 -145
- package/eigen/Eigen/src/Geometry/Scaling.h +115 -90
- package/eigen/Eigen/src/Geometry/Transform.h +896 -953
- package/eigen/Eigen/src/Geometry/Translation.h +100 -98
- package/eigen/Eigen/src/Geometry/Umeyama.h +79 -84
- package/eigen/Eigen/src/Geometry/arch/Geometry_SIMD.h +154 -0
- package/eigen/Eigen/src/Householder/BlockHouseholder.h +54 -42
- package/eigen/Eigen/src/Householder/Householder.h +104 -122
- package/eigen/Eigen/src/Householder/HouseholderSequence.h +416 -382
- package/eigen/Eigen/src/Householder/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +153 -166
- package/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +127 -138
- package/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +95 -124
- package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +269 -267
- package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +246 -259
- package/eigen/Eigen/src/IterativeLinearSolvers/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +218 -217
- package/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +80 -103
- package/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +59 -63
- package/eigen/Eigen/src/Jacobi/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Jacobi/Jacobi.h +256 -291
- package/eigen/Eigen/src/KLUSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/KLUSupport/KLUSupport.h +339 -0
- package/eigen/Eigen/src/LU/Determinant.h +60 -63
- package/eigen/Eigen/src/LU/FullPivLU.h +561 -626
- package/eigen/Eigen/src/LU/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/LU/InverseImpl.h +213 -275
- package/eigen/Eigen/src/LU/PartialPivLU.h +407 -435
- package/eigen/Eigen/src/LU/PartialPivLU_LAPACKE.h +54 -40
- package/eigen/Eigen/src/LU/arch/InverseSize4.h +353 -0
- package/eigen/Eigen/src/MetisSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/MetisSupport/MetisSupport.h +81 -93
- package/eigen/Eigen/src/OrderingMethods/Amd.h +250 -282
- package/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +950 -1103
- package/eigen/Eigen/src/OrderingMethods/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/OrderingMethods/Ordering.h +111 -122
- package/eigen/Eigen/src/PaStiXSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h +524 -570
- package/eigen/Eigen/src/PardisoSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/PardisoSupport/PardisoSupport.h +385 -429
- package/eigen/Eigen/src/QR/ColPivHouseholderQR.h +494 -473
- package/eigen/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +120 -56
- package/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +223 -137
- package/eigen/Eigen/src/QR/FullPivHouseholderQR.h +517 -460
- package/eigen/Eigen/src/QR/HouseholderQR.h +412 -278
- package/eigen/Eigen/src/QR/HouseholderQR_LAPACKE.h +32 -23
- package/eigen/Eigen/src/QR/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SPQRSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +263 -261
- package/eigen/Eigen/src/SVD/BDCSVD.h +872 -679
- package/eigen/Eigen/src/SVD/BDCSVD_LAPACKE.h +174 -0
- package/eigen/Eigen/src/SVD/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SVD/JacobiSVD.h +585 -543
- package/eigen/Eigen/src/SVD/JacobiSVD_LAPACKE.h +85 -49
- package/eigen/Eigen/src/SVD/SVDBase.h +281 -160
- package/eigen/Eigen/src/SVD/UpperBidiagonalization.h +202 -237
- package/eigen/Eigen/src/SparseCholesky/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +769 -590
- package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +318 -129
- package/eigen/Eigen/src/SparseCore/AmbiVector.h +202 -251
- package/eigen/Eigen/src/SparseCore/CompressedStorage.h +184 -236
- package/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +140 -184
- package/eigen/Eigen/src/SparseCore/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseCore/SparseAssign.h +174 -111
- package/eigen/Eigen/src/SparseCore/SparseBlock.h +408 -477
- package/eigen/Eigen/src/SparseCore/SparseColEtree.h +100 -112
- package/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +531 -280
- package/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +559 -347
- package/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +100 -108
- package/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +185 -191
- package/eigen/Eigen/src/SparseCore/SparseDiagonalProduct.h +71 -71
- package/eigen/Eigen/src/SparseCore/SparseDot.h +49 -47
- package/eigen/Eigen/src/SparseCore/SparseFuzzy.h +13 -11
- package/eigen/Eigen/src/SparseCore/SparseMap.h +243 -253
- package/eigen/Eigen/src/SparseCore/SparseMatrix.h +1614 -1142
- package/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +403 -357
- package/eigen/Eigen/src/SparseCore/SparsePermutation.h +186 -115
- package/eigen/Eigen/src/SparseCore/SparseProduct.h +100 -91
- package/eigen/Eigen/src/SparseCore/SparseRedux.h +22 -24
- package/eigen/Eigen/src/SparseCore/SparseRef.h +268 -295
- package/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h +371 -414
- package/eigen/Eigen/src/SparseCore/SparseSolverBase.h +78 -87
- package/eigen/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +81 -95
- package/eigen/Eigen/src/SparseCore/SparseTranspose.h +62 -71
- package/eigen/Eigen/src/SparseCore/SparseTriangularView.h +132 -144
- package/eigen/Eigen/src/SparseCore/SparseUtil.h +146 -115
- package/eigen/Eigen/src/SparseCore/SparseVector.h +426 -372
- package/eigen/Eigen/src/SparseCore/SparseView.h +164 -193
- package/eigen/Eigen/src/SparseCore/TriangularSolver.h +129 -170
- package/eigen/Eigen/src/SparseLU/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseLU/SparseLU.h +814 -618
- package/eigen/Eigen/src/SparseLU/SparseLUImpl.h +61 -48
- package/eigen/Eigen/src/SparseLU/SparseLU_Memory.h +102 -118
- package/eigen/Eigen/src/SparseLU/SparseLU_Structs.h +38 -35
- package/eigen/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +273 -255
- package/eigen/Eigen/src/SparseLU/SparseLU_Utils.h +44 -49
- package/eigen/Eigen/src/SparseLU/SparseLU_column_bmod.h +104 -108
- package/eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h +90 -101
- package/eigen/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +57 -58
- package/eigen/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +43 -55
- package/eigen/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +74 -71
- package/eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h +125 -133
- package/eigen/Eigen/src/SparseLU/SparseLU_panel_dfs.h +136 -159
- package/eigen/Eigen/src/SparseLU/SparseLU_pivotL.h +51 -52
- package/eigen/Eigen/src/SparseLU/SparseLU_pruneL.h +67 -73
- package/eigen/Eigen/src/SparseLU/SparseLU_relax_snode.h +24 -26
- package/eigen/Eigen/src/SparseQR/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseQR/SparseQR.h +451 -490
- package/eigen/Eigen/src/StlSupport/StdDeque.h +28 -105
- package/eigen/Eigen/src/StlSupport/StdList.h +28 -84
- package/eigen/Eigen/src/StlSupport/StdVector.h +28 -108
- package/eigen/Eigen/src/StlSupport/details.h +48 -50
- package/eigen/Eigen/src/SuperLUSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SuperLUSupport/SuperLUSupport.h +634 -732
- package/eigen/Eigen/src/ThreadPool/Barrier.h +70 -0
- package/eigen/Eigen/src/ThreadPool/CoreThreadPoolDevice.h +336 -0
- package/eigen/Eigen/src/ThreadPool/EventCount.h +241 -0
- package/eigen/Eigen/src/ThreadPool/ForkJoin.h +140 -0
- package/eigen/Eigen/src/ThreadPool/InternalHeaderCheck.h +4 -0
- package/eigen/Eigen/src/ThreadPool/NonBlockingThreadPool.h +587 -0
- package/eigen/Eigen/src/ThreadPool/RunQueue.h +230 -0
- package/eigen/Eigen/src/ThreadPool/ThreadCancel.h +21 -0
- package/eigen/Eigen/src/ThreadPool/ThreadEnvironment.h +43 -0
- package/eigen/Eigen/src/ThreadPool/ThreadLocal.h +289 -0
- package/eigen/Eigen/src/ThreadPool/ThreadPoolInterface.h +50 -0
- package/eigen/Eigen/src/ThreadPool/ThreadYield.h +16 -0
- package/eigen/Eigen/src/UmfPackSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/UmfPackSupport/UmfPackSupport.h +480 -380
- package/eigen/Eigen/src/misc/Image.h +41 -43
- package/eigen/Eigen/src/misc/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/misc/Kernel.h +39 -41
- package/eigen/Eigen/src/misc/RealSvd2x2.h +19 -21
- package/eigen/Eigen/src/misc/blas.h +83 -426
- package/eigen/Eigen/src/misc/lapacke.h +9976 -16182
- package/eigen/Eigen/src/misc/lapacke_helpers.h +163 -0
- package/eigen/Eigen/src/misc/lapacke_mangling.h +4 -5
- package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.inc +344 -0
- package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.inc +544 -0
- package/eigen/Eigen/src/plugins/BlockMethods.inc +1370 -0
- package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.inc +116 -0
- package/eigen/Eigen/src/plugins/CommonCwiseUnaryOps.inc +167 -0
- package/eigen/Eigen/src/plugins/IndexedViewMethods.inc +192 -0
- package/eigen/Eigen/src/plugins/InternalHeaderCheck.inc +3 -0
- package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.inc +331 -0
- package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.inc +118 -0
- package/eigen/Eigen/src/plugins/ReshapedMethods.inc +133 -0
- package/lib/LibEigen.d.ts +4 -0
- package/lib/LibEigen.js +14 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +7 -3
- package/package.json +2 -10
- package/eigen/Eigen/CMakeLists.txt +0 -19
- package/eigen/Eigen/src/Core/BooleanRedux.h +0 -164
- package/eigen/Eigen/src/Core/arch/CUDA/Complex.h +0 -103
- package/eigen/Eigen/src/Core/arch/CUDA/Half.h +0 -675
- package/eigen/Eigen/src/Core/arch/CUDA/MathFunctions.h +0 -91
- package/eigen/Eigen/src/Core/arch/CUDA/PacketMath.h +0 -333
- package/eigen/Eigen/src/Core/arch/CUDA/PacketMathHalf.h +0 -1124
- package/eigen/Eigen/src/Core/arch/CUDA/TypeCasting.h +0 -212
- package/eigen/Eigen/src/Core/util/NonMPL2.h +0 -3
- package/eigen/Eigen/src/Geometry/arch/Geometry_SSE.h +0 -161
- package/eigen/Eigen/src/LU/arch/Inverse_SSE.h +0 -338
- package/eigen/Eigen/src/SparseCore/MappedSparseMatrix.h +0 -67
- package/eigen/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +0 -280
- package/eigen/Eigen/src/misc/lapack.h +0 -152
- package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.h +0 -332
- package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h +0 -552
- package/eigen/Eigen/src/plugins/BlockMethods.h +0 -1058
- package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.h +0 -115
- package/eigen/Eigen/src/plugins/CommonCwiseUnaryOps.h +0 -163
- package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h +0 -152
- package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h +0 -85
- package/lib/eigen.d.ts +0 -2
- package/lib/eigen.js +0 -15
|
@@ -10,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 = 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,218 +198,198 @@ public:
|
|
|
209
198
|
StorageIndex m_innerSize;
|
|
210
199
|
};
|
|
211
200
|
|
|
212
|
-
|
|
213
201
|
enum {
|
|
214
|
-
CoeffReadCost =
|
|
215
|
-
|
|
216
|
-
Flags =
|
|
202
|
+
CoeffReadCost =
|
|
203
|
+
int(evaluator<Lhs>::CoeffReadCost) + int(evaluator<Rhs>::CoeffReadCost) + int(functor_traits<BinaryOp>::Cost),
|
|
204
|
+
Flags = XprType::Flags
|
|
217
205
|
};
|
|
218
206
|
|
|
219
207
|
explicit binary_evaluator(const XprType& xpr)
|
|
220
|
-
|
|
221
|
-
m_lhsImpl(xpr.lhs()),
|
|
222
|
-
m_rhsImpl(xpr.rhs()),
|
|
223
|
-
m_expr(xpr)
|
|
224
|
-
{
|
|
208
|
+
: m_functor(xpr.functor()), m_lhsImpl(xpr.lhs()), m_rhsImpl(xpr.rhs()), m_expr(xpr) {
|
|
225
209
|
EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<BinaryOp>::Cost);
|
|
226
210
|
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
|
227
211
|
}
|
|
228
212
|
|
|
229
|
-
inline Index nonZerosEstimate() const {
|
|
230
|
-
return m_expr.size();
|
|
231
|
-
}
|
|
213
|
+
inline Index nonZerosEstimate() const { return m_expr.size(); }
|
|
232
214
|
|
|
233
|
-
protected:
|
|
215
|
+
protected:
|
|
234
216
|
const BinaryOp m_functor;
|
|
235
217
|
evaluator<Lhs> m_lhsImpl;
|
|
236
218
|
evaluator<Rhs> m_rhsImpl;
|
|
237
|
-
const XprType
|
|
219
|
+
const XprType& m_expr;
|
|
238
220
|
};
|
|
239
221
|
|
|
240
222
|
// sparse op dense
|
|
241
|
-
template<typename BinaryOp, typename Lhs, typename Rhs>
|
|
223
|
+
template <typename BinaryOp, typename Lhs, typename Rhs>
|
|
242
224
|
struct binary_evaluator<CwiseBinaryOp<BinaryOp, Lhs, Rhs>, IteratorBased, IndexBased>
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
typedef typename evaluator<Lhs>::InnerIterator LhsIterator;
|
|
225
|
+
: evaluator_base<CwiseBinaryOp<BinaryOp, Lhs, Rhs> > {
|
|
226
|
+
protected:
|
|
227
|
+
typedef typename evaluator<Lhs>::InnerIterator LhsIterator;
|
|
247
228
|
typedef CwiseBinaryOp<BinaryOp, Lhs, Rhs> XprType;
|
|
248
229
|
typedef typename traits<XprType>::Scalar Scalar;
|
|
249
230
|
typedef typename XprType::StorageIndex StorageIndex;
|
|
250
|
-
public:
|
|
251
231
|
|
|
252
|
-
|
|
253
|
-
{
|
|
254
|
-
enum { IsRowMajor = (int(Lhs::Flags)&RowMajorBit)==RowMajorBit };
|
|
255
|
-
public:
|
|
232
|
+
public:
|
|
233
|
+
class InnerIterator {
|
|
234
|
+
enum { IsRowMajor = (int(Lhs::Flags) & RowMajorBit) == RowMajorBit };
|
|
256
235
|
|
|
236
|
+
public:
|
|
257
237
|
EIGEN_STRONG_INLINE InnerIterator(const binary_evaluator& aEval, Index outer)
|
|
258
|
-
|
|
259
|
-
|
|
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()) {
|
|
260
244
|
this->operator++();
|
|
261
245
|
}
|
|
262
246
|
|
|
263
|
-
EIGEN_STRONG_INLINE InnerIterator& operator++()
|
|
264
|
-
{
|
|
247
|
+
EIGEN_STRONG_INLINE InnerIterator& operator++() {
|
|
265
248
|
++m_id;
|
|
266
|
-
if(m_id<m_innerSize)
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
IsRowMajor?m_id:m_lhsIter.outer());
|
|
270
|
-
if(m_lhsIter && m_lhsIter.index()==m_id)
|
|
271
|
-
{
|
|
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) {
|
|
272
252
|
m_value = m_functor(m_lhsIter.value(), rhsVal);
|
|
273
253
|
++m_lhsIter;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
m_value = m_functor(Scalar(0),rhsVal);
|
|
254
|
+
} else
|
|
255
|
+
m_value = m_functor(Scalar(0), rhsVal);
|
|
277
256
|
}
|
|
278
257
|
|
|
279
258
|
return *this;
|
|
280
259
|
}
|
|
281
260
|
|
|
282
|
-
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
|
+
}
|
|
283
265
|
|
|
284
266
|
EIGEN_STRONG_INLINE StorageIndex index() const { return m_id; }
|
|
285
267
|
EIGEN_STRONG_INLINE Index outer() const { return m_lhsIter.outer(); }
|
|
286
268
|
EIGEN_STRONG_INLINE Index row() const { return IsRowMajor ? m_lhsIter.outer() : m_id; }
|
|
287
269
|
EIGEN_STRONG_INLINE Index col() const { return IsRowMajor ? m_id : m_lhsIter.outer(); }
|
|
288
270
|
|
|
289
|
-
EIGEN_STRONG_INLINE operator bool() const { return m_id<m_innerSize; }
|
|
271
|
+
EIGEN_STRONG_INLINE operator bool() const { return m_id < m_innerSize; }
|
|
290
272
|
|
|
291
|
-
|
|
273
|
+
protected:
|
|
292
274
|
LhsIterator m_lhsIter;
|
|
293
|
-
const evaluator<Rhs
|
|
275
|
+
const evaluator<Rhs>& m_rhsEval;
|
|
294
276
|
const BinaryOp& m_functor;
|
|
295
277
|
Scalar m_value;
|
|
296
278
|
StorageIndex m_id;
|
|
297
279
|
StorageIndex m_innerSize;
|
|
298
280
|
};
|
|
299
281
|
|
|
300
|
-
|
|
301
282
|
enum {
|
|
302
|
-
CoeffReadCost =
|
|
303
|
-
|
|
304
|
-
Flags =
|
|
283
|
+
CoeffReadCost =
|
|
284
|
+
int(evaluator<Lhs>::CoeffReadCost) + int(evaluator<Rhs>::CoeffReadCost) + int(functor_traits<BinaryOp>::Cost),
|
|
285
|
+
Flags = XprType::Flags
|
|
305
286
|
};
|
|
306
287
|
|
|
307
288
|
explicit binary_evaluator(const XprType& xpr)
|
|
308
|
-
|
|
309
|
-
m_lhsImpl(xpr.lhs()),
|
|
310
|
-
m_rhsImpl(xpr.rhs()),
|
|
311
|
-
m_expr(xpr)
|
|
312
|
-
{
|
|
289
|
+
: m_functor(xpr.functor()), m_lhsImpl(xpr.lhs()), m_rhsImpl(xpr.rhs()), m_expr(xpr) {
|
|
313
290
|
EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<BinaryOp>::Cost);
|
|
314
291
|
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
|
315
292
|
}
|
|
316
293
|
|
|
317
|
-
inline Index nonZerosEstimate() const {
|
|
318
|
-
return m_expr.size();
|
|
319
|
-
}
|
|
294
|
+
inline Index nonZerosEstimate() const { return m_expr.size(); }
|
|
320
295
|
|
|
321
|
-
protected:
|
|
296
|
+
protected:
|
|
322
297
|
const BinaryOp m_functor;
|
|
323
298
|
evaluator<Lhs> m_lhsImpl;
|
|
324
299
|
evaluator<Rhs> m_rhsImpl;
|
|
325
|
-
const XprType
|
|
300
|
+
const XprType& m_expr;
|
|
326
301
|
};
|
|
327
302
|
|
|
328
|
-
template<typename T,
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
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;
|
|
333
308
|
|
|
334
309
|
// "sparse .* sparse"
|
|
335
|
-
template<typename T1, typename T2, typename Lhs, typename Rhs>
|
|
336
|
-
struct binary_evaluator<CwiseBinaryOp<scalar_product_op<T1,T2>, Lhs, Rhs>, IteratorBased, IteratorBased>
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
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;
|
|
340
314
|
typedef sparse_conjunction_evaluator<XprType> Base;
|
|
341
315
|
explicit binary_evaluator(const XprType& xpr) : Base(xpr) {}
|
|
342
316
|
};
|
|
343
317
|
// "dense .* sparse"
|
|
344
|
-
template<typename T1, typename T2, typename Lhs, typename Rhs>
|
|
345
|
-
struct binary_evaluator<CwiseBinaryOp<scalar_product_op<T1,T2>, Lhs, Rhs>, IndexBased, IteratorBased>
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
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;
|
|
349
322
|
typedef sparse_conjunction_evaluator<XprType> Base;
|
|
350
323
|
explicit binary_evaluator(const XprType& xpr) : Base(xpr) {}
|
|
351
324
|
};
|
|
352
325
|
// "sparse .* dense"
|
|
353
|
-
template<typename T1, typename T2, typename Lhs, typename Rhs>
|
|
354
|
-
struct binary_evaluator<CwiseBinaryOp<scalar_product_op<T1,T2>, Lhs, Rhs>, IteratorBased, IndexBased>
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
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;
|
|
358
330
|
typedef sparse_conjunction_evaluator<XprType> Base;
|
|
359
331
|
explicit binary_evaluator(const XprType& xpr) : Base(xpr) {}
|
|
360
332
|
};
|
|
361
333
|
|
|
362
334
|
// "sparse ./ dense"
|
|
363
|
-
template<typename T1, typename T2, typename Lhs, typename Rhs>
|
|
364
|
-
struct binary_evaluator<CwiseBinaryOp<scalar_quotient_op<T1,T2>, Lhs, Rhs>, IteratorBased, IndexBased>
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
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;
|
|
368
339
|
typedef sparse_conjunction_evaluator<XprType> Base;
|
|
369
340
|
explicit binary_evaluator(const XprType& xpr) : Base(xpr) {}
|
|
370
341
|
};
|
|
371
342
|
|
|
372
343
|
// "sparse && sparse"
|
|
373
|
-
template<typename Lhs, typename Rhs>
|
|
374
|
-
struct binary_evaluator<CwiseBinaryOp<scalar_boolean_and_op
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
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;
|
|
378
348
|
typedef sparse_conjunction_evaluator<XprType> Base;
|
|
379
349
|
explicit binary_evaluator(const XprType& xpr) : Base(xpr) {}
|
|
380
350
|
};
|
|
381
351
|
// "dense && sparse"
|
|
382
|
-
template<typename Lhs, typename Rhs>
|
|
383
|
-
struct binary_evaluator<CwiseBinaryOp<scalar_boolean_and_op
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
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;
|
|
387
356
|
typedef sparse_conjunction_evaluator<XprType> Base;
|
|
388
357
|
explicit binary_evaluator(const XprType& xpr) : Base(xpr) {}
|
|
389
358
|
};
|
|
390
359
|
// "sparse && dense"
|
|
391
|
-
template<typename Lhs, typename Rhs>
|
|
392
|
-
struct binary_evaluator<CwiseBinaryOp<scalar_boolean_and_op
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
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;
|
|
396
364
|
typedef sparse_conjunction_evaluator<XprType> Base;
|
|
397
365
|
explicit binary_evaluator(const XprType& xpr) : Base(xpr) {}
|
|
398
366
|
};
|
|
399
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
|
+
|
|
400
375
|
// "sparse ^ sparse"
|
|
401
|
-
template<typename XprType>
|
|
402
|
-
struct sparse_conjunction_evaluator<XprType, IteratorBased, IteratorBased>
|
|
403
|
-
|
|
404
|
-
{
|
|
405
|
-
protected:
|
|
376
|
+
template <typename XprType>
|
|
377
|
+
struct sparse_conjunction_evaluator<XprType, IteratorBased, IteratorBased> : evaluator_base<XprType> {
|
|
378
|
+
protected:
|
|
406
379
|
typedef typename XprType::Functor BinaryOp;
|
|
407
380
|
typedef typename XprType::Lhs LhsArg;
|
|
408
381
|
typedef typename XprType::Rhs RhsArg;
|
|
409
|
-
typedef typename evaluator<LhsArg>::InnerIterator
|
|
410
|
-
typedef typename evaluator<RhsArg>::InnerIterator
|
|
382
|
+
typedef typename evaluator<LhsArg>::InnerIterator LhsIterator;
|
|
383
|
+
typedef typename evaluator<RhsArg>::InnerIterator RhsIterator;
|
|
411
384
|
typedef typename XprType::StorageIndex StorageIndex;
|
|
412
385
|
typedef typename traits<XprType>::Scalar Scalar;
|
|
413
|
-
public:
|
|
414
386
|
|
|
415
|
-
|
|
416
|
-
{
|
|
417
|
-
|
|
418
|
-
|
|
387
|
+
public:
|
|
388
|
+
class InnerIterator {
|
|
389
|
+
public:
|
|
419
390
|
EIGEN_STRONG_INLINE InnerIterator(const sparse_conjunction_evaluator& aEval, Index outer)
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
while (m_lhsIter && m_rhsIter && (m_lhsIter.index() != m_rhsIter.index()))
|
|
423
|
-
{
|
|
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())) {
|
|
424
393
|
if (m_lhsIter.index() < m_rhsIter.index())
|
|
425
394
|
++m_lhsIter;
|
|
426
395
|
else
|
|
@@ -428,12 +397,10 @@ public:
|
|
|
428
397
|
}
|
|
429
398
|
}
|
|
430
399
|
|
|
431
|
-
EIGEN_STRONG_INLINE InnerIterator& operator++()
|
|
432
|
-
{
|
|
400
|
+
EIGEN_STRONG_INLINE InnerIterator& operator++() {
|
|
433
401
|
++m_lhsIter;
|
|
434
402
|
++m_rhsIter;
|
|
435
|
-
while (m_lhsIter && m_rhsIter && (m_lhsIter.index() != m_rhsIter.index()))
|
|
436
|
-
{
|
|
403
|
+
while (m_lhsIter && m_rhsIter && (m_lhsIter.index() != m_rhsIter.index())) {
|
|
437
404
|
if (m_lhsIter.index() < m_rhsIter.index())
|
|
438
405
|
++m_lhsIter;
|
|
439
406
|
else
|
|
@@ -441,7 +408,7 @@ public:
|
|
|
441
408
|
}
|
|
442
409
|
return *this;
|
|
443
410
|
}
|
|
444
|
-
|
|
411
|
+
|
|
445
412
|
EIGEN_STRONG_INLINE Scalar value() const { return m_functor(m_lhsIter.value(), m_rhsIter.value()); }
|
|
446
413
|
|
|
447
414
|
EIGEN_STRONG_INLINE StorageIndex index() const { return m_lhsIter.index(); }
|
|
@@ -451,70 +418,64 @@ public:
|
|
|
451
418
|
|
|
452
419
|
EIGEN_STRONG_INLINE operator bool() const { return (m_lhsIter && m_rhsIter); }
|
|
453
420
|
|
|
454
|
-
|
|
421
|
+
protected:
|
|
455
422
|
LhsIterator m_lhsIter;
|
|
456
423
|
RhsIterator m_rhsIter;
|
|
457
424
|
const BinaryOp& m_functor;
|
|
458
425
|
};
|
|
459
|
-
|
|
460
|
-
|
|
426
|
+
|
|
461
427
|
enum {
|
|
462
|
-
CoeffReadCost = evaluator<LhsArg>::CoeffReadCost + evaluator<RhsArg>::CoeffReadCost +
|
|
428
|
+
CoeffReadCost = int(evaluator<LhsArg>::CoeffReadCost) + int(evaluator<RhsArg>::CoeffReadCost) +
|
|
429
|
+
int(functor_traits<BinaryOp>::Cost),
|
|
463
430
|
Flags = XprType::Flags
|
|
464
431
|
};
|
|
465
|
-
|
|
432
|
+
|
|
466
433
|
explicit sparse_conjunction_evaluator(const XprType& xpr)
|
|
467
|
-
|
|
468
|
-
m_lhsImpl(xpr.lhs()),
|
|
469
|
-
m_rhsImpl(xpr.rhs())
|
|
470
|
-
{
|
|
434
|
+
: m_functor(xpr.functor()), m_lhsImpl(xpr.lhs()), m_rhsImpl(xpr.rhs()) {
|
|
471
435
|
EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<BinaryOp>::Cost);
|
|
472
436
|
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
|
473
437
|
}
|
|
474
|
-
|
|
438
|
+
|
|
475
439
|
inline Index nonZerosEstimate() const {
|
|
476
440
|
return (std::min)(m_lhsImpl.nonZerosEstimate(), m_rhsImpl.nonZerosEstimate());
|
|
477
441
|
}
|
|
478
442
|
|
|
479
|
-
protected:
|
|
443
|
+
protected:
|
|
480
444
|
const BinaryOp m_functor;
|
|
481
445
|
evaluator<LhsArg> m_lhsImpl;
|
|
482
446
|
evaluator<RhsArg> m_rhsImpl;
|
|
483
447
|
};
|
|
484
448
|
|
|
485
449
|
// "dense ^ sparse"
|
|
486
|
-
template<typename XprType>
|
|
487
|
-
struct sparse_conjunction_evaluator<XprType, IndexBased, IteratorBased>
|
|
488
|
-
|
|
489
|
-
{
|
|
490
|
-
protected:
|
|
450
|
+
template <typename XprType>
|
|
451
|
+
struct sparse_conjunction_evaluator<XprType, IndexBased, IteratorBased> : evaluator_base<XprType> {
|
|
452
|
+
protected:
|
|
491
453
|
typedef typename XprType::Functor BinaryOp;
|
|
492
454
|
typedef typename XprType::Lhs LhsArg;
|
|
493
455
|
typedef typename XprType::Rhs RhsArg;
|
|
494
456
|
typedef evaluator<LhsArg> LhsEvaluator;
|
|
495
|
-
typedef typename evaluator<RhsArg>::InnerIterator
|
|
457
|
+
typedef typename evaluator<RhsArg>::InnerIterator RhsIterator;
|
|
496
458
|
typedef typename XprType::StorageIndex StorageIndex;
|
|
497
459
|
typedef typename traits<XprType>::Scalar Scalar;
|
|
498
|
-
public:
|
|
499
460
|
|
|
500
|
-
|
|
501
|
-
{
|
|
502
|
-
enum { IsRowMajor = (int(RhsArg::Flags)&RowMajorBit)==RowMajorBit };
|
|
461
|
+
public:
|
|
462
|
+
class InnerIterator {
|
|
463
|
+
enum { IsRowMajor = (int(RhsArg::Flags) & RowMajorBit) == RowMajorBit };
|
|
503
464
|
|
|
504
|
-
|
|
505
|
-
|
|
465
|
+
public:
|
|
506
466
|
EIGEN_STRONG_INLINE InnerIterator(const sparse_conjunction_evaluator& aEval, Index outer)
|
|
507
|
-
|
|
508
|
-
{}
|
|
467
|
+
: m_lhsEval(aEval.m_lhsImpl), m_rhsIter(aEval.m_rhsImpl, outer), m_functor(aEval.m_functor), m_outer(outer) {}
|
|
509
468
|
|
|
510
|
-
EIGEN_STRONG_INLINE InnerIterator& operator++()
|
|
511
|
-
{
|
|
469
|
+
EIGEN_STRONG_INLINE InnerIterator& operator++() {
|
|
512
470
|
++m_rhsIter;
|
|
513
471
|
return *this;
|
|
514
472
|
}
|
|
515
473
|
|
|
516
|
-
EIGEN_STRONG_INLINE Scalar value() const
|
|
517
|
-
|
|
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
|
+
}
|
|
518
479
|
|
|
519
480
|
EIGEN_STRONG_INLINE StorageIndex index() const { return m_rhsIter.index(); }
|
|
520
481
|
EIGEN_STRONG_INLINE Index outer() const { return m_rhsIter.outer(); }
|
|
@@ -522,46 +483,38 @@ public:
|
|
|
522
483
|
EIGEN_STRONG_INLINE Index col() const { return m_rhsIter.col(); }
|
|
523
484
|
|
|
524
485
|
EIGEN_STRONG_INLINE operator bool() const { return m_rhsIter; }
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
const LhsEvaluator
|
|
486
|
+
|
|
487
|
+
protected:
|
|
488
|
+
const LhsEvaluator& m_lhsEval;
|
|
528
489
|
RhsIterator m_rhsIter;
|
|
529
490
|
const BinaryOp& m_functor;
|
|
530
491
|
const Index m_outer;
|
|
531
492
|
};
|
|
532
|
-
|
|
533
|
-
|
|
493
|
+
|
|
534
494
|
enum {
|
|
535
|
-
CoeffReadCost = evaluator<LhsArg>::CoeffReadCost + evaluator<RhsArg>::CoeffReadCost +
|
|
536
|
-
|
|
537
|
-
Flags =
|
|
495
|
+
CoeffReadCost = int(evaluator<LhsArg>::CoeffReadCost) + int(evaluator<RhsArg>::CoeffReadCost) +
|
|
496
|
+
int(functor_traits<BinaryOp>::Cost),
|
|
497
|
+
Flags = XprType::Flags
|
|
538
498
|
};
|
|
539
|
-
|
|
499
|
+
|
|
540
500
|
explicit sparse_conjunction_evaluator(const XprType& xpr)
|
|
541
|
-
|
|
542
|
-
m_lhsImpl(xpr.lhs()),
|
|
543
|
-
m_rhsImpl(xpr.rhs())
|
|
544
|
-
{
|
|
501
|
+
: m_functor(xpr.functor()), m_lhsImpl(xpr.lhs()), m_rhsImpl(xpr.rhs()) {
|
|
545
502
|
EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<BinaryOp>::Cost);
|
|
546
503
|
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
|
547
504
|
}
|
|
548
|
-
|
|
549
|
-
inline Index nonZerosEstimate() const {
|
|
550
|
-
return m_rhsImpl.nonZerosEstimate();
|
|
551
|
-
}
|
|
552
505
|
|
|
553
|
-
|
|
506
|
+
inline Index nonZerosEstimate() const { return m_rhsImpl.nonZerosEstimate(); }
|
|
507
|
+
|
|
508
|
+
protected:
|
|
554
509
|
const BinaryOp m_functor;
|
|
555
510
|
evaluator<LhsArg> m_lhsImpl;
|
|
556
511
|
evaluator<RhsArg> m_rhsImpl;
|
|
557
512
|
};
|
|
558
513
|
|
|
559
514
|
// "sparse ^ dense"
|
|
560
|
-
template<typename XprType>
|
|
561
|
-
struct sparse_conjunction_evaluator<XprType, IteratorBased, IndexBased>
|
|
562
|
-
|
|
563
|
-
{
|
|
564
|
-
protected:
|
|
515
|
+
template <typename XprType>
|
|
516
|
+
struct sparse_conjunction_evaluator<XprType, IteratorBased, IndexBased> : evaluator_base<XprType> {
|
|
517
|
+
protected:
|
|
565
518
|
typedef typename XprType::Functor BinaryOp;
|
|
566
519
|
typedef typename XprType::Lhs LhsArg;
|
|
567
520
|
typedef typename XprType::Rhs RhsArg;
|
|
@@ -569,27 +522,24 @@ protected:
|
|
|
569
522
|
typedef evaluator<RhsArg> RhsEvaluator;
|
|
570
523
|
typedef typename XprType::StorageIndex StorageIndex;
|
|
571
524
|
typedef typename traits<XprType>::Scalar Scalar;
|
|
572
|
-
public:
|
|
573
525
|
|
|
574
|
-
|
|
575
|
-
{
|
|
576
|
-
enum { IsRowMajor = (int(LhsArg::Flags)&RowMajorBit)==RowMajorBit };
|
|
526
|
+
public:
|
|
527
|
+
class InnerIterator {
|
|
528
|
+
enum { IsRowMajor = (int(LhsArg::Flags) & RowMajorBit) == RowMajorBit };
|
|
577
529
|
|
|
578
|
-
|
|
579
|
-
|
|
530
|
+
public:
|
|
580
531
|
EIGEN_STRONG_INLINE InnerIterator(const sparse_conjunction_evaluator& aEval, Index outer)
|
|
581
|
-
|
|
582
|
-
{}
|
|
532
|
+
: m_lhsIter(aEval.m_lhsImpl, outer), m_rhsEval(aEval.m_rhsImpl), m_functor(aEval.m_functor), m_outer(outer) {}
|
|
583
533
|
|
|
584
|
-
EIGEN_STRONG_INLINE InnerIterator& operator++()
|
|
585
|
-
{
|
|
534
|
+
EIGEN_STRONG_INLINE InnerIterator& operator++() {
|
|
586
535
|
++m_lhsIter;
|
|
587
536
|
return *this;
|
|
588
537
|
}
|
|
589
538
|
|
|
590
|
-
EIGEN_STRONG_INLINE Scalar value() const
|
|
591
|
-
|
|
592
|
-
|
|
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
|
+
}
|
|
593
543
|
|
|
594
544
|
EIGEN_STRONG_INLINE StorageIndex index() const { return m_lhsIter.index(); }
|
|
595
545
|
EIGEN_STRONG_INLINE Index outer() const { return m_lhsIter.outer(); }
|
|
@@ -597,130 +547,392 @@ public:
|
|
|
597
547
|
EIGEN_STRONG_INLINE Index col() const { return m_lhsIter.col(); }
|
|
598
548
|
|
|
599
549
|
EIGEN_STRONG_INLINE operator bool() const { return m_lhsIter; }
|
|
600
|
-
|
|
601
|
-
|
|
550
|
+
|
|
551
|
+
protected:
|
|
602
552
|
LhsIterator m_lhsIter;
|
|
603
|
-
const evaluator<RhsArg
|
|
553
|
+
const evaluator<RhsArg>& m_rhsEval;
|
|
604
554
|
const BinaryOp& m_functor;
|
|
605
555
|
const Index m_outer;
|
|
606
556
|
};
|
|
607
|
-
|
|
608
|
-
|
|
557
|
+
|
|
609
558
|
enum {
|
|
610
|
-
CoeffReadCost = evaluator<LhsArg>::CoeffReadCost + evaluator<RhsArg>::CoeffReadCost +
|
|
611
|
-
|
|
612
|
-
Flags =
|
|
559
|
+
CoeffReadCost = int(evaluator<LhsArg>::CoeffReadCost) + int(evaluator<RhsArg>::CoeffReadCost) +
|
|
560
|
+
int(functor_traits<BinaryOp>::Cost),
|
|
561
|
+
Flags = XprType::Flags
|
|
613
562
|
};
|
|
614
|
-
|
|
563
|
+
|
|
615
564
|
explicit sparse_conjunction_evaluator(const XprType& xpr)
|
|
616
|
-
|
|
617
|
-
m_lhsImpl(xpr.lhs()),
|
|
618
|
-
m_rhsImpl(xpr.rhs())
|
|
619
|
-
{
|
|
565
|
+
: m_functor(xpr.functor()), m_lhsImpl(xpr.lhs()), m_rhsImpl(xpr.rhs()) {
|
|
620
566
|
EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<BinaryOp>::Cost);
|
|
621
567
|
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
|
622
568
|
}
|
|
623
|
-
|
|
624
|
-
inline Index nonZerosEstimate() const {
|
|
625
|
-
|
|
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);
|
|
626
661
|
}
|
|
627
662
|
|
|
628
|
-
|
|
663
|
+
inline Index nonZerosEstimate() const { return m_lhsImpl.nonZerosEstimate() + m_rhsImpl.nonZerosEstimate(); }
|
|
664
|
+
|
|
665
|
+
protected:
|
|
629
666
|
const BinaryOp m_functor;
|
|
630
667
|
evaluator<LhsArg> m_lhsImpl;
|
|
631
668
|
evaluator<RhsArg> m_rhsImpl;
|
|
632
669
|
};
|
|
633
670
|
|
|
634
|
-
|
|
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
|
|
635
846
|
|
|
636
847
|
/***************************************************************************
|
|
637
|
-
* Implementation of SparseMatrixBase and SparseCwise functions/operators
|
|
638
|
-
***************************************************************************/
|
|
639
|
-
|
|
640
|
-
template<typename Derived>
|
|
641
|
-
template<typename OtherDerived>
|
|
642
|
-
Derived& SparseMatrixBase<Derived>::operator+=(const EigenBase<OtherDerived
|
|
643
|
-
|
|
644
|
-
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>());
|
|
645
855
|
return derived();
|
|
646
856
|
}
|
|
647
857
|
|
|
648
|
-
template<typename Derived>
|
|
649
|
-
template<typename OtherDerived>
|
|
650
|
-
Derived& SparseMatrixBase<Derived>::operator-=(const EigenBase<OtherDerived
|
|
651
|
-
|
|
652
|
-
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>());
|
|
653
862
|
return derived();
|
|
654
863
|
}
|
|
655
864
|
|
|
656
|
-
template<typename Derived>
|
|
657
|
-
template<typename OtherDerived>
|
|
658
|
-
EIGEN_STRONG_INLINE Derived
|
|
659
|
-
SparseMatrixBase<Derived>::operator-=(const SparseMatrixBase<OtherDerived> &other)
|
|
660
|
-
{
|
|
865
|
+
template <typename Derived>
|
|
866
|
+
template <typename OtherDerived>
|
|
867
|
+
EIGEN_STRONG_INLINE Derived& SparseMatrixBase<Derived>::operator-=(const SparseMatrixBase<OtherDerived>& other) {
|
|
661
868
|
return derived() = derived() - other.derived();
|
|
662
869
|
}
|
|
663
870
|
|
|
664
|
-
template<typename Derived>
|
|
665
|
-
template<typename OtherDerived>
|
|
666
|
-
EIGEN_STRONG_INLINE Derived
|
|
667
|
-
SparseMatrixBase<Derived>::operator+=(const SparseMatrixBase<OtherDerived>& other)
|
|
668
|
-
{
|
|
871
|
+
template <typename Derived>
|
|
872
|
+
template <typename OtherDerived>
|
|
873
|
+
EIGEN_STRONG_INLINE Derived& SparseMatrixBase<Derived>::operator+=(const SparseMatrixBase<OtherDerived>& other) {
|
|
669
874
|
return derived() = derived() + other.derived();
|
|
670
875
|
}
|
|
671
876
|
|
|
672
|
-
template<typename Derived>
|
|
673
|
-
template<typename OtherDerived>
|
|
674
|
-
Derived& SparseMatrixBase<Derived>::operator+=(const DiagonalBase<OtherDerived>& other)
|
|
675
|
-
|
|
676
|
-
|
|
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>());
|
|
677
882
|
return derived();
|
|
678
883
|
}
|
|
679
884
|
|
|
680
|
-
template<typename Derived>
|
|
681
|
-
template<typename OtherDerived>
|
|
682
|
-
Derived& SparseMatrixBase<Derived>::operator-=(const DiagonalBase<OtherDerived>& other)
|
|
683
|
-
|
|
684
|
-
|
|
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>());
|
|
685
890
|
return derived();
|
|
686
891
|
}
|
|
687
|
-
|
|
688
|
-
template<typename Derived>
|
|
689
|
-
template<typename OtherDerived>
|
|
892
|
+
|
|
893
|
+
template <typename Derived>
|
|
894
|
+
template <typename OtherDerived>
|
|
690
895
|
EIGEN_STRONG_INLINE const typename SparseMatrixBase<Derived>::template CwiseProductDenseReturnType<OtherDerived>::Type
|
|
691
|
-
SparseMatrixBase<Derived>::cwiseProduct(const MatrixBase<OtherDerived
|
|
692
|
-
{
|
|
896
|
+
SparseMatrixBase<Derived>::cwiseProduct(const MatrixBase<OtherDerived>& other) const {
|
|
693
897
|
return typename CwiseProductDenseReturnType<OtherDerived>::Type(derived(), other.derived());
|
|
694
898
|
}
|
|
695
899
|
|
|
696
|
-
template<typename DenseDerived, typename SparseDerived>
|
|
697
|
-
EIGEN_STRONG_INLINE const
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
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());
|
|
701
907
|
}
|
|
702
908
|
|
|
703
|
-
template<typename SparseDerived, typename DenseDerived>
|
|
704
|
-
EIGEN_STRONG_INLINE const
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
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());
|
|
708
916
|
}
|
|
709
917
|
|
|
710
|
-
template<typename DenseDerived, typename SparseDerived>
|
|
711
|
-
EIGEN_STRONG_INLINE const
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
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());
|
|
715
925
|
}
|
|
716
926
|
|
|
717
|
-
template<typename SparseDerived, typename DenseDerived>
|
|
718
|
-
EIGEN_STRONG_INLINE const
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
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());
|
|
722
934
|
}
|
|
723
935
|
|
|
724
|
-
}
|
|
936
|
+
} // end namespace Eigen
|
|
725
937
|
|
|
726
|
-
#endif
|
|
938
|
+
#endif // EIGEN_SPARSE_CWISE_BINARY_OP_H
|