@smake/eigen 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/eigen/Eigen/AccelerateSupport +52 -0
- package/eigen/Eigen/Cholesky +18 -20
- package/eigen/Eigen/CholmodSupport +28 -28
- package/eigen/Eigen/Core +187 -120
- package/eigen/Eigen/Eigenvalues +16 -13
- package/eigen/Eigen/Geometry +18 -18
- package/eigen/Eigen/Householder +9 -7
- package/eigen/Eigen/IterativeLinearSolvers +8 -4
- package/eigen/Eigen/Jacobi +14 -13
- package/eigen/Eigen/KLUSupport +23 -21
- package/eigen/Eigen/LU +15 -16
- package/eigen/Eigen/MetisSupport +12 -12
- package/eigen/Eigen/OrderingMethods +54 -51
- package/eigen/Eigen/PaStiXSupport +23 -21
- package/eigen/Eigen/PardisoSupport +17 -14
- package/eigen/Eigen/QR +18 -20
- package/eigen/Eigen/QtAlignedMalloc +5 -12
- package/eigen/Eigen/SPQRSupport +21 -14
- package/eigen/Eigen/SVD +23 -17
- package/eigen/Eigen/Sparse +1 -2
- package/eigen/Eigen/SparseCholesky +18 -15
- package/eigen/Eigen/SparseCore +18 -17
- package/eigen/Eigen/SparseLU +9 -9
- package/eigen/Eigen/SparseQR +16 -14
- package/eigen/Eigen/StdDeque +5 -2
- package/eigen/Eigen/StdList +5 -2
- package/eigen/Eigen/StdVector +5 -2
- package/eigen/Eigen/SuperLUSupport +30 -24
- package/eigen/Eigen/ThreadPool +80 -0
- package/eigen/Eigen/UmfPackSupport +19 -17
- package/eigen/Eigen/Version +14 -0
- package/eigen/Eigen/src/AccelerateSupport/AccelerateSupport.h +423 -0
- package/eigen/Eigen/src/AccelerateSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Cholesky/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Cholesky/LDLT.h +366 -405
- package/eigen/Eigen/src/Cholesky/LLT.h +323 -367
- package/eigen/Eigen/src/Cholesky/LLT_LAPACKE.h +81 -56
- package/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +585 -529
- package/eigen/Eigen/src/CholmodSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Core/ArithmeticSequence.h +143 -317
- package/eigen/Eigen/src/Core/Array.h +329 -370
- package/eigen/Eigen/src/Core/ArrayBase.h +190 -203
- package/eigen/Eigen/src/Core/ArrayWrapper.h +126 -170
- package/eigen/Eigen/src/Core/Assign.h +30 -40
- package/eigen/Eigen/src/Core/AssignEvaluator.h +651 -604
- package/eigen/Eigen/src/Core/Assign_MKL.h +125 -120
- package/eigen/Eigen/src/Core/BandMatrix.h +267 -282
- package/eigen/Eigen/src/Core/Block.h +371 -390
- package/eigen/Eigen/src/Core/CommaInitializer.h +85 -100
- package/eigen/Eigen/src/Core/ConditionEstimator.h +51 -53
- package/eigen/Eigen/src/Core/CoreEvaluators.h +1214 -937
- package/eigen/Eigen/src/Core/CoreIterators.h +72 -63
- package/eigen/Eigen/src/Core/CwiseBinaryOp.h +112 -129
- package/eigen/Eigen/src/Core/CwiseNullaryOp.h +676 -702
- package/eigen/Eigen/src/Core/CwiseTernaryOp.h +77 -103
- package/eigen/Eigen/src/Core/CwiseUnaryOp.h +55 -67
- package/eigen/Eigen/src/Core/CwiseUnaryView.h +127 -92
- package/eigen/Eigen/src/Core/DenseBase.h +630 -658
- package/eigen/Eigen/src/Core/DenseCoeffsBase.h +511 -628
- package/eigen/Eigen/src/Core/DenseStorage.h +511 -590
- package/eigen/Eigen/src/Core/DeviceWrapper.h +153 -0
- package/eigen/Eigen/src/Core/Diagonal.h +168 -207
- package/eigen/Eigen/src/Core/DiagonalMatrix.h +346 -317
- package/eigen/Eigen/src/Core/DiagonalProduct.h +12 -10
- package/eigen/Eigen/src/Core/Dot.h +167 -217
- package/eigen/Eigen/src/Core/EigenBase.h +74 -85
- package/eigen/Eigen/src/Core/Fill.h +138 -0
- package/eigen/Eigen/src/Core/FindCoeff.h +464 -0
- package/eigen/Eigen/src/Core/ForceAlignedAccess.h +90 -113
- package/eigen/Eigen/src/Core/Fuzzy.h +82 -105
- package/eigen/Eigen/src/Core/GeneralProduct.h +315 -261
- package/eigen/Eigen/src/Core/GenericPacketMath.h +1182 -520
- package/eigen/Eigen/src/Core/GlobalFunctions.h +193 -157
- package/eigen/Eigen/src/Core/IO.h +131 -156
- package/eigen/Eigen/src/Core/IndexedView.h +209 -125
- package/eigen/Eigen/src/Core/InnerProduct.h +260 -0
- package/eigen/Eigen/src/Core/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Core/Inverse.h +50 -59
- package/eigen/Eigen/src/Core/Map.h +123 -141
- package/eigen/Eigen/src/Core/MapBase.h +255 -282
- package/eigen/Eigen/src/Core/MathFunctions.h +1247 -1201
- package/eigen/Eigen/src/Core/MathFunctionsImpl.h +162 -99
- package/eigen/Eigen/src/Core/Matrix.h +463 -494
- package/eigen/Eigen/src/Core/MatrixBase.h +468 -470
- package/eigen/Eigen/src/Core/NestByValue.h +58 -52
- package/eigen/Eigen/src/Core/NoAlias.h +79 -86
- package/eigen/Eigen/src/Core/NumTraits.h +206 -206
- package/eigen/Eigen/src/Core/PartialReduxEvaluator.h +163 -142
- package/eigen/Eigen/src/Core/PermutationMatrix.h +461 -511
- package/eigen/Eigen/src/Core/PlainObjectBase.h +858 -972
- package/eigen/Eigen/src/Core/Product.h +246 -130
- package/eigen/Eigen/src/Core/ProductEvaluators.h +779 -671
- package/eigen/Eigen/src/Core/Random.h +153 -164
- package/eigen/Eigen/src/Core/RandomImpl.h +262 -0
- package/eigen/Eigen/src/Core/RealView.h +250 -0
- package/eigen/Eigen/src/Core/Redux.h +334 -314
- package/eigen/Eigen/src/Core/Ref.h +259 -257
- package/eigen/Eigen/src/Core/Replicate.h +92 -104
- package/eigen/Eigen/src/Core/Reshaped.h +215 -271
- package/eigen/Eigen/src/Core/ReturnByValue.h +47 -55
- package/eigen/Eigen/src/Core/Reverse.h +133 -148
- package/eigen/Eigen/src/Core/Select.h +68 -140
- package/eigen/Eigen/src/Core/SelfAdjointView.h +254 -290
- package/eigen/Eigen/src/Core/SelfCwiseBinaryOp.h +23 -20
- package/eigen/Eigen/src/Core/SkewSymmetricMatrix3.h +382 -0
- package/eigen/Eigen/src/Core/Solve.h +88 -102
- package/eigen/Eigen/src/Core/SolveTriangular.h +126 -124
- package/eigen/Eigen/src/Core/SolverBase.h +132 -133
- package/eigen/Eigen/src/Core/StableNorm.h +113 -147
- package/eigen/Eigen/src/Core/StlIterators.h +404 -248
- package/eigen/Eigen/src/Core/Stride.h +90 -92
- package/eigen/Eigen/src/Core/Swap.h +70 -39
- package/eigen/Eigen/src/Core/Transpose.h +258 -295
- package/eigen/Eigen/src/Core/Transpositions.h +270 -333
- package/eigen/Eigen/src/Core/TriangularMatrix.h +642 -743
- package/eigen/Eigen/src/Core/VectorBlock.h +59 -72
- package/eigen/Eigen/src/Core/VectorwiseOp.h +653 -704
- package/eigen/Eigen/src/Core/Visitor.h +464 -308
- package/eigen/Eigen/src/Core/arch/AVX/Complex.h +380 -187
- package/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +65 -163
- package/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +2145 -638
- package/eigen/Eigen/src/Core/arch/AVX/Reductions.h +353 -0
- package/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +253 -60
- package/eigen/Eigen/src/Core/arch/AVX512/Complex.h +278 -228
- package/eigen/Eigen/src/Core/arch/AVX512/GemmKernel.h +1245 -0
- package/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +48 -269
- package/eigen/Eigen/src/Core/arch/AVX512/MathFunctionsFP16.h +75 -0
- package/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +1597 -754
- package/eigen/Eigen/src/Core/arch/AVX512/PacketMathFP16.h +1413 -0
- package/eigen/Eigen/src/Core/arch/AVX512/Reductions.h +297 -0
- package/eigen/Eigen/src/Core/arch/AVX512/TrsmKernel.h +1167 -0
- package/eigen/Eigen/src/Core/arch/AVX512/TrsmUnrolls.inc +1219 -0
- package/eigen/Eigen/src/Core/arch/AVX512/TypeCasting.h +229 -41
- package/eigen/Eigen/src/Core/arch/AVX512/TypeCastingFP16.h +130 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +420 -184
- package/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +40 -49
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +2962 -2213
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +196 -212
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +713 -441
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMAbfloat16.h +742 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixVectorProduct.inc +2818 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h +2380 -1362
- package/eigen/Eigen/src/Core/arch/AltiVec/TypeCasting.h +153 -0
- package/eigen/Eigen/src/Core/arch/Default/BFloat16.h +390 -224
- package/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +78 -67
- package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +1784 -799
- package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +167 -50
- package/eigen/Eigen/src/Core/arch/Default/Half.h +528 -379
- package/eigen/Eigen/src/Core/arch/Default/Settings.h +10 -12
- package/eigen/Eigen/src/Core/arch/GPU/Complex.h +244 -0
- package/eigen/Eigen/src/Core/arch/GPU/MathFunctions.h +41 -40
- package/eigen/Eigen/src/Core/arch/GPU/PacketMath.h +550 -523
- package/eigen/Eigen/src/Core/arch/GPU/Tuple.h +268 -0
- package/eigen/Eigen/src/Core/arch/GPU/TypeCasting.h +27 -30
- package/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h +8 -8
- package/eigen/Eigen/src/Core/arch/HVX/PacketMath.h +1088 -0
- package/eigen/Eigen/src/Core/arch/LSX/Complex.h +520 -0
- package/eigen/Eigen/src/Core/arch/LSX/GeneralBlockPanelKernel.h +23 -0
- package/eigen/Eigen/src/Core/arch/LSX/MathFunctions.h +43 -0
- package/eigen/Eigen/src/Core/arch/LSX/PacketMath.h +2866 -0
- package/eigen/Eigen/src/Core/arch/LSX/TypeCasting.h +526 -0
- package/eigen/Eigen/src/Core/arch/MSA/Complex.h +54 -82
- package/eigen/Eigen/src/Core/arch/MSA/MathFunctions.h +84 -92
- package/eigen/Eigen/src/Core/arch/MSA/PacketMath.h +51 -47
- package/eigen/Eigen/src/Core/arch/NEON/Complex.h +454 -306
- package/eigen/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +175 -115
- package/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +23 -30
- package/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +4366 -2857
- package/eigen/Eigen/src/Core/arch/NEON/TypeCasting.h +616 -393
- package/eigen/Eigen/src/Core/arch/NEON/UnaryFunctors.h +57 -0
- package/eigen/Eigen/src/Core/arch/SSE/Complex.h +350 -198
- package/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +38 -149
- package/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +1791 -912
- package/eigen/Eigen/src/Core/arch/SSE/Reductions.h +324 -0
- package/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +128 -40
- package/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h +10 -6
- package/eigen/Eigen/src/Core/arch/SVE/PacketMath.h +156 -234
- package/eigen/Eigen/src/Core/arch/SVE/TypeCasting.h +6 -3
- package/eigen/Eigen/src/Core/arch/SYCL/InteropHeaders.h +27 -32
- package/eigen/Eigen/src/Core/arch/SYCL/MathFunctions.h +119 -117
- package/eigen/Eigen/src/Core/arch/SYCL/PacketMath.h +325 -419
- package/eigen/Eigen/src/Core/arch/SYCL/TypeCasting.h +15 -17
- package/eigen/Eigen/src/Core/arch/ZVector/Complex.h +325 -181
- package/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +94 -83
- package/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +811 -458
- package/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +121 -124
- package/eigen/Eigen/src/Core/functors/BinaryFunctors.h +576 -370
- package/eigen/Eigen/src/Core/functors/NullaryFunctors.h +194 -109
- package/eigen/Eigen/src/Core/functors/StlFunctors.h +95 -112
- package/eigen/Eigen/src/Core/functors/TernaryFunctors.h +34 -7
- package/eigen/Eigen/src/Core/functors/UnaryFunctors.h +1038 -749
- package/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +1883 -1375
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +312 -370
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +189 -176
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +84 -81
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +154 -73
- package/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +292 -337
- package/eigen/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +80 -77
- package/eigen/Eigen/src/Core/products/Parallelizer.h +207 -105
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +327 -388
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +206 -224
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +138 -147
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h +58 -61
- package/eigen/Eigen/src/Core/products/SelfadjointProduct.h +71 -71
- package/eigen/Eigen/src/Core/products/SelfadjointRank2Update.h +48 -47
- package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix.h +294 -369
- package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +246 -238
- package/eigen/Eigen/src/Core/products/TriangularMatrixVector.h +244 -247
- package/eigen/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h +212 -192
- package/eigen/Eigen/src/Core/products/TriangularSolverMatrix.h +328 -277
- package/eigen/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +108 -109
- package/eigen/Eigen/src/Core/products/TriangularSolverVector.h +68 -94
- package/eigen/Eigen/src/Core/util/Assert.h +158 -0
- package/eigen/Eigen/src/Core/util/BlasUtil.h +342 -303
- package/eigen/Eigen/src/Core/util/ConfigureVectorization.h +348 -317
- package/eigen/Eigen/src/Core/util/Constants.h +297 -262
- package/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +130 -90
- package/eigen/Eigen/src/Core/util/EmulateArray.h +270 -0
- package/eigen/Eigen/src/Core/util/ForwardDeclarations.h +449 -247
- package/eigen/Eigen/src/Core/util/GpuHipCudaDefines.inc +101 -0
- package/eigen/Eigen/src/Core/util/GpuHipCudaUndefines.inc +45 -0
- package/eigen/Eigen/src/Core/util/IndexedViewHelper.h +417 -116
- package/eigen/Eigen/src/Core/util/IntegralConstant.h +211 -204
- package/eigen/Eigen/src/Core/util/MKL_support.h +39 -37
- package/eigen/Eigen/src/Core/util/Macros.h +655 -773
- package/eigen/Eigen/src/Core/util/MaxSizeVector.h +139 -0
- package/eigen/Eigen/src/Core/util/Memory.h +970 -748
- package/eigen/Eigen/src/Core/util/Meta.h +581 -633
- package/eigen/Eigen/src/Core/util/MoreMeta.h +638 -0
- package/eigen/Eigen/src/Core/util/ReenableStupidWarnings.h +32 -19
- package/eigen/Eigen/src/Core/util/ReshapedHelper.h +17 -17
- package/eigen/Eigen/src/Core/util/Serializer.h +209 -0
- package/eigen/Eigen/src/Core/util/StaticAssert.h +50 -166
- package/eigen/Eigen/src/Core/util/SymbolicIndex.h +377 -225
- package/eigen/Eigen/src/Core/util/XprHelper.h +784 -547
- package/eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h +246 -277
- package/eigen/Eigen/src/Eigenvalues/ComplexSchur.h +299 -319
- package/eigen/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h +52 -48
- package/eigen/Eigen/src/Eigenvalues/EigenSolver.h +413 -456
- package/eigen/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +309 -325
- package/eigen/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +157 -171
- package/eigen/Eigen/src/Eigenvalues/HessenbergDecomposition.h +292 -310
- package/eigen/Eigen/src/Eigenvalues/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +89 -105
- package/eigen/Eigen/src/Eigenvalues/RealQZ.h +537 -607
- package/eigen/Eigen/src/Eigenvalues/RealSchur.h +342 -381
- package/eigen/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +41 -35
- package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +541 -595
- package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +47 -44
- package/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +430 -462
- package/eigen/Eigen/src/Geometry/AlignedBox.h +226 -227
- package/eigen/Eigen/src/Geometry/AngleAxis.h +131 -133
- package/eigen/Eigen/src/Geometry/EulerAngles.h +163 -74
- package/eigen/Eigen/src/Geometry/Homogeneous.h +285 -333
- package/eigen/Eigen/src/Geometry/Hyperplane.h +151 -160
- package/eigen/Eigen/src/Geometry/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Geometry/OrthoMethods.h +168 -146
- package/eigen/Eigen/src/Geometry/ParametrizedLine.h +127 -127
- package/eigen/Eigen/src/Geometry/Quaternion.h +566 -506
- package/eigen/Eigen/src/Geometry/Rotation2D.h +107 -105
- package/eigen/Eigen/src/Geometry/RotationBase.h +148 -145
- package/eigen/Eigen/src/Geometry/Scaling.h +113 -106
- package/eigen/Eigen/src/Geometry/Transform.h +858 -936
- package/eigen/Eigen/src/Geometry/Translation.h +94 -92
- package/eigen/Eigen/src/Geometry/Umeyama.h +79 -84
- package/eigen/Eigen/src/Geometry/arch/Geometry_SIMD.h +90 -104
- package/eigen/Eigen/src/Householder/BlockHouseholder.h +51 -46
- package/eigen/Eigen/src/Householder/Householder.h +102 -124
- package/eigen/Eigen/src/Householder/HouseholderSequence.h +412 -453
- package/eigen/Eigen/src/Householder/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +149 -162
- package/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +124 -119
- package/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +92 -104
- package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +251 -243
- package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +224 -228
- package/eigen/Eigen/src/IterativeLinearSolvers/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +178 -227
- package/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +79 -84
- package/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +54 -60
- package/eigen/Eigen/src/Jacobi/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Jacobi/Jacobi.h +252 -308
- package/eigen/Eigen/src/KLUSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/KLUSupport/KLUSupport.h +208 -227
- package/eigen/Eigen/src/LU/Determinant.h +50 -69
- package/eigen/Eigen/src/LU/FullPivLU.h +545 -596
- package/eigen/Eigen/src/LU/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/LU/InverseImpl.h +206 -285
- package/eigen/Eigen/src/LU/PartialPivLU.h +390 -428
- package/eigen/Eigen/src/LU/PartialPivLU_LAPACKE.h +54 -40
- package/eigen/Eigen/src/LU/arch/InverseSize4.h +72 -70
- package/eigen/Eigen/src/MetisSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/MetisSupport/MetisSupport.h +81 -93
- package/eigen/Eigen/src/OrderingMethods/Amd.h +243 -265
- package/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +831 -1004
- package/eigen/Eigen/src/OrderingMethods/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/OrderingMethods/Ordering.h +112 -119
- package/eigen/Eigen/src/PaStiXSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h +524 -570
- package/eigen/Eigen/src/PardisoSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/PardisoSupport/PardisoSupport.h +385 -430
- package/eigen/Eigen/src/QR/ColPivHouseholderQR.h +479 -479
- package/eigen/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +120 -56
- package/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +166 -153
- package/eigen/Eigen/src/QR/FullPivHouseholderQR.h +495 -475
- package/eigen/Eigen/src/QR/HouseholderQR.h +394 -285
- package/eigen/Eigen/src/QR/HouseholderQR_LAPACKE.h +32 -23
- package/eigen/Eigen/src/QR/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SPQRSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +244 -264
- package/eigen/Eigen/src/SVD/BDCSVD.h +817 -713
- package/eigen/Eigen/src/SVD/BDCSVD_LAPACKE.h +174 -0
- package/eigen/Eigen/src/SVD/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SVD/JacobiSVD.h +577 -543
- package/eigen/Eigen/src/SVD/JacobiSVD_LAPACKE.h +85 -49
- package/eigen/Eigen/src/SVD/SVDBase.h +242 -182
- package/eigen/Eigen/src/SVD/UpperBidiagonalization.h +200 -235
- package/eigen/Eigen/src/SparseCholesky/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +765 -594
- package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +308 -94
- package/eigen/Eigen/src/SparseCore/AmbiVector.h +202 -251
- package/eigen/Eigen/src/SparseCore/CompressedStorage.h +184 -252
- package/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +134 -178
- package/eigen/Eigen/src/SparseCore/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseCore/SparseAssign.h +149 -140
- package/eigen/Eigen/src/SparseCore/SparseBlock.h +403 -440
- package/eigen/Eigen/src/SparseCore/SparseColEtree.h +100 -112
- package/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +525 -303
- package/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +555 -339
- package/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +100 -108
- package/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +169 -197
- package/eigen/Eigen/src/SparseCore/SparseDiagonalProduct.h +71 -71
- package/eigen/Eigen/src/SparseCore/SparseDot.h +49 -47
- package/eigen/Eigen/src/SparseCore/SparseFuzzy.h +13 -11
- package/eigen/Eigen/src/SparseCore/SparseMap.h +243 -253
- package/eigen/Eigen/src/SparseCore/SparseMatrix.h +1603 -1245
- package/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +403 -350
- package/eigen/Eigen/src/SparseCore/SparsePermutation.h +186 -115
- package/eigen/Eigen/src/SparseCore/SparseProduct.h +94 -97
- package/eigen/Eigen/src/SparseCore/SparseRedux.h +22 -24
- package/eigen/Eigen/src/SparseCore/SparseRef.h +268 -295
- package/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h +370 -416
- package/eigen/Eigen/src/SparseCore/SparseSolverBase.h +78 -87
- package/eigen/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +81 -95
- package/eigen/Eigen/src/SparseCore/SparseTranspose.h +62 -71
- package/eigen/Eigen/src/SparseCore/SparseTriangularView.h +132 -144
- package/eigen/Eigen/src/SparseCore/SparseUtil.h +138 -115
- package/eigen/Eigen/src/SparseCore/SparseVector.h +426 -372
- package/eigen/Eigen/src/SparseCore/SparseView.h +164 -193
- package/eigen/Eigen/src/SparseCore/TriangularSolver.h +129 -170
- package/eigen/Eigen/src/SparseLU/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseLU/SparseLU.h +756 -710
- package/eigen/Eigen/src/SparseLU/SparseLUImpl.h +61 -48
- package/eigen/Eigen/src/SparseLU/SparseLU_Memory.h +102 -118
- package/eigen/Eigen/src/SparseLU/SparseLU_Structs.h +38 -35
- package/eigen/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +245 -301
- package/eigen/Eigen/src/SparseLU/SparseLU_Utils.h +44 -49
- package/eigen/Eigen/src/SparseLU/SparseLU_column_bmod.h +104 -108
- package/eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h +89 -100
- package/eigen/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +57 -58
- package/eigen/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +43 -55
- package/eigen/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +74 -71
- package/eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h +124 -132
- package/eigen/Eigen/src/SparseLU/SparseLU_panel_dfs.h +136 -159
- package/eigen/Eigen/src/SparseLU/SparseLU_pivotL.h +51 -52
- package/eigen/Eigen/src/SparseLU/SparseLU_pruneL.h +67 -73
- package/eigen/Eigen/src/SparseLU/SparseLU_relax_snode.h +24 -26
- package/eigen/Eigen/src/SparseQR/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseQR/SparseQR.h +450 -502
- package/eigen/Eigen/src/StlSupport/StdDeque.h +28 -93
- package/eigen/Eigen/src/StlSupport/StdList.h +28 -84
- package/eigen/Eigen/src/StlSupport/StdVector.h +28 -108
- package/eigen/Eigen/src/StlSupport/details.h +48 -50
- package/eigen/Eigen/src/SuperLUSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SuperLUSupport/SuperLUSupport.h +634 -730
- package/eigen/Eigen/src/ThreadPool/Barrier.h +70 -0
- package/eigen/Eigen/src/ThreadPool/CoreThreadPoolDevice.h +336 -0
- package/eigen/Eigen/src/ThreadPool/EventCount.h +241 -0
- package/eigen/Eigen/src/ThreadPool/ForkJoin.h +140 -0
- package/eigen/Eigen/src/ThreadPool/InternalHeaderCheck.h +4 -0
- package/eigen/Eigen/src/ThreadPool/NonBlockingThreadPool.h +587 -0
- package/eigen/Eigen/src/ThreadPool/RunQueue.h +230 -0
- package/eigen/Eigen/src/ThreadPool/ThreadCancel.h +21 -0
- package/eigen/Eigen/src/ThreadPool/ThreadEnvironment.h +43 -0
- package/eigen/Eigen/src/ThreadPool/ThreadLocal.h +289 -0
- package/eigen/Eigen/src/ThreadPool/ThreadPoolInterface.h +50 -0
- package/eigen/Eigen/src/ThreadPool/ThreadYield.h +16 -0
- package/eigen/Eigen/src/UmfPackSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/UmfPackSupport/UmfPackSupport.h +428 -464
- package/eigen/Eigen/src/misc/Image.h +41 -43
- package/eigen/Eigen/src/misc/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/misc/Kernel.h +39 -41
- package/eigen/Eigen/src/misc/RealSvd2x2.h +19 -21
- package/eigen/Eigen/src/misc/blas.h +83 -426
- package/eigen/Eigen/src/misc/lapacke.h +9972 -16179
- package/eigen/Eigen/src/misc/lapacke_helpers.h +163 -0
- package/eigen/Eigen/src/misc/lapacke_mangling.h +4 -5
- package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.inc +344 -0
- package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.inc +544 -0
- package/eigen/Eigen/src/plugins/{BlockMethods.h → BlockMethods.inc} +434 -506
- package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.inc +116 -0
- package/eigen/Eigen/src/plugins/{CommonCwiseUnaryOps.h → CommonCwiseUnaryOps.inc} +58 -68
- package/eigen/Eigen/src/plugins/IndexedViewMethods.inc +192 -0
- package/eigen/Eigen/src/plugins/InternalHeaderCheck.inc +3 -0
- package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.inc +331 -0
- package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.inc +118 -0
- package/eigen/Eigen/src/plugins/ReshapedMethods.inc +133 -0
- package/package.json +1 -1
- package/eigen/COPYING.APACHE +0 -203
- package/eigen/COPYING.BSD +0 -26
- package/eigen/COPYING.GPL +0 -674
- package/eigen/COPYING.LGPL +0 -502
- package/eigen/COPYING.MINPACK +0 -51
- package/eigen/COPYING.MPL2 +0 -373
- package/eigen/COPYING.README +0 -18
- package/eigen/Eigen/src/Core/BooleanRedux.h +0 -162
- package/eigen/Eigen/src/Core/arch/CUDA/Complex.h +0 -258
- package/eigen/Eigen/src/Core/arch/Default/TypeCasting.h +0 -120
- package/eigen/Eigen/src/Core/arch/SYCL/SyclMemoryModel.h +0 -694
- package/eigen/Eigen/src/Core/util/NonMPL2.h +0 -3
- package/eigen/Eigen/src/SparseCore/MappedSparseMatrix.h +0 -67
- package/eigen/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +0 -280
- package/eigen/Eigen/src/misc/lapack.h +0 -152
- package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.h +0 -358
- package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h +0 -696
- package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.h +0 -115
- package/eigen/Eigen/src/plugins/IndexedViewMethods.h +0 -262
- package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h +0 -152
- package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h +0 -95
- package/eigen/Eigen/src/plugins/ReshapedMethods.h +0 -149
- package/eigen/README.md +0 -5
|
@@ -11,764 +11,1004 @@
|
|
|
11
11
|
#ifndef EIGEN_XPRHELPER_H
|
|
12
12
|
#define EIGEN_XPRHELPER_H
|
|
13
13
|
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
// so currently we simply disable this optimization for gcc 4.3
|
|
17
|
-
#if EIGEN_COMP_GNUC && !EIGEN_GNUC_AT(4,3)
|
|
18
|
-
#define EIGEN_EMPTY_STRUCT_CTOR(X) \
|
|
19
|
-
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE X() {} \
|
|
20
|
-
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE X(const X& ) {}
|
|
21
|
-
#else
|
|
22
|
-
#define EIGEN_EMPTY_STRUCT_CTOR(X)
|
|
23
|
-
#endif
|
|
14
|
+
// IWYU pragma: private
|
|
15
|
+
#include "../InternalHeaderCheck.h"
|
|
24
16
|
|
|
25
17
|
namespace Eigen {
|
|
26
18
|
|
|
27
19
|
namespace internal {
|
|
28
20
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
// useful for unsigned / signed integer comparisons when idx is intended to be non-negative
|
|
22
|
+
template <typename IndexType>
|
|
23
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename make_unsigned<IndexType>::type returnUnsignedIndexValue(
|
|
24
|
+
const IndexType& idx) {
|
|
25
|
+
EIGEN_STATIC_ASSERT((NumTraits<IndexType>::IsInteger), THIS FUNCTION IS FOR INTEGER TYPES)
|
|
26
|
+
eigen_internal_assert(idx >= 0 && "Index value is negative and target type is unsigned");
|
|
27
|
+
using UnsignedType = typename make_unsigned<IndexType>::type;
|
|
28
|
+
return static_cast<UnsignedType>(idx);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
template <typename IndexDest, typename IndexSrc, bool IndexDestIsInteger = NumTraits<IndexDest>::IsInteger,
|
|
32
|
+
bool IndexDestIsSigned = NumTraits<IndexDest>::IsSigned,
|
|
33
|
+
bool IndexSrcIsInteger = NumTraits<IndexSrc>::IsInteger,
|
|
34
|
+
bool IndexSrcIsSigned = NumTraits<IndexSrc>::IsSigned>
|
|
35
|
+
struct convert_index_impl {
|
|
36
|
+
static inline EIGEN_DEVICE_FUNC IndexDest run(const IndexSrc& idx) {
|
|
37
|
+
eigen_internal_assert(idx <= NumTraits<IndexDest>::highest() && "Index value is too big for target type");
|
|
38
|
+
return static_cast<IndexDest>(idx);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
template <typename IndexDest, typename IndexSrc>
|
|
42
|
+
struct convert_index_impl<IndexDest, IndexSrc, true, true, true, false> {
|
|
43
|
+
// IndexDest is a signed integer
|
|
44
|
+
// IndexSrc is an unsigned integer
|
|
45
|
+
static inline EIGEN_DEVICE_FUNC IndexDest run(const IndexSrc& idx) {
|
|
46
|
+
eigen_internal_assert(idx <= returnUnsignedIndexValue(NumTraits<IndexDest>::highest()) &&
|
|
47
|
+
"Index value is too big for target type");
|
|
48
|
+
return static_cast<IndexDest>(idx);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
template <typename IndexDest, typename IndexSrc>
|
|
52
|
+
struct convert_index_impl<IndexDest, IndexSrc, true, false, true, true> {
|
|
53
|
+
// IndexDest is an unsigned integer
|
|
54
|
+
// IndexSrc is a signed integer
|
|
55
|
+
static inline EIGEN_DEVICE_FUNC IndexDest run(const IndexSrc& idx) {
|
|
56
|
+
eigen_internal_assert(returnUnsignedIndexValue(idx) <= NumTraits<IndexDest>::highest() &&
|
|
57
|
+
"Index value is too big for target type");
|
|
58
|
+
return static_cast<IndexDest>(idx);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
template <typename IndexDest, typename IndexSrc>
|
|
63
|
+
EIGEN_DEVICE_FUNC inline IndexDest convert_index(const IndexSrc& idx) {
|
|
64
|
+
return convert_index_impl<IndexDest, IndexSrc>::run(idx);
|
|
35
65
|
}
|
|
36
66
|
|
|
37
67
|
// true if T can be considered as an integral index (i.e., and integral type or enum)
|
|
38
|
-
template<typename T>
|
|
39
|
-
{
|
|
40
|
-
enum { value =
|
|
41
|
-
#if EIGEN_HAS_TYPE_TRAITS
|
|
42
|
-
internal::is_integral<T>::value || std::is_enum<T>::value
|
|
43
|
-
#elif EIGEN_COMP_MSVC
|
|
44
|
-
internal::is_integral<T>::value || __is_enum(T)
|
|
45
|
-
#else
|
|
46
|
-
// without C++11, we use is_convertible to Index instead of is_integral in order to treat enums as Index.
|
|
47
|
-
internal::is_convertible<T,Index>::value && !internal::is_same<T,float>::value && !is_same<T,double>::value
|
|
48
|
-
#endif
|
|
49
|
-
};
|
|
68
|
+
template <typename T>
|
|
69
|
+
struct is_valid_index_type {
|
|
70
|
+
enum { value = internal::is_integral<T>::value || std::is_enum<T>::value };
|
|
50
71
|
};
|
|
51
72
|
|
|
52
73
|
// true if both types are not valid index types
|
|
53
|
-
template<typename RowIndices, typename ColIndices>
|
|
74
|
+
template <typename RowIndices, typename ColIndices>
|
|
54
75
|
struct valid_indexed_view_overload {
|
|
55
|
-
enum {
|
|
76
|
+
enum {
|
|
77
|
+
value = !(internal::is_valid_index_type<RowIndices>::value && internal::is_valid_index_type<ColIndices>::value)
|
|
78
|
+
};
|
|
56
79
|
};
|
|
57
80
|
|
|
58
81
|
// promote_scalar_arg is an helper used in operation between an expression and a scalar, like:
|
|
59
82
|
// expression * scalar
|
|
60
|
-
// Its role is to determine how the type T of the scalar operand should be promoted given the scalar type ExprScalar of
|
|
61
|
-
// The IsSupported template parameter must be provided by the caller as:
|
|
83
|
+
// Its role is to determine how the type T of the scalar operand should be promoted given the scalar type ExprScalar of
|
|
84
|
+
// the given expression. The IsSupported template parameter must be provided by the caller as:
|
|
85
|
+
// internal::has_ReturnType<ScalarBinaryOpTraits<ExprScalar,T,op> >::value using the proper order for ExprScalar and T.
|
|
62
86
|
// Then the logic is as follows:
|
|
63
|
-
// - if the operation is natively supported as defined by IsSupported, then the scalar type is not promoted, and T is
|
|
64
|
-
//
|
|
65
|
-
// - otherwise, ExprScalar is returned if T is implicitly convertible to
|
|
66
|
-
//
|
|
67
|
-
|
|
87
|
+
// - if the operation is natively supported as defined by IsSupported, then the scalar type is not promoted, and T is
|
|
88
|
+
// returned.
|
|
89
|
+
// - otherwise, NumTraits<ExprScalar>::Literal is returned if T is implicitly convertible to
|
|
90
|
+
// NumTraits<ExprScalar>::Literal AND that this does not imply a float to integer conversion.
|
|
91
|
+
// - otherwise, ExprScalar is returned if T is implicitly convertible to ExprScalar AND that this does not imply a
|
|
92
|
+
// float to integer conversion.
|
|
93
|
+
// - In all other cases, the promoted type is not defined, and the respective operation is thus invalid and not
|
|
94
|
+
// available (SFINAE).
|
|
95
|
+
template <typename ExprScalar, typename T, bool IsSupported>
|
|
68
96
|
struct promote_scalar_arg;
|
|
69
97
|
|
|
70
|
-
template<typename S,typename T>
|
|
71
|
-
struct promote_scalar_arg<S,T,true>
|
|
72
|
-
{
|
|
98
|
+
template <typename S, typename T>
|
|
99
|
+
struct promote_scalar_arg<S, T, true> {
|
|
73
100
|
typedef T type;
|
|
74
101
|
};
|
|
75
102
|
|
|
76
103
|
// Recursively check safe conversion to PromotedType, and then ExprScalar if they are different.
|
|
77
|
-
template<typename ExprScalar,typename T,typename PromotedType,
|
|
78
|
-
|
|
79
|
-
|
|
104
|
+
template <typename ExprScalar, typename T, typename PromotedType,
|
|
105
|
+
bool ConvertibleToLiteral = internal::is_convertible<T, PromotedType>::value,
|
|
106
|
+
bool IsSafe = NumTraits<T>::IsInteger || !NumTraits<PromotedType>::IsInteger>
|
|
80
107
|
struct promote_scalar_arg_unsupported;
|
|
81
108
|
|
|
82
109
|
// Start recursion with NumTraits<ExprScalar>::Literal
|
|
83
|
-
template<typename S,typename T>
|
|
84
|
-
struct promote_scalar_arg<S,T,false> : promote_scalar_arg_unsupported<S,T,typename NumTraits<S>::Literal> {};
|
|
110
|
+
template <typename S, typename T>
|
|
111
|
+
struct promote_scalar_arg<S, T, false> : promote_scalar_arg_unsupported<S, T, typename NumTraits<S>::Literal> {};
|
|
85
112
|
|
|
86
113
|
// We found a match!
|
|
87
|
-
template<typename S,typename T, typename PromotedType>
|
|
88
|
-
struct promote_scalar_arg_unsupported<S,T,PromotedType,true,true>
|
|
89
|
-
{
|
|
114
|
+
template <typename S, typename T, typename PromotedType>
|
|
115
|
+
struct promote_scalar_arg_unsupported<S, T, PromotedType, true, true> {
|
|
90
116
|
typedef PromotedType type;
|
|
91
117
|
};
|
|
92
118
|
|
|
93
119
|
// No match, but no real-to-integer issues, and ExprScalar and current PromotedType are different,
|
|
94
120
|
// so let's try to promote to ExprScalar
|
|
95
|
-
template<typename ExprScalar,typename T, typename PromotedType>
|
|
96
|
-
struct promote_scalar_arg_unsupported<ExprScalar,T,PromotedType,false,true>
|
|
97
|
-
|
|
98
|
-
{};
|
|
121
|
+
template <typename ExprScalar, typename T, typename PromotedType>
|
|
122
|
+
struct promote_scalar_arg_unsupported<ExprScalar, T, PromotedType, false, true>
|
|
123
|
+
: promote_scalar_arg_unsupported<ExprScalar, T, ExprScalar> {};
|
|
99
124
|
|
|
100
125
|
// Unsafe real-to-integer, let's stop.
|
|
101
|
-
template<typename S,typename T, typename PromotedType, bool ConvertibleToLiteral>
|
|
102
|
-
struct promote_scalar_arg_unsupported<S,T,PromotedType,ConvertibleToLiteral,false> {};
|
|
126
|
+
template <typename S, typename T, typename PromotedType, bool ConvertibleToLiteral>
|
|
127
|
+
struct promote_scalar_arg_unsupported<S, T, PromotedType, ConvertibleToLiteral, false> {};
|
|
103
128
|
|
|
104
129
|
// T is not even convertible to ExprScalar, let's stop.
|
|
105
|
-
template<typename S,typename T>
|
|
106
|
-
struct promote_scalar_arg_unsupported<S,T,S,false,true> {};
|
|
130
|
+
template <typename S, typename T>
|
|
131
|
+
struct promote_scalar_arg_unsupported<S, T, S, false, true> {};
|
|
107
132
|
|
|
108
|
-
//classes inheriting no_assignment_operator don't generate a default operator=.
|
|
109
|
-
class no_assignment_operator
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
133
|
+
// classes inheriting no_assignment_operator don't generate a default operator=.
|
|
134
|
+
class no_assignment_operator {
|
|
135
|
+
private:
|
|
136
|
+
no_assignment_operator& operator=(const no_assignment_operator&);
|
|
137
|
+
|
|
138
|
+
protected:
|
|
139
|
+
EIGEN_DEFAULT_COPY_CONSTRUCTOR(no_assignment_operator)
|
|
140
|
+
EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(no_assignment_operator)
|
|
116
141
|
};
|
|
117
142
|
|
|
118
143
|
/** \internal return the index type with the largest number of bits */
|
|
119
|
-
template<typename I1, typename I2>
|
|
120
|
-
struct promote_index_type
|
|
121
|
-
|
|
122
|
-
typedef typename conditional<(sizeof(I1)<sizeof(I2)), I2, I1>::type type;
|
|
144
|
+
template <typename I1, typename I2>
|
|
145
|
+
struct promote_index_type {
|
|
146
|
+
typedef std::conditional_t<(sizeof(I1) < sizeof(I2)), I2, I1> type;
|
|
123
147
|
};
|
|
124
148
|
|
|
125
149
|
/** \internal If the template parameter Value is Dynamic, this class is just a wrapper around a T variable that
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
template<typename T, int Value>
|
|
130
|
-
{
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
+
* can be accessed using value() and setValue().
|
|
151
|
+
* Otherwise, this class is an empty structure and value() just returns the template parameter Value.
|
|
152
|
+
*/
|
|
153
|
+
template <typename T, int Value>
|
|
154
|
+
class variable_if_dynamic {
|
|
155
|
+
public:
|
|
156
|
+
EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(variable_if_dynamic)
|
|
157
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit variable_if_dynamic(T v) {
|
|
158
|
+
EIGEN_ONLY_USED_FOR_DEBUG(v);
|
|
159
|
+
eigen_assert(v == T(Value));
|
|
160
|
+
}
|
|
161
|
+
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr T value() { return T(Value); }
|
|
162
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr operator T() const { return T(Value); }
|
|
163
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void setValue(T v) const {
|
|
164
|
+
EIGEN_ONLY_USED_FOR_DEBUG(v);
|
|
165
|
+
eigen_assert(v == T(Value));
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
template <typename T>
|
|
170
|
+
class variable_if_dynamic<T, Dynamic> {
|
|
171
|
+
T m_value;
|
|
172
|
+
|
|
173
|
+
public:
|
|
174
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit variable_if_dynamic(T value = 0) noexcept : m_value(value) {}
|
|
175
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T value() const { return m_value; }
|
|
176
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE operator T() const { return m_value; }
|
|
177
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void setValue(T value) { m_value = value; }
|
|
150
178
|
};
|
|
151
179
|
|
|
152
180
|
/** \internal like variable_if_dynamic but for DynamicIndex
|
|
153
|
-
|
|
154
|
-
template<typename T, int Value>
|
|
155
|
-
{
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
181
|
+
*/
|
|
182
|
+
template <typename T, int Value>
|
|
183
|
+
class variable_if_dynamicindex {
|
|
184
|
+
public:
|
|
185
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit variable_if_dynamicindex(T v) {
|
|
186
|
+
EIGEN_ONLY_USED_FOR_DEBUG(v);
|
|
187
|
+
eigen_assert(v == T(Value));
|
|
188
|
+
}
|
|
189
|
+
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr T value() { return T(Value); }
|
|
190
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void setValue(T) {}
|
|
163
191
|
};
|
|
164
192
|
|
|
165
|
-
template<typename T>
|
|
166
|
-
{
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
193
|
+
template <typename T>
|
|
194
|
+
class variable_if_dynamicindex<T, DynamicIndex> {
|
|
195
|
+
T m_value;
|
|
196
|
+
EIGEN_DEVICE_FUNC variable_if_dynamicindex() { eigen_assert(false); }
|
|
197
|
+
|
|
198
|
+
public:
|
|
199
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit variable_if_dynamicindex(T value) : m_value(value) {}
|
|
200
|
+
EIGEN_DEVICE_FUNC T EIGEN_STRONG_INLINE value() const { return m_value; }
|
|
201
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void setValue(T value) { m_value = value; }
|
|
173
202
|
};
|
|
174
203
|
|
|
175
|
-
template<typename T>
|
|
176
|
-
{
|
|
177
|
-
enum
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
204
|
+
template <typename T>
|
|
205
|
+
struct functor_traits {
|
|
206
|
+
enum { Cost = 10, PacketAccess = false, IsRepeatable = false };
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
// estimates the cost of lazily evaluating a generic functor by unwinding the expression
|
|
210
|
+
template <typename Xpr>
|
|
211
|
+
struct nested_functor_cost {
|
|
212
|
+
static constexpr Index Cost = static_cast<Index>(functor_traits<Xpr>::Cost);
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
template <typename Scalar, int Rows, int Cols, int Options, int MaxRows, int MaxCols>
|
|
216
|
+
struct nested_functor_cost<Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols>> {
|
|
217
|
+
static constexpr Index Cost = 1;
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
template <typename Scalar, int Rows, int Cols, int Options, int MaxRows, int MaxCols>
|
|
221
|
+
struct nested_functor_cost<Array<Scalar, Rows, Cols, Options, MaxRows, MaxCols>> {
|
|
222
|
+
static constexpr Index Cost = 1;
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
// TODO: assign a cost to the stride type?
|
|
226
|
+
template <typename PlainObjectType, int MapOptions, typename StrideType>
|
|
227
|
+
struct nested_functor_cost<Map<PlainObjectType, MapOptions, StrideType>> : nested_functor_cost<PlainObjectType> {};
|
|
228
|
+
|
|
229
|
+
template <typename Func, typename Xpr>
|
|
230
|
+
struct nested_functor_cost<CwiseUnaryOp<Func, Xpr>> {
|
|
231
|
+
using XprCleaned = remove_all_t<Xpr>;
|
|
232
|
+
using FuncCleaned = remove_all_t<Func>;
|
|
233
|
+
static constexpr Index Cost = nested_functor_cost<FuncCleaned>::Cost + nested_functor_cost<XprCleaned>::Cost;
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
template <typename Func, typename Xpr>
|
|
237
|
+
struct nested_functor_cost<CwiseNullaryOp<Func, Xpr>> {
|
|
238
|
+
using XprCleaned = remove_all_t<Xpr>;
|
|
239
|
+
using FuncCleaned = remove_all_t<Func>;
|
|
240
|
+
static constexpr Index Cost = nested_functor_cost<FuncCleaned>::Cost + nested_functor_cost<XprCleaned>::Cost;
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
template <typename Func, typename LhsXpr, typename RhsXpr>
|
|
244
|
+
struct nested_functor_cost<CwiseBinaryOp<Func, LhsXpr, RhsXpr>> {
|
|
245
|
+
using LhsXprCleaned = remove_all_t<LhsXpr>;
|
|
246
|
+
using RhsXprCleaned = remove_all_t<RhsXpr>;
|
|
247
|
+
using FuncCleaned = remove_all_t<Func>;
|
|
248
|
+
static constexpr Index Cost = nested_functor_cost<FuncCleaned>::Cost + nested_functor_cost<LhsXprCleaned>::Cost +
|
|
249
|
+
nested_functor_cost<RhsXprCleaned>::Cost;
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
template <typename Func, typename LhsXpr, typename MidXpr, typename RhsXpr>
|
|
253
|
+
struct nested_functor_cost<CwiseTernaryOp<Func, LhsXpr, MidXpr, RhsXpr>> {
|
|
254
|
+
using LhsXprCleaned = remove_all_t<LhsXpr>;
|
|
255
|
+
using MidXprCleaned = remove_all_t<MidXpr>;
|
|
256
|
+
using RhsXprCleaned = remove_all_t<RhsXpr>;
|
|
257
|
+
using FuncCleaned = remove_all_t<Func>;
|
|
258
|
+
static constexpr Index Cost = nested_functor_cost<FuncCleaned>::Cost + nested_functor_cost<LhsXprCleaned>::Cost +
|
|
259
|
+
nested_functor_cost<MidXprCleaned>::Cost + nested_functor_cost<RhsXprCleaned>::Cost;
|
|
183
260
|
};
|
|
184
261
|
|
|
185
|
-
template<typename
|
|
262
|
+
template <typename Xpr>
|
|
263
|
+
struct functor_cost {
|
|
264
|
+
static constexpr Index Cost = plain_enum_max(nested_functor_cost<Xpr>::Cost, 1);
|
|
265
|
+
};
|
|
186
266
|
|
|
187
|
-
template<typename T>
|
|
267
|
+
template <typename T>
|
|
268
|
+
struct packet_traits;
|
|
188
269
|
|
|
189
|
-
template<
|
|
190
|
-
|
|
270
|
+
template <typename T>
|
|
271
|
+
struct unpacket_traits;
|
|
272
|
+
|
|
273
|
+
template <int Size, typename PacketType,
|
|
274
|
+
bool Stop = Size == Dynamic || (Size % unpacket_traits<PacketType>::size) == 0 ||
|
|
275
|
+
is_same<PacketType, typename unpacket_traits<PacketType>::half>::value>
|
|
191
276
|
struct find_best_packet_helper;
|
|
192
277
|
|
|
193
|
-
template<
|
|
194
|
-
struct find_best_packet_helper<Size,PacketType,true>
|
|
195
|
-
{
|
|
278
|
+
template <int Size, typename PacketType>
|
|
279
|
+
struct find_best_packet_helper<Size, PacketType, true> {
|
|
196
280
|
typedef PacketType type;
|
|
197
281
|
};
|
|
198
282
|
|
|
199
|
-
template<int Size, typename PacketType>
|
|
200
|
-
struct find_best_packet_helper<Size,PacketType,false>
|
|
201
|
-
|
|
202
|
-
typedef typename find_best_packet_helper<Size,typename unpacket_traits<PacketType>::half>::type type;
|
|
283
|
+
template <int Size, typename PacketType>
|
|
284
|
+
struct find_best_packet_helper<Size, PacketType, false> {
|
|
285
|
+
typedef typename find_best_packet_helper<Size, typename unpacket_traits<PacketType>::half>::type type;
|
|
203
286
|
};
|
|
204
287
|
|
|
205
|
-
template<typename T, int Size>
|
|
206
|
-
struct find_best_packet
|
|
207
|
-
|
|
208
|
-
typedef typename find_best_packet_helper<Size,typename packet_traits<T>::type>::type type;
|
|
288
|
+
template <typename T, int Size>
|
|
289
|
+
struct find_best_packet {
|
|
290
|
+
typedef typename find_best_packet_helper<Size, typename packet_traits<T>::type>::type type;
|
|
209
291
|
};
|
|
210
292
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
{
|
|
217
|
-
|
|
293
|
+
template <int Size, typename PacketType,
|
|
294
|
+
bool Stop = (Size == unpacket_traits<PacketType>::size) ||
|
|
295
|
+
is_same<PacketType, typename unpacket_traits<PacketType>::half>::value>
|
|
296
|
+
struct find_packet_by_size_helper;
|
|
297
|
+
template <int Size, typename PacketType>
|
|
298
|
+
struct find_packet_by_size_helper<Size, PacketType, true> {
|
|
299
|
+
using type = PacketType;
|
|
218
300
|
};
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
{
|
|
223
|
-
enum { value = AlignmentBytes };
|
|
301
|
+
template <int Size, typename PacketType>
|
|
302
|
+
struct find_packet_by_size_helper<Size, PacketType, false> {
|
|
303
|
+
using type = typename find_packet_by_size_helper<Size, typename unpacket_traits<PacketType>::half>::type;
|
|
224
304
|
};
|
|
225
305
|
|
|
226
|
-
template<
|
|
227
|
-
struct
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
306
|
+
template <typename T, int Size>
|
|
307
|
+
struct find_packet_by_size {
|
|
308
|
+
using type = typename find_packet_by_size_helper<Size, typename packet_traits<T>::type>::type;
|
|
309
|
+
static constexpr bool value = (Size == unpacket_traits<type>::size);
|
|
310
|
+
};
|
|
311
|
+
template <typename T>
|
|
312
|
+
struct find_packet_by_size<T, 1> {
|
|
313
|
+
using type = typename unpacket_traits<T>::type;
|
|
314
|
+
static constexpr bool value = (unpacket_traits<type>::size == 1);
|
|
231
315
|
};
|
|
316
|
+
|
|
317
|
+
#if EIGEN_MAX_STATIC_ALIGN_BYTES > 0
|
|
318
|
+
constexpr int compute_default_alignment_helper(int ArrayBytes, int AlignmentBytes) {
|
|
319
|
+
if ((ArrayBytes % AlignmentBytes) == 0) {
|
|
320
|
+
return AlignmentBytes;
|
|
321
|
+
} else if (EIGEN_MIN_ALIGN_BYTES < AlignmentBytes) {
|
|
322
|
+
return compute_default_alignment_helper(ArrayBytes, AlignmentBytes / 2);
|
|
323
|
+
} else {
|
|
324
|
+
return 0;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
232
327
|
#else
|
|
233
328
|
// If static alignment is disabled, no need to bother.
|
|
234
|
-
// This also avoids a division by zero
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
}
|
|
329
|
+
// This also avoids a division by zero
|
|
330
|
+
constexpr int compute_default_alignment_helper(int ArrayBytes, int AlignmentBytes) {
|
|
331
|
+
EIGEN_UNUSED_VARIABLE(ArrayBytes);
|
|
332
|
+
EIGEN_UNUSED_VARIABLE(AlignmentBytes);
|
|
333
|
+
return 0;
|
|
334
|
+
}
|
|
240
335
|
#endif
|
|
241
336
|
|
|
242
|
-
template<typename T, int Size>
|
|
243
|
-
|
|
337
|
+
template <typename T, int Size>
|
|
338
|
+
struct compute_default_alignment {
|
|
339
|
+
enum { value = compute_default_alignment_helper(Size * sizeof(T), EIGEN_MAX_STATIC_ALIGN_BYTES) };
|
|
244
340
|
};
|
|
245
341
|
|
|
246
|
-
template<typename T>
|
|
342
|
+
template <typename T>
|
|
343
|
+
struct compute_default_alignment<T, Dynamic> {
|
|
247
344
|
enum { value = EIGEN_MAX_ALIGN_BYTES };
|
|
248
345
|
};
|
|
249
346
|
|
|
250
|
-
template<typename
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
: IsRowVector ? (_Options | RowMajor) & ~ColMajor
|
|
264
|
-
: _Options
|
|
265
|
-
};
|
|
266
|
-
public:
|
|
267
|
-
typedef Matrix<_Scalar, _Rows, _Cols, Options, _MaxRows, _MaxCols> type;
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
template<typename Scalar, int Rows, int Cols, int Options, int MaxRows, int MaxCols>
|
|
271
|
-
class compute_matrix_flags
|
|
272
|
-
{
|
|
273
|
-
enum { row_major_bit = Options&RowMajor ? RowMajorBit : 0 };
|
|
274
|
-
public:
|
|
275
|
-
// FIXME currently we still have to handle DirectAccessBit at the expression level to handle DenseCoeffsBase<>
|
|
276
|
-
// and then propagate this information to the evaluator's flags.
|
|
277
|
-
// However, I (Gael) think that DirectAccessBit should only matter at the evaluation stage.
|
|
278
|
-
enum { ret = DirectAccessBit | LvalueBit | NestByRefBit | row_major_bit };
|
|
279
|
-
};
|
|
347
|
+
template <typename Scalar_, int Rows_, int Cols_,
|
|
348
|
+
int Options_ = AutoAlign | ((Rows_ == 1 && Cols_ != 1) ? RowMajor
|
|
349
|
+
: (Cols_ == 1 && Rows_ != 1) ? ColMajor
|
|
350
|
+
: EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION),
|
|
351
|
+
int MaxRows_ = Rows_, int MaxCols_ = Cols_>
|
|
352
|
+
class make_proper_matrix_type {
|
|
353
|
+
enum {
|
|
354
|
+
IsColVector = Cols_ == 1 && Rows_ != 1,
|
|
355
|
+
IsRowVector = Rows_ == 1 && Cols_ != 1,
|
|
356
|
+
Options = IsColVector ? (Options_ | ColMajor) & ~RowMajor
|
|
357
|
+
: IsRowVector ? (Options_ | RowMajor) & ~ColMajor
|
|
358
|
+
: Options_
|
|
359
|
+
};
|
|
280
360
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
enum { ret = (_Rows==Dynamic || _Cols==Dynamic) ? Dynamic : _Rows * _Cols };
|
|
361
|
+
public:
|
|
362
|
+
typedef Matrix<Scalar_, Rows_, Cols_, Options, MaxRows_, MaxCols_> type;
|
|
284
363
|
};
|
|
285
364
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
365
|
+
constexpr unsigned compute_matrix_flags(int Options) {
|
|
366
|
+
unsigned row_major_bit = Options & RowMajor ? RowMajorBit : 0;
|
|
367
|
+
// FIXME currently we still have to handle DirectAccessBit at the expression level to handle DenseCoeffsBase<>
|
|
368
|
+
// and then propagate this information to the evaluator's flags.
|
|
369
|
+
// However, I (Gael) think that DirectAccessBit should only matter at the evaluation stage.
|
|
370
|
+
return DirectAccessBit | LvalueBit | NestByRefBit | row_major_bit;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
constexpr int size_at_compile_time(int rows, int cols) {
|
|
374
|
+
if (rows == 0 || cols == 0) return 0;
|
|
375
|
+
if (rows == Dynamic || cols == Dynamic) return Dynamic;
|
|
376
|
+
return rows * cols;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
template <typename XprType>
|
|
380
|
+
struct size_of_xpr_at_compile_time {
|
|
381
|
+
enum { ret = size_at_compile_time(traits<XprType>::RowsAtCompileTime, traits<XprType>::ColsAtCompileTime) };
|
|
289
382
|
};
|
|
290
383
|
|
|
291
384
|
/* plain_matrix_type : the difference from eval is that plain_matrix_type is always a plain matrix type,
|
|
292
385
|
* whereas eval is a const reference in the case of a matrix
|
|
293
386
|
*/
|
|
294
387
|
|
|
295
|
-
template<typename T, typename StorageKind = typename traits<T>::StorageKind>
|
|
296
|
-
|
|
297
|
-
template<typename T
|
|
298
|
-
|
|
299
|
-
|
|
388
|
+
template <typename T, typename StorageKind = typename traits<T>::StorageKind>
|
|
389
|
+
struct plain_matrix_type;
|
|
390
|
+
template <typename T, typename BaseClassType, int Flags>
|
|
391
|
+
struct plain_matrix_type_dense;
|
|
392
|
+
template <typename T>
|
|
393
|
+
struct plain_matrix_type<T, Dense> {
|
|
394
|
+
typedef typename plain_matrix_type_dense<T, typename traits<T>::XprKind, traits<T>::Flags>::type type;
|
|
300
395
|
};
|
|
301
|
-
template<typename T>
|
|
302
|
-
{
|
|
396
|
+
template <typename T>
|
|
397
|
+
struct plain_matrix_type<T, DiagonalShape> {
|
|
303
398
|
typedef typename T::PlainObject type;
|
|
304
399
|
};
|
|
305
400
|
|
|
306
|
-
template<typename T
|
|
307
|
-
{
|
|
308
|
-
typedef
|
|
309
|
-
traits<T>::RowsAtCompileTime,
|
|
310
|
-
traits<T>::ColsAtCompileTime,
|
|
311
|
-
AutoAlign | (Flags&RowMajorBit ? RowMajor : ColMajor),
|
|
312
|
-
traits<T>::MaxRowsAtCompileTime,
|
|
313
|
-
traits<T>::MaxColsAtCompileTime
|
|
314
|
-
> type;
|
|
401
|
+
template <typename T>
|
|
402
|
+
struct plain_matrix_type<T, SkewSymmetricShape> {
|
|
403
|
+
typedef typename T::PlainObject type;
|
|
315
404
|
};
|
|
316
405
|
|
|
317
|
-
template<typename T, int Flags>
|
|
318
|
-
{
|
|
319
|
-
typedef
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
406
|
+
template <typename T, int Flags>
|
|
407
|
+
struct plain_matrix_type_dense<T, MatrixXpr, Flags> {
|
|
408
|
+
typedef Matrix<typename traits<T>::Scalar, traits<T>::RowsAtCompileTime, traits<T>::ColsAtCompileTime,
|
|
409
|
+
AutoAlign | (Flags & RowMajorBit ? RowMajor : ColMajor), traits<T>::MaxRowsAtCompileTime,
|
|
410
|
+
traits<T>::MaxColsAtCompileTime>
|
|
411
|
+
type;
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
template <typename T, int Flags>
|
|
415
|
+
struct plain_matrix_type_dense<T, ArrayXpr, Flags> {
|
|
416
|
+
typedef Array<typename traits<T>::Scalar, traits<T>::RowsAtCompileTime, traits<T>::ColsAtCompileTime,
|
|
417
|
+
AutoAlign | (Flags & RowMajorBit ? RowMajor : ColMajor), traits<T>::MaxRowsAtCompileTime,
|
|
418
|
+
traits<T>::MaxColsAtCompileTime>
|
|
419
|
+
type;
|
|
326
420
|
};
|
|
327
421
|
|
|
328
422
|
/* eval : the return type of eval(). For matrices, this is just a const reference
|
|
329
423
|
* in order to avoid a useless copy
|
|
330
424
|
*/
|
|
331
425
|
|
|
332
|
-
template<typename T, typename StorageKind = typename traits<T>::StorageKind>
|
|
426
|
+
template <typename T, typename StorageKind = typename traits<T>::StorageKind>
|
|
427
|
+
struct eval;
|
|
333
428
|
|
|
334
|
-
template<typename T>
|
|
335
|
-
{
|
|
429
|
+
template <typename T>
|
|
430
|
+
struct eval<T, Dense> {
|
|
336
431
|
typedef typename plain_matrix_type<T>::type type;
|
|
337
|
-
// typedef typename T::PlainObject type;
|
|
338
|
-
// typedef T::Matrix<typename traits<T>::Scalar,
|
|
339
|
-
// traits<T>::RowsAtCompileTime,
|
|
340
|
-
// traits<T>::ColsAtCompileTime,
|
|
341
|
-
// AutoAlign | (traits<T>::Flags&RowMajorBit ? RowMajor : ColMajor),
|
|
342
|
-
// traits<T>::MaxRowsAtCompileTime,
|
|
343
|
-
// traits<T>::MaxColsAtCompileTime
|
|
344
|
-
// > type;
|
|
432
|
+
// typedef typename T::PlainObject type;
|
|
433
|
+
// typedef T::Matrix<typename traits<T>::Scalar,
|
|
434
|
+
// traits<T>::RowsAtCompileTime,
|
|
435
|
+
// traits<T>::ColsAtCompileTime,
|
|
436
|
+
// AutoAlign | (traits<T>::Flags&RowMajorBit ? RowMajor : ColMajor),
|
|
437
|
+
// traits<T>::MaxRowsAtCompileTime,
|
|
438
|
+
// traits<T>::MaxColsAtCompileTime
|
|
439
|
+
// > type;
|
|
345
440
|
};
|
|
346
441
|
|
|
347
|
-
template<typename T>
|
|
348
|
-
{
|
|
442
|
+
template <typename T>
|
|
443
|
+
struct eval<T, DiagonalShape> {
|
|
349
444
|
typedef typename plain_matrix_type<T>::type type;
|
|
350
445
|
};
|
|
351
446
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
{
|
|
356
|
-
typedef const Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& type;
|
|
447
|
+
template <typename T>
|
|
448
|
+
struct eval<T, SkewSymmetricShape> {
|
|
449
|
+
typedef typename plain_matrix_type<T>::type type;
|
|
357
450
|
};
|
|
358
451
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
{
|
|
362
|
-
typedef const
|
|
452
|
+
// for matrices, no need to evaluate, just use a const reference to avoid a useless copy
|
|
453
|
+
template <typename Scalar_, int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
|
|
454
|
+
struct eval<Matrix<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_>, Dense> {
|
|
455
|
+
typedef const Matrix<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_>& type;
|
|
363
456
|
};
|
|
364
457
|
|
|
458
|
+
template <typename Scalar_, int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
|
|
459
|
+
struct eval<Array<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_>, Dense> {
|
|
460
|
+
typedef const Array<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_>& type;
|
|
461
|
+
};
|
|
365
462
|
|
|
366
463
|
/* similar to plain_matrix_type, but using the evaluator's Flags */
|
|
367
|
-
template<typename T, typename StorageKind = typename traits<T>::StorageKind>
|
|
464
|
+
template <typename T, typename StorageKind = typename traits<T>::StorageKind>
|
|
465
|
+
struct plain_object_eval;
|
|
368
466
|
|
|
369
|
-
template<typename T>
|
|
370
|
-
struct plain_object_eval<T,Dense>
|
|
371
|
-
|
|
372
|
-
typedef typename plain_matrix_type_dense<T,typename traits<T>::XprKind, evaluator<T>::Flags>::type type;
|
|
467
|
+
template <typename T>
|
|
468
|
+
struct plain_object_eval<T, Dense> {
|
|
469
|
+
typedef typename plain_matrix_type_dense<T, typename traits<T>::XprKind, evaluator<T>::Flags>::type type;
|
|
373
470
|
};
|
|
374
471
|
|
|
375
|
-
|
|
376
472
|
/* plain_matrix_type_column_major : same as plain_matrix_type but guaranteed to be column-major
|
|
377
473
|
*/
|
|
378
|
-
template<typename T>
|
|
379
|
-
{
|
|
380
|
-
enum {
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
474
|
+
template <typename T>
|
|
475
|
+
struct plain_matrix_type_column_major {
|
|
476
|
+
enum {
|
|
477
|
+
Rows = traits<T>::RowsAtCompileTime,
|
|
478
|
+
Cols = traits<T>::ColsAtCompileTime,
|
|
479
|
+
MaxRows = traits<T>::MaxRowsAtCompileTime,
|
|
480
|
+
MaxCols = traits<T>::MaxColsAtCompileTime
|
|
384
481
|
};
|
|
385
|
-
typedef Matrix<typename traits<T>::Scalar,
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
(MaxRows==1&&MaxCols!=1) ? RowMajor : ColMajor,
|
|
389
|
-
MaxRows,
|
|
390
|
-
MaxCols
|
|
391
|
-
> type;
|
|
482
|
+
typedef Matrix<typename traits<T>::Scalar, Rows, Cols, (MaxRows == 1 && MaxCols != 1) ? RowMajor : ColMajor, MaxRows,
|
|
483
|
+
MaxCols>
|
|
484
|
+
type;
|
|
392
485
|
};
|
|
393
486
|
|
|
394
487
|
/* plain_matrix_type_row_major : same as plain_matrix_type but guaranteed to be row-major
|
|
395
488
|
*/
|
|
396
|
-
template<typename T>
|
|
397
|
-
{
|
|
398
|
-
enum {
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
489
|
+
template <typename T>
|
|
490
|
+
struct plain_matrix_type_row_major {
|
|
491
|
+
enum {
|
|
492
|
+
Rows = traits<T>::RowsAtCompileTime,
|
|
493
|
+
Cols = traits<T>::ColsAtCompileTime,
|
|
494
|
+
MaxRows = traits<T>::MaxRowsAtCompileTime,
|
|
495
|
+
MaxCols = traits<T>::MaxColsAtCompileTime
|
|
402
496
|
};
|
|
403
|
-
typedef Matrix<typename traits<T>::Scalar,
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
(MaxCols==1&&MaxRows!=1) ? ColMajor : RowMajor,
|
|
407
|
-
MaxRows,
|
|
408
|
-
MaxCols
|
|
409
|
-
> type;
|
|
497
|
+
typedef Matrix<typename traits<T>::Scalar, Rows, Cols, (MaxCols == 1 && MaxRows != 1) ? ColMajor : RowMajor, MaxRows,
|
|
498
|
+
MaxCols>
|
|
499
|
+
type;
|
|
410
500
|
};
|
|
411
501
|
|
|
412
502
|
/** \internal The reference selector for template expressions. The idea is that we don't
|
|
413
|
-
|
|
414
|
-
|
|
503
|
+
* need to use references for expressions since they are light weight proxy
|
|
504
|
+
* objects which should generate no copying overhead. */
|
|
415
505
|
template <typename T>
|
|
416
|
-
struct ref_selector
|
|
417
|
-
|
|
418
|
-
typedef typename conditional<
|
|
419
|
-
bool(traits<T>::Flags & NestByRefBit),
|
|
420
|
-
T const&,
|
|
421
|
-
const T
|
|
422
|
-
>::type type;
|
|
506
|
+
struct ref_selector {
|
|
507
|
+
typedef std::conditional_t<bool(traits<T>::Flags& NestByRefBit), T const&, const T> type;
|
|
423
508
|
|
|
424
|
-
typedef
|
|
425
|
-
bool(traits<T>::Flags & NestByRefBit),
|
|
426
|
-
T &,
|
|
427
|
-
T
|
|
428
|
-
>::type non_const_type;
|
|
509
|
+
typedef std::conditional_t<bool(traits<T>::Flags& NestByRefBit), T&, T> non_const_type;
|
|
429
510
|
};
|
|
430
511
|
|
|
431
512
|
/** \internal Adds the const qualifier on the value-type of T2 if and only if T1 is a const type */
|
|
432
|
-
template<typename T1, typename T2>
|
|
433
|
-
struct transfer_constness
|
|
434
|
-
|
|
435
|
-
typedef typename conditional<
|
|
436
|
-
bool(internal::is_const<T1>::value),
|
|
437
|
-
typename internal::add_const_on_value_type<T2>::type,
|
|
438
|
-
T2
|
|
439
|
-
>::type type;
|
|
513
|
+
template <typename T1, typename T2>
|
|
514
|
+
struct transfer_constness {
|
|
515
|
+
typedef std::conditional_t<bool(internal::is_const<T1>::value), add_const_on_value_type_t<T2>, T2> type;
|
|
440
516
|
};
|
|
441
517
|
|
|
442
|
-
|
|
443
518
|
// However, we still need a mechanism to detect whether an expression which is evaluated multiple time
|
|
444
519
|
// has to be evaluated into a temporary.
|
|
445
520
|
// That's the purpose of this new nested_eval helper:
|
|
446
521
|
/** \internal Determines how a given expression should be nested when evaluated multiple times.
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
template<typename T, int n, typename PlainObject = typename plain_object_eval<T>::type>
|
|
458
|
-
{
|
|
522
|
+
* For example, when you do a * (b+c), Eigen will determine how the expression b+c should be
|
|
523
|
+
* evaluated into the bigger product expression. The choice is between nesting the expression b+c as-is, or
|
|
524
|
+
* evaluating that expression b+c into a temporary variable d, and nest d so that the resulting expression is
|
|
525
|
+
* a*d. Evaluating can be beneficial for example if every coefficient access in the resulting expression causes
|
|
526
|
+
* many coefficient accesses in the nested expressions -- as is the case with matrix product for example.
|
|
527
|
+
*
|
|
528
|
+
* \tparam T the type of the expression being nested.
|
|
529
|
+
* \tparam n the number of coefficient accesses in the nested expression for each coefficient access in the bigger
|
|
530
|
+
* expression. \tparam PlainObject the type of the temporary if needed.
|
|
531
|
+
*/
|
|
532
|
+
template <typename T, int n, typename PlainObject = typename plain_object_eval<T>::type>
|
|
533
|
+
struct nested_eval {
|
|
459
534
|
enum {
|
|
460
535
|
ScalarReadCost = NumTraits<typename traits<T>::Scalar>::ReadCost,
|
|
461
|
-
CoeffReadCost =
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
536
|
+
CoeffReadCost =
|
|
537
|
+
evaluator<T>::CoeffReadCost, // NOTE What if an evaluator evaluate itself into a temporary?
|
|
538
|
+
// Then CoeffReadCost will be small (e.g., 1) but we still have to evaluate,
|
|
539
|
+
// especially if n>1. This situation is already taken care by the
|
|
540
|
+
// EvalBeforeNestingBit flag, which is turned ON for all evaluator creating a
|
|
541
|
+
// temporary. This flag is then propagated by the parent evaluators. Another
|
|
542
|
+
// solution could be to count the number of temps?
|
|
466
543
|
NAsInteger = n == Dynamic ? HugeCost : n,
|
|
467
|
-
CostEval
|
|
468
|
-
CostNoEval = NAsInteger * CoeffReadCost,
|
|
544
|
+
CostEval = (NAsInteger + 1) * ScalarReadCost + CoeffReadCost,
|
|
545
|
+
CostNoEval = int(NAsInteger) * int(CoeffReadCost),
|
|
469
546
|
Evaluate = (int(evaluator<T>::Flags) & EvalBeforeNestingBit) || (int(CostEval) < int(CostNoEval))
|
|
470
547
|
};
|
|
471
548
|
|
|
472
|
-
typedef
|
|
549
|
+
typedef std::conditional_t<Evaluate, PlainObject, typename ref_selector<T>::type> type;
|
|
473
550
|
};
|
|
474
551
|
|
|
475
|
-
template<typename T>
|
|
476
|
-
EIGEN_DEVICE_FUNC
|
|
477
|
-
inline T* const_cast_ptr(const T* ptr)
|
|
478
|
-
{
|
|
552
|
+
template <typename T>
|
|
553
|
+
EIGEN_DEVICE_FUNC inline T* const_cast_ptr(const T* ptr) {
|
|
479
554
|
return const_cast<T*>(ptr);
|
|
480
555
|
}
|
|
481
556
|
|
|
482
|
-
template<typename Derived, typename XprKind = typename traits<Derived>::XprKind>
|
|
483
|
-
struct dense_xpr_base
|
|
484
|
-
|
|
485
|
-
|
|
557
|
+
template <typename Derived, typename XprKind = typename traits<Derived>::XprKind>
|
|
558
|
+
struct dense_xpr_base {
|
|
559
|
+
/* dense_xpr_base should only ever be used on dense expressions, thus falling either into the MatrixXpr or into the
|
|
560
|
+
* ArrayXpr cases */
|
|
486
561
|
};
|
|
487
562
|
|
|
488
|
-
template<typename Derived>
|
|
489
|
-
struct dense_xpr_base<Derived, MatrixXpr>
|
|
490
|
-
{
|
|
563
|
+
template <typename Derived>
|
|
564
|
+
struct dense_xpr_base<Derived, MatrixXpr> {
|
|
491
565
|
typedef MatrixBase<Derived> type;
|
|
492
566
|
};
|
|
493
567
|
|
|
494
|
-
template<typename Derived>
|
|
495
|
-
struct dense_xpr_base<Derived, ArrayXpr>
|
|
496
|
-
{
|
|
568
|
+
template <typename Derived>
|
|
569
|
+
struct dense_xpr_base<Derived, ArrayXpr> {
|
|
497
570
|
typedef ArrayBase<Derived> type;
|
|
498
571
|
};
|
|
499
572
|
|
|
500
|
-
template<typename Derived, typename XprKind = typename traits<Derived>::XprKind,
|
|
573
|
+
template <typename Derived, typename XprKind = typename traits<Derived>::XprKind,
|
|
574
|
+
typename StorageKind = typename traits<Derived>::StorageKind>
|
|
501
575
|
struct generic_xpr_base;
|
|
502
576
|
|
|
503
|
-
template<typename Derived, typename XprKind>
|
|
504
|
-
struct generic_xpr_base<Derived, XprKind, Dense>
|
|
505
|
-
|
|
506
|
-
typedef typename dense_xpr_base<Derived,XprKind>::type type;
|
|
577
|
+
template <typename Derived, typename XprKind>
|
|
578
|
+
struct generic_xpr_base<Derived, XprKind, Dense> {
|
|
579
|
+
typedef typename dense_xpr_base<Derived, XprKind>::type type;
|
|
507
580
|
};
|
|
508
581
|
|
|
509
|
-
template<typename XprType, typename CastType>
|
|
510
|
-
{
|
|
582
|
+
template <typename XprType, typename CastType>
|
|
583
|
+
struct cast_return_type {
|
|
511
584
|
typedef typename XprType::Scalar CurrentScalarType;
|
|
512
|
-
typedef
|
|
513
|
-
typedef typename
|
|
514
|
-
typedef
|
|
515
|
-
const XprType&,CastType>::type type;
|
|
585
|
+
typedef remove_all_t<CastType> CastType_;
|
|
586
|
+
typedef typename CastType_::Scalar NewScalarType;
|
|
587
|
+
typedef std::conditional_t<is_same<CurrentScalarType, NewScalarType>::value, const XprType&, CastType> type;
|
|
516
588
|
};
|
|
517
589
|
|
|
518
|
-
template <typename A, typename B>
|
|
590
|
+
template <typename A, typename B>
|
|
591
|
+
struct promote_storage_type;
|
|
519
592
|
|
|
520
|
-
template <typename A>
|
|
521
|
-
{
|
|
593
|
+
template <typename A>
|
|
594
|
+
struct promote_storage_type<A, A> {
|
|
522
595
|
typedef A ret;
|
|
523
596
|
};
|
|
524
|
-
template <typename A>
|
|
525
|
-
{
|
|
597
|
+
template <typename A>
|
|
598
|
+
struct promote_storage_type<A, const A> {
|
|
526
599
|
typedef A ret;
|
|
527
600
|
};
|
|
528
|
-
template <typename A>
|
|
529
|
-
{
|
|
601
|
+
template <typename A>
|
|
602
|
+
struct promote_storage_type<const A, A> {
|
|
530
603
|
typedef A ret;
|
|
531
604
|
};
|
|
532
605
|
|
|
533
606
|
/** \internal Specify the "storage kind" of applying a coefficient-wise
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
template <typename A, typename B, typename Functor>
|
|
607
|
+
* binary operations between two expressions of kinds A and B respectively.
|
|
608
|
+
* The template parameter Functor permits to specialize the resulting storage kind wrt to
|
|
609
|
+
* the functor.
|
|
610
|
+
* The default rules are as follows:
|
|
611
|
+
* \code
|
|
612
|
+
* A op A -> A
|
|
613
|
+
* A op dense -> dense
|
|
614
|
+
* dense op B -> dense
|
|
615
|
+
* sparse op dense -> sparse
|
|
616
|
+
* dense op sparse -> sparse
|
|
617
|
+
* \endcode
|
|
618
|
+
*/
|
|
619
|
+
template <typename A, typename B, typename Functor>
|
|
620
|
+
struct cwise_promote_storage_type;
|
|
547
621
|
|
|
548
|
-
template <typename A, typename Functor>
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
template <typename Functor>
|
|
553
|
-
|
|
622
|
+
template <typename A, typename Functor>
|
|
623
|
+
struct cwise_promote_storage_type<A, A, Functor> {
|
|
624
|
+
typedef A ret;
|
|
625
|
+
};
|
|
626
|
+
template <typename Functor>
|
|
627
|
+
struct cwise_promote_storage_type<Dense, Dense, Functor> {
|
|
628
|
+
typedef Dense ret;
|
|
629
|
+
};
|
|
630
|
+
template <typename A, typename Functor>
|
|
631
|
+
struct cwise_promote_storage_type<A, Dense, Functor> {
|
|
632
|
+
typedef Dense ret;
|
|
633
|
+
};
|
|
634
|
+
template <typename B, typename Functor>
|
|
635
|
+
struct cwise_promote_storage_type<Dense, B, Functor> {
|
|
636
|
+
typedef Dense ret;
|
|
637
|
+
};
|
|
638
|
+
template <typename Functor>
|
|
639
|
+
struct cwise_promote_storage_type<Sparse, Dense, Functor> {
|
|
640
|
+
typedef Sparse ret;
|
|
641
|
+
};
|
|
642
|
+
template <typename Functor>
|
|
643
|
+
struct cwise_promote_storage_type<Dense, Sparse, Functor> {
|
|
644
|
+
typedef Sparse ret;
|
|
645
|
+
};
|
|
554
646
|
|
|
555
|
-
template <typename LhsKind, typename RhsKind, int LhsOrder, int RhsOrder>
|
|
647
|
+
template <typename LhsKind, typename RhsKind, int LhsOrder, int RhsOrder>
|
|
648
|
+
struct cwise_promote_storage_order {
|
|
556
649
|
enum { value = LhsOrder };
|
|
557
650
|
};
|
|
558
651
|
|
|
559
|
-
template <typename LhsKind, int LhsOrder, int RhsOrder>
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
652
|
+
template <typename LhsKind, int LhsOrder, int RhsOrder>
|
|
653
|
+
struct cwise_promote_storage_order<LhsKind, Sparse, LhsOrder, RhsOrder> {
|
|
654
|
+
enum { value = RhsOrder };
|
|
655
|
+
};
|
|
656
|
+
template <typename RhsKind, int LhsOrder, int RhsOrder>
|
|
657
|
+
struct cwise_promote_storage_order<Sparse, RhsKind, LhsOrder, RhsOrder> {
|
|
658
|
+
enum { value = LhsOrder };
|
|
659
|
+
};
|
|
660
|
+
template <int Order>
|
|
661
|
+
struct cwise_promote_storage_order<Sparse, Sparse, Order, Order> {
|
|
662
|
+
enum { value = Order };
|
|
663
|
+
};
|
|
563
664
|
|
|
564
665
|
/** \internal Specify the "storage kind" of multiplying an expression of kind A with kind B.
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
template <typename A, typename B, int ProductTag>
|
|
666
|
+
* The template parameter ProductTag permits to specialize the resulting storage kind wrt to
|
|
667
|
+
* some compile-time properties of the product: GemmProduct, GemvProduct, OuterProduct, InnerProduct.
|
|
668
|
+
* The default rules are as follows:
|
|
669
|
+
* \code
|
|
670
|
+
* K * K -> K
|
|
671
|
+
* dense * K -> dense
|
|
672
|
+
* K * dense -> dense
|
|
673
|
+
* diag * K -> K
|
|
674
|
+
* K * diag -> K
|
|
675
|
+
* Perm * K -> K
|
|
676
|
+
* K * Perm -> K
|
|
677
|
+
* \endcode
|
|
678
|
+
*/
|
|
679
|
+
template <typename A, typename B, int ProductTag>
|
|
680
|
+
struct product_promote_storage_type;
|
|
681
|
+
|
|
682
|
+
template <typename A, int ProductTag>
|
|
683
|
+
struct product_promote_storage_type<A, A, ProductTag> {
|
|
684
|
+
typedef A ret;
|
|
685
|
+
};
|
|
686
|
+
template <int ProductTag>
|
|
687
|
+
struct product_promote_storage_type<Dense, Dense, ProductTag> {
|
|
688
|
+
typedef Dense ret;
|
|
689
|
+
};
|
|
690
|
+
template <typename A, int ProductTag>
|
|
691
|
+
struct product_promote_storage_type<A, Dense, ProductTag> {
|
|
692
|
+
typedef Dense ret;
|
|
693
|
+
};
|
|
694
|
+
template <typename B, int ProductTag>
|
|
695
|
+
struct product_promote_storage_type<Dense, B, ProductTag> {
|
|
696
|
+
typedef Dense ret;
|
|
697
|
+
};
|
|
579
698
|
|
|
580
|
-
template <typename A, int ProductTag>
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
699
|
+
template <typename A, int ProductTag>
|
|
700
|
+
struct product_promote_storage_type<A, DiagonalShape, ProductTag> {
|
|
701
|
+
typedef A ret;
|
|
702
|
+
};
|
|
703
|
+
template <typename B, int ProductTag>
|
|
704
|
+
struct product_promote_storage_type<DiagonalShape, B, ProductTag> {
|
|
705
|
+
typedef B ret;
|
|
706
|
+
};
|
|
707
|
+
template <int ProductTag>
|
|
708
|
+
struct product_promote_storage_type<Dense, DiagonalShape, ProductTag> {
|
|
709
|
+
typedef Dense ret;
|
|
710
|
+
};
|
|
711
|
+
template <int ProductTag>
|
|
712
|
+
struct product_promote_storage_type<DiagonalShape, Dense, ProductTag> {
|
|
713
|
+
typedef Dense ret;
|
|
714
|
+
};
|
|
584
715
|
|
|
585
|
-
template <typename A, int ProductTag>
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
716
|
+
template <typename A, int ProductTag>
|
|
717
|
+
struct product_promote_storage_type<A, SkewSymmetricShape, ProductTag> {
|
|
718
|
+
typedef A ret;
|
|
719
|
+
};
|
|
720
|
+
template <typename B, int ProductTag>
|
|
721
|
+
struct product_promote_storage_type<SkewSymmetricShape, B, ProductTag> {
|
|
722
|
+
typedef B ret;
|
|
723
|
+
};
|
|
724
|
+
template <int ProductTag>
|
|
725
|
+
struct product_promote_storage_type<Dense, SkewSymmetricShape, ProductTag> {
|
|
726
|
+
typedef Dense ret;
|
|
727
|
+
};
|
|
728
|
+
template <int ProductTag>
|
|
729
|
+
struct product_promote_storage_type<SkewSymmetricShape, Dense, ProductTag> {
|
|
730
|
+
typedef Dense ret;
|
|
731
|
+
};
|
|
732
|
+
template <int ProductTag>
|
|
733
|
+
struct product_promote_storage_type<SkewSymmetricShape, SkewSymmetricShape, ProductTag> {
|
|
734
|
+
typedef Dense ret;
|
|
735
|
+
};
|
|
589
736
|
|
|
590
|
-
template <typename A, int ProductTag>
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
737
|
+
template <typename A, int ProductTag>
|
|
738
|
+
struct product_promote_storage_type<A, PermutationStorage, ProductTag> {
|
|
739
|
+
typedef A ret;
|
|
740
|
+
};
|
|
741
|
+
template <typename B, int ProductTag>
|
|
742
|
+
struct product_promote_storage_type<PermutationStorage, B, ProductTag> {
|
|
743
|
+
typedef B ret;
|
|
744
|
+
};
|
|
745
|
+
template <int ProductTag>
|
|
746
|
+
struct product_promote_storage_type<Dense, PermutationStorage, ProductTag> {
|
|
747
|
+
typedef Dense ret;
|
|
748
|
+
};
|
|
749
|
+
template <int ProductTag>
|
|
750
|
+
struct product_promote_storage_type<PermutationStorage, Dense, ProductTag> {
|
|
751
|
+
typedef Dense ret;
|
|
752
|
+
};
|
|
594
753
|
|
|
595
754
|
/** \internal gives the plain matrix or array type to store a row/column/diagonal of a matrix type.
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
template<typename ExpressionType, typename Scalar = typename ExpressionType::Scalar>
|
|
599
|
-
struct plain_row_type
|
|
600
|
-
{
|
|
755
|
+
* \tparam Scalar optional parameter allowing to pass a different scalar type than the one of the MatrixType.
|
|
756
|
+
*/
|
|
757
|
+
template <typename ExpressionType, typename Scalar = typename ExpressionType::Scalar>
|
|
758
|
+
struct plain_row_type {
|
|
601
759
|
typedef Matrix<Scalar, 1, ExpressionType::ColsAtCompileTime,
|
|
602
|
-
int(ExpressionType::PlainObject::Options) | int(RowMajor), 1, ExpressionType::MaxColsAtCompileTime>
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
760
|
+
int(ExpressionType::PlainObject::Options) | int(RowMajor), 1, ExpressionType::MaxColsAtCompileTime>
|
|
761
|
+
MatrixRowType;
|
|
762
|
+
typedef Array<Scalar, 1, ExpressionType::ColsAtCompileTime, int(ExpressionType::PlainObject::Options) | int(RowMajor),
|
|
763
|
+
1, ExpressionType::MaxColsAtCompileTime>
|
|
764
|
+
ArrayRowType;
|
|
765
|
+
|
|
766
|
+
typedef std::conditional_t<is_same<typename traits<ExpressionType>::XprKind, MatrixXpr>::value, MatrixRowType,
|
|
767
|
+
ArrayRowType>
|
|
768
|
+
type;
|
|
611
769
|
};
|
|
612
770
|
|
|
613
|
-
template<typename ExpressionType, typename Scalar = typename ExpressionType::Scalar>
|
|
614
|
-
struct plain_col_type
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
typedef Array<Scalar, ExpressionType::RowsAtCompileTime, 1,
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
>::type type;
|
|
771
|
+
template <typename ExpressionType, typename Scalar = typename ExpressionType::Scalar>
|
|
772
|
+
struct plain_col_type {
|
|
773
|
+
typedef Matrix<Scalar, ExpressionType::RowsAtCompileTime, 1, ExpressionType::PlainObject::Options & ~RowMajor,
|
|
774
|
+
ExpressionType::MaxRowsAtCompileTime, 1>
|
|
775
|
+
MatrixColType;
|
|
776
|
+
typedef Array<Scalar, ExpressionType::RowsAtCompileTime, 1, ExpressionType::PlainObject::Options & ~RowMajor,
|
|
777
|
+
ExpressionType::MaxRowsAtCompileTime, 1>
|
|
778
|
+
ArrayColType;
|
|
779
|
+
|
|
780
|
+
typedef std::conditional_t<is_same<typename traits<ExpressionType>::XprKind, MatrixXpr>::value, MatrixColType,
|
|
781
|
+
ArrayColType>
|
|
782
|
+
type;
|
|
626
783
|
};
|
|
627
784
|
|
|
628
|
-
template<typename ExpressionType, typename Scalar = typename ExpressionType::Scalar>
|
|
629
|
-
struct plain_diag_type
|
|
630
|
-
{
|
|
631
|
-
|
|
632
|
-
|
|
785
|
+
template <typename ExpressionType, typename Scalar = typename ExpressionType::Scalar>
|
|
786
|
+
struct plain_diag_type {
|
|
787
|
+
enum {
|
|
788
|
+
diag_size = internal::min_size_prefer_dynamic(ExpressionType::RowsAtCompileTime, ExpressionType::ColsAtCompileTime),
|
|
789
|
+
max_diag_size = min_size_prefer_fixed(ExpressionType::MaxRowsAtCompileTime, ExpressionType::MaxColsAtCompileTime)
|
|
633
790
|
};
|
|
634
|
-
typedef Matrix<Scalar, diag_size, 1, ExpressionType::PlainObject::Options & ~RowMajor, max_diag_size, 1>
|
|
791
|
+
typedef Matrix<Scalar, diag_size, 1, ExpressionType::PlainObject::Options & ~RowMajor, max_diag_size, 1>
|
|
792
|
+
MatrixDiagType;
|
|
635
793
|
typedef Array<Scalar, diag_size, 1, ExpressionType::PlainObject::Options & ~RowMajor, max_diag_size, 1> ArrayDiagType;
|
|
636
794
|
|
|
637
|
-
typedef typename
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
ArrayDiagType
|
|
641
|
-
>::type type;
|
|
795
|
+
typedef std::conditional_t<is_same<typename traits<ExpressionType>::XprKind, MatrixXpr>::value, MatrixDiagType,
|
|
796
|
+
ArrayDiagType>
|
|
797
|
+
type;
|
|
642
798
|
};
|
|
643
799
|
|
|
644
|
-
template<typename Expr,typename Scalar = typename Expr::Scalar>
|
|
645
|
-
struct plain_constant_type
|
|
646
|
-
{
|
|
647
|
-
enum { Options = (traits<Expr>::Flags&RowMajorBit)?RowMajor:0 };
|
|
800
|
+
template <typename Expr, typename Scalar = typename Expr::Scalar>
|
|
801
|
+
struct plain_constant_type {
|
|
802
|
+
enum { Options = (traits<Expr>::Flags & RowMajorBit) ? RowMajor : 0 };
|
|
648
803
|
|
|
649
|
-
typedef Array<Scalar,
|
|
650
|
-
|
|
804
|
+
typedef Array<Scalar, traits<Expr>::RowsAtCompileTime, traits<Expr>::ColsAtCompileTime, Options,
|
|
805
|
+
traits<Expr>::MaxRowsAtCompileTime, traits<Expr>::MaxColsAtCompileTime>
|
|
806
|
+
array_type;
|
|
651
807
|
|
|
652
|
-
typedef Matrix<Scalar,
|
|
653
|
-
|
|
808
|
+
typedef Matrix<Scalar, traits<Expr>::RowsAtCompileTime, traits<Expr>::ColsAtCompileTime, Options,
|
|
809
|
+
traits<Expr>::MaxRowsAtCompileTime, traits<Expr>::MaxColsAtCompileTime>
|
|
810
|
+
matrix_type;
|
|
654
811
|
|
|
655
|
-
typedef CwiseNullaryOp<
|
|
812
|
+
typedef CwiseNullaryOp<
|
|
813
|
+
scalar_constant_op<Scalar>,
|
|
814
|
+
const std::conditional_t<is_same<typename traits<Expr>::XprKind, MatrixXpr>::value, matrix_type, array_type>>
|
|
815
|
+
type;
|
|
656
816
|
};
|
|
657
817
|
|
|
658
|
-
template<typename ExpressionType>
|
|
659
|
-
struct is_lvalue
|
|
660
|
-
{
|
|
661
|
-
enum { value = (!bool(is_const<ExpressionType>::value)) &&
|
|
662
|
-
bool(traits<ExpressionType>::Flags & LvalueBit) };
|
|
818
|
+
template <typename ExpressionType>
|
|
819
|
+
struct is_lvalue {
|
|
820
|
+
enum { value = (!bool(is_const<ExpressionType>::value)) && bool(traits<ExpressionType>::Flags & LvalueBit) };
|
|
663
821
|
};
|
|
664
822
|
|
|
665
|
-
template<typename T>
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
{ enum { ret = true }; };
|
|
670
|
-
|
|
671
|
-
template<typename T> struct is_diagonal<DiagonalWrapper<T> >
|
|
672
|
-
{ enum { ret = true }; };
|
|
823
|
+
template <typename T>
|
|
824
|
+
struct is_diagonal {
|
|
825
|
+
enum { ret = false };
|
|
826
|
+
};
|
|
673
827
|
|
|
674
|
-
template<typename T
|
|
675
|
-
|
|
828
|
+
template <typename T>
|
|
829
|
+
struct is_diagonal<DiagonalBase<T>> {
|
|
830
|
+
enum { ret = true };
|
|
831
|
+
};
|
|
676
832
|
|
|
833
|
+
template <typename T>
|
|
834
|
+
struct is_diagonal<DiagonalWrapper<T>> {
|
|
835
|
+
enum { ret = true };
|
|
836
|
+
};
|
|
677
837
|
|
|
678
|
-
template<typename T
|
|
679
|
-
|
|
838
|
+
template <typename T, int S>
|
|
839
|
+
struct is_diagonal<DiagonalMatrix<T, S>> {
|
|
840
|
+
enum { ret = true };
|
|
841
|
+
};
|
|
680
842
|
|
|
681
|
-
template
|
|
682
|
-
|
|
843
|
+
template <typename T>
|
|
844
|
+
struct is_identity {
|
|
845
|
+
enum { value = false };
|
|
846
|
+
};
|
|
683
847
|
|
|
848
|
+
template <typename T>
|
|
849
|
+
struct is_identity<CwiseNullaryOp<internal::scalar_identity_op<typename T::Scalar>, T>> {
|
|
850
|
+
enum { value = true };
|
|
851
|
+
};
|
|
684
852
|
|
|
685
|
-
template<typename S1, typename S2>
|
|
686
|
-
|
|
853
|
+
template <typename S1, typename S2>
|
|
854
|
+
struct glue_shapes;
|
|
855
|
+
template <>
|
|
856
|
+
struct glue_shapes<DenseShape, TriangularShape> {
|
|
857
|
+
typedef TriangularShape type;
|
|
858
|
+
};
|
|
687
859
|
|
|
688
|
-
template<typename T1, typename T2>
|
|
860
|
+
template <typename T1, typename T2>
|
|
689
861
|
struct possibly_same_dense {
|
|
690
|
-
enum {
|
|
862
|
+
enum {
|
|
863
|
+
value = has_direct_access<T1>::ret && has_direct_access<T2>::ret &&
|
|
864
|
+
is_same<typename T1::Scalar, typename T2::Scalar>::value
|
|
865
|
+
};
|
|
691
866
|
};
|
|
692
867
|
|
|
693
|
-
template<typename T1, typename T2>
|
|
694
|
-
EIGEN_DEVICE_FUNC
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
868
|
+
template <typename T1, typename T2>
|
|
869
|
+
EIGEN_DEVICE_FUNC bool is_same_dense(const T1& mat1, const T2& mat2,
|
|
870
|
+
std::enable_if_t<possibly_same_dense<T1, T2>::value>* = 0) {
|
|
871
|
+
return (mat1.data() == mat2.data()) && (mat1.innerStride() == mat2.innerStride()) &&
|
|
872
|
+
(mat1.outerStride() == mat2.outerStride());
|
|
698
873
|
}
|
|
699
874
|
|
|
700
|
-
template<typename T1, typename T2>
|
|
701
|
-
EIGEN_DEVICE_FUNC
|
|
702
|
-
bool is_same_dense(const T1 &, const T2 &, typename enable_if<!possibly_same_dense<T1,T2>::value>::type * = 0)
|
|
703
|
-
{
|
|
875
|
+
template <typename T1, typename T2>
|
|
876
|
+
EIGEN_DEVICE_FUNC bool is_same_dense(const T1&, const T2&, std::enable_if_t<!possibly_same_dense<T1, T2>::value>* = 0) {
|
|
704
877
|
return false;
|
|
705
878
|
}
|
|
706
879
|
|
|
707
880
|
// Internal helper defining the cost of a scalar division for the type T.
|
|
708
881
|
// The default heuristic can be specialized for each scalar type and architecture.
|
|
709
|
-
template<typename T,bool Vectorized=false,typename EnableIf = void>
|
|
882
|
+
template <typename T, bool Vectorized = false, typename EnableIf = void>
|
|
710
883
|
struct scalar_div_cost {
|
|
711
|
-
enum { value = 8*NumTraits<T>::MulCost };
|
|
884
|
+
enum { value = 8 * NumTraits<T>::MulCost };
|
|
712
885
|
};
|
|
713
886
|
|
|
714
|
-
template<typename T,bool Vectorized>
|
|
715
|
-
struct scalar_div_cost<std::
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
887
|
+
template <typename T, bool Vectorized>
|
|
888
|
+
struct scalar_div_cost<T, Vectorized, std::enable_if_t<NumTraits<T>::IsComplex>> {
|
|
889
|
+
using RealScalar = typename NumTraits<T>::Real;
|
|
890
|
+
enum {
|
|
891
|
+
value =
|
|
892
|
+
2 * scalar_div_cost<RealScalar>::value + 6 * NumTraits<RealScalar>::MulCost + 3 * NumTraits<RealScalar>::AddCost
|
|
719
893
|
};
|
|
720
894
|
};
|
|
721
895
|
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
896
|
+
template <bool Vectorized>
|
|
897
|
+
struct scalar_div_cost<signed long, Vectorized, std::conditional_t<sizeof(long) == 8, void, false_type>> {
|
|
898
|
+
enum { value = 24 };
|
|
899
|
+
};
|
|
900
|
+
template <bool Vectorized>
|
|
901
|
+
struct scalar_div_cost<unsigned long, Vectorized, std::conditional_t<sizeof(long) == 8, void, false_type>> {
|
|
902
|
+
enum { value = 21 };
|
|
903
|
+
};
|
|
728
904
|
|
|
729
905
|
#ifdef EIGEN_DEBUG_ASSIGN
|
|
730
|
-
std::string demangle_traversal(int t)
|
|
731
|
-
|
|
732
|
-
if(t==
|
|
733
|
-
if(t==
|
|
734
|
-
if(t==
|
|
735
|
-
if(t==
|
|
736
|
-
if(t==SliceVectorizedTraversal) return "SliceVectorizedTraversal";
|
|
906
|
+
std::string demangle_traversal(int t) {
|
|
907
|
+
if (t == DefaultTraversal) return "DefaultTraversal";
|
|
908
|
+
if (t == LinearTraversal) return "LinearTraversal";
|
|
909
|
+
if (t == InnerVectorizedTraversal) return "InnerVectorizedTraversal";
|
|
910
|
+
if (t == LinearVectorizedTraversal) return "LinearVectorizedTraversal";
|
|
911
|
+
if (t == SliceVectorizedTraversal) return "SliceVectorizedTraversal";
|
|
737
912
|
return "?";
|
|
738
913
|
}
|
|
739
|
-
std::string demangle_unrolling(int t)
|
|
740
|
-
|
|
741
|
-
if(t==
|
|
742
|
-
if(t==
|
|
743
|
-
if(t==CompleteUnrolling) return "CompleteUnrolling";
|
|
914
|
+
std::string demangle_unrolling(int t) {
|
|
915
|
+
if (t == NoUnrolling) return "NoUnrolling";
|
|
916
|
+
if (t == InnerUnrolling) return "InnerUnrolling";
|
|
917
|
+
if (t == CompleteUnrolling) return "CompleteUnrolling";
|
|
744
918
|
return "?";
|
|
745
919
|
}
|
|
746
|
-
std::string demangle_flags(int f)
|
|
747
|
-
{
|
|
920
|
+
std::string demangle_flags(int f) {
|
|
748
921
|
std::string res;
|
|
749
|
-
if(f&RowMajorBit)
|
|
750
|
-
if(f&PacketAccessBit)
|
|
751
|
-
if(f&LinearAccessBit)
|
|
752
|
-
if(f&LvalueBit)
|
|
753
|
-
if(f&DirectAccessBit)
|
|
754
|
-
if(f&NestByRefBit)
|
|
755
|
-
if(f&NoPreferredStorageOrderBit)
|
|
922
|
+
if (f & RowMajorBit) res += " | RowMajor";
|
|
923
|
+
if (f & PacketAccessBit) res += " | Packet";
|
|
924
|
+
if (f & LinearAccessBit) res += " | Linear";
|
|
925
|
+
if (f & LvalueBit) res += " | Lvalue";
|
|
926
|
+
if (f & DirectAccessBit) res += " | Direct";
|
|
927
|
+
if (f & NestByRefBit) res += " | NestByRef";
|
|
928
|
+
if (f & NoPreferredStorageOrderBit) res += " | NoPreferredStorageOrderBit";
|
|
756
929
|
|
|
757
930
|
return res;
|
|
758
931
|
}
|
|
759
932
|
#endif
|
|
760
933
|
|
|
761
|
-
|
|
934
|
+
template <typename XprType>
|
|
935
|
+
struct is_block_xpr : std::false_type {};
|
|
936
|
+
|
|
937
|
+
template <typename XprType, int BlockRows, int BlockCols, bool InnerPanel>
|
|
938
|
+
struct is_block_xpr<Block<XprType, BlockRows, BlockCols, InnerPanel>> : std::true_type {};
|
|
939
|
+
|
|
940
|
+
template <typename XprType, int BlockRows, int BlockCols, bool InnerPanel>
|
|
941
|
+
struct is_block_xpr<const Block<XprType, BlockRows, BlockCols, InnerPanel>> : std::true_type {};
|
|
942
|
+
|
|
943
|
+
// Helper utility for constructing non-recursive block expressions.
|
|
944
|
+
template <typename XprType>
|
|
945
|
+
struct block_xpr_helper {
|
|
946
|
+
using BaseType = XprType;
|
|
947
|
+
|
|
948
|
+
// For regular block expressions, simply forward along the InnerPanel argument,
|
|
949
|
+
// which is set when calling row/column expressions.
|
|
950
|
+
static constexpr bool is_inner_panel(bool inner_panel) { return inner_panel; }
|
|
951
|
+
|
|
952
|
+
// Only enable non-const base function if XprType is not const (otherwise we get a duplicate definition).
|
|
953
|
+
template <typename T = XprType, typename EnableIf = std::enable_if_t<!std::is_const<T>::value>>
|
|
954
|
+
static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE BaseType& base(XprType& xpr) {
|
|
955
|
+
return xpr;
|
|
956
|
+
}
|
|
957
|
+
static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE const BaseType& base(const XprType& xpr) { return xpr; }
|
|
958
|
+
static constexpr EIGEN_ALWAYS_INLINE Index row(const XprType& /*xpr*/, Index r) { return r; }
|
|
959
|
+
static constexpr EIGEN_ALWAYS_INLINE Index col(const XprType& /*xpr*/, Index c) { return c; }
|
|
960
|
+
};
|
|
961
|
+
|
|
962
|
+
template <typename XprType, int BlockRows, int BlockCols, bool InnerPanel>
|
|
963
|
+
struct block_xpr_helper<Block<XprType, BlockRows, BlockCols, InnerPanel>> {
|
|
964
|
+
using BlockXprType = Block<XprType, BlockRows, BlockCols, InnerPanel>;
|
|
965
|
+
// Recursive helper in case of explicit block-of-block expression.
|
|
966
|
+
using NestedXprHelper = block_xpr_helper<XprType>;
|
|
967
|
+
using BaseType = typename NestedXprHelper::BaseType;
|
|
968
|
+
|
|
969
|
+
// For block-of-block expressions, we need to combine the InnerPannel trait
|
|
970
|
+
// with that of the block subexpression.
|
|
971
|
+
static constexpr bool is_inner_panel(bool inner_panel) { return InnerPanel && inner_panel; }
|
|
972
|
+
|
|
973
|
+
// Only enable non-const base function if XprType is not const (otherwise we get a duplicates definition).
|
|
974
|
+
template <typename T = XprType, typename EnableIf = std::enable_if_t<!std::is_const<T>::value>>
|
|
975
|
+
static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE BaseType& base(BlockXprType& xpr) {
|
|
976
|
+
return NestedXprHelper::base(xpr.nestedExpression());
|
|
977
|
+
}
|
|
978
|
+
static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE const BaseType& base(const BlockXprType& xpr) {
|
|
979
|
+
return NestedXprHelper::base(xpr.nestedExpression());
|
|
980
|
+
}
|
|
981
|
+
static constexpr EIGEN_ALWAYS_INLINE Index row(const BlockXprType& xpr, Index r) {
|
|
982
|
+
return xpr.startRow() + NestedXprHelper::row(xpr.nestedExpression(), r);
|
|
983
|
+
}
|
|
984
|
+
static constexpr EIGEN_ALWAYS_INLINE Index col(const BlockXprType& xpr, Index c) {
|
|
985
|
+
return xpr.startCol() + NestedXprHelper::col(xpr.nestedExpression(), c);
|
|
986
|
+
}
|
|
987
|
+
};
|
|
988
|
+
|
|
989
|
+
template <typename XprType, int BlockRows, int BlockCols, bool InnerPanel>
|
|
990
|
+
struct block_xpr_helper<const Block<XprType, BlockRows, BlockCols, InnerPanel>>
|
|
991
|
+
: block_xpr_helper<Block<XprType, BlockRows, BlockCols, InnerPanel>> {};
|
|
762
992
|
|
|
993
|
+
template <typename XprType>
|
|
994
|
+
struct is_matrix_base_xpr : std::is_base_of<MatrixBase<remove_all_t<XprType>>, remove_all_t<XprType>> {};
|
|
995
|
+
|
|
996
|
+
template <typename XprType>
|
|
997
|
+
struct is_permutation_base_xpr : std::is_base_of<PermutationBase<remove_all_t<XprType>>, remove_all_t<XprType>> {};
|
|
998
|
+
|
|
999
|
+
} // end namespace internal
|
|
763
1000
|
|
|
764
1001
|
/** \class ScalarBinaryOpTraits
|
|
765
1002
|
* \ingroup Core_Module
|
|
766
1003
|
*
|
|
767
|
-
* \brief Determines whether the given binary operation of two numeric types is allowed and what the scalar return type
|
|
1004
|
+
* \brief Determines whether the given binary operation of two numeric types is allowed and what the scalar return type
|
|
1005
|
+
is.
|
|
768
1006
|
*
|
|
769
|
-
* This class permits to control the scalar return type of any binary operation performed on two different scalar types
|
|
1007
|
+
* This class permits to control the scalar return type of any binary operation performed on two different scalar types
|
|
1008
|
+
through (partial) template specializations.
|
|
770
1009
|
*
|
|
771
|
-
* For instance, let \c U1, \c U2 and \c U3 be three user defined scalar types for which most operations between
|
|
1010
|
+
* For instance, let \c U1, \c U2 and \c U3 be three user defined scalar types for which most operations between
|
|
1011
|
+
instances of \c U1 and \c U2 returns an \c U3.
|
|
772
1012
|
* You can let %Eigen knows that by defining:
|
|
773
1013
|
\code
|
|
774
1014
|
template<typename BinaryOp>
|
|
@@ -791,66 +1031,63 @@ std::string demangle_flags(int f)
|
|
|
791
1031
|
<table class="manual">
|
|
792
1032
|
<tr><th>ScalarA</th><th>ScalarB</th><th>BinaryOp</th><th>ReturnType</th><th>Note</th></tr>
|
|
793
1033
|
<tr ><td>\c T </td><td>\c T </td><td>\c * </td><td>\c T </td><td></td></tr>
|
|
794
|
-
<tr class="alt"><td>\c NumTraits<T>::Real </td><td>\c T </td><td>\c * </td><td>\c T </td><td>Only if \c
|
|
795
|
-
<tr ><td>\c T </td><td>\c NumTraits<T>::Real </td><td>\c * </td><td>\c T
|
|
1034
|
+
<tr class="alt"><td>\c NumTraits<T>::Real </td><td>\c T </td><td>\c * </td><td>\c T </td><td>Only if \c
|
|
1035
|
+
NumTraits<T>::IsComplex </td></tr> <tr ><td>\c T </td><td>\c NumTraits<T>::Real </td><td>\c * </td><td>\c T
|
|
1036
|
+
</td><td>Only if \c NumTraits<T>::IsComplex </td></tr>
|
|
796
1037
|
</table>
|
|
797
1038
|
*
|
|
798
1039
|
* \sa CwiseBinaryOp
|
|
799
1040
|
*/
|
|
800
|
-
template<typename ScalarA, typename ScalarB, typename BinaryOp=internal::scalar_product_op<ScalarA,ScalarB
|
|
1041
|
+
template <typename ScalarA, typename ScalarB, typename BinaryOp = internal::scalar_product_op<ScalarA, ScalarB>>
|
|
801
1042
|
struct ScalarBinaryOpTraits
|
|
802
1043
|
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
#endif
|
|
806
|
-
{};
|
|
807
|
-
|
|
808
|
-
template<typename T, typename BinaryOp>
|
|
809
|
-
struct ScalarBinaryOpTraits<T,T,BinaryOp>
|
|
1044
|
+
// for backward compatibility, use the hints given by the (deprecated) internal::scalar_product_traits class.
|
|
1045
|
+
: internal::scalar_product_traits<ScalarA, ScalarB>
|
|
1046
|
+
#endif // EIGEN_PARSED_BY_DOXYGEN
|
|
810
1047
|
{
|
|
1048
|
+
};
|
|
1049
|
+
|
|
1050
|
+
template <typename T, typename BinaryOp>
|
|
1051
|
+
struct ScalarBinaryOpTraits<T, T, BinaryOp> {
|
|
811
1052
|
typedef T ReturnType;
|
|
812
1053
|
};
|
|
813
1054
|
|
|
814
1055
|
template <typename T, typename BinaryOp>
|
|
815
|
-
struct ScalarBinaryOpTraits<T, typename NumTraits<
|
|
816
|
-
{
|
|
1056
|
+
struct ScalarBinaryOpTraits<T, typename NumTraits<std::enable_if_t<NumTraits<T>::IsComplex, T>>::Real, BinaryOp> {
|
|
817
1057
|
typedef T ReturnType;
|
|
818
1058
|
};
|
|
819
1059
|
template <typename T, typename BinaryOp>
|
|
820
|
-
struct ScalarBinaryOpTraits<typename NumTraits<
|
|
821
|
-
{
|
|
1060
|
+
struct ScalarBinaryOpTraits<typename NumTraits<std::enable_if_t<NumTraits<T>::IsComplex, T>>::Real, T, BinaryOp> {
|
|
822
1061
|
typedef T ReturnType;
|
|
823
1062
|
};
|
|
824
1063
|
|
|
825
1064
|
// For Matrix * Permutation
|
|
826
|
-
template<typename T, typename BinaryOp>
|
|
827
|
-
struct ScalarBinaryOpTraits<T,void,BinaryOp>
|
|
828
|
-
{
|
|
1065
|
+
template <typename T, typename BinaryOp>
|
|
1066
|
+
struct ScalarBinaryOpTraits<T, void, BinaryOp> {
|
|
829
1067
|
typedef T ReturnType;
|
|
830
1068
|
};
|
|
831
1069
|
|
|
832
1070
|
// For Permutation * Matrix
|
|
833
|
-
template<typename T, typename BinaryOp>
|
|
834
|
-
struct ScalarBinaryOpTraits<void,T,BinaryOp>
|
|
835
|
-
{
|
|
1071
|
+
template <typename T, typename BinaryOp>
|
|
1072
|
+
struct ScalarBinaryOpTraits<void, T, BinaryOp> {
|
|
836
1073
|
typedef T ReturnType;
|
|
837
1074
|
};
|
|
838
1075
|
|
|
839
1076
|
// for Permutation*Permutation
|
|
840
|
-
template<typename BinaryOp>
|
|
841
|
-
struct ScalarBinaryOpTraits<void,void,BinaryOp>
|
|
842
|
-
{
|
|
1077
|
+
template <typename BinaryOp>
|
|
1078
|
+
struct ScalarBinaryOpTraits<void, void, BinaryOp> {
|
|
843
1079
|
typedef void ReturnType;
|
|
844
1080
|
};
|
|
845
1081
|
|
|
846
1082
|
// We require Lhs and Rhs to have "compatible" scalar types.
|
|
847
|
-
// It is tempting to always allow mixing different types but remember that this is often impossible in the vectorized
|
|
848
|
-
// So allowing mixing different types gives very unexpected errors when enabling vectorization, when the user
|
|
849
|
-
// add together a float matrix and a double matrix.
|
|
850
|
-
#define EIGEN_CHECK_BINARY_COMPATIBILIY(BINOP,LHS,RHS)
|
|
851
|
-
EIGEN_STATIC_ASSERT(
|
|
852
|
-
|
|
1083
|
+
// It is tempting to always allow mixing different types but remember that this is often impossible in the vectorized
|
|
1084
|
+
// paths. So allowing mixing different types gives very unexpected errors when enabling vectorization, when the user
|
|
1085
|
+
// tries to add together a float matrix and a double matrix.
|
|
1086
|
+
#define EIGEN_CHECK_BINARY_COMPATIBILIY(BINOP, LHS, RHS) \
|
|
1087
|
+
EIGEN_STATIC_ASSERT( \
|
|
1088
|
+
(Eigen::internal::has_ReturnType<ScalarBinaryOpTraits<LHS, RHS, BINOP>>::value), \
|
|
1089
|
+
YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
|
|
853
1090
|
|
|
854
|
-
}
|
|
1091
|
+
} // end namespace Eigen
|
|
855
1092
|
|
|
856
|
-
#endif
|
|
1093
|
+
#endif // EIGEN_XPRHELPER_H
|