@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
|
@@ -66,21 +66,31 @@ namespace Eigen
|
|
|
66
66
|
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(sinh,scalar_sinh_op,hyperbolic sine,\sa ArrayBase::sinh)
|
|
67
67
|
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(cosh,scalar_cosh_op,hyperbolic cosine,\sa ArrayBase::cosh)
|
|
68
68
|
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(tanh,scalar_tanh_op,hyperbolic tangent,\sa ArrayBase::tanh)
|
|
69
|
+
#if EIGEN_HAS_CXX11_MATH
|
|
70
|
+
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(asinh,scalar_asinh_op,inverse hyperbolic sine,\sa ArrayBase::asinh)
|
|
71
|
+
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(acosh,scalar_acosh_op,inverse hyperbolic cosine,\sa ArrayBase::acosh)
|
|
72
|
+
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(atanh,scalar_atanh_op,inverse hyperbolic tangent,\sa ArrayBase::atanh)
|
|
73
|
+
#endif
|
|
74
|
+
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(logistic,scalar_logistic_op,logistic function,\sa ArrayBase::logistic)
|
|
69
75
|
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(lgamma,scalar_lgamma_op,natural logarithm of the gamma function,\sa ArrayBase::lgamma)
|
|
70
76
|
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(digamma,scalar_digamma_op,derivative of lgamma,\sa ArrayBase::digamma)
|
|
71
77
|
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(erf,scalar_erf_op,error function,\sa ArrayBase::erf)
|
|
72
78
|
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(erfc,scalar_erfc_op,complement error function,\sa ArrayBase::erfc)
|
|
79
|
+
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(ndtri,scalar_ndtri_op,inverse normal distribution function,\sa ArrayBase::ndtri)
|
|
73
80
|
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(exp,scalar_exp_op,exponential,\sa ArrayBase::exp)
|
|
81
|
+
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(expm1,scalar_expm1_op,exponential of a value minus 1,\sa ArrayBase::expm1)
|
|
74
82
|
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(log,scalar_log_op,natural logarithm,\sa Eigen::log10 DOXCOMMA ArrayBase::log)
|
|
75
83
|
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(log1p,scalar_log1p_op,natural logarithm of 1 plus the value,\sa ArrayBase::log1p)
|
|
76
|
-
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(log10,scalar_log10_op,base 10 logarithm,\sa Eigen::log DOXCOMMA ArrayBase::
|
|
84
|
+
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(log10,scalar_log10_op,base 10 logarithm,\sa Eigen::log DOXCOMMA ArrayBase::log10)
|
|
85
|
+
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(log2,scalar_log2_op,base 2 logarithm,\sa Eigen::log DOXCOMMA ArrayBase::log2)
|
|
77
86
|
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(abs,scalar_abs_op,absolute value,\sa ArrayBase::abs DOXCOMMA MatrixBase::cwiseAbs)
|
|
78
87
|
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(abs2,scalar_abs2_op,squared absolute value,\sa ArrayBase::abs2 DOXCOMMA MatrixBase::cwiseAbs2)
|
|
79
|
-
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(arg,scalar_arg_op,complex argument,\sa ArrayBase::arg)
|
|
88
|
+
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(arg,scalar_arg_op,complex argument,\sa ArrayBase::arg DOXCOMMA MatrixBase::cwiseArg)
|
|
80
89
|
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(sqrt,scalar_sqrt_op,square root,\sa ArrayBase::sqrt DOXCOMMA MatrixBase::cwiseSqrt)
|
|
81
90
|
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(rsqrt,scalar_rsqrt_op,reciprocal square root,\sa ArrayBase::rsqrt)
|
|
82
91
|
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(square,scalar_square_op,square (power 2),\sa Eigen::abs2 DOXCOMMA Eigen::pow DOXCOMMA ArrayBase::square)
|
|
83
92
|
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(cube,scalar_cube_op,cube (power 3),\sa Eigen::pow DOXCOMMA ArrayBase::cube)
|
|
93
|
+
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(rint,scalar_rint_op,nearest integer,\sa Eigen::floor DOXCOMMA Eigen::ceil DOXCOMMA ArrayBase::round)
|
|
84
94
|
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(round,scalar_round_op,nearest integer,\sa Eigen::floor DOXCOMMA Eigen::ceil DOXCOMMA ArrayBase::round)
|
|
85
95
|
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(floor,scalar_floor_op,nearest integer not greater than the giben value,\sa Eigen::ceil DOXCOMMA ArrayBase::floor)
|
|
86
96
|
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(ceil,scalar_ceil_op,nearest integer not less than the giben value,\sa Eigen::floor DOXCOMMA ArrayBase::ceil)
|
|
@@ -88,7 +98,7 @@ namespace Eigen
|
|
|
88
98
|
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(isinf,scalar_isinf_op,infinite value test,\sa Eigen::isnan DOXCOMMA Eigen::isfinite DOXCOMMA ArrayBase::isinf)
|
|
89
99
|
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(isfinite,scalar_isfinite_op,finite value test,\sa Eigen::isinf DOXCOMMA Eigen::isnan DOXCOMMA ArrayBase::isfinite)
|
|
90
100
|
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(sign,scalar_sign_op,sign (or 0),\sa ArrayBase::sign)
|
|
91
|
-
|
|
101
|
+
|
|
92
102
|
/** \returns an expression of the coefficient-wise power of \a x to the given constant \a exponent.
|
|
93
103
|
*
|
|
94
104
|
* \tparam ScalarExponent is the scalar type of \a exponent. It must be compatible with the scalar type of the given expression (\c Derived::Scalar).
|
|
@@ -102,17 +112,18 @@ namespace Eigen
|
|
|
102
112
|
inline const CwiseBinaryOp<internal::scalar_pow_op<Derived::Scalar,ScalarExponent>,Derived,Constant<ScalarExponent> >
|
|
103
113
|
pow(const Eigen::ArrayBase<Derived>& x, const ScalarExponent& exponent);
|
|
104
114
|
#else
|
|
105
|
-
template<typename Derived,typename ScalarExponent>
|
|
106
|
-
inline
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
return x.derived()
|
|
115
|
+
template <typename Derived,typename ScalarExponent>
|
|
116
|
+
EIGEN_DEVICE_FUNC inline
|
|
117
|
+
EIGEN_MSVC10_WORKAROUND_BINARYOP_RETURN_TYPE(
|
|
118
|
+
const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(Derived,typename internal::promote_scalar_arg<typename Derived::Scalar
|
|
119
|
+
EIGEN_COMMA ScalarExponent EIGEN_COMMA
|
|
120
|
+
EIGEN_SCALAR_BINARY_SUPPORTED(pow,typename Derived::Scalar,ScalarExponent)>::type,pow))
|
|
121
|
+
pow(const Eigen::ArrayBase<Derived>& x, const ScalarExponent& exponent)
|
|
122
|
+
{
|
|
123
|
+
typedef typename internal::promote_scalar_arg<typename Derived::Scalar,ScalarExponent,
|
|
124
|
+
EIGEN_SCALAR_BINARY_SUPPORTED(pow,typename Derived::Scalar,ScalarExponent)>::type PromotedExponent;
|
|
125
|
+
return EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(Derived,PromotedExponent,pow)(x.derived(),
|
|
126
|
+
typename internal::plain_constant_type<Derived,PromotedExponent>::type(x.derived().rows(), x.derived().cols(), internal::scalar_constant_op<PromotedExponent>(exponent)));
|
|
116
127
|
}
|
|
117
128
|
#endif
|
|
118
129
|
|
|
@@ -122,21 +133,21 @@ namespace Eigen
|
|
|
122
133
|
*
|
|
123
134
|
* Example: \include Cwise_array_power_array.cpp
|
|
124
135
|
* Output: \verbinclude Cwise_array_power_array.out
|
|
125
|
-
*
|
|
136
|
+
*
|
|
126
137
|
* \sa ArrayBase::pow()
|
|
127
138
|
*
|
|
128
139
|
* \relates ArrayBase
|
|
129
140
|
*/
|
|
130
141
|
template<typename Derived,typename ExponentDerived>
|
|
131
142
|
inline const Eigen::CwiseBinaryOp<Eigen::internal::scalar_pow_op<typename Derived::Scalar, typename ExponentDerived::Scalar>, const Derived, const ExponentDerived>
|
|
132
|
-
pow(const Eigen::ArrayBase<Derived>& x, const Eigen::ArrayBase<ExponentDerived>& exponents)
|
|
143
|
+
pow(const Eigen::ArrayBase<Derived>& x, const Eigen::ArrayBase<ExponentDerived>& exponents)
|
|
133
144
|
{
|
|
134
145
|
return Eigen::CwiseBinaryOp<Eigen::internal::scalar_pow_op<typename Derived::Scalar, typename ExponentDerived::Scalar>, const Derived, const ExponentDerived>(
|
|
135
146
|
x.derived(),
|
|
136
147
|
exponents.derived()
|
|
137
148
|
);
|
|
138
149
|
}
|
|
139
|
-
|
|
150
|
+
|
|
140
151
|
/** \returns an expression of the coefficient-wise power of the scalar \a x to the given array of \a exponents.
|
|
141
152
|
*
|
|
142
153
|
* This function computes the coefficient-wise power between a scalar and an array of exponents.
|
|
@@ -145,7 +156,7 @@ namespace Eigen
|
|
|
145
156
|
*
|
|
146
157
|
* Example: \include Cwise_scalar_power_array.cpp
|
|
147
158
|
* Output: \verbinclude Cwise_scalar_power_array.out
|
|
148
|
-
*
|
|
159
|
+
*
|
|
149
160
|
* \sa ArrayBase::pow()
|
|
150
161
|
*
|
|
151
162
|
* \relates ArrayBase
|
|
@@ -155,21 +166,17 @@ namespace Eigen
|
|
|
155
166
|
inline const CwiseBinaryOp<internal::scalar_pow_op<Scalar,Derived::Scalar>,Constant<Scalar>,Derived>
|
|
156
167
|
pow(const Scalar& x,const Eigen::ArrayBase<Derived>& x);
|
|
157
168
|
#else
|
|
158
|
-
template<typename Scalar, typename Derived>
|
|
159
|
-
inline
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
pow(const typename Derived::Scalar& x, const Eigen::ArrayBase<Derived>& exponents)
|
|
170
|
-
{
|
|
171
|
-
return EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(typename Derived::Scalar,Derived,pow)(
|
|
172
|
-
typename internal::plain_constant_type<Derived,typename Derived::Scalar>::type(exponents.rows(), exponents.cols(), x), exponents.derived() );
|
|
169
|
+
template <typename Scalar, typename Derived>
|
|
170
|
+
EIGEN_DEVICE_FUNC inline
|
|
171
|
+
EIGEN_MSVC10_WORKAROUND_BINARYOP_RETURN_TYPE(
|
|
172
|
+
const EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(typename internal::promote_scalar_arg<typename Derived::Scalar
|
|
173
|
+
EIGEN_COMMA Scalar EIGEN_COMMA
|
|
174
|
+
EIGEN_SCALAR_BINARY_SUPPORTED(pow,Scalar,typename Derived::Scalar)>::type,Derived,pow))
|
|
175
|
+
pow(const Scalar& x, const Eigen::ArrayBase<Derived>& exponents) {
|
|
176
|
+
typedef typename internal::promote_scalar_arg<typename Derived::Scalar,Scalar,
|
|
177
|
+
EIGEN_SCALAR_BINARY_SUPPORTED(pow,Scalar,typename Derived::Scalar)>::type PromotedScalar;
|
|
178
|
+
return EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(PromotedScalar,Derived,pow)(
|
|
179
|
+
typename internal::plain_constant_type<Derived,PromotedScalar>::type(exponents.derived().rows(), exponents.derived().cols(), internal::scalar_constant_op<PromotedScalar>(x)), exponents.derived());
|
|
173
180
|
}
|
|
174
181
|
#endif
|
|
175
182
|
|
|
@@ -41,6 +41,7 @@ std::ostream & print_matrix(std::ostream & s, const Derived& _m, const IOFormat&
|
|
|
41
41
|
* - \b rowSuffix string printed at the end of each row
|
|
42
42
|
* - \b matPrefix string printed at the beginning of the matrix
|
|
43
43
|
* - \b matSuffix string printed at the end of the matrix
|
|
44
|
+
* - \b fill character printed to fill the empty space in aligned columns
|
|
44
45
|
*
|
|
45
46
|
* Example: \include IOFormat.cpp
|
|
46
47
|
* Output: \verbinclude IOFormat.out
|
|
@@ -53,9 +54,9 @@ struct IOFormat
|
|
|
53
54
|
IOFormat(int _precision = StreamPrecision, int _flags = 0,
|
|
54
55
|
const std::string& _coeffSeparator = " ",
|
|
55
56
|
const std::string& _rowSeparator = "\n", const std::string& _rowPrefix="", const std::string& _rowSuffix="",
|
|
56
|
-
const std::string& _matPrefix="", const std::string& _matSuffix="")
|
|
57
|
+
const std::string& _matPrefix="", const std::string& _matSuffix="", const char _fill=' ')
|
|
57
58
|
: matPrefix(_matPrefix), matSuffix(_matSuffix), rowPrefix(_rowPrefix), rowSuffix(_rowSuffix), rowSeparator(_rowSeparator),
|
|
58
|
-
rowSpacer(""), coeffSeparator(_coeffSeparator), precision(_precision), flags(_flags)
|
|
59
|
+
rowSpacer(""), coeffSeparator(_coeffSeparator), fill(_fill), precision(_precision), flags(_flags)
|
|
59
60
|
{
|
|
60
61
|
// TODO check if rowPrefix, rowSuffix or rowSeparator contains a newline
|
|
61
62
|
// don't add rowSpacer if columns are not to be aligned
|
|
@@ -71,6 +72,7 @@ struct IOFormat
|
|
|
71
72
|
std::string matPrefix, matSuffix;
|
|
72
73
|
std::string rowPrefix, rowSuffix, rowSeparator, rowSpacer;
|
|
73
74
|
std::string coeffSeparator;
|
|
75
|
+
char fill;
|
|
74
76
|
int precision;
|
|
75
77
|
int flags;
|
|
76
78
|
};
|
|
@@ -128,6 +130,9 @@ struct significant_decimals_impl
|
|
|
128
130
|
template<typename Derived>
|
|
129
131
|
std::ostream & print_matrix(std::ostream & s, const Derived& _m, const IOFormat& fmt)
|
|
130
132
|
{
|
|
133
|
+
using internal::is_same;
|
|
134
|
+
using internal::conditional;
|
|
135
|
+
|
|
131
136
|
if(_m.size() == 0)
|
|
132
137
|
{
|
|
133
138
|
s << fmt.matPrefix << fmt.matSuffix;
|
|
@@ -136,6 +141,22 @@ std::ostream & print_matrix(std::ostream & s, const Derived& _m, const IOFormat&
|
|
|
136
141
|
|
|
137
142
|
typename Derived::Nested m = _m;
|
|
138
143
|
typedef typename Derived::Scalar Scalar;
|
|
144
|
+
typedef typename
|
|
145
|
+
conditional<
|
|
146
|
+
is_same<Scalar, char>::value ||
|
|
147
|
+
is_same<Scalar, unsigned char>::value ||
|
|
148
|
+
is_same<Scalar, numext::int8_t>::value ||
|
|
149
|
+
is_same<Scalar, numext::uint8_t>::value,
|
|
150
|
+
int,
|
|
151
|
+
typename conditional<
|
|
152
|
+
is_same<Scalar, std::complex<char> >::value ||
|
|
153
|
+
is_same<Scalar, std::complex<unsigned char> >::value ||
|
|
154
|
+
is_same<Scalar, std::complex<numext::int8_t> >::value ||
|
|
155
|
+
is_same<Scalar, std::complex<numext::uint8_t> >::value,
|
|
156
|
+
std::complex<int>,
|
|
157
|
+
const Scalar&
|
|
158
|
+
>::type
|
|
159
|
+
>::type PrintType;
|
|
139
160
|
|
|
140
161
|
Index width = 0;
|
|
141
162
|
|
|
@@ -172,23 +193,31 @@ std::ostream & print_matrix(std::ostream & s, const Derived& _m, const IOFormat&
|
|
|
172
193
|
{
|
|
173
194
|
std::stringstream sstr;
|
|
174
195
|
sstr.copyfmt(s);
|
|
175
|
-
sstr << m.coeff(i,j);
|
|
196
|
+
sstr << static_cast<PrintType>(m.coeff(i,j));
|
|
176
197
|
width = std::max<Index>(width, Index(sstr.str().length()));
|
|
177
198
|
}
|
|
178
199
|
}
|
|
200
|
+
std::streamsize old_width = s.width();
|
|
201
|
+
char old_fill_character = s.fill();
|
|
179
202
|
s << fmt.matPrefix;
|
|
180
203
|
for(Index i = 0; i < m.rows(); ++i)
|
|
181
204
|
{
|
|
182
205
|
if (i)
|
|
183
206
|
s << fmt.rowSpacer;
|
|
184
207
|
s << fmt.rowPrefix;
|
|
185
|
-
if(width)
|
|
186
|
-
|
|
208
|
+
if(width) {
|
|
209
|
+
s.fill(fmt.fill);
|
|
210
|
+
s.width(width);
|
|
211
|
+
}
|
|
212
|
+
s << static_cast<PrintType>(m.coeff(i, 0));
|
|
187
213
|
for(Index j = 1; j < m.cols(); ++j)
|
|
188
214
|
{
|
|
189
215
|
s << fmt.coeffSeparator;
|
|
190
|
-
if
|
|
191
|
-
|
|
216
|
+
if(width) {
|
|
217
|
+
s.fill(fmt.fill);
|
|
218
|
+
s.width(width);
|
|
219
|
+
}
|
|
220
|
+
s << static_cast<PrintType>(m.coeff(i, j));
|
|
192
221
|
}
|
|
193
222
|
s << fmt.rowSuffix;
|
|
194
223
|
if( i < m.rows() - 1)
|
|
@@ -196,6 +225,10 @@ std::ostream & print_matrix(std::ostream & s, const Derived& _m, const IOFormat&
|
|
|
196
225
|
}
|
|
197
226
|
s << fmt.matSuffix;
|
|
198
227
|
if(explicit_precision) s.precision(old_precision);
|
|
228
|
+
if(width) {
|
|
229
|
+
s.fill(old_fill_character);
|
|
230
|
+
s.width(old_width);
|
|
231
|
+
}
|
|
199
232
|
return s;
|
|
200
233
|
}
|
|
201
234
|
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
|
2
|
+
// for linear algebra.
|
|
3
|
+
//
|
|
4
|
+
// Copyright (C) 2017 Gael Guennebaud <gael.guennebaud@inria.fr>
|
|
5
|
+
//
|
|
6
|
+
// This Source Code Form is subject to the terms of the Mozilla
|
|
7
|
+
// Public License v. 2.0. If a copy of the MPL was not distributed
|
|
8
|
+
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
9
|
+
|
|
10
|
+
#ifndef EIGEN_INDEXED_VIEW_H
|
|
11
|
+
#define EIGEN_INDEXED_VIEW_H
|
|
12
|
+
|
|
13
|
+
namespace Eigen {
|
|
14
|
+
|
|
15
|
+
namespace internal {
|
|
16
|
+
|
|
17
|
+
template<typename XprType, typename RowIndices, typename ColIndices>
|
|
18
|
+
struct traits<IndexedView<XprType, RowIndices, ColIndices> >
|
|
19
|
+
: traits<XprType>
|
|
20
|
+
{
|
|
21
|
+
enum {
|
|
22
|
+
RowsAtCompileTime = int(array_size<RowIndices>::value),
|
|
23
|
+
ColsAtCompileTime = int(array_size<ColIndices>::value),
|
|
24
|
+
MaxRowsAtCompileTime = RowsAtCompileTime != Dynamic ? int(RowsAtCompileTime) : Dynamic,
|
|
25
|
+
MaxColsAtCompileTime = ColsAtCompileTime != Dynamic ? int(ColsAtCompileTime) : Dynamic,
|
|
26
|
+
|
|
27
|
+
XprTypeIsRowMajor = (int(traits<XprType>::Flags)&RowMajorBit) != 0,
|
|
28
|
+
IsRowMajor = (MaxRowsAtCompileTime==1&&MaxColsAtCompileTime!=1) ? 1
|
|
29
|
+
: (MaxColsAtCompileTime==1&&MaxRowsAtCompileTime!=1) ? 0
|
|
30
|
+
: XprTypeIsRowMajor,
|
|
31
|
+
|
|
32
|
+
RowIncr = int(get_compile_time_incr<RowIndices>::value),
|
|
33
|
+
ColIncr = int(get_compile_time_incr<ColIndices>::value),
|
|
34
|
+
InnerIncr = IsRowMajor ? ColIncr : RowIncr,
|
|
35
|
+
OuterIncr = IsRowMajor ? RowIncr : ColIncr,
|
|
36
|
+
|
|
37
|
+
HasSameStorageOrderAsXprType = (IsRowMajor == XprTypeIsRowMajor),
|
|
38
|
+
XprInnerStride = HasSameStorageOrderAsXprType ? int(inner_stride_at_compile_time<XprType>::ret) : int(outer_stride_at_compile_time<XprType>::ret),
|
|
39
|
+
XprOuterstride = HasSameStorageOrderAsXprType ? int(outer_stride_at_compile_time<XprType>::ret) : int(inner_stride_at_compile_time<XprType>::ret),
|
|
40
|
+
|
|
41
|
+
InnerSize = XprTypeIsRowMajor ? ColsAtCompileTime : RowsAtCompileTime,
|
|
42
|
+
IsBlockAlike = InnerIncr==1 && OuterIncr==1,
|
|
43
|
+
IsInnerPannel = HasSameStorageOrderAsXprType && is_same<AllRange<InnerSize>,typename conditional<XprTypeIsRowMajor,ColIndices,RowIndices>::type>::value,
|
|
44
|
+
|
|
45
|
+
InnerStrideAtCompileTime = InnerIncr<0 || InnerIncr==DynamicIndex || XprInnerStride==Dynamic ? Dynamic : XprInnerStride * InnerIncr,
|
|
46
|
+
OuterStrideAtCompileTime = OuterIncr<0 || OuterIncr==DynamicIndex || XprOuterstride==Dynamic ? Dynamic : XprOuterstride * OuterIncr,
|
|
47
|
+
|
|
48
|
+
ReturnAsScalar = is_same<RowIndices,SingleRange>::value && is_same<ColIndices,SingleRange>::value,
|
|
49
|
+
ReturnAsBlock = (!ReturnAsScalar) && IsBlockAlike,
|
|
50
|
+
ReturnAsIndexedView = (!ReturnAsScalar) && (!ReturnAsBlock),
|
|
51
|
+
|
|
52
|
+
// FIXME we deal with compile-time strides if and only if we have DirectAccessBit flag,
|
|
53
|
+
// but this is too strict regarding negative strides...
|
|
54
|
+
DirectAccessMask = (int(InnerIncr)!=UndefinedIncr && int(OuterIncr)!=UndefinedIncr && InnerIncr>=0 && OuterIncr>=0) ? DirectAccessBit : 0,
|
|
55
|
+
FlagsRowMajorBit = IsRowMajor ? RowMajorBit : 0,
|
|
56
|
+
FlagsLvalueBit = is_lvalue<XprType>::value ? LvalueBit : 0,
|
|
57
|
+
FlagsLinearAccessBit = (RowsAtCompileTime == 1 || ColsAtCompileTime == 1) ? LinearAccessBit : 0,
|
|
58
|
+
Flags = (traits<XprType>::Flags & (HereditaryBits | DirectAccessMask )) | FlagsLvalueBit | FlagsRowMajorBit | FlagsLinearAccessBit
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
typedef Block<XprType,RowsAtCompileTime,ColsAtCompileTime,IsInnerPannel> BlockType;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
template<typename XprType, typename RowIndices, typename ColIndices, typename StorageKind>
|
|
67
|
+
class IndexedViewImpl;
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
/** \class IndexedView
|
|
71
|
+
* \ingroup Core_Module
|
|
72
|
+
*
|
|
73
|
+
* \brief Expression of a non-sequential sub-matrix defined by arbitrary sequences of row and column indices
|
|
74
|
+
*
|
|
75
|
+
* \tparam XprType the type of the expression in which we are taking the intersections of sub-rows and sub-columns
|
|
76
|
+
* \tparam RowIndices the type of the object defining the sequence of row indices
|
|
77
|
+
* \tparam ColIndices the type of the object defining the sequence of column indices
|
|
78
|
+
*
|
|
79
|
+
* This class represents an expression of a sub-matrix (or sub-vector) defined as the intersection
|
|
80
|
+
* of sub-sets of rows and columns, that are themself defined by generic sequences of row indices \f$ \{r_0,r_1,..r_{m-1}\} \f$
|
|
81
|
+
* and column indices \f$ \{c_0,c_1,..c_{n-1} \}\f$. Let \f$ A \f$ be the nested matrix, then the resulting matrix \f$ B \f$ has \c m
|
|
82
|
+
* rows and \c n columns, and its entries are given by: \f$ B(i,j) = A(r_i,c_j) \f$.
|
|
83
|
+
*
|
|
84
|
+
* The \c RowIndices and \c ColIndices types must be compatible with the following API:
|
|
85
|
+
* \code
|
|
86
|
+
* <integral type> operator[](Index) const;
|
|
87
|
+
* Index size() const;
|
|
88
|
+
* \endcode
|
|
89
|
+
*
|
|
90
|
+
* Typical supported types thus include:
|
|
91
|
+
* - std::vector<int>
|
|
92
|
+
* - std::valarray<int>
|
|
93
|
+
* - std::array<int>
|
|
94
|
+
* - Plain C arrays: int[N]
|
|
95
|
+
* - Eigen::ArrayXi
|
|
96
|
+
* - decltype(ArrayXi::LinSpaced(...))
|
|
97
|
+
* - Any view/expressions of the previous types
|
|
98
|
+
* - Eigen::ArithmeticSequence
|
|
99
|
+
* - Eigen::internal::AllRange (helper for Eigen::all)
|
|
100
|
+
* - Eigen::internal::SingleRange (helper for single index)
|
|
101
|
+
* - etc.
|
|
102
|
+
*
|
|
103
|
+
* In typical usages of %Eigen, this class should never be used directly. It is the return type of
|
|
104
|
+
* DenseBase::operator()(const RowIndices&, const ColIndices&).
|
|
105
|
+
*
|
|
106
|
+
* \sa class Block
|
|
107
|
+
*/
|
|
108
|
+
template<typename XprType, typename RowIndices, typename ColIndices>
|
|
109
|
+
class IndexedView : public IndexedViewImpl<XprType, RowIndices, ColIndices, typename internal::traits<XprType>::StorageKind>
|
|
110
|
+
{
|
|
111
|
+
public:
|
|
112
|
+
typedef typename IndexedViewImpl<XprType, RowIndices, ColIndices, typename internal::traits<XprType>::StorageKind>::Base Base;
|
|
113
|
+
EIGEN_GENERIC_PUBLIC_INTERFACE(IndexedView)
|
|
114
|
+
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(IndexedView)
|
|
115
|
+
|
|
116
|
+
typedef typename internal::ref_selector<XprType>::non_const_type MatrixTypeNested;
|
|
117
|
+
typedef typename internal::remove_all<XprType>::type NestedExpression;
|
|
118
|
+
|
|
119
|
+
template<typename T0, typename T1>
|
|
120
|
+
IndexedView(XprType& xpr, const T0& rowIndices, const T1& colIndices)
|
|
121
|
+
: m_xpr(xpr), m_rowIndices(rowIndices), m_colIndices(colIndices)
|
|
122
|
+
{}
|
|
123
|
+
|
|
124
|
+
/** \returns number of rows */
|
|
125
|
+
Index rows() const { return internal::size(m_rowIndices); }
|
|
126
|
+
|
|
127
|
+
/** \returns number of columns */
|
|
128
|
+
Index cols() const { return internal::size(m_colIndices); }
|
|
129
|
+
|
|
130
|
+
/** \returns the nested expression */
|
|
131
|
+
const typename internal::remove_all<XprType>::type&
|
|
132
|
+
nestedExpression() const { return m_xpr; }
|
|
133
|
+
|
|
134
|
+
/** \returns the nested expression */
|
|
135
|
+
typename internal::remove_reference<XprType>::type&
|
|
136
|
+
nestedExpression() { return m_xpr; }
|
|
137
|
+
|
|
138
|
+
/** \returns a const reference to the object storing/generating the row indices */
|
|
139
|
+
const RowIndices& rowIndices() const { return m_rowIndices; }
|
|
140
|
+
|
|
141
|
+
/** \returns a const reference to the object storing/generating the column indices */
|
|
142
|
+
const ColIndices& colIndices() const { return m_colIndices; }
|
|
143
|
+
|
|
144
|
+
protected:
|
|
145
|
+
MatrixTypeNested m_xpr;
|
|
146
|
+
RowIndices m_rowIndices;
|
|
147
|
+
ColIndices m_colIndices;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
// Generic API dispatcher
|
|
152
|
+
template<typename XprType, typename RowIndices, typename ColIndices, typename StorageKind>
|
|
153
|
+
class IndexedViewImpl
|
|
154
|
+
: public internal::generic_xpr_base<IndexedView<XprType, RowIndices, ColIndices> >::type
|
|
155
|
+
{
|
|
156
|
+
public:
|
|
157
|
+
typedef typename internal::generic_xpr_base<IndexedView<XprType, RowIndices, ColIndices> >::type Base;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
namespace internal {
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
template<typename ArgType, typename RowIndices, typename ColIndices>
|
|
164
|
+
struct unary_evaluator<IndexedView<ArgType, RowIndices, ColIndices>, IndexBased>
|
|
165
|
+
: evaluator_base<IndexedView<ArgType, RowIndices, ColIndices> >
|
|
166
|
+
{
|
|
167
|
+
typedef IndexedView<ArgType, RowIndices, ColIndices> XprType;
|
|
168
|
+
|
|
169
|
+
enum {
|
|
170
|
+
CoeffReadCost = evaluator<ArgType>::CoeffReadCost /* TODO + cost of row/col index */,
|
|
171
|
+
|
|
172
|
+
FlagsLinearAccessBit = (traits<XprType>::RowsAtCompileTime == 1 || traits<XprType>::ColsAtCompileTime == 1) ? LinearAccessBit : 0,
|
|
173
|
+
|
|
174
|
+
FlagsRowMajorBit = traits<XprType>::FlagsRowMajorBit,
|
|
175
|
+
|
|
176
|
+
Flags = (evaluator<ArgType>::Flags & (HereditaryBits & ~RowMajorBit /*| LinearAccessBit | DirectAccessBit*/)) | FlagsLinearAccessBit | FlagsRowMajorBit,
|
|
177
|
+
|
|
178
|
+
Alignment = 0
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
EIGEN_DEVICE_FUNC explicit unary_evaluator(const XprType& xpr) : m_argImpl(xpr.nestedExpression()), m_xpr(xpr)
|
|
182
|
+
{
|
|
183
|
+
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
typedef typename XprType::Scalar Scalar;
|
|
187
|
+
typedef typename XprType::CoeffReturnType CoeffReturnType;
|
|
188
|
+
|
|
189
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
190
|
+
CoeffReturnType coeff(Index row, Index col) const
|
|
191
|
+
{
|
|
192
|
+
return m_argImpl.coeff(m_xpr.rowIndices()[row], m_xpr.colIndices()[col]);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
196
|
+
Scalar& coeffRef(Index row, Index col)
|
|
197
|
+
{
|
|
198
|
+
return m_argImpl.coeffRef(m_xpr.rowIndices()[row], m_xpr.colIndices()[col]);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
202
|
+
Scalar& coeffRef(Index index)
|
|
203
|
+
{
|
|
204
|
+
EIGEN_STATIC_ASSERT_LVALUE(XprType)
|
|
205
|
+
Index row = XprType::RowsAtCompileTime == 1 ? 0 : index;
|
|
206
|
+
Index col = XprType::RowsAtCompileTime == 1 ? index : 0;
|
|
207
|
+
return m_argImpl.coeffRef( m_xpr.rowIndices()[row], m_xpr.colIndices()[col]);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
211
|
+
const Scalar& coeffRef(Index index) const
|
|
212
|
+
{
|
|
213
|
+
Index row = XprType::RowsAtCompileTime == 1 ? 0 : index;
|
|
214
|
+
Index col = XprType::RowsAtCompileTime == 1 ? index : 0;
|
|
215
|
+
return m_argImpl.coeffRef( m_xpr.rowIndices()[row], m_xpr.colIndices()[col]);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
219
|
+
const CoeffReturnType coeff(Index index) const
|
|
220
|
+
{
|
|
221
|
+
Index row = XprType::RowsAtCompileTime == 1 ? 0 : index;
|
|
222
|
+
Index col = XprType::RowsAtCompileTime == 1 ? index : 0;
|
|
223
|
+
return m_argImpl.coeff( m_xpr.rowIndices()[row], m_xpr.colIndices()[col]);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
protected:
|
|
227
|
+
|
|
228
|
+
evaluator<ArgType> m_argImpl;
|
|
229
|
+
const XprType& m_xpr;
|
|
230
|
+
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
} // end namespace internal
|
|
234
|
+
|
|
235
|
+
} // end namespace Eigen
|
|
236
|
+
|
|
237
|
+
#endif // EIGEN_INDEXED_VIEW_H
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// This file is part of Eigen, a lightweight C++ template library
|
|
2
2
|
// for linear algebra.
|
|
3
3
|
//
|
|
4
|
-
// Copyright (C) 2014 Gael Guennebaud <gael.guennebaud@inria.fr>
|
|
4
|
+
// Copyright (C) 2014-2019 Gael Guennebaud <gael.guennebaud@inria.fr>
|
|
5
5
|
//
|
|
6
6
|
// This Source Code Form is subject to the terms of the Mozilla
|
|
7
7
|
// Public License v. 2.0. If a copy of the MPL was not distributed
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
#ifndef EIGEN_INVERSE_H
|
|
11
11
|
#define EIGEN_INVERSE_H
|
|
12
12
|
|
|
13
|
-
namespace Eigen {
|
|
13
|
+
namespace Eigen {
|
|
14
14
|
|
|
15
15
|
template<typename XprType,typename StorageKind> class InverseImpl;
|
|
16
16
|
|
|
@@ -44,19 +44,18 @@ class Inverse : public InverseImpl<XprType,typename internal::traits<XprType>::S
|
|
|
44
44
|
{
|
|
45
45
|
public:
|
|
46
46
|
typedef typename XprType::StorageIndex StorageIndex;
|
|
47
|
-
typedef typename XprType::PlainObject PlainObject;
|
|
48
47
|
typedef typename XprType::Scalar Scalar;
|
|
49
48
|
typedef typename internal::ref_selector<XprType>::type XprTypeNested;
|
|
50
49
|
typedef typename internal::remove_all<XprTypeNested>::type XprTypeNestedCleaned;
|
|
51
50
|
typedef typename internal::ref_selector<Inverse>::type Nested;
|
|
52
51
|
typedef typename internal::remove_all<XprType>::type NestedExpression;
|
|
53
|
-
|
|
52
|
+
|
|
54
53
|
explicit EIGEN_DEVICE_FUNC Inverse(const XprType &xpr)
|
|
55
54
|
: m_xpr(xpr)
|
|
56
55
|
{}
|
|
57
56
|
|
|
58
|
-
EIGEN_DEVICE_FUNC Index rows() const { return m_xpr.
|
|
59
|
-
EIGEN_DEVICE_FUNC Index cols() const { return m_xpr.
|
|
57
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_xpr.cols(); }
|
|
58
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_xpr.rows(); }
|
|
60
59
|
|
|
61
60
|
EIGEN_DEVICE_FUNC const XprTypeNestedCleaned& nestedExpression() const { return m_xpr; }
|
|
62
61
|
|
|
@@ -82,7 +81,7 @@ namespace internal {
|
|
|
82
81
|
|
|
83
82
|
/** \internal
|
|
84
83
|
* \brief Default evaluator for Inverse expression.
|
|
85
|
-
*
|
|
84
|
+
*
|
|
86
85
|
* This default evaluator for Inverse expression simply evaluate the inverse into a temporary
|
|
87
86
|
* by a call to internal::call_assignment_no_alias.
|
|
88
87
|
* Therefore, inverse implementers only have to specialize Assignment<Dst,Inverse<...>, ...> for
|
|
@@ -97,7 +96,7 @@ struct unary_evaluator<Inverse<ArgType> >
|
|
|
97
96
|
typedef Inverse<ArgType> InverseType;
|
|
98
97
|
typedef typename InverseType::PlainObject PlainObject;
|
|
99
98
|
typedef evaluator<PlainObject> Base;
|
|
100
|
-
|
|
99
|
+
|
|
101
100
|
enum { Flags = Base::Flags | EvalBeforeNestingBit };
|
|
102
101
|
|
|
103
102
|
unary_evaluator(const InverseType& inv_xpr)
|
|
@@ -106,11 +105,11 @@ struct unary_evaluator<Inverse<ArgType> >
|
|
|
106
105
|
::new (static_cast<Base*>(this)) Base(m_result);
|
|
107
106
|
internal::call_assignment_no_alias(m_result, inv_xpr);
|
|
108
107
|
}
|
|
109
|
-
|
|
108
|
+
|
|
110
109
|
protected:
|
|
111
110
|
PlainObject m_result;
|
|
112
111
|
};
|
|
113
|
-
|
|
112
|
+
|
|
114
113
|
} // end namespace internal
|
|
115
114
|
|
|
116
115
|
} // end namespace Eigen
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#ifndef EIGEN_MAP_H
|
|
12
12
|
#define EIGEN_MAP_H
|
|
13
13
|
|
|
14
|
-
namespace Eigen {
|
|
14
|
+
namespace Eigen {
|
|
15
15
|
|
|
16
16
|
namespace internal {
|
|
17
17
|
template<typename PlainObjectType, int MapOptions, typename StrideType>
|
|
@@ -47,7 +47,7 @@ private:
|
|
|
47
47
|
* \brief A matrix or vector expression mapping an existing array of data.
|
|
48
48
|
*
|
|
49
49
|
* \tparam PlainObjectType the equivalent matrix type of the mapped data
|
|
50
|
-
* \tparam MapOptions specifies the pointer alignment in bytes. It can be: \c #Aligned128,
|
|
50
|
+
* \tparam MapOptions specifies the pointer alignment in bytes. It can be: \c #Aligned128, \c #Aligned64, \c #Aligned32, \c #Aligned16, \c #Aligned8 or \c #Unaligned.
|
|
51
51
|
* The default is \c #Unaligned.
|
|
52
52
|
* \tparam StrideType optionally specifies strides. By default, Map assumes the memory layout
|
|
53
53
|
* of an ordinary, contiguous array. This can be overridden by specifying strides.
|
|
@@ -104,19 +104,19 @@ template<typename PlainObjectType, int MapOptions, typename StrideType> class Ma
|
|
|
104
104
|
EIGEN_DEVICE_FUNC
|
|
105
105
|
inline PointerType cast_to_pointer_type(PointerArgType ptr) { return ptr; }
|
|
106
106
|
|
|
107
|
-
EIGEN_DEVICE_FUNC
|
|
107
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
108
108
|
inline Index innerStride() const
|
|
109
109
|
{
|
|
110
110
|
return StrideType::InnerStrideAtCompileTime != 0 ? m_stride.inner() : 1;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
EIGEN_DEVICE_FUNC
|
|
113
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
114
114
|
inline Index outerStride() const
|
|
115
115
|
{
|
|
116
|
-
return
|
|
117
|
-
:
|
|
116
|
+
return StrideType::OuterStrideAtCompileTime != 0 ? m_stride.outer()
|
|
117
|
+
: internal::traits<Map>::OuterStrideAtCompileTime != Dynamic ? Index(internal::traits<Map>::OuterStrideAtCompileTime)
|
|
118
118
|
: IsVectorAtCompileTime ? (this->size() * innerStride())
|
|
119
|
-
:
|
|
119
|
+
: int(Flags)&RowMajorBit ? (this->cols() * innerStride())
|
|
120
120
|
: (this->rows() * innerStride());
|
|
121
121
|
}
|
|
122
122
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
EIGEN_STATIC_ASSERT((int(internal::evaluator<Derived>::Flags) & LinearAccessBit) || Derived::IsVectorAtCompileTime, \
|
|
16
16
|
YOU_ARE_TRYING_TO_USE_AN_INDEX_BASED_ACCESSOR_ON_AN_EXPRESSION_THAT_DOES_NOT_SUPPORT_THAT)
|
|
17
17
|
|
|
18
|
-
namespace Eigen {
|
|
18
|
+
namespace Eigen {
|
|
19
19
|
|
|
20
20
|
/** \ingroup Core_Module
|
|
21
21
|
*
|
|
@@ -87,9 +87,11 @@ template<typename Derived> class MapBase<Derived, ReadOnlyAccessors>
|
|
|
87
87
|
typedef typename Base::CoeffReturnType CoeffReturnType;
|
|
88
88
|
|
|
89
89
|
/** \copydoc DenseBase::rows() */
|
|
90
|
-
EIGEN_DEVICE_FUNC
|
|
90
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
91
|
+
inline Index rows() const EIGEN_NOEXCEPT { return m_rows.value(); }
|
|
91
92
|
/** \copydoc DenseBase::cols() */
|
|
92
|
-
EIGEN_DEVICE_FUNC
|
|
93
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
94
|
+
inline Index cols() const EIGEN_NOEXCEPT { return m_cols.value(); }
|
|
93
95
|
|
|
94
96
|
/** Returns a pointer to the first coefficient of the matrix or vector.
|
|
95
97
|
*
|