@smake/eigen 1.0.1 → 1.1.0
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/COPYING.APACHE +203 -0
- package/eigen/COPYING.BSD +1 -1
- package/eigen/COPYING.MINPACK +51 -52
- package/eigen/Eigen/Cholesky +0 -1
- package/eigen/Eigen/Core +108 -266
- package/eigen/Eigen/Eigenvalues +0 -1
- package/eigen/Eigen/Geometry +3 -6
- package/eigen/Eigen/Householder +0 -1
- package/eigen/Eigen/Jacobi +0 -1
- package/eigen/Eigen/KLUSupport +41 -0
- package/eigen/Eigen/LU +2 -5
- package/eigen/Eigen/OrderingMethods +0 -3
- package/eigen/Eigen/PaStiXSupport +1 -0
- package/eigen/Eigen/PardisoSupport +0 -0
- package/eigen/Eigen/QR +0 -1
- package/eigen/Eigen/QtAlignedMalloc +0 -1
- package/eigen/Eigen/SVD +0 -1
- package/eigen/Eigen/Sparse +0 -2
- package/eigen/Eigen/SparseCholesky +0 -8
- package/eigen/Eigen/SparseLU +4 -0
- package/eigen/Eigen/src/Cholesky/LDLT.h +42 -27
- package/eigen/Eigen/src/Cholesky/LLT.h +39 -23
- package/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +90 -47
- package/eigen/Eigen/src/Core/ArithmeticSequence.h +413 -0
- package/eigen/Eigen/src/Core/Array.h +99 -11
- package/eigen/Eigen/src/Core/ArrayBase.h +1 -1
- package/eigen/Eigen/src/Core/ArrayWrapper.h +21 -21
- package/eigen/Eigen/src/Core/Assign.h +1 -1
- package/eigen/Eigen/src/Core/AssignEvaluator.h +125 -50
- package/eigen/Eigen/src/Core/Assign_MKL.h +10 -10
- package/eigen/Eigen/src/Core/BandMatrix.h +16 -16
- package/eigen/Eigen/src/Core/Block.h +56 -60
- package/eigen/Eigen/src/Core/BooleanRedux.h +29 -31
- package/eigen/Eigen/src/Core/CommaInitializer.h +7 -3
- package/eigen/Eigen/src/Core/CoreEvaluators.h +325 -272
- package/eigen/Eigen/src/Core/CoreIterators.h +5 -0
- package/eigen/Eigen/src/Core/CwiseBinaryOp.h +21 -22
- package/eigen/Eigen/src/Core/CwiseNullaryOp.h +153 -18
- package/eigen/Eigen/src/Core/CwiseUnaryOp.h +6 -6
- package/eigen/Eigen/src/Core/CwiseUnaryView.h +12 -10
- package/eigen/Eigen/src/Core/DenseBase.h +128 -39
- package/eigen/Eigen/src/Core/DenseCoeffsBase.h +25 -21
- package/eigen/Eigen/src/Core/DenseStorage.h +150 -68
- package/eigen/Eigen/src/Core/Diagonal.h +21 -23
- package/eigen/Eigen/src/Core/DiagonalMatrix.h +50 -2
- package/eigen/Eigen/src/Core/DiagonalProduct.h +1 -1
- package/eigen/Eigen/src/Core/Dot.h +10 -10
- package/eigen/Eigen/src/Core/EigenBase.h +10 -9
- package/eigen/Eigen/src/Core/ForceAlignedAccess.h +8 -4
- package/eigen/Eigen/src/Core/Fuzzy.h +3 -3
- package/eigen/Eigen/src/Core/GeneralProduct.h +20 -10
- package/eigen/Eigen/src/Core/GenericPacketMath.h +597 -147
- package/eigen/Eigen/src/Core/GlobalFunctions.h +40 -33
- package/eigen/Eigen/src/Core/IO.h +40 -7
- package/eigen/Eigen/src/Core/IndexedView.h +237 -0
- package/eigen/Eigen/src/Core/Inverse.h +9 -10
- package/eigen/Eigen/src/Core/Map.h +7 -7
- package/eigen/Eigen/src/Core/MapBase.h +5 -3
- package/eigen/Eigen/src/Core/MathFunctions.h +756 -120
- package/eigen/Eigen/src/Core/MathFunctionsImpl.h +118 -19
- package/eigen/Eigen/src/Core/Matrix.h +131 -25
- package/eigen/Eigen/src/Core/MatrixBase.h +19 -2
- package/eigen/Eigen/src/Core/NestByValue.h +25 -50
- package/eigen/Eigen/src/Core/NoAlias.h +4 -3
- package/eigen/Eigen/src/Core/NumTraits.h +107 -20
- package/eigen/Eigen/src/Core/PartialReduxEvaluator.h +232 -0
- package/eigen/Eigen/src/Core/PermutationMatrix.h +3 -3
- package/eigen/Eigen/src/Core/PlainObjectBase.h +145 -54
- package/eigen/Eigen/src/Core/Product.h +30 -25
- package/eigen/Eigen/src/Core/ProductEvaluators.h +183 -142
- package/eigen/Eigen/src/Core/Random.h +37 -1
- package/eigen/Eigen/src/Core/Redux.h +180 -170
- package/eigen/Eigen/src/Core/Ref.h +118 -21
- package/eigen/Eigen/src/Core/Replicate.h +8 -8
- package/eigen/Eigen/src/Core/Reshaped.h +454 -0
- package/eigen/Eigen/src/Core/ReturnByValue.h +7 -5
- package/eigen/Eigen/src/Core/Reverse.h +18 -12
- package/eigen/Eigen/src/Core/Select.h +8 -6
- package/eigen/Eigen/src/Core/SelfAdjointView.h +33 -20
- package/eigen/Eigen/src/Core/Solve.h +14 -14
- package/eigen/Eigen/src/Core/SolveTriangular.h +13 -13
- package/eigen/Eigen/src/Core/SolverBase.h +41 -3
- package/eigen/Eigen/src/Core/StableNorm.h +100 -70
- package/eigen/Eigen/src/Core/StlIterators.h +463 -0
- package/eigen/Eigen/src/Core/Stride.h +9 -4
- package/eigen/Eigen/src/Core/Swap.h +5 -4
- package/eigen/Eigen/src/Core/Transpose.h +86 -27
- package/eigen/Eigen/src/Core/Transpositions.h +26 -8
- package/eigen/Eigen/src/Core/TriangularMatrix.h +88 -72
- package/eigen/Eigen/src/Core/VectorBlock.h +5 -5
- package/eigen/Eigen/src/Core/VectorwiseOp.h +159 -70
- package/eigen/Eigen/src/Core/Visitor.h +137 -29
- package/eigen/Eigen/src/Core/arch/AVX/Complex.h +50 -129
- package/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +126 -337
- package/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +1092 -155
- package/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +65 -1
- package/eigen/Eigen/src/Core/arch/AVX512/Complex.h +422 -0
- package/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +186 -213
- package/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +1250 -252
- package/eigen/Eigen/src/Core/arch/AVX512/TypeCasting.h +89 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +152 -165
- package/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +19 -251
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +2937 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +221 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +629 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h +2042 -392
- package/eigen/Eigen/src/Core/arch/CUDA/Complex.h +235 -80
- package/eigen/Eigen/src/Core/arch/Default/BFloat16.h +700 -0
- package/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +102 -14
- package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +1649 -0
- package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +110 -0
- package/eigen/Eigen/src/Core/arch/Default/Half.h +942 -0
- package/eigen/Eigen/src/Core/arch/Default/Settings.h +1 -1
- package/eigen/Eigen/src/Core/arch/Default/TypeCasting.h +120 -0
- package/eigen/Eigen/src/Core/arch/{CUDA → GPU}/MathFunctions.h +16 -4
- package/eigen/Eigen/src/Core/arch/GPU/PacketMath.h +1685 -0
- package/eigen/Eigen/src/Core/arch/GPU/TypeCasting.h +80 -0
- package/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h +23 -0
- package/eigen/Eigen/src/Core/arch/MSA/Complex.h +648 -0
- package/eigen/Eigen/src/Core/arch/MSA/MathFunctions.h +387 -0
- package/eigen/Eigen/src/Core/arch/MSA/PacketMath.h +1233 -0
- package/eigen/Eigen/src/Core/arch/NEON/Complex.h +313 -219
- package/eigen/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +183 -0
- package/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +54 -70
- package/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +4376 -549
- package/eigen/Eigen/src/Core/arch/NEON/TypeCasting.h +1419 -0
- package/eigen/Eigen/src/Core/arch/SSE/Complex.h +59 -179
- package/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +65 -428
- package/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +893 -283
- package/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +65 -0
- package/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h +44 -0
- package/eigen/Eigen/src/Core/arch/SVE/PacketMath.h +752 -0
- package/eigen/Eigen/src/Core/arch/SVE/TypeCasting.h +49 -0
- package/eigen/Eigen/src/Core/arch/SYCL/InteropHeaders.h +232 -0
- package/eigen/Eigen/src/Core/arch/SYCL/MathFunctions.h +301 -0
- package/eigen/Eigen/src/Core/arch/SYCL/PacketMath.h +670 -0
- package/eigen/Eigen/src/Core/arch/SYCL/SyclMemoryModel.h +694 -0
- package/eigen/Eigen/src/Core/arch/SYCL/TypeCasting.h +85 -0
- package/eigen/Eigen/src/Core/arch/ZVector/Complex.h +212 -183
- package/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +101 -5
- package/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +510 -395
- package/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +11 -2
- package/eigen/Eigen/src/Core/functors/BinaryFunctors.h +112 -46
- package/eigen/Eigen/src/Core/functors/NullaryFunctors.h +31 -30
- package/eigen/Eigen/src/Core/functors/StlFunctors.h +32 -2
- package/eigen/Eigen/src/Core/functors/UnaryFunctors.h +354 -15
- package/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +1073 -585
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +29 -7
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +4 -4
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +1 -1
- package/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +382 -483
- package/eigen/Eigen/src/Core/products/Parallelizer.h +23 -9
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +23 -6
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +8 -6
- package/eigen/Eigen/src/Core/products/SelfadjointProduct.h +2 -2
- package/eigen/Eigen/src/Core/products/SelfadjointRank2Update.h +5 -4
- package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix.h +3 -3
- package/eigen/Eigen/src/Core/products/TriangularSolverMatrix.h +5 -3
- package/eigen/Eigen/src/Core/products/TriangularSolverVector.h +13 -10
- package/eigen/Eigen/src/Core/util/BlasUtil.h +208 -124
- package/eigen/Eigen/src/Core/util/ConfigureVectorization.h +512 -0
- package/eigen/Eigen/src/Core/util/Constants.h +25 -9
- package/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +14 -2
- package/eigen/Eigen/src/Core/util/ForwardDeclarations.h +28 -4
- package/eigen/Eigen/src/Core/util/IndexedViewHelper.h +186 -0
- package/eigen/Eigen/src/Core/util/IntegralConstant.h +272 -0
- package/eigen/Eigen/src/Core/util/MKL_support.h +8 -1
- package/eigen/Eigen/src/Core/util/Macros.h +661 -250
- package/eigen/Eigen/src/Core/util/Memory.h +222 -52
- package/eigen/Eigen/src/Core/util/Meta.h +349 -105
- package/eigen/Eigen/src/Core/util/ReshapedHelper.h +51 -0
- package/eigen/Eigen/src/Core/util/StaticAssert.h +8 -5
- package/eigen/Eigen/src/Core/util/SymbolicIndex.h +293 -0
- package/eigen/Eigen/src/Core/util/XprHelper.h +48 -30
- package/eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h +1 -1
- package/eigen/Eigen/src/Eigenvalues/ComplexSchur.h +1 -1
- package/eigen/Eigen/src/Eigenvalues/EigenSolver.h +2 -2
- package/eigen/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +1 -1
- package/eigen/Eigen/src/Eigenvalues/HessenbergDecomposition.h +2 -2
- package/eigen/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +2 -2
- package/eigen/Eigen/src/Eigenvalues/RealQZ.h +9 -6
- package/eigen/Eigen/src/Eigenvalues/RealSchur.h +10 -5
- package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +75 -42
- package/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +20 -15
- package/eigen/Eigen/src/Geometry/AlignedBox.h +99 -5
- package/eigen/Eigen/src/Geometry/AngleAxis.h +4 -4
- package/eigen/Eigen/src/Geometry/EulerAngles.h +3 -3
- package/eigen/Eigen/src/Geometry/Homogeneous.h +15 -11
- package/eigen/Eigen/src/Geometry/Hyperplane.h +1 -1
- package/eigen/Eigen/src/Geometry/OrthoMethods.h +3 -2
- package/eigen/Eigen/src/Geometry/ParametrizedLine.h +39 -2
- package/eigen/Eigen/src/Geometry/Quaternion.h +52 -14
- package/eigen/Eigen/src/Geometry/Rotation2D.h +3 -3
- package/eigen/Eigen/src/Geometry/Scaling.h +22 -4
- package/eigen/Eigen/src/Geometry/Transform.h +86 -65
- package/eigen/Eigen/src/Geometry/Translation.h +6 -6
- package/eigen/Eigen/src/Geometry/arch/Geometry_SIMD.h +168 -0
- package/eigen/Eigen/src/Householder/BlockHouseholder.h +9 -2
- package/eigen/Eigen/src/Householder/Householder.h +8 -4
- package/eigen/Eigen/src/Householder/HouseholderSequence.h +123 -48
- package/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +15 -15
- package/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +7 -23
- package/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +5 -22
- package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +41 -47
- package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +51 -60
- package/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +70 -20
- package/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +2 -20
- package/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +11 -9
- package/eigen/Eigen/src/Jacobi/Jacobi.h +31 -10
- package/eigen/Eigen/src/KLUSupport/KLUSupport.h +358 -0
- package/eigen/Eigen/src/LU/Determinant.h +35 -19
- package/eigen/Eigen/src/LU/FullPivLU.h +29 -43
- package/eigen/Eigen/src/LU/InverseImpl.h +25 -8
- package/eigen/Eigen/src/LU/PartialPivLU.h +67 -57
- package/eigen/Eigen/src/LU/arch/InverseSize4.h +351 -0
- package/eigen/Eigen/src/OrderingMethods/Amd.h +7 -17
- package/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +297 -277
- package/eigen/Eigen/src/OrderingMethods/Ordering.h +6 -10
- package/eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h +1 -1
- package/eigen/Eigen/src/PardisoSupport/PardisoSupport.h +10 -9
- package/eigen/Eigen/src/QR/ColPivHouseholderQR.h +41 -20
- package/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +100 -27
- package/eigen/Eigen/src/QR/FullPivHouseholderQR.h +59 -22
- package/eigen/Eigen/src/QR/HouseholderQR.h +48 -23
- package/eigen/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +25 -3
- package/eigen/Eigen/src/SVD/BDCSVD.h +137 -48
- package/eigen/Eigen/src/SVD/JacobiSVD.h +22 -14
- package/eigen/Eigen/src/SVD/SVDBase.h +82 -21
- package/eigen/Eigen/src/SVD/UpperBidiagonalization.h +3 -3
- package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +16 -8
- package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +11 -36
- package/eigen/Eigen/src/SparseCore/CompressedStorage.h +16 -0
- package/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +6 -6
- package/eigen/Eigen/src/SparseCore/SparseAssign.h +81 -27
- package/eigen/Eigen/src/SparseCore/SparseBlock.h +25 -57
- package/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +40 -11
- package/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +11 -15
- package/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +2 -2
- package/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +30 -8
- package/eigen/Eigen/src/SparseCore/SparseMatrix.h +124 -10
- package/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +5 -12
- package/eigen/Eigen/src/SparseCore/SparseProduct.h +13 -1
- package/eigen/Eigen/src/SparseCore/SparseRef.h +7 -7
- package/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h +3 -0
- package/eigen/Eigen/src/SparseCore/SparseUtil.h +8 -0
- package/eigen/Eigen/src/SparseCore/SparseVector.h +1 -1
- package/eigen/Eigen/src/SparseLU/SparseLU.h +160 -10
- package/eigen/Eigen/src/SparseLU/SparseLU_Memory.h +1 -1
- package/eigen/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +76 -2
- package/eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h +2 -2
- package/eigen/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +1 -1
- package/eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h +1 -1
- package/eigen/Eigen/src/SparseQR/SparseQR.h +19 -6
- package/eigen/Eigen/src/StlSupport/StdDeque.h +2 -14
- package/eigen/Eigen/src/StlSupport/StdList.h +2 -2
- package/eigen/Eigen/src/StlSupport/StdVector.h +2 -2
- package/eigen/Eigen/src/SuperLUSupport/SuperLUSupport.h +6 -8
- package/eigen/Eigen/src/UmfPackSupport/UmfPackSupport.h +175 -39
- package/eigen/Eigen/src/misc/lapacke.h +5 -4
- package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.h +27 -1
- package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h +155 -11
- package/eigen/Eigen/src/plugins/BlockMethods.h +626 -242
- package/eigen/Eigen/src/plugins/CommonCwiseUnaryOps.h +14 -0
- package/eigen/Eigen/src/plugins/IndexedViewMethods.h +262 -0
- package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h +4 -4
- package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h +10 -0
- package/eigen/Eigen/src/plugins/ReshapedMethods.h +149 -0
- package/eigen/README.md +2 -0
- package/lib/LibEigen.d.ts +4 -0
- package/lib/LibEigen.js +14 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +7 -3
- package/package.json +2 -10
- package/eigen/Eigen/CMakeLists.txt +0 -19
- package/eigen/Eigen/src/Core/arch/CUDA/Half.h +0 -675
- package/eigen/Eigen/src/Core/arch/CUDA/PacketMath.h +0 -333
- package/eigen/Eigen/src/Core/arch/CUDA/PacketMathHalf.h +0 -1124
- package/eigen/Eigen/src/Core/arch/CUDA/TypeCasting.h +0 -212
- package/eigen/Eigen/src/Geometry/arch/Geometry_SSE.h +0 -161
- package/eigen/Eigen/src/LU/arch/Inverse_SSE.h +0 -338
- package/lib/eigen.d.ts +0 -2
- package/lib/eigen.js +0 -15
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
#define EIGEN_COREEVALUATORS_H
|
|
15
15
|
|
|
16
16
|
namespace Eigen {
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
namespace internal {
|
|
19
19
|
|
|
20
20
|
// This class returns the evaluator kind from the expression storage kind.
|
|
@@ -63,8 +63,8 @@ template< typename T,
|
|
|
63
63
|
template< typename T,
|
|
64
64
|
typename Kind = typename evaluator_traits<typename T::NestedExpression>::Kind,
|
|
65
65
|
typename Scalar = typename T::Scalar> struct unary_evaluator;
|
|
66
|
-
|
|
67
|
-
// evaluator_traits<T> contains traits for evaluator<T>
|
|
66
|
+
|
|
67
|
+
// evaluator_traits<T> contains traits for evaluator<T>
|
|
68
68
|
|
|
69
69
|
template<typename T>
|
|
70
70
|
struct evaluator_traits_base
|
|
@@ -90,7 +90,8 @@ template<typename T>
|
|
|
90
90
|
struct evaluator : public unary_evaluator<T>
|
|
91
91
|
{
|
|
92
92
|
typedef unary_evaluator<T> Base;
|
|
93
|
-
EIGEN_DEVICE_FUNC
|
|
93
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
94
|
+
explicit evaluator(const T& xpr) : Base(xpr) {}
|
|
94
95
|
};
|
|
95
96
|
|
|
96
97
|
|
|
@@ -99,21 +100,29 @@ template<typename T>
|
|
|
99
100
|
struct evaluator<const T>
|
|
100
101
|
: evaluator<T>
|
|
101
102
|
{
|
|
102
|
-
EIGEN_DEVICE_FUNC
|
|
103
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
103
104
|
explicit evaluator(const T& xpr) : evaluator<T>(xpr) {}
|
|
104
105
|
};
|
|
105
106
|
|
|
106
107
|
// ---------- base class for all evaluators ----------
|
|
107
108
|
|
|
108
109
|
template<typename ExpressionType>
|
|
109
|
-
struct evaluator_base
|
|
110
|
+
struct evaluator_base
|
|
110
111
|
{
|
|
111
112
|
// TODO that's not very nice to have to propagate all these traits. They are currently only needed to handle outer,inner indices.
|
|
112
113
|
typedef traits<ExpressionType> ExpressionTraits;
|
|
113
|
-
|
|
114
|
+
|
|
114
115
|
enum {
|
|
115
116
|
Alignment = 0
|
|
116
117
|
};
|
|
118
|
+
// noncopyable:
|
|
119
|
+
// Don't make this class inherit noncopyable as this kills EBO (Empty Base Optimization)
|
|
120
|
+
// and make complex evaluator much larger than then should do.
|
|
121
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE evaluator_base() {}
|
|
122
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ~evaluator_base() {}
|
|
123
|
+
private:
|
|
124
|
+
EIGEN_DEVICE_FUNC evaluator_base(const evaluator_base&);
|
|
125
|
+
EIGEN_DEVICE_FUNC const evaluator_base& operator=(const evaluator_base&);
|
|
117
126
|
};
|
|
118
127
|
|
|
119
128
|
// -------------------- Matrix and Array --------------------
|
|
@@ -123,6 +132,33 @@ struct evaluator_base : public noncopyable
|
|
|
123
132
|
// Here we directly specialize evaluator. This is not really a unary expression, and it is, by definition, dense,
|
|
124
133
|
// so no need for more sophisticated dispatching.
|
|
125
134
|
|
|
135
|
+
// this helper permits to completely eliminate m_outerStride if it is known at compiletime.
|
|
136
|
+
template<typename Scalar,int OuterStride> class plainobjectbase_evaluator_data {
|
|
137
|
+
public:
|
|
138
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
139
|
+
plainobjectbase_evaluator_data(const Scalar* ptr, Index outerStride) : data(ptr)
|
|
140
|
+
{
|
|
141
|
+
#ifndef EIGEN_INTERNAL_DEBUGGING
|
|
142
|
+
EIGEN_UNUSED_VARIABLE(outerStride);
|
|
143
|
+
#endif
|
|
144
|
+
eigen_internal_assert(outerStride==OuterStride);
|
|
145
|
+
}
|
|
146
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
|
|
147
|
+
Index outerStride() const EIGEN_NOEXCEPT { return OuterStride; }
|
|
148
|
+
const Scalar *data;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
template<typename Scalar> class plainobjectbase_evaluator_data<Scalar,Dynamic> {
|
|
152
|
+
public:
|
|
153
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
154
|
+
plainobjectbase_evaluator_data(const Scalar* ptr, Index outerStride) : data(ptr), m_outerStride(outerStride) {}
|
|
155
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
156
|
+
Index outerStride() const { return m_outerStride; }
|
|
157
|
+
const Scalar *data;
|
|
158
|
+
protected:
|
|
159
|
+
Index m_outerStride;
|
|
160
|
+
};
|
|
161
|
+
|
|
126
162
|
template<typename Derived>
|
|
127
163
|
struct evaluator<PlainObjectBase<Derived> >
|
|
128
164
|
: evaluator_base<Derived>
|
|
@@ -136,23 +172,28 @@ struct evaluator<PlainObjectBase<Derived> >
|
|
|
136
172
|
IsVectorAtCompileTime = PlainObjectType::IsVectorAtCompileTime,
|
|
137
173
|
RowsAtCompileTime = PlainObjectType::RowsAtCompileTime,
|
|
138
174
|
ColsAtCompileTime = PlainObjectType::ColsAtCompileTime,
|
|
139
|
-
|
|
175
|
+
|
|
140
176
|
CoeffReadCost = NumTraits<Scalar>::ReadCost,
|
|
141
177
|
Flags = traits<Derived>::EvaluatorFlags,
|
|
142
178
|
Alignment = traits<Derived>::Alignment
|
|
143
179
|
};
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
180
|
+
enum {
|
|
181
|
+
// We do not need to know the outer stride for vectors
|
|
182
|
+
OuterStrideAtCompileTime = IsVectorAtCompileTime ? 0
|
|
183
|
+
: int(IsRowMajor) ? ColsAtCompileTime
|
|
184
|
+
: RowsAtCompileTime
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
188
|
+
evaluator()
|
|
189
|
+
: m_d(0,OuterStrideAtCompileTime)
|
|
150
190
|
{
|
|
151
191
|
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
|
152
192
|
}
|
|
153
|
-
|
|
154
|
-
EIGEN_DEVICE_FUNC
|
|
155
|
-
|
|
193
|
+
|
|
194
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
195
|
+
explicit evaluator(const PlainObjectType& m)
|
|
196
|
+
: m_d(m.data(),IsVectorAtCompileTime ? 0 : m.outerStride())
|
|
156
197
|
{
|
|
157
198
|
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
|
158
199
|
}
|
|
@@ -161,30 +202,30 @@ struct evaluator<PlainObjectBase<Derived> >
|
|
|
161
202
|
CoeffReturnType coeff(Index row, Index col) const
|
|
162
203
|
{
|
|
163
204
|
if (IsRowMajor)
|
|
164
|
-
return
|
|
205
|
+
return m_d.data[row * m_d.outerStride() + col];
|
|
165
206
|
else
|
|
166
|
-
return
|
|
207
|
+
return m_d.data[row + col * m_d.outerStride()];
|
|
167
208
|
}
|
|
168
209
|
|
|
169
210
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
170
211
|
CoeffReturnType coeff(Index index) const
|
|
171
212
|
{
|
|
172
|
-
return
|
|
213
|
+
return m_d.data[index];
|
|
173
214
|
}
|
|
174
215
|
|
|
175
216
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
176
217
|
Scalar& coeffRef(Index row, Index col)
|
|
177
218
|
{
|
|
178
219
|
if (IsRowMajor)
|
|
179
|
-
return const_cast<Scalar*>(
|
|
220
|
+
return const_cast<Scalar*>(m_d.data)[row * m_d.outerStride() + col];
|
|
180
221
|
else
|
|
181
|
-
return const_cast<Scalar*>(
|
|
222
|
+
return const_cast<Scalar*>(m_d.data)[row + col * m_d.outerStride()];
|
|
182
223
|
}
|
|
183
224
|
|
|
184
225
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
185
226
|
Scalar& coeffRef(Index index)
|
|
186
227
|
{
|
|
187
|
-
return const_cast<Scalar*>(
|
|
228
|
+
return const_cast<Scalar*>(m_d.data)[index];
|
|
188
229
|
}
|
|
189
230
|
|
|
190
231
|
template<int LoadMode, typename PacketType>
|
|
@@ -192,16 +233,16 @@ struct evaluator<PlainObjectBase<Derived> >
|
|
|
192
233
|
PacketType packet(Index row, Index col) const
|
|
193
234
|
{
|
|
194
235
|
if (IsRowMajor)
|
|
195
|
-
return ploadt<PacketType, LoadMode>(
|
|
236
|
+
return ploadt<PacketType, LoadMode>(m_d.data + row * m_d.outerStride() + col);
|
|
196
237
|
else
|
|
197
|
-
return ploadt<PacketType, LoadMode>(
|
|
238
|
+
return ploadt<PacketType, LoadMode>(m_d.data + row + col * m_d.outerStride());
|
|
198
239
|
}
|
|
199
240
|
|
|
200
241
|
template<int LoadMode, typename PacketType>
|
|
201
242
|
EIGEN_STRONG_INLINE
|
|
202
243
|
PacketType packet(Index index) const
|
|
203
244
|
{
|
|
204
|
-
return ploadt<PacketType, LoadMode>(
|
|
245
|
+
return ploadt<PacketType, LoadMode>(m_d.data + index);
|
|
205
246
|
}
|
|
206
247
|
|
|
207
248
|
template<int StoreMode,typename PacketType>
|
|
@@ -210,26 +251,22 @@ struct evaluator<PlainObjectBase<Derived> >
|
|
|
210
251
|
{
|
|
211
252
|
if (IsRowMajor)
|
|
212
253
|
return pstoret<Scalar, PacketType, StoreMode>
|
|
213
|
-
(const_cast<Scalar*>(
|
|
254
|
+
(const_cast<Scalar*>(m_d.data) + row * m_d.outerStride() + col, x);
|
|
214
255
|
else
|
|
215
256
|
return pstoret<Scalar, PacketType, StoreMode>
|
|
216
|
-
(const_cast<Scalar*>(
|
|
257
|
+
(const_cast<Scalar*>(m_d.data) + row + col * m_d.outerStride(), x);
|
|
217
258
|
}
|
|
218
259
|
|
|
219
260
|
template<int StoreMode, typename PacketType>
|
|
220
261
|
EIGEN_STRONG_INLINE
|
|
221
262
|
void writePacket(Index index, const PacketType& x)
|
|
222
263
|
{
|
|
223
|
-
return pstoret<Scalar, PacketType, StoreMode>(const_cast<Scalar*>(
|
|
264
|
+
return pstoret<Scalar, PacketType, StoreMode>(const_cast<Scalar*>(m_d.data) + index, x);
|
|
224
265
|
}
|
|
225
266
|
|
|
226
267
|
protected:
|
|
227
|
-
const Scalar *m_data;
|
|
228
268
|
|
|
229
|
-
|
|
230
|
-
variable_if_dynamic<Index, IsVectorAtCompileTime ? 0
|
|
231
|
-
: int(IsRowMajor) ? ColsAtCompileTime
|
|
232
|
-
: RowsAtCompileTime> m_outerStride;
|
|
269
|
+
plainobjectbase_evaluator_data<Scalar,OuterStrideAtCompileTime> m_d;
|
|
233
270
|
};
|
|
234
271
|
|
|
235
272
|
template<typename Scalar, int Rows, int Cols, int Options, int MaxRows, int MaxCols>
|
|
@@ -237,11 +274,13 @@ struct evaluator<Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> >
|
|
|
237
274
|
: evaluator<PlainObjectBase<Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> > >
|
|
238
275
|
{
|
|
239
276
|
typedef Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> XprType;
|
|
240
|
-
|
|
241
|
-
EIGEN_DEVICE_FUNC evaluator() {}
|
|
242
277
|
|
|
243
|
-
EIGEN_DEVICE_FUNC
|
|
244
|
-
|
|
278
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
279
|
+
evaluator() {}
|
|
280
|
+
|
|
281
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
282
|
+
explicit evaluator(const XprType& m)
|
|
283
|
+
: evaluator<PlainObjectBase<XprType> >(m)
|
|
245
284
|
{ }
|
|
246
285
|
};
|
|
247
286
|
|
|
@@ -251,10 +290,12 @@ struct evaluator<Array<Scalar, Rows, Cols, Options, MaxRows, MaxCols> >
|
|
|
251
290
|
{
|
|
252
291
|
typedef Array<Scalar, Rows, Cols, Options, MaxRows, MaxCols> XprType;
|
|
253
292
|
|
|
254
|
-
EIGEN_DEVICE_FUNC
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
293
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
294
|
+
evaluator() {}
|
|
295
|
+
|
|
296
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
297
|
+
explicit evaluator(const XprType& m)
|
|
298
|
+
: evaluator<PlainObjectBase<XprType> >(m)
|
|
258
299
|
{ }
|
|
259
300
|
};
|
|
260
301
|
|
|
@@ -265,14 +306,15 @@ struct unary_evaluator<Transpose<ArgType>, IndexBased>
|
|
|
265
306
|
: evaluator_base<Transpose<ArgType> >
|
|
266
307
|
{
|
|
267
308
|
typedef Transpose<ArgType> XprType;
|
|
268
|
-
|
|
309
|
+
|
|
269
310
|
enum {
|
|
270
|
-
CoeffReadCost = evaluator<ArgType>::CoeffReadCost,
|
|
311
|
+
CoeffReadCost = evaluator<ArgType>::CoeffReadCost,
|
|
271
312
|
Flags = evaluator<ArgType>::Flags ^ RowMajorBit,
|
|
272
313
|
Alignment = evaluator<ArgType>::Alignment
|
|
273
314
|
};
|
|
274
315
|
|
|
275
|
-
EIGEN_DEVICE_FUNC
|
|
316
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
317
|
+
explicit unary_evaluator(const XprType& t) : m_argImpl(t.nestedExpression()) {}
|
|
276
318
|
|
|
277
319
|
typedef typename XprType::Scalar Scalar;
|
|
278
320
|
typedef typename XprType::CoeffReturnType CoeffReturnType;
|
|
@@ -457,10 +499,10 @@ struct evaluator<CwiseNullaryOp<NullaryOp,PlainObjectType> >
|
|
|
457
499
|
{
|
|
458
500
|
typedef CwiseNullaryOp<NullaryOp,PlainObjectType> XprType;
|
|
459
501
|
typedef typename internal::remove_all<PlainObjectType>::type PlainObjectTypeCleaned;
|
|
460
|
-
|
|
502
|
+
|
|
461
503
|
enum {
|
|
462
504
|
CoeffReadCost = internal::functor_traits<NullaryOp>::Cost,
|
|
463
|
-
|
|
505
|
+
|
|
464
506
|
Flags = (evaluator<PlainObjectTypeCleaned>::Flags
|
|
465
507
|
& ( HereditaryBits
|
|
466
508
|
| (functor_has_linear_access<NullaryOp>::ret ? LinearAccessBit : 0)
|
|
@@ -517,19 +559,17 @@ struct unary_evaluator<CwiseUnaryOp<UnaryOp, ArgType>, IndexBased >
|
|
|
517
559
|
: evaluator_base<CwiseUnaryOp<UnaryOp, ArgType> >
|
|
518
560
|
{
|
|
519
561
|
typedef CwiseUnaryOp<UnaryOp, ArgType> XprType;
|
|
520
|
-
|
|
562
|
+
|
|
521
563
|
enum {
|
|
522
|
-
CoeffReadCost = evaluator<ArgType>::CoeffReadCost + functor_traits<UnaryOp>::Cost,
|
|
523
|
-
|
|
564
|
+
CoeffReadCost = int(evaluator<ArgType>::CoeffReadCost) + int(functor_traits<UnaryOp>::Cost),
|
|
565
|
+
|
|
524
566
|
Flags = evaluator<ArgType>::Flags
|
|
525
567
|
& (HereditaryBits | LinearAccessBit | (functor_traits<UnaryOp>::PacketAccess ? PacketAccessBit : 0)),
|
|
526
568
|
Alignment = evaluator<ArgType>::Alignment
|
|
527
569
|
};
|
|
528
570
|
|
|
529
571
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
530
|
-
explicit unary_evaluator(const XprType& op)
|
|
531
|
-
: m_functor(op.functor()),
|
|
532
|
-
m_argImpl(op.nestedExpression())
|
|
572
|
+
explicit unary_evaluator(const XprType& op) : m_d(op)
|
|
533
573
|
{
|
|
534
574
|
EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<UnaryOp>::Cost);
|
|
535
575
|
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
|
@@ -540,32 +580,43 @@ struct unary_evaluator<CwiseUnaryOp<UnaryOp, ArgType>, IndexBased >
|
|
|
540
580
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
541
581
|
CoeffReturnType coeff(Index row, Index col) const
|
|
542
582
|
{
|
|
543
|
-
return
|
|
583
|
+
return m_d.func()(m_d.argImpl.coeff(row, col));
|
|
544
584
|
}
|
|
545
585
|
|
|
546
586
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
547
587
|
CoeffReturnType coeff(Index index) const
|
|
548
588
|
{
|
|
549
|
-
return
|
|
589
|
+
return m_d.func()(m_d.argImpl.coeff(index));
|
|
550
590
|
}
|
|
551
591
|
|
|
552
592
|
template<int LoadMode, typename PacketType>
|
|
553
593
|
EIGEN_STRONG_INLINE
|
|
554
594
|
PacketType packet(Index row, Index col) const
|
|
555
595
|
{
|
|
556
|
-
return
|
|
596
|
+
return m_d.func().packetOp(m_d.argImpl.template packet<LoadMode, PacketType>(row, col));
|
|
557
597
|
}
|
|
558
598
|
|
|
559
599
|
template<int LoadMode, typename PacketType>
|
|
560
600
|
EIGEN_STRONG_INLINE
|
|
561
601
|
PacketType packet(Index index) const
|
|
562
602
|
{
|
|
563
|
-
return
|
|
603
|
+
return m_d.func().packetOp(m_d.argImpl.template packet<LoadMode, PacketType>(index));
|
|
564
604
|
}
|
|
565
605
|
|
|
566
606
|
protected:
|
|
567
|
-
|
|
568
|
-
|
|
607
|
+
|
|
608
|
+
// this helper permits to completely eliminate the functor if it is empty
|
|
609
|
+
struct Data
|
|
610
|
+
{
|
|
611
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
612
|
+
Data(const XprType& xpr) : op(xpr.functor()), argImpl(xpr.nestedExpression()) {}
|
|
613
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
614
|
+
const UnaryOp& func() const { return op; }
|
|
615
|
+
UnaryOp op;
|
|
616
|
+
evaluator<ArgType> argImpl;
|
|
617
|
+
};
|
|
618
|
+
|
|
619
|
+
Data m_d;
|
|
569
620
|
};
|
|
570
621
|
|
|
571
622
|
// -------------------- CwiseTernaryOp --------------------
|
|
@@ -577,7 +628,7 @@ struct evaluator<CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3> >
|
|
|
577
628
|
{
|
|
578
629
|
typedef CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3> XprType;
|
|
579
630
|
typedef ternary_evaluator<CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3> > Base;
|
|
580
|
-
|
|
631
|
+
|
|
581
632
|
EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr) : Base(xpr) {}
|
|
582
633
|
};
|
|
583
634
|
|
|
@@ -586,10 +637,10 @@ struct ternary_evaluator<CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3>, IndexBased
|
|
|
586
637
|
: evaluator_base<CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3> >
|
|
587
638
|
{
|
|
588
639
|
typedef CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3> XprType;
|
|
589
|
-
|
|
640
|
+
|
|
590
641
|
enum {
|
|
591
|
-
CoeffReadCost = evaluator<Arg1>::CoeffReadCost + evaluator<Arg2>::CoeffReadCost + evaluator<Arg3>::CoeffReadCost + functor_traits<TernaryOp>::Cost,
|
|
592
|
-
|
|
642
|
+
CoeffReadCost = int(evaluator<Arg1>::CoeffReadCost) + int(evaluator<Arg2>::CoeffReadCost) + int(evaluator<Arg3>::CoeffReadCost) + int(functor_traits<TernaryOp>::Cost),
|
|
643
|
+
|
|
593
644
|
Arg1Flags = evaluator<Arg1>::Flags,
|
|
594
645
|
Arg2Flags = evaluator<Arg2>::Flags,
|
|
595
646
|
Arg3Flags = evaluator<Arg3>::Flags,
|
|
@@ -609,11 +660,7 @@ struct ternary_evaluator<CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3>, IndexBased
|
|
|
609
660
|
evaluator<Arg3>::Alignment)
|
|
610
661
|
};
|
|
611
662
|
|
|
612
|
-
EIGEN_DEVICE_FUNC explicit ternary_evaluator(const XprType& xpr)
|
|
613
|
-
: m_functor(xpr.functor()),
|
|
614
|
-
m_arg1Impl(xpr.arg1()),
|
|
615
|
-
m_arg2Impl(xpr.arg2()),
|
|
616
|
-
m_arg3Impl(xpr.arg3())
|
|
663
|
+
EIGEN_DEVICE_FUNC explicit ternary_evaluator(const XprType& xpr) : m_d(xpr)
|
|
617
664
|
{
|
|
618
665
|
EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<TernaryOp>::Cost);
|
|
619
666
|
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
|
@@ -624,38 +671,48 @@ struct ternary_evaluator<CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3>, IndexBased
|
|
|
624
671
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
625
672
|
CoeffReturnType coeff(Index row, Index col) const
|
|
626
673
|
{
|
|
627
|
-
return
|
|
674
|
+
return m_d.func()(m_d.arg1Impl.coeff(row, col), m_d.arg2Impl.coeff(row, col), m_d.arg3Impl.coeff(row, col));
|
|
628
675
|
}
|
|
629
676
|
|
|
630
677
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
631
678
|
CoeffReturnType coeff(Index index) const
|
|
632
679
|
{
|
|
633
|
-
return
|
|
680
|
+
return m_d.func()(m_d.arg1Impl.coeff(index), m_d.arg2Impl.coeff(index), m_d.arg3Impl.coeff(index));
|
|
634
681
|
}
|
|
635
682
|
|
|
636
683
|
template<int LoadMode, typename PacketType>
|
|
637
684
|
EIGEN_STRONG_INLINE
|
|
638
685
|
PacketType packet(Index row, Index col) const
|
|
639
686
|
{
|
|
640
|
-
return
|
|
641
|
-
|
|
642
|
-
|
|
687
|
+
return m_d.func().packetOp(m_d.arg1Impl.template packet<LoadMode,PacketType>(row, col),
|
|
688
|
+
m_d.arg2Impl.template packet<LoadMode,PacketType>(row, col),
|
|
689
|
+
m_d.arg3Impl.template packet<LoadMode,PacketType>(row, col));
|
|
643
690
|
}
|
|
644
691
|
|
|
645
692
|
template<int LoadMode, typename PacketType>
|
|
646
693
|
EIGEN_STRONG_INLINE
|
|
647
694
|
PacketType packet(Index index) const
|
|
648
695
|
{
|
|
649
|
-
return
|
|
650
|
-
|
|
651
|
-
|
|
696
|
+
return m_d.func().packetOp(m_d.arg1Impl.template packet<LoadMode,PacketType>(index),
|
|
697
|
+
m_d.arg2Impl.template packet<LoadMode,PacketType>(index),
|
|
698
|
+
m_d.arg3Impl.template packet<LoadMode,PacketType>(index));
|
|
652
699
|
}
|
|
653
700
|
|
|
654
701
|
protected:
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
702
|
+
// this helper permits to completely eliminate the functor if it is empty
|
|
703
|
+
struct Data
|
|
704
|
+
{
|
|
705
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
706
|
+
Data(const XprType& xpr) : op(xpr.functor()), arg1Impl(xpr.arg1()), arg2Impl(xpr.arg2()), arg3Impl(xpr.arg3()) {}
|
|
707
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
708
|
+
const TernaryOp& func() const { return op; }
|
|
709
|
+
TernaryOp op;
|
|
710
|
+
evaluator<Arg1> arg1Impl;
|
|
711
|
+
evaluator<Arg2> arg2Impl;
|
|
712
|
+
evaluator<Arg3> arg3Impl;
|
|
713
|
+
};
|
|
714
|
+
|
|
715
|
+
Data m_d;
|
|
659
716
|
};
|
|
660
717
|
|
|
661
718
|
// -------------------- CwiseBinaryOp --------------------
|
|
@@ -667,8 +724,9 @@ struct evaluator<CwiseBinaryOp<BinaryOp, Lhs, Rhs> >
|
|
|
667
724
|
{
|
|
668
725
|
typedef CwiseBinaryOp<BinaryOp, Lhs, Rhs> XprType;
|
|
669
726
|
typedef binary_evaluator<CwiseBinaryOp<BinaryOp, Lhs, Rhs> > Base;
|
|
670
|
-
|
|
671
|
-
EIGEN_DEVICE_FUNC
|
|
727
|
+
|
|
728
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
729
|
+
explicit evaluator(const XprType& xpr) : Base(xpr) {}
|
|
672
730
|
};
|
|
673
731
|
|
|
674
732
|
template<typename BinaryOp, typename Lhs, typename Rhs>
|
|
@@ -676,10 +734,10 @@ struct binary_evaluator<CwiseBinaryOp<BinaryOp, Lhs, Rhs>, IndexBased, IndexBase
|
|
|
676
734
|
: evaluator_base<CwiseBinaryOp<BinaryOp, Lhs, Rhs> >
|
|
677
735
|
{
|
|
678
736
|
typedef CwiseBinaryOp<BinaryOp, Lhs, Rhs> XprType;
|
|
679
|
-
|
|
737
|
+
|
|
680
738
|
enum {
|
|
681
|
-
CoeffReadCost = evaluator<Lhs>::CoeffReadCost + evaluator<Rhs>::CoeffReadCost + functor_traits<BinaryOp>::Cost,
|
|
682
|
-
|
|
739
|
+
CoeffReadCost = int(evaluator<Lhs>::CoeffReadCost) + int(evaluator<Rhs>::CoeffReadCost) + int(functor_traits<BinaryOp>::Cost),
|
|
740
|
+
|
|
683
741
|
LhsFlags = evaluator<Lhs>::Flags,
|
|
684
742
|
RhsFlags = evaluator<Rhs>::Flags,
|
|
685
743
|
SameType = is_same<typename Lhs::Scalar,typename Rhs::Scalar>::value,
|
|
@@ -696,10 +754,8 @@ struct binary_evaluator<CwiseBinaryOp<BinaryOp, Lhs, Rhs>, IndexBased, IndexBase
|
|
|
696
754
|
Alignment = EIGEN_PLAIN_ENUM_MIN(evaluator<Lhs>::Alignment,evaluator<Rhs>::Alignment)
|
|
697
755
|
};
|
|
698
756
|
|
|
699
|
-
EIGEN_DEVICE_FUNC
|
|
700
|
-
|
|
701
|
-
m_lhsImpl(xpr.lhs()),
|
|
702
|
-
m_rhsImpl(xpr.rhs())
|
|
757
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
758
|
+
explicit binary_evaluator(const XprType& xpr) : m_d(xpr)
|
|
703
759
|
{
|
|
704
760
|
EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<BinaryOp>::Cost);
|
|
705
761
|
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
|
@@ -710,35 +766,46 @@ struct binary_evaluator<CwiseBinaryOp<BinaryOp, Lhs, Rhs>, IndexBased, IndexBase
|
|
|
710
766
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
711
767
|
CoeffReturnType coeff(Index row, Index col) const
|
|
712
768
|
{
|
|
713
|
-
return
|
|
769
|
+
return m_d.func()(m_d.lhsImpl.coeff(row, col), m_d.rhsImpl.coeff(row, col));
|
|
714
770
|
}
|
|
715
771
|
|
|
716
772
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
717
773
|
CoeffReturnType coeff(Index index) const
|
|
718
774
|
{
|
|
719
|
-
return
|
|
775
|
+
return m_d.func()(m_d.lhsImpl.coeff(index), m_d.rhsImpl.coeff(index));
|
|
720
776
|
}
|
|
721
777
|
|
|
722
778
|
template<int LoadMode, typename PacketType>
|
|
723
779
|
EIGEN_STRONG_INLINE
|
|
724
780
|
PacketType packet(Index row, Index col) const
|
|
725
781
|
{
|
|
726
|
-
return
|
|
727
|
-
|
|
782
|
+
return m_d.func().packetOp(m_d.lhsImpl.template packet<LoadMode,PacketType>(row, col),
|
|
783
|
+
m_d.rhsImpl.template packet<LoadMode,PacketType>(row, col));
|
|
728
784
|
}
|
|
729
785
|
|
|
730
786
|
template<int LoadMode, typename PacketType>
|
|
731
787
|
EIGEN_STRONG_INLINE
|
|
732
788
|
PacketType packet(Index index) const
|
|
733
789
|
{
|
|
734
|
-
return
|
|
735
|
-
|
|
790
|
+
return m_d.func().packetOp(m_d.lhsImpl.template packet<LoadMode,PacketType>(index),
|
|
791
|
+
m_d.rhsImpl.template packet<LoadMode,PacketType>(index));
|
|
736
792
|
}
|
|
737
793
|
|
|
738
794
|
protected:
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
795
|
+
|
|
796
|
+
// this helper permits to completely eliminate the functor if it is empty
|
|
797
|
+
struct Data
|
|
798
|
+
{
|
|
799
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
800
|
+
Data(const XprType& xpr) : op(xpr.functor()), lhsImpl(xpr.lhs()), rhsImpl(xpr.rhs()) {}
|
|
801
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
802
|
+
const BinaryOp& func() const { return op; }
|
|
803
|
+
BinaryOp op;
|
|
804
|
+
evaluator<Lhs> lhsImpl;
|
|
805
|
+
evaluator<Rhs> rhsImpl;
|
|
806
|
+
};
|
|
807
|
+
|
|
808
|
+
Data m_d;
|
|
742
809
|
};
|
|
743
810
|
|
|
744
811
|
// -------------------- CwiseUnaryView --------------------
|
|
@@ -748,18 +815,16 @@ struct unary_evaluator<CwiseUnaryView<UnaryOp, ArgType>, IndexBased>
|
|
|
748
815
|
: evaluator_base<CwiseUnaryView<UnaryOp, ArgType> >
|
|
749
816
|
{
|
|
750
817
|
typedef CwiseUnaryView<UnaryOp, ArgType> XprType;
|
|
751
|
-
|
|
818
|
+
|
|
752
819
|
enum {
|
|
753
|
-
CoeffReadCost = evaluator<ArgType>::CoeffReadCost + functor_traits<UnaryOp>::Cost,
|
|
754
|
-
|
|
820
|
+
CoeffReadCost = int(evaluator<ArgType>::CoeffReadCost) + int(functor_traits<UnaryOp>::Cost),
|
|
821
|
+
|
|
755
822
|
Flags = (evaluator<ArgType>::Flags & (HereditaryBits | LinearAccessBit | DirectAccessBit)),
|
|
756
|
-
|
|
823
|
+
|
|
757
824
|
Alignment = 0 // FIXME it is not very clear why alignment is necessarily lost...
|
|
758
825
|
};
|
|
759
826
|
|
|
760
|
-
EIGEN_DEVICE_FUNC explicit unary_evaluator(const XprType& op)
|
|
761
|
-
: m_unaryOp(op.functor()),
|
|
762
|
-
m_argImpl(op.nestedExpression())
|
|
827
|
+
EIGEN_DEVICE_FUNC explicit unary_evaluator(const XprType& op) : m_d(op)
|
|
763
828
|
{
|
|
764
829
|
EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<UnaryOp>::Cost);
|
|
765
830
|
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
|
@@ -771,30 +836,41 @@ struct unary_evaluator<CwiseUnaryView<UnaryOp, ArgType>, IndexBased>
|
|
|
771
836
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
772
837
|
CoeffReturnType coeff(Index row, Index col) const
|
|
773
838
|
{
|
|
774
|
-
return
|
|
839
|
+
return m_d.func()(m_d.argImpl.coeff(row, col));
|
|
775
840
|
}
|
|
776
841
|
|
|
777
842
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
778
843
|
CoeffReturnType coeff(Index index) const
|
|
779
844
|
{
|
|
780
|
-
return
|
|
845
|
+
return m_d.func()(m_d.argImpl.coeff(index));
|
|
781
846
|
}
|
|
782
847
|
|
|
783
848
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
784
849
|
Scalar& coeffRef(Index row, Index col)
|
|
785
850
|
{
|
|
786
|
-
return
|
|
851
|
+
return m_d.func()(m_d.argImpl.coeffRef(row, col));
|
|
787
852
|
}
|
|
788
853
|
|
|
789
854
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
790
855
|
Scalar& coeffRef(Index index)
|
|
791
856
|
{
|
|
792
|
-
return
|
|
857
|
+
return m_d.func()(m_d.argImpl.coeffRef(index));
|
|
793
858
|
}
|
|
794
859
|
|
|
795
860
|
protected:
|
|
796
|
-
|
|
797
|
-
|
|
861
|
+
|
|
862
|
+
// this helper permits to completely eliminate the functor if it is empty
|
|
863
|
+
struct Data
|
|
864
|
+
{
|
|
865
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
866
|
+
Data(const XprType& xpr) : op(xpr.functor()), argImpl(xpr.nestedExpression()) {}
|
|
867
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
868
|
+
const UnaryOp& func() const { return op; }
|
|
869
|
+
UnaryOp op;
|
|
870
|
+
evaluator<ArgType> argImpl;
|
|
871
|
+
};
|
|
872
|
+
|
|
873
|
+
Data m_d;
|
|
798
874
|
};
|
|
799
875
|
|
|
800
876
|
// -------------------- Map --------------------
|
|
@@ -811,14 +887,15 @@ struct mapbase_evaluator : evaluator_base<Derived>
|
|
|
811
887
|
typedef typename XprType::PointerType PointerType;
|
|
812
888
|
typedef typename XprType::Scalar Scalar;
|
|
813
889
|
typedef typename XprType::CoeffReturnType CoeffReturnType;
|
|
814
|
-
|
|
890
|
+
|
|
815
891
|
enum {
|
|
816
892
|
IsRowMajor = XprType::RowsAtCompileTime,
|
|
817
893
|
ColsAtCompileTime = XprType::ColsAtCompileTime,
|
|
818
894
|
CoeffReadCost = NumTraits<Scalar>::ReadCost
|
|
819
895
|
};
|
|
820
896
|
|
|
821
|
-
EIGEN_DEVICE_FUNC
|
|
897
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
898
|
+
explicit mapbase_evaluator(const XprType& map)
|
|
822
899
|
: m_data(const_cast<PointerType>(map.data())),
|
|
823
900
|
m_innerStride(map.innerStride()),
|
|
824
901
|
m_outerStride(map.outerStride())
|
|
@@ -882,17 +959,21 @@ struct mapbase_evaluator : evaluator_base<Derived>
|
|
|
882
959
|
internal::pstoret<Scalar, PacketType, StoreMode>(m_data + index * m_innerStride.value(), x);
|
|
883
960
|
}
|
|
884
961
|
protected:
|
|
885
|
-
EIGEN_DEVICE_FUNC
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
962
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
|
|
963
|
+
Index rowStride() const EIGEN_NOEXCEPT {
|
|
964
|
+
return XprType::IsRowMajor ? m_outerStride.value() : m_innerStride.value();
|
|
965
|
+
}
|
|
966
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
|
|
967
|
+
Index colStride() const EIGEN_NOEXCEPT {
|
|
968
|
+
return XprType::IsRowMajor ? m_innerStride.value() : m_outerStride.value();
|
|
969
|
+
}
|
|
889
970
|
|
|
890
971
|
PointerType m_data;
|
|
891
972
|
const internal::variable_if_dynamic<Index, XprType::InnerStrideAtCompileTime> m_innerStride;
|
|
892
973
|
const internal::variable_if_dynamic<Index, XprType::OuterStrideAtCompileTime> m_outerStride;
|
|
893
974
|
};
|
|
894
975
|
|
|
895
|
-
template<typename PlainObjectType, int MapOptions, typename StrideType>
|
|
976
|
+
template<typename PlainObjectType, int MapOptions, typename StrideType>
|
|
896
977
|
struct evaluator<Map<PlainObjectType, MapOptions, StrideType> >
|
|
897
978
|
: public mapbase_evaluator<Map<PlainObjectType, MapOptions, StrideType>, PlainObjectType>
|
|
898
979
|
{
|
|
@@ -900,7 +981,7 @@ struct evaluator<Map<PlainObjectType, MapOptions, StrideType> >
|
|
|
900
981
|
typedef typename XprType::Scalar Scalar;
|
|
901
982
|
// TODO: should check for smaller packet types once we can handle multi-sized packet types
|
|
902
983
|
typedef typename packet_traits<Scalar>::type PacketScalar;
|
|
903
|
-
|
|
984
|
+
|
|
904
985
|
enum {
|
|
905
986
|
InnerStrideAtCompileTime = StrideType::InnerStrideAtCompileTime == 0
|
|
906
987
|
? int(PlainObjectType::InnerStrideAtCompileTime)
|
|
@@ -912,34 +993,35 @@ struct evaluator<Map<PlainObjectType, MapOptions, StrideType> >
|
|
|
912
993
|
HasNoOuterStride = StrideType::OuterStrideAtCompileTime == 0,
|
|
913
994
|
HasNoStride = HasNoInnerStride && HasNoOuterStride,
|
|
914
995
|
IsDynamicSize = PlainObjectType::SizeAtCompileTime==Dynamic,
|
|
915
|
-
|
|
996
|
+
|
|
916
997
|
PacketAccessMask = bool(HasNoInnerStride) ? ~int(0) : ~int(PacketAccessBit),
|
|
917
998
|
LinearAccessMask = bool(HasNoStride) || bool(PlainObjectType::IsVectorAtCompileTime) ? ~int(0) : ~int(LinearAccessBit),
|
|
918
999
|
Flags = int( evaluator<PlainObjectType>::Flags) & (LinearAccessMask&PacketAccessMask),
|
|
919
|
-
|
|
1000
|
+
|
|
920
1001
|
Alignment = int(MapOptions)&int(AlignedMask)
|
|
921
1002
|
};
|
|
922
1003
|
|
|
923
1004
|
EIGEN_DEVICE_FUNC explicit evaluator(const XprType& map)
|
|
924
|
-
: mapbase_evaluator<XprType, PlainObjectType>(map)
|
|
1005
|
+
: mapbase_evaluator<XprType, PlainObjectType>(map)
|
|
925
1006
|
{ }
|
|
926
1007
|
};
|
|
927
1008
|
|
|
928
1009
|
// -------------------- Ref --------------------
|
|
929
1010
|
|
|
930
|
-
template<typename PlainObjectType, int RefOptions, typename StrideType>
|
|
1011
|
+
template<typename PlainObjectType, int RefOptions, typename StrideType>
|
|
931
1012
|
struct evaluator<Ref<PlainObjectType, RefOptions, StrideType> >
|
|
932
1013
|
: public mapbase_evaluator<Ref<PlainObjectType, RefOptions, StrideType>, PlainObjectType>
|
|
933
1014
|
{
|
|
934
1015
|
typedef Ref<PlainObjectType, RefOptions, StrideType> XprType;
|
|
935
|
-
|
|
1016
|
+
|
|
936
1017
|
enum {
|
|
937
1018
|
Flags = evaluator<Map<PlainObjectType, RefOptions, StrideType> >::Flags,
|
|
938
1019
|
Alignment = evaluator<Map<PlainObjectType, RefOptions, StrideType> >::Alignment
|
|
939
1020
|
};
|
|
940
1021
|
|
|
941
|
-
EIGEN_DEVICE_FUNC
|
|
942
|
-
|
|
1022
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1023
|
+
explicit evaluator(const XprType& ref)
|
|
1024
|
+
: mapbase_evaluator<XprType, PlainObjectType>(ref)
|
|
943
1025
|
{ }
|
|
944
1026
|
};
|
|
945
1027
|
|
|
@@ -947,8 +1029,8 @@ struct evaluator<Ref<PlainObjectType, RefOptions, StrideType> >
|
|
|
947
1029
|
|
|
948
1030
|
template<typename ArgType, int BlockRows, int BlockCols, bool InnerPanel,
|
|
949
1031
|
bool HasDirectAccess = internal::has_direct_access<ArgType>::ret> struct block_evaluator;
|
|
950
|
-
|
|
951
|
-
template<typename ArgType, int BlockRows, int BlockCols, bool InnerPanel>
|
|
1032
|
+
|
|
1033
|
+
template<typename ArgType, int BlockRows, int BlockCols, bool InnerPanel>
|
|
952
1034
|
struct evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel> >
|
|
953
1035
|
: block_evaluator<ArgType, BlockRows, BlockCols, InnerPanel>
|
|
954
1036
|
{
|
|
@@ -956,15 +1038,15 @@ struct evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel> >
|
|
|
956
1038
|
typedef typename XprType::Scalar Scalar;
|
|
957
1039
|
// TODO: should check for smaller packet types once we can handle multi-sized packet types
|
|
958
1040
|
typedef typename packet_traits<Scalar>::type PacketScalar;
|
|
959
|
-
|
|
1041
|
+
|
|
960
1042
|
enum {
|
|
961
1043
|
CoeffReadCost = evaluator<ArgType>::CoeffReadCost,
|
|
962
|
-
|
|
1044
|
+
|
|
963
1045
|
RowsAtCompileTime = traits<XprType>::RowsAtCompileTime,
|
|
964
1046
|
ColsAtCompileTime = traits<XprType>::ColsAtCompileTime,
|
|
965
1047
|
MaxRowsAtCompileTime = traits<XprType>::MaxRowsAtCompileTime,
|
|
966
1048
|
MaxColsAtCompileTime = traits<XprType>::MaxColsAtCompileTime,
|
|
967
|
-
|
|
1049
|
+
|
|
968
1050
|
ArgTypeIsRowMajor = (int(evaluator<ArgType>::Flags)&RowMajorBit) != 0,
|
|
969
1051
|
IsRowMajor = (MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1) ? 1
|
|
970
1052
|
: (MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1) ? 0
|
|
@@ -978,14 +1060,14 @@ struct evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel> >
|
|
|
978
1060
|
? int(outer_stride_at_compile_time<ArgType>::ret)
|
|
979
1061
|
: int(inner_stride_at_compile_time<ArgType>::ret),
|
|
980
1062
|
MaskPacketAccessBit = (InnerStrideAtCompileTime == 1 || HasSameStorageOrderAsArgType) ? PacketAccessBit : 0,
|
|
981
|
-
|
|
982
|
-
FlagsLinearAccessBit = (RowsAtCompileTime == 1 || ColsAtCompileTime == 1 || (InnerPanel && (evaluator<ArgType>::Flags&LinearAccessBit))) ? LinearAccessBit : 0,
|
|
1063
|
+
|
|
1064
|
+
FlagsLinearAccessBit = (RowsAtCompileTime == 1 || ColsAtCompileTime == 1 || (InnerPanel && (evaluator<ArgType>::Flags&LinearAccessBit))) ? LinearAccessBit : 0,
|
|
983
1065
|
FlagsRowMajorBit = XprType::Flags&RowMajorBit,
|
|
984
1066
|
Flags0 = evaluator<ArgType>::Flags & ( (HereditaryBits & ~RowMajorBit) |
|
|
985
1067
|
DirectAccessBit |
|
|
986
1068
|
MaskPacketAccessBit),
|
|
987
1069
|
Flags = Flags0 | FlagsLinearAccessBit | FlagsRowMajorBit,
|
|
988
|
-
|
|
1070
|
+
|
|
989
1071
|
PacketAlignment = unpacket_traits<PacketScalar>::alignment,
|
|
990
1072
|
Alignment0 = (InnerPanel && (OuterStrideAtCompileTime!=Dynamic)
|
|
991
1073
|
&& (OuterStrideAtCompileTime!=0)
|
|
@@ -993,7 +1075,8 @@ struct evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel> >
|
|
|
993
1075
|
Alignment = EIGEN_PLAIN_ENUM_MIN(evaluator<ArgType>::Alignment, Alignment0)
|
|
994
1076
|
};
|
|
995
1077
|
typedef block_evaluator<ArgType, BlockRows, BlockCols, InnerPanel> block_evaluator_type;
|
|
996
|
-
EIGEN_DEVICE_FUNC
|
|
1078
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1079
|
+
explicit evaluator(const XprType& block) : block_evaluator_type(block)
|
|
997
1080
|
{
|
|
998
1081
|
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
|
999
1082
|
}
|
|
@@ -1006,8 +1089,9 @@ struct block_evaluator<ArgType, BlockRows, BlockCols, InnerPanel, /*HasDirectAcc
|
|
|
1006
1089
|
{
|
|
1007
1090
|
typedef Block<ArgType, BlockRows, BlockCols, InnerPanel> XprType;
|
|
1008
1091
|
|
|
1009
|
-
EIGEN_DEVICE_FUNC
|
|
1010
|
-
|
|
1092
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1093
|
+
explicit block_evaluator(const XprType& block)
|
|
1094
|
+
: unary_evaluator<XprType>(block)
|
|
1011
1095
|
{}
|
|
1012
1096
|
};
|
|
1013
1097
|
|
|
@@ -1017,79 +1101,74 @@ struct unary_evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel>, IndexBa
|
|
|
1017
1101
|
{
|
|
1018
1102
|
typedef Block<ArgType, BlockRows, BlockCols, InnerPanel> XprType;
|
|
1019
1103
|
|
|
1020
|
-
EIGEN_DEVICE_FUNC
|
|
1021
|
-
|
|
1022
|
-
|
|
1104
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1105
|
+
explicit unary_evaluator(const XprType& block)
|
|
1106
|
+
: m_argImpl(block.nestedExpression()),
|
|
1107
|
+
m_startRow(block.startRow()),
|
|
1023
1108
|
m_startCol(block.startCol()),
|
|
1024
|
-
m_linear_offset(
|
|
1109
|
+
m_linear_offset(ForwardLinearAccess?(ArgType::IsRowMajor ? block.startRow()*block.nestedExpression().cols() + block.startCol() : block.startCol()*block.nestedExpression().rows() + block.startRow()):0)
|
|
1025
1110
|
{ }
|
|
1026
|
-
|
|
1111
|
+
|
|
1027
1112
|
typedef typename XprType::Scalar Scalar;
|
|
1028
1113
|
typedef typename XprType::CoeffReturnType CoeffReturnType;
|
|
1029
1114
|
|
|
1030
1115
|
enum {
|
|
1031
1116
|
RowsAtCompileTime = XprType::RowsAtCompileTime,
|
|
1032
|
-
ForwardLinearAccess = InnerPanel && bool(evaluator<ArgType>::Flags&LinearAccessBit)
|
|
1117
|
+
ForwardLinearAccess = (InnerPanel || int(XprType::IsRowMajor)==int(ArgType::IsRowMajor)) && bool(evaluator<ArgType>::Flags&LinearAccessBit)
|
|
1033
1118
|
};
|
|
1034
|
-
|
|
1119
|
+
|
|
1035
1120
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1036
1121
|
CoeffReturnType coeff(Index row, Index col) const
|
|
1037
|
-
{
|
|
1038
|
-
return m_argImpl.coeff(m_startRow.value() + row, m_startCol.value() + col);
|
|
1122
|
+
{
|
|
1123
|
+
return m_argImpl.coeff(m_startRow.value() + row, m_startCol.value() + col);
|
|
1039
1124
|
}
|
|
1040
|
-
|
|
1125
|
+
|
|
1041
1126
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1042
1127
|
CoeffReturnType coeff(Index index) const
|
|
1043
|
-
{
|
|
1044
|
-
|
|
1045
|
-
return m_argImpl.coeff(m_linear_offset.value() + index);
|
|
1046
|
-
else
|
|
1047
|
-
return coeff(RowsAtCompileTime == 1 ? 0 : index, RowsAtCompileTime == 1 ? index : 0);
|
|
1128
|
+
{
|
|
1129
|
+
return linear_coeff_impl(index, bool_constant<ForwardLinearAccess>());
|
|
1048
1130
|
}
|
|
1049
1131
|
|
|
1050
1132
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1051
1133
|
Scalar& coeffRef(Index row, Index col)
|
|
1052
|
-
{
|
|
1053
|
-
return m_argImpl.coeffRef(m_startRow.value() + row, m_startCol.value() + col);
|
|
1134
|
+
{
|
|
1135
|
+
return m_argImpl.coeffRef(m_startRow.value() + row, m_startCol.value() + col);
|
|
1054
1136
|
}
|
|
1055
|
-
|
|
1137
|
+
|
|
1056
1138
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1057
1139
|
Scalar& coeffRef(Index index)
|
|
1058
|
-
{
|
|
1059
|
-
|
|
1060
|
-
return m_argImpl.coeffRef(m_linear_offset.value() + index);
|
|
1061
|
-
else
|
|
1062
|
-
return coeffRef(RowsAtCompileTime == 1 ? 0 : index, RowsAtCompileTime == 1 ? index : 0);
|
|
1140
|
+
{
|
|
1141
|
+
return linear_coeffRef_impl(index, bool_constant<ForwardLinearAccess>());
|
|
1063
1142
|
}
|
|
1064
|
-
|
|
1143
|
+
|
|
1065
1144
|
template<int LoadMode, typename PacketType>
|
|
1066
1145
|
EIGEN_STRONG_INLINE
|
|
1067
|
-
PacketType packet(Index row, Index col) const
|
|
1068
|
-
{
|
|
1069
|
-
return m_argImpl.template packet<LoadMode,PacketType>(m_startRow.value() + row, m_startCol.value() + col);
|
|
1146
|
+
PacketType packet(Index row, Index col) const
|
|
1147
|
+
{
|
|
1148
|
+
return m_argImpl.template packet<LoadMode,PacketType>(m_startRow.value() + row, m_startCol.value() + col);
|
|
1070
1149
|
}
|
|
1071
1150
|
|
|
1072
1151
|
template<int LoadMode, typename PacketType>
|
|
1073
1152
|
EIGEN_STRONG_INLINE
|
|
1074
|
-
PacketType packet(Index index) const
|
|
1075
|
-
{
|
|
1153
|
+
PacketType packet(Index index) const
|
|
1154
|
+
{
|
|
1076
1155
|
if (ForwardLinearAccess)
|
|
1077
1156
|
return m_argImpl.template packet<LoadMode,PacketType>(m_linear_offset.value() + index);
|
|
1078
1157
|
else
|
|
1079
1158
|
return packet<LoadMode,PacketType>(RowsAtCompileTime == 1 ? 0 : index,
|
|
1080
1159
|
RowsAtCompileTime == 1 ? index : 0);
|
|
1081
1160
|
}
|
|
1082
|
-
|
|
1161
|
+
|
|
1083
1162
|
template<int StoreMode, typename PacketType>
|
|
1084
1163
|
EIGEN_STRONG_INLINE
|
|
1085
|
-
void writePacket(Index row, Index col, const PacketType& x)
|
|
1164
|
+
void writePacket(Index row, Index col, const PacketType& x)
|
|
1086
1165
|
{
|
|
1087
|
-
return m_argImpl.template writePacket<StoreMode,PacketType>(m_startRow.value() + row, m_startCol.value() + col, x);
|
|
1166
|
+
return m_argImpl.template writePacket<StoreMode,PacketType>(m_startRow.value() + row, m_startCol.value() + col, x);
|
|
1088
1167
|
}
|
|
1089
|
-
|
|
1168
|
+
|
|
1090
1169
|
template<int StoreMode, typename PacketType>
|
|
1091
1170
|
EIGEN_STRONG_INLINE
|
|
1092
|
-
void writePacket(Index index, const PacketType& x)
|
|
1171
|
+
void writePacket(Index index, const PacketType& x)
|
|
1093
1172
|
{
|
|
1094
1173
|
if (ForwardLinearAccess)
|
|
1095
1174
|
return m_argImpl.template writePacket<StoreMode,PacketType>(m_linear_offset.value() + index, x);
|
|
@@ -1098,18 +1177,40 @@ struct unary_evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel>, IndexBa
|
|
|
1098
1177
|
RowsAtCompileTime == 1 ? index : 0,
|
|
1099
1178
|
x);
|
|
1100
1179
|
}
|
|
1101
|
-
|
|
1180
|
+
|
|
1102
1181
|
protected:
|
|
1182
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1183
|
+
CoeffReturnType linear_coeff_impl(Index index, internal::true_type /* ForwardLinearAccess */) const
|
|
1184
|
+
{
|
|
1185
|
+
return m_argImpl.coeff(m_linear_offset.value() + index);
|
|
1186
|
+
}
|
|
1187
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1188
|
+
CoeffReturnType linear_coeff_impl(Index index, internal::false_type /* not ForwardLinearAccess */) const
|
|
1189
|
+
{
|
|
1190
|
+
return coeff(RowsAtCompileTime == 1 ? 0 : index, RowsAtCompileTime == 1 ? index : 0);
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1194
|
+
Scalar& linear_coeffRef_impl(Index index, internal::true_type /* ForwardLinearAccess */)
|
|
1195
|
+
{
|
|
1196
|
+
return m_argImpl.coeffRef(m_linear_offset.value() + index);
|
|
1197
|
+
}
|
|
1198
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1199
|
+
Scalar& linear_coeffRef_impl(Index index, internal::false_type /* not ForwardLinearAccess */)
|
|
1200
|
+
{
|
|
1201
|
+
return coeffRef(RowsAtCompileTime == 1 ? 0 : index, RowsAtCompileTime == 1 ? index : 0);
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1103
1204
|
evaluator<ArgType> m_argImpl;
|
|
1104
1205
|
const variable_if_dynamic<Index, (ArgType::RowsAtCompileTime == 1 && BlockRows==1) ? 0 : Dynamic> m_startRow;
|
|
1105
1206
|
const variable_if_dynamic<Index, (ArgType::ColsAtCompileTime == 1 && BlockCols==1) ? 0 : Dynamic> m_startCol;
|
|
1106
|
-
const variable_if_dynamic<Index,
|
|
1207
|
+
const variable_if_dynamic<Index, ForwardLinearAccess ? Dynamic : 0> m_linear_offset;
|
|
1107
1208
|
};
|
|
1108
1209
|
|
|
1109
|
-
// TODO: This evaluator does not actually use the child evaluator;
|
|
1210
|
+
// TODO: This evaluator does not actually use the child evaluator;
|
|
1110
1211
|
// all action is via the data() as returned by the Block expression.
|
|
1111
1212
|
|
|
1112
|
-
template<typename ArgType, int BlockRows, int BlockCols, bool InnerPanel>
|
|
1213
|
+
template<typename ArgType, int BlockRows, int BlockCols, bool InnerPanel>
|
|
1113
1214
|
struct block_evaluator<ArgType, BlockRows, BlockCols, InnerPanel, /* HasDirectAccess */ true>
|
|
1114
1215
|
: mapbase_evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel>,
|
|
1115
1216
|
typename Block<ArgType, BlockRows, BlockCols, InnerPanel>::PlainObject>
|
|
@@ -1117,8 +1218,9 @@ struct block_evaluator<ArgType, BlockRows, BlockCols, InnerPanel, /* HasDirectAc
|
|
|
1117
1218
|
typedef Block<ArgType, BlockRows, BlockCols, InnerPanel> XprType;
|
|
1118
1219
|
typedef typename XprType::Scalar Scalar;
|
|
1119
1220
|
|
|
1120
|
-
EIGEN_DEVICE_FUNC
|
|
1121
|
-
|
|
1221
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1222
|
+
explicit block_evaluator(const XprType& block)
|
|
1223
|
+
: mapbase_evaluator<XprType, typename XprType::PlainObject>(block)
|
|
1122
1224
|
{
|
|
1123
1225
|
// TODO: for the 3.3 release, this should be turned to an internal assertion, but let's keep it as is for the beta lifetime
|
|
1124
1226
|
eigen_assert(((internal::UIntPtr(block.data()) % EIGEN_PLAIN_ENUM_MAX(1,evaluator<XprType>::Alignment)) == 0) && "data is not aligned");
|
|
@@ -1141,18 +1243,19 @@ struct evaluator<Select<ConditionMatrixType, ThenMatrixType, ElseMatrixType> >
|
|
|
1141
1243
|
evaluator<ElseMatrixType>::CoeffReadCost),
|
|
1142
1244
|
|
|
1143
1245
|
Flags = (unsigned int)evaluator<ThenMatrixType>::Flags & evaluator<ElseMatrixType>::Flags & HereditaryBits,
|
|
1144
|
-
|
|
1246
|
+
|
|
1145
1247
|
Alignment = EIGEN_PLAIN_ENUM_MIN(evaluator<ThenMatrixType>::Alignment, evaluator<ElseMatrixType>::Alignment)
|
|
1146
1248
|
};
|
|
1147
1249
|
|
|
1148
|
-
EIGEN_DEVICE_FUNC
|
|
1250
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1251
|
+
explicit evaluator(const XprType& select)
|
|
1149
1252
|
: m_conditionImpl(select.conditionMatrix()),
|
|
1150
1253
|
m_thenImpl(select.thenMatrix()),
|
|
1151
1254
|
m_elseImpl(select.elseMatrix())
|
|
1152
1255
|
{
|
|
1153
1256
|
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
|
1154
1257
|
}
|
|
1155
|
-
|
|
1258
|
+
|
|
1156
1259
|
typedef typename XprType::CoeffReturnType CoeffReturnType;
|
|
1157
1260
|
|
|
1158
1261
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
@@ -1172,7 +1275,7 @@ struct evaluator<Select<ConditionMatrixType, ThenMatrixType, ElseMatrixType> >
|
|
|
1172
1275
|
else
|
|
1173
1276
|
return m_elseImpl.coeff(index);
|
|
1174
1277
|
}
|
|
1175
|
-
|
|
1278
|
+
|
|
1176
1279
|
protected:
|
|
1177
1280
|
evaluator<ConditionMatrixType> m_conditionImpl;
|
|
1178
1281
|
evaluator<ThenMatrixType> m_thenImpl;
|
|
@@ -1182,7 +1285,7 @@ protected:
|
|
|
1182
1285
|
|
|
1183
1286
|
// -------------------- Replicate --------------------
|
|
1184
1287
|
|
|
1185
|
-
template<typename ArgType, int RowFactor, int ColFactor>
|
|
1288
|
+
template<typename ArgType, int RowFactor, int ColFactor>
|
|
1186
1289
|
struct unary_evaluator<Replicate<ArgType, RowFactor, ColFactor> >
|
|
1187
1290
|
: evaluator_base<Replicate<ArgType, RowFactor, ColFactor> >
|
|
1188
1291
|
{
|
|
@@ -1193,22 +1296,23 @@ struct unary_evaluator<Replicate<ArgType, RowFactor, ColFactor> >
|
|
|
1193
1296
|
};
|
|
1194
1297
|
typedef typename internal::nested_eval<ArgType,Factor>::type ArgTypeNested;
|
|
1195
1298
|
typedef typename internal::remove_all<ArgTypeNested>::type ArgTypeNestedCleaned;
|
|
1196
|
-
|
|
1299
|
+
|
|
1197
1300
|
enum {
|
|
1198
1301
|
CoeffReadCost = evaluator<ArgTypeNestedCleaned>::CoeffReadCost,
|
|
1199
1302
|
LinearAccessMask = XprType::IsVectorAtCompileTime ? LinearAccessBit : 0,
|
|
1200
1303
|
Flags = (evaluator<ArgTypeNestedCleaned>::Flags & (HereditaryBits|LinearAccessMask) & ~RowMajorBit) | (traits<XprType>::Flags & RowMajorBit),
|
|
1201
|
-
|
|
1304
|
+
|
|
1202
1305
|
Alignment = evaluator<ArgTypeNestedCleaned>::Alignment
|
|
1203
1306
|
};
|
|
1204
1307
|
|
|
1205
|
-
EIGEN_DEVICE_FUNC
|
|
1308
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1309
|
+
explicit unary_evaluator(const XprType& replicate)
|
|
1206
1310
|
: m_arg(replicate.nestedExpression()),
|
|
1207
1311
|
m_argImpl(m_arg),
|
|
1208
1312
|
m_rows(replicate.nestedExpression().rows()),
|
|
1209
1313
|
m_cols(replicate.nestedExpression().cols())
|
|
1210
1314
|
{}
|
|
1211
|
-
|
|
1315
|
+
|
|
1212
1316
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1213
1317
|
CoeffReturnType coeff(Index row, Index col) const
|
|
1214
1318
|
{
|
|
@@ -1219,10 +1323,10 @@ struct unary_evaluator<Replicate<ArgType, RowFactor, ColFactor> >
|
|
|
1219
1323
|
const Index actual_col = internal::traits<XprType>::ColsAtCompileTime==1 ? 0
|
|
1220
1324
|
: ColFactor==1 ? col
|
|
1221
1325
|
: col % m_cols.value();
|
|
1222
|
-
|
|
1326
|
+
|
|
1223
1327
|
return m_argImpl.coeff(actual_row, actual_col);
|
|
1224
1328
|
}
|
|
1225
|
-
|
|
1329
|
+
|
|
1226
1330
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1227
1331
|
CoeffReturnType coeff(Index index) const
|
|
1228
1332
|
{
|
|
@@ -1230,7 +1334,7 @@ struct unary_evaluator<Replicate<ArgType, RowFactor, ColFactor> >
|
|
|
1230
1334
|
const Index actual_index = internal::traits<XprType>::RowsAtCompileTime==1
|
|
1231
1335
|
? (ColFactor==1 ? index : index%m_cols.value())
|
|
1232
1336
|
: (RowFactor==1 ? index : index%m_rows.value());
|
|
1233
|
-
|
|
1337
|
+
|
|
1234
1338
|
return m_argImpl.coeff(actual_index);
|
|
1235
1339
|
}
|
|
1236
1340
|
|
|
@@ -1247,7 +1351,7 @@ struct unary_evaluator<Replicate<ArgType, RowFactor, ColFactor> >
|
|
|
1247
1351
|
|
|
1248
1352
|
return m_argImpl.template packet<LoadMode,PacketType>(actual_row, actual_col);
|
|
1249
1353
|
}
|
|
1250
|
-
|
|
1354
|
+
|
|
1251
1355
|
template<int LoadMode, typename PacketType>
|
|
1252
1356
|
EIGEN_STRONG_INLINE
|
|
1253
1357
|
PacketType packet(Index index) const
|
|
@@ -1258,7 +1362,7 @@ struct unary_evaluator<Replicate<ArgType, RowFactor, ColFactor> >
|
|
|
1258
1362
|
|
|
1259
1363
|
return m_argImpl.template packet<LoadMode,PacketType>(actual_index);
|
|
1260
1364
|
}
|
|
1261
|
-
|
|
1365
|
+
|
|
1262
1366
|
protected:
|
|
1263
1367
|
const ArgTypeNested m_arg;
|
|
1264
1368
|
evaluator<ArgTypeNestedCleaned> m_argImpl;
|
|
@@ -1266,64 +1370,6 @@ protected:
|
|
|
1266
1370
|
const variable_if_dynamic<Index, ArgType::ColsAtCompileTime> m_cols;
|
|
1267
1371
|
};
|
|
1268
1372
|
|
|
1269
|
-
|
|
1270
|
-
// -------------------- PartialReduxExpr --------------------
|
|
1271
|
-
|
|
1272
|
-
template< typename ArgType, typename MemberOp, int Direction>
|
|
1273
|
-
struct evaluator<PartialReduxExpr<ArgType, MemberOp, Direction> >
|
|
1274
|
-
: evaluator_base<PartialReduxExpr<ArgType, MemberOp, Direction> >
|
|
1275
|
-
{
|
|
1276
|
-
typedef PartialReduxExpr<ArgType, MemberOp, Direction> XprType;
|
|
1277
|
-
typedef typename internal::nested_eval<ArgType,1>::type ArgTypeNested;
|
|
1278
|
-
typedef typename internal::remove_all<ArgTypeNested>::type ArgTypeNestedCleaned;
|
|
1279
|
-
typedef typename ArgType::Scalar InputScalar;
|
|
1280
|
-
typedef typename XprType::Scalar Scalar;
|
|
1281
|
-
enum {
|
|
1282
|
-
TraversalSize = Direction==int(Vertical) ? int(ArgType::RowsAtCompileTime) : int(ArgType::ColsAtCompileTime)
|
|
1283
|
-
};
|
|
1284
|
-
typedef typename MemberOp::template Cost<InputScalar,int(TraversalSize)> CostOpType;
|
|
1285
|
-
enum {
|
|
1286
|
-
CoeffReadCost = TraversalSize==Dynamic ? HugeCost
|
|
1287
|
-
: TraversalSize * evaluator<ArgType>::CoeffReadCost + int(CostOpType::value),
|
|
1288
|
-
|
|
1289
|
-
Flags = (traits<XprType>::Flags&RowMajorBit) | (evaluator<ArgType>::Flags&(HereditaryBits&(~RowMajorBit))) | LinearAccessBit,
|
|
1290
|
-
|
|
1291
|
-
Alignment = 0 // FIXME this will need to be improved once PartialReduxExpr is vectorized
|
|
1292
|
-
};
|
|
1293
|
-
|
|
1294
|
-
EIGEN_DEVICE_FUNC explicit evaluator(const XprType xpr)
|
|
1295
|
-
: m_arg(xpr.nestedExpression()), m_functor(xpr.functor())
|
|
1296
|
-
{
|
|
1297
|
-
EIGEN_INTERNAL_CHECK_COST_VALUE(TraversalSize==Dynamic ? HugeCost : int(CostOpType::value));
|
|
1298
|
-
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
|
1299
|
-
}
|
|
1300
|
-
|
|
1301
|
-
typedef typename XprType::CoeffReturnType CoeffReturnType;
|
|
1302
|
-
|
|
1303
|
-
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1304
|
-
const Scalar coeff(Index i, Index j) const
|
|
1305
|
-
{
|
|
1306
|
-
if (Direction==Vertical)
|
|
1307
|
-
return m_functor(m_arg.col(j));
|
|
1308
|
-
else
|
|
1309
|
-
return m_functor(m_arg.row(i));
|
|
1310
|
-
}
|
|
1311
|
-
|
|
1312
|
-
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1313
|
-
const Scalar coeff(Index index) const
|
|
1314
|
-
{
|
|
1315
|
-
if (Direction==Vertical)
|
|
1316
|
-
return m_functor(m_arg.col(index));
|
|
1317
|
-
else
|
|
1318
|
-
return m_functor(m_arg.row(index));
|
|
1319
|
-
}
|
|
1320
|
-
|
|
1321
|
-
protected:
|
|
1322
|
-
typename internal::add_const_on_value_type<ArgTypeNested>::type m_arg;
|
|
1323
|
-
const MemberOp m_functor;
|
|
1324
|
-
};
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
1373
|
// -------------------- MatrixWrapper and ArrayWrapper --------------------
|
|
1328
1374
|
//
|
|
1329
1375
|
// evaluator_wrapper_base<T> is a common base class for the
|
|
@@ -1340,7 +1386,8 @@ struct evaluator_wrapper_base
|
|
|
1340
1386
|
Alignment = evaluator<ArgType>::Alignment
|
|
1341
1387
|
};
|
|
1342
1388
|
|
|
1343
|
-
EIGEN_DEVICE_FUNC
|
|
1389
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1390
|
+
explicit evaluator_wrapper_base(const ArgType& arg) : m_argImpl(arg) {}
|
|
1344
1391
|
|
|
1345
1392
|
typedef typename ArgType::Scalar Scalar;
|
|
1346
1393
|
typedef typename ArgType::CoeffReturnType CoeffReturnType;
|
|
@@ -1407,7 +1454,8 @@ struct unary_evaluator<MatrixWrapper<TArgType> >
|
|
|
1407
1454
|
{
|
|
1408
1455
|
typedef MatrixWrapper<TArgType> XprType;
|
|
1409
1456
|
|
|
1410
|
-
EIGEN_DEVICE_FUNC
|
|
1457
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1458
|
+
explicit unary_evaluator(const XprType& wrapper)
|
|
1411
1459
|
: evaluator_wrapper_base<MatrixWrapper<TArgType> >(wrapper.nestedExpression())
|
|
1412
1460
|
{ }
|
|
1413
1461
|
};
|
|
@@ -1418,7 +1466,8 @@ struct unary_evaluator<ArrayWrapper<TArgType> >
|
|
|
1418
1466
|
{
|
|
1419
1467
|
typedef ArrayWrapper<TArgType> XprType;
|
|
1420
1468
|
|
|
1421
|
-
EIGEN_DEVICE_FUNC
|
|
1469
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1470
|
+
explicit unary_evaluator(const XprType& wrapper)
|
|
1422
1471
|
: evaluator_wrapper_base<ArrayWrapper<TArgType> >(wrapper.nestedExpression())
|
|
1423
1472
|
{ }
|
|
1424
1473
|
};
|
|
@@ -1445,9 +1494,9 @@ struct unary_evaluator<Reverse<ArgType, Direction> >
|
|
|
1445
1494
|
ReversePacket = (Direction == BothDirections)
|
|
1446
1495
|
|| ((Direction == Vertical) && IsColMajor)
|
|
1447
1496
|
|| ((Direction == Horizontal) && IsRowMajor),
|
|
1448
|
-
|
|
1497
|
+
|
|
1449
1498
|
CoeffReadCost = evaluator<ArgType>::CoeffReadCost,
|
|
1450
|
-
|
|
1499
|
+
|
|
1451
1500
|
// let's enable LinearAccess only with vectorization because of the product overhead
|
|
1452
1501
|
// FIXME enable DirectAccess with negative strides?
|
|
1453
1502
|
Flags0 = evaluator<ArgType>::Flags,
|
|
@@ -1456,16 +1505,17 @@ struct unary_evaluator<Reverse<ArgType, Direction> >
|
|
|
1456
1505
|
? LinearAccessBit : 0,
|
|
1457
1506
|
|
|
1458
1507
|
Flags = int(Flags0) & (HereditaryBits | PacketAccessBit | LinearAccess),
|
|
1459
|
-
|
|
1508
|
+
|
|
1460
1509
|
Alignment = 0 // FIXME in some rare cases, Alignment could be preserved, like a Vector4f.
|
|
1461
1510
|
};
|
|
1462
1511
|
|
|
1463
|
-
EIGEN_DEVICE_FUNC
|
|
1512
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1513
|
+
explicit unary_evaluator(const XprType& reverse)
|
|
1464
1514
|
: m_argImpl(reverse.nestedExpression()),
|
|
1465
1515
|
m_rows(ReverseRow ? reverse.nestedExpression().rows() : 1),
|
|
1466
1516
|
m_cols(ReverseCol ? reverse.nestedExpression().cols() : 1)
|
|
1467
1517
|
{ }
|
|
1468
|
-
|
|
1518
|
+
|
|
1469
1519
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1470
1520
|
CoeffReturnType coeff(Index row, Index col) const
|
|
1471
1521
|
{
|
|
@@ -1540,7 +1590,7 @@ struct unary_evaluator<Reverse<ArgType, Direction> >
|
|
|
1540
1590
|
m_argImpl.template writePacket<LoadMode>
|
|
1541
1591
|
(m_rows.value() * m_cols.value() - index - PacketSize, preverse(x));
|
|
1542
1592
|
}
|
|
1543
|
-
|
|
1593
|
+
|
|
1544
1594
|
protected:
|
|
1545
1595
|
evaluator<ArgType> m_argImpl;
|
|
1546
1596
|
|
|
@@ -1558,20 +1608,21 @@ struct evaluator<Diagonal<ArgType, DiagIndex> >
|
|
|
1558
1608
|
: evaluator_base<Diagonal<ArgType, DiagIndex> >
|
|
1559
1609
|
{
|
|
1560
1610
|
typedef Diagonal<ArgType, DiagIndex> XprType;
|
|
1561
|
-
|
|
1611
|
+
|
|
1562
1612
|
enum {
|
|
1563
1613
|
CoeffReadCost = evaluator<ArgType>::CoeffReadCost,
|
|
1564
|
-
|
|
1614
|
+
|
|
1565
1615
|
Flags = (unsigned int)(evaluator<ArgType>::Flags & (HereditaryBits | DirectAccessBit) & ~RowMajorBit) | LinearAccessBit,
|
|
1566
|
-
|
|
1616
|
+
|
|
1567
1617
|
Alignment = 0
|
|
1568
1618
|
};
|
|
1569
1619
|
|
|
1570
|
-
EIGEN_DEVICE_FUNC
|
|
1620
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1621
|
+
explicit evaluator(const XprType& diagonal)
|
|
1571
1622
|
: m_argImpl(diagonal.nestedExpression()),
|
|
1572
1623
|
m_index(diagonal.index())
|
|
1573
1624
|
{ }
|
|
1574
|
-
|
|
1625
|
+
|
|
1575
1626
|
typedef typename XprType::Scalar Scalar;
|
|
1576
1627
|
typedef typename XprType::CoeffReturnType CoeffReturnType;
|
|
1577
1628
|
|
|
@@ -1604,8 +1655,10 @@ protected:
|
|
|
1604
1655
|
const internal::variable_if_dynamicindex<Index, XprType::DiagIndex> m_index;
|
|
1605
1656
|
|
|
1606
1657
|
private:
|
|
1607
|
-
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
1608
|
-
|
|
1658
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
|
|
1659
|
+
Index rowOffset() const { return m_index.value() > 0 ? 0 : -m_index.value(); }
|
|
1660
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
|
|
1661
|
+
Index colOffset() const { return m_index.value() > 0 ? m_index.value() : 0; }
|
|
1609
1662
|
};
|
|
1610
1663
|
|
|
1611
1664
|
|
|
@@ -1629,25 +1682,25 @@ class EvalToTemp
|
|
|
1629
1682
|
: public dense_xpr_base<EvalToTemp<ArgType> >::type
|
|
1630
1683
|
{
|
|
1631
1684
|
public:
|
|
1632
|
-
|
|
1685
|
+
|
|
1633
1686
|
typedef typename dense_xpr_base<EvalToTemp>::type Base;
|
|
1634
1687
|
EIGEN_GENERIC_PUBLIC_INTERFACE(EvalToTemp)
|
|
1635
|
-
|
|
1688
|
+
|
|
1636
1689
|
explicit EvalToTemp(const ArgType& arg)
|
|
1637
1690
|
: m_arg(arg)
|
|
1638
1691
|
{ }
|
|
1639
|
-
|
|
1692
|
+
|
|
1640
1693
|
const ArgType& arg() const
|
|
1641
1694
|
{
|
|
1642
1695
|
return m_arg;
|
|
1643
1696
|
}
|
|
1644
1697
|
|
|
1645
|
-
Index rows() const
|
|
1698
|
+
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
|
|
1646
1699
|
{
|
|
1647
1700
|
return m_arg.rows();
|
|
1648
1701
|
}
|
|
1649
1702
|
|
|
1650
|
-
Index cols() const
|
|
1703
|
+
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
|
|
1651
1704
|
{
|
|
1652
1705
|
return m_arg.cols();
|
|
1653
1706
|
}
|
|
@@ -1655,7 +1708,7 @@ class EvalToTemp
|
|
|
1655
1708
|
private:
|
|
1656
1709
|
const ArgType& m_arg;
|
|
1657
1710
|
};
|
|
1658
|
-
|
|
1711
|
+
|
|
1659
1712
|
template<typename ArgType>
|
|
1660
1713
|
struct evaluator<EvalToTemp<ArgType> >
|
|
1661
1714
|
: public evaluator<typename ArgType::PlainObject>
|
|
@@ -1663,7 +1716,7 @@ struct evaluator<EvalToTemp<ArgType> >
|
|
|
1663
1716
|
typedef EvalToTemp<ArgType> XprType;
|
|
1664
1717
|
typedef typename ArgType::PlainObject PlainObject;
|
|
1665
1718
|
typedef evaluator<PlainObject> Base;
|
|
1666
|
-
|
|
1719
|
+
|
|
1667
1720
|
EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr)
|
|
1668
1721
|
: m_result(xpr.arg())
|
|
1669
1722
|
{
|