@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
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
|
|
11
|
+
#ifndef EIGEN_RESHAPED_HELPER_H
|
|
12
|
+
#define EIGEN_RESHAPED_HELPER_H
|
|
13
|
+
|
|
14
|
+
namespace Eigen {
|
|
15
|
+
|
|
16
|
+
enum AutoSize_t { AutoSize };
|
|
17
|
+
const int AutoOrder = 2;
|
|
18
|
+
|
|
19
|
+
namespace internal {
|
|
20
|
+
|
|
21
|
+
template<typename SizeType,typename OtherSize, int TotalSize>
|
|
22
|
+
struct get_compiletime_reshape_size {
|
|
23
|
+
enum { value = get_fixed_value<SizeType>::value };
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
template<typename SizeType>
|
|
27
|
+
Index get_runtime_reshape_size(SizeType size, Index /*other*/, Index /*total*/) {
|
|
28
|
+
return internal::get_runtime_value(size);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
template<typename OtherSize, int TotalSize>
|
|
32
|
+
struct get_compiletime_reshape_size<AutoSize_t,OtherSize,TotalSize> {
|
|
33
|
+
enum {
|
|
34
|
+
other_size = get_fixed_value<OtherSize>::value,
|
|
35
|
+
value = (TotalSize==Dynamic || other_size==Dynamic) ? Dynamic : TotalSize / other_size };
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
inline Index get_runtime_reshape_size(AutoSize_t /*size*/, Index other, Index total) {
|
|
39
|
+
return total/other;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
template<int Flags, int Order>
|
|
43
|
+
struct get_compiletime_reshape_order {
|
|
44
|
+
enum { value = Order == AutoOrder ? Flags & RowMajorBit : Order };
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
} // end namespace Eigen
|
|
50
|
+
|
|
51
|
+
#endif // EIGEN_RESHAPED_HELPER_H
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
#ifndef EIGEN_STATIC_ASSERT
|
|
28
28
|
#ifndef EIGEN_NO_STATIC_ASSERT
|
|
29
29
|
|
|
30
|
-
#if EIGEN_MAX_CPP_VER>=11 && (__has_feature(cxx_static_assert) || (
|
|
30
|
+
#if EIGEN_MAX_CPP_VER>=11 && (__has_feature(cxx_static_assert) || (EIGEN_COMP_CXXVER >= 11) || (EIGEN_COMP_MSVC >= 1600))
|
|
31
31
|
|
|
32
32
|
// if native static_assert is enabled, let's use it
|
|
33
33
|
#define EIGEN_STATIC_ASSERT(X,MSG) static_assert(X,#MSG);
|
|
@@ -103,7 +103,10 @@
|
|
|
103
103
|
STORAGE_KIND_MUST_MATCH=1,
|
|
104
104
|
STORAGE_INDEX_MUST_MATCH=1,
|
|
105
105
|
CHOLMOD_SUPPORTS_DOUBLE_PRECISION_ONLY=1,
|
|
106
|
-
SELFADJOINTVIEW_ACCEPTS_UPPER_AND_LOWER_MODE_ONLY=1
|
|
106
|
+
SELFADJOINTVIEW_ACCEPTS_UPPER_AND_LOWER_MODE_ONLY=1,
|
|
107
|
+
INVALID_TEMPLATE_PARAMETER=1,
|
|
108
|
+
GPU_TENSOR_CONTRACTION_DOES_NOT_SUPPORT_OUTPUT_KERNELS=1,
|
|
109
|
+
THE_ARRAY_SIZE_SHOULD_EQUAL_WITH_PACKET_SIZE=1
|
|
107
110
|
};
|
|
108
111
|
};
|
|
109
112
|
|
|
@@ -182,7 +185,7 @@
|
|
|
182
185
|
)
|
|
183
186
|
|
|
184
187
|
#define EIGEN_STATIC_ASSERT_NON_INTEGER(TYPE) \
|
|
185
|
-
EIGEN_STATIC_ASSERT(!NumTraits<TYPE>::IsInteger, THIS_FUNCTION_IS_NOT_FOR_INTEGER_NUMERIC_TYPES)
|
|
188
|
+
EIGEN_STATIC_ASSERT(!Eigen::NumTraits<TYPE>::IsInteger, THIS_FUNCTION_IS_NOT_FOR_INTEGER_NUMERIC_TYPES)
|
|
186
189
|
|
|
187
190
|
|
|
188
191
|
// static assertion failing if it is guaranteed at compile-time that the two matrix expression types have different sizes
|
|
@@ -192,8 +195,8 @@
|
|
|
192
195
|
YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES)
|
|
193
196
|
|
|
194
197
|
#define EIGEN_STATIC_ASSERT_SIZE_1x1(TYPE) \
|
|
195
|
-
EIGEN_STATIC_ASSERT((TYPE::RowsAtCompileTime == 1 || TYPE::RowsAtCompileTime == Dynamic) && \
|
|
196
|
-
(TYPE::ColsAtCompileTime == 1 || TYPE::ColsAtCompileTime == Dynamic), \
|
|
198
|
+
EIGEN_STATIC_ASSERT((TYPE::RowsAtCompileTime == 1 || TYPE::RowsAtCompileTime == Eigen::Dynamic) && \
|
|
199
|
+
(TYPE::ColsAtCompileTime == 1 || TYPE::ColsAtCompileTime == Eigen::Dynamic), \
|
|
197
200
|
THIS_METHOD_IS_ONLY_FOR_1x1_EXPRESSIONS)
|
|
198
201
|
|
|
199
202
|
#define EIGEN_STATIC_ASSERT_LVALUE(Derived) \
|
|
@@ -0,0 +1,293 @@
|
|
|
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_SYMBOLIC_INDEX_H
|
|
11
|
+
#define EIGEN_SYMBOLIC_INDEX_H
|
|
12
|
+
|
|
13
|
+
namespace Eigen {
|
|
14
|
+
|
|
15
|
+
/** \namespace Eigen::symbolic
|
|
16
|
+
* \ingroup Core_Module
|
|
17
|
+
*
|
|
18
|
+
* This namespace defines a set of classes and functions to build and evaluate symbolic expressions of scalar type Index.
|
|
19
|
+
* Here is a simple example:
|
|
20
|
+
*
|
|
21
|
+
* \code
|
|
22
|
+
* // First step, defines symbols:
|
|
23
|
+
* struct x_tag {}; static const symbolic::SymbolExpr<x_tag> x;
|
|
24
|
+
* struct y_tag {}; static const symbolic::SymbolExpr<y_tag> y;
|
|
25
|
+
* struct z_tag {}; static const symbolic::SymbolExpr<z_tag> z;
|
|
26
|
+
*
|
|
27
|
+
* // Defines an expression:
|
|
28
|
+
* auto expr = (x+3)/y+z;
|
|
29
|
+
*
|
|
30
|
+
* // And evaluate it: (c++14)
|
|
31
|
+
* std::cout << expr.eval(x=6,y=3,z=-13) << "\n";
|
|
32
|
+
*
|
|
33
|
+
* // In c++98/11, only one symbol per expression is supported for now:
|
|
34
|
+
* auto expr98 = (3-x)/2;
|
|
35
|
+
* std::cout << expr98.eval(x=6) << "\n";
|
|
36
|
+
* \endcode
|
|
37
|
+
*
|
|
38
|
+
* It is currently only used internally to define and manipulate the Eigen::last and Eigen::lastp1 symbols in Eigen::seq and Eigen::seqN.
|
|
39
|
+
*
|
|
40
|
+
*/
|
|
41
|
+
namespace symbolic {
|
|
42
|
+
|
|
43
|
+
template<typename Tag> class Symbol;
|
|
44
|
+
template<typename Arg0> class NegateExpr;
|
|
45
|
+
template<typename Arg1,typename Arg2> class AddExpr;
|
|
46
|
+
template<typename Arg1,typename Arg2> class ProductExpr;
|
|
47
|
+
template<typename Arg1,typename Arg2> class QuotientExpr;
|
|
48
|
+
|
|
49
|
+
// A simple wrapper around an integral value to provide the eval method.
|
|
50
|
+
// We could also use a free-function symbolic_eval...
|
|
51
|
+
template<typename IndexType=Index>
|
|
52
|
+
class ValueExpr {
|
|
53
|
+
public:
|
|
54
|
+
ValueExpr(IndexType val) : m_value(val) {}
|
|
55
|
+
template<typename T>
|
|
56
|
+
IndexType eval_impl(const T&) const { return m_value; }
|
|
57
|
+
protected:
|
|
58
|
+
IndexType m_value;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// Specialization for compile-time value,
|
|
62
|
+
// It is similar to ValueExpr(N) but this version helps the compiler to generate better code.
|
|
63
|
+
template<int N>
|
|
64
|
+
class ValueExpr<internal::FixedInt<N> > {
|
|
65
|
+
public:
|
|
66
|
+
ValueExpr() {}
|
|
67
|
+
template<typename T>
|
|
68
|
+
EIGEN_CONSTEXPR Index eval_impl(const T&) const { return N; }
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
/** \class BaseExpr
|
|
73
|
+
* \ingroup Core_Module
|
|
74
|
+
* Common base class of any symbolic expressions
|
|
75
|
+
*/
|
|
76
|
+
template<typename Derived>
|
|
77
|
+
class BaseExpr
|
|
78
|
+
{
|
|
79
|
+
public:
|
|
80
|
+
const Derived& derived() const { return *static_cast<const Derived*>(this); }
|
|
81
|
+
|
|
82
|
+
/** Evaluate the expression given the \a values of the symbols.
|
|
83
|
+
*
|
|
84
|
+
* \param values defines the values of the symbols, it can either be a SymbolValue or a std::tuple of SymbolValue
|
|
85
|
+
* as constructed by SymbolExpr::operator= operator.
|
|
86
|
+
*
|
|
87
|
+
*/
|
|
88
|
+
template<typename T>
|
|
89
|
+
Index eval(const T& values) const { return derived().eval_impl(values); }
|
|
90
|
+
|
|
91
|
+
#if EIGEN_HAS_CXX14
|
|
92
|
+
template<typename... Types>
|
|
93
|
+
Index eval(Types&&... values) const { return derived().eval_impl(std::make_tuple(values...)); }
|
|
94
|
+
#endif
|
|
95
|
+
|
|
96
|
+
NegateExpr<Derived> operator-() const { return NegateExpr<Derived>(derived()); }
|
|
97
|
+
|
|
98
|
+
AddExpr<Derived,ValueExpr<> > operator+(Index b) const
|
|
99
|
+
{ return AddExpr<Derived,ValueExpr<> >(derived(), b); }
|
|
100
|
+
AddExpr<Derived,ValueExpr<> > operator-(Index a) const
|
|
101
|
+
{ return AddExpr<Derived,ValueExpr<> >(derived(), -a); }
|
|
102
|
+
ProductExpr<Derived,ValueExpr<> > operator*(Index a) const
|
|
103
|
+
{ return ProductExpr<Derived,ValueExpr<> >(derived(),a); }
|
|
104
|
+
QuotientExpr<Derived,ValueExpr<> > operator/(Index a) const
|
|
105
|
+
{ return QuotientExpr<Derived,ValueExpr<> >(derived(),a); }
|
|
106
|
+
|
|
107
|
+
friend AddExpr<Derived,ValueExpr<> > operator+(Index a, const BaseExpr& b)
|
|
108
|
+
{ return AddExpr<Derived,ValueExpr<> >(b.derived(), a); }
|
|
109
|
+
friend AddExpr<NegateExpr<Derived>,ValueExpr<> > operator-(Index a, const BaseExpr& b)
|
|
110
|
+
{ return AddExpr<NegateExpr<Derived>,ValueExpr<> >(-b.derived(), a); }
|
|
111
|
+
friend ProductExpr<ValueExpr<>,Derived> operator*(Index a, const BaseExpr& b)
|
|
112
|
+
{ return ProductExpr<ValueExpr<>,Derived>(a,b.derived()); }
|
|
113
|
+
friend QuotientExpr<ValueExpr<>,Derived> operator/(Index a, const BaseExpr& b)
|
|
114
|
+
{ return QuotientExpr<ValueExpr<>,Derived>(a,b.derived()); }
|
|
115
|
+
|
|
116
|
+
template<int N>
|
|
117
|
+
AddExpr<Derived,ValueExpr<internal::FixedInt<N> > > operator+(internal::FixedInt<N>) const
|
|
118
|
+
{ return AddExpr<Derived,ValueExpr<internal::FixedInt<N> > >(derived(), ValueExpr<internal::FixedInt<N> >()); }
|
|
119
|
+
template<int N>
|
|
120
|
+
AddExpr<Derived,ValueExpr<internal::FixedInt<-N> > > operator-(internal::FixedInt<N>) const
|
|
121
|
+
{ return AddExpr<Derived,ValueExpr<internal::FixedInt<-N> > >(derived(), ValueExpr<internal::FixedInt<-N> >()); }
|
|
122
|
+
template<int N>
|
|
123
|
+
ProductExpr<Derived,ValueExpr<internal::FixedInt<N> > > operator*(internal::FixedInt<N>) const
|
|
124
|
+
{ return ProductExpr<Derived,ValueExpr<internal::FixedInt<N> > >(derived(),ValueExpr<internal::FixedInt<N> >()); }
|
|
125
|
+
template<int N>
|
|
126
|
+
QuotientExpr<Derived,ValueExpr<internal::FixedInt<N> > > operator/(internal::FixedInt<N>) const
|
|
127
|
+
{ return QuotientExpr<Derived,ValueExpr<internal::FixedInt<N> > >(derived(),ValueExpr<internal::FixedInt<N> >()); }
|
|
128
|
+
|
|
129
|
+
template<int N>
|
|
130
|
+
friend AddExpr<Derived,ValueExpr<internal::FixedInt<N> > > operator+(internal::FixedInt<N>, const BaseExpr& b)
|
|
131
|
+
{ return AddExpr<Derived,ValueExpr<internal::FixedInt<N> > >(b.derived(), ValueExpr<internal::FixedInt<N> >()); }
|
|
132
|
+
template<int N>
|
|
133
|
+
friend AddExpr<NegateExpr<Derived>,ValueExpr<internal::FixedInt<N> > > operator-(internal::FixedInt<N>, const BaseExpr& b)
|
|
134
|
+
{ return AddExpr<NegateExpr<Derived>,ValueExpr<internal::FixedInt<N> > >(-b.derived(), ValueExpr<internal::FixedInt<N> >()); }
|
|
135
|
+
template<int N>
|
|
136
|
+
friend ProductExpr<ValueExpr<internal::FixedInt<N> >,Derived> operator*(internal::FixedInt<N>, const BaseExpr& b)
|
|
137
|
+
{ return ProductExpr<ValueExpr<internal::FixedInt<N> >,Derived>(ValueExpr<internal::FixedInt<N> >(),b.derived()); }
|
|
138
|
+
template<int N>
|
|
139
|
+
friend QuotientExpr<ValueExpr<internal::FixedInt<N> >,Derived> operator/(internal::FixedInt<N>, const BaseExpr& b)
|
|
140
|
+
{ return QuotientExpr<ValueExpr<internal::FixedInt<N> > ,Derived>(ValueExpr<internal::FixedInt<N> >(),b.derived()); }
|
|
141
|
+
|
|
142
|
+
#if (!EIGEN_HAS_CXX14)
|
|
143
|
+
template<int N>
|
|
144
|
+
AddExpr<Derived,ValueExpr<internal::FixedInt<N> > > operator+(internal::FixedInt<N> (*)()) const
|
|
145
|
+
{ return AddExpr<Derived,ValueExpr<internal::FixedInt<N> > >(derived(), ValueExpr<internal::FixedInt<N> >()); }
|
|
146
|
+
template<int N>
|
|
147
|
+
AddExpr<Derived,ValueExpr<internal::FixedInt<-N> > > operator-(internal::FixedInt<N> (*)()) const
|
|
148
|
+
{ return AddExpr<Derived,ValueExpr<internal::FixedInt<-N> > >(derived(), ValueExpr<internal::FixedInt<-N> >()); }
|
|
149
|
+
template<int N>
|
|
150
|
+
ProductExpr<Derived,ValueExpr<internal::FixedInt<N> > > operator*(internal::FixedInt<N> (*)()) const
|
|
151
|
+
{ return ProductExpr<Derived,ValueExpr<internal::FixedInt<N> > >(derived(),ValueExpr<internal::FixedInt<N> >()); }
|
|
152
|
+
template<int N>
|
|
153
|
+
QuotientExpr<Derived,ValueExpr<internal::FixedInt<N> > > operator/(internal::FixedInt<N> (*)()) const
|
|
154
|
+
{ return QuotientExpr<Derived,ValueExpr<internal::FixedInt<N> > >(derived(),ValueExpr<internal::FixedInt<N> >()); }
|
|
155
|
+
|
|
156
|
+
template<int N>
|
|
157
|
+
friend AddExpr<Derived,ValueExpr<internal::FixedInt<N> > > operator+(internal::FixedInt<N> (*)(), const BaseExpr& b)
|
|
158
|
+
{ return AddExpr<Derived,ValueExpr<internal::FixedInt<N> > >(b.derived(), ValueExpr<internal::FixedInt<N> >()); }
|
|
159
|
+
template<int N>
|
|
160
|
+
friend AddExpr<NegateExpr<Derived>,ValueExpr<internal::FixedInt<N> > > operator-(internal::FixedInt<N> (*)(), const BaseExpr& b)
|
|
161
|
+
{ return AddExpr<NegateExpr<Derived>,ValueExpr<internal::FixedInt<N> > >(-b.derived(), ValueExpr<internal::FixedInt<N> >()); }
|
|
162
|
+
template<int N>
|
|
163
|
+
friend ProductExpr<ValueExpr<internal::FixedInt<N> >,Derived> operator*(internal::FixedInt<N> (*)(), const BaseExpr& b)
|
|
164
|
+
{ return ProductExpr<ValueExpr<internal::FixedInt<N> >,Derived>(ValueExpr<internal::FixedInt<N> >(),b.derived()); }
|
|
165
|
+
template<int N>
|
|
166
|
+
friend QuotientExpr<ValueExpr<internal::FixedInt<N> >,Derived> operator/(internal::FixedInt<N> (*)(), const BaseExpr& b)
|
|
167
|
+
{ return QuotientExpr<ValueExpr<internal::FixedInt<N> > ,Derived>(ValueExpr<internal::FixedInt<N> >(),b.derived()); }
|
|
168
|
+
#endif
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
template<typename OtherDerived>
|
|
172
|
+
AddExpr<Derived,OtherDerived> operator+(const BaseExpr<OtherDerived> &b) const
|
|
173
|
+
{ return AddExpr<Derived,OtherDerived>(derived(), b.derived()); }
|
|
174
|
+
|
|
175
|
+
template<typename OtherDerived>
|
|
176
|
+
AddExpr<Derived,NegateExpr<OtherDerived> > operator-(const BaseExpr<OtherDerived> &b) const
|
|
177
|
+
{ return AddExpr<Derived,NegateExpr<OtherDerived> >(derived(), -b.derived()); }
|
|
178
|
+
|
|
179
|
+
template<typename OtherDerived>
|
|
180
|
+
ProductExpr<Derived,OtherDerived> operator*(const BaseExpr<OtherDerived> &b) const
|
|
181
|
+
{ return ProductExpr<Derived,OtherDerived>(derived(), b.derived()); }
|
|
182
|
+
|
|
183
|
+
template<typename OtherDerived>
|
|
184
|
+
QuotientExpr<Derived,OtherDerived> operator/(const BaseExpr<OtherDerived> &b) const
|
|
185
|
+
{ return QuotientExpr<Derived,OtherDerived>(derived(), b.derived()); }
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
template<typename T>
|
|
189
|
+
struct is_symbolic {
|
|
190
|
+
// BaseExpr has no conversion ctor, so we only have to check whether T can be statically cast to its base class BaseExpr<T>.
|
|
191
|
+
enum { value = internal::is_convertible<T,BaseExpr<T> >::value };
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
/** Represents the actual value of a symbol identified by its tag
|
|
195
|
+
*
|
|
196
|
+
* It is the return type of SymbolValue::operator=, and most of the time this is only way it is used.
|
|
197
|
+
*/
|
|
198
|
+
template<typename Tag>
|
|
199
|
+
class SymbolValue
|
|
200
|
+
{
|
|
201
|
+
public:
|
|
202
|
+
/** Default constructor from the value \a val */
|
|
203
|
+
SymbolValue(Index val) : m_value(val) {}
|
|
204
|
+
|
|
205
|
+
/** \returns the stored value of the symbol */
|
|
206
|
+
Index value() const { return m_value; }
|
|
207
|
+
protected:
|
|
208
|
+
Index m_value;
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
/** Expression of a symbol uniquely identified by the template parameter type \c tag */
|
|
212
|
+
template<typename tag>
|
|
213
|
+
class SymbolExpr : public BaseExpr<SymbolExpr<tag> >
|
|
214
|
+
{
|
|
215
|
+
public:
|
|
216
|
+
/** Alias to the template parameter \c tag */
|
|
217
|
+
typedef tag Tag;
|
|
218
|
+
|
|
219
|
+
SymbolExpr() {}
|
|
220
|
+
|
|
221
|
+
/** Associate the value \a val to the given symbol \c *this, uniquely identified by its \c Tag.
|
|
222
|
+
*
|
|
223
|
+
* The returned object should be passed to ExprBase::eval() to evaluate a given expression with this specified runtime-time value.
|
|
224
|
+
*/
|
|
225
|
+
SymbolValue<Tag> operator=(Index val) const {
|
|
226
|
+
return SymbolValue<Tag>(val);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
Index eval_impl(const SymbolValue<Tag> &values) const { return values.value(); }
|
|
230
|
+
|
|
231
|
+
#if EIGEN_HAS_CXX14
|
|
232
|
+
// C++14 versions suitable for multiple symbols
|
|
233
|
+
template<typename... Types>
|
|
234
|
+
Index eval_impl(const std::tuple<Types...>& values) const { return std::get<SymbolValue<Tag> >(values).value(); }
|
|
235
|
+
#endif
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
template<typename Arg0>
|
|
239
|
+
class NegateExpr : public BaseExpr<NegateExpr<Arg0> >
|
|
240
|
+
{
|
|
241
|
+
public:
|
|
242
|
+
NegateExpr(const Arg0& arg0) : m_arg0(arg0) {}
|
|
243
|
+
|
|
244
|
+
template<typename T>
|
|
245
|
+
Index eval_impl(const T& values) const { return -m_arg0.eval_impl(values); }
|
|
246
|
+
protected:
|
|
247
|
+
Arg0 m_arg0;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
template<typename Arg0, typename Arg1>
|
|
251
|
+
class AddExpr : public BaseExpr<AddExpr<Arg0,Arg1> >
|
|
252
|
+
{
|
|
253
|
+
public:
|
|
254
|
+
AddExpr(const Arg0& arg0, const Arg1& arg1) : m_arg0(arg0), m_arg1(arg1) {}
|
|
255
|
+
|
|
256
|
+
template<typename T>
|
|
257
|
+
Index eval_impl(const T& values) const { return m_arg0.eval_impl(values) + m_arg1.eval_impl(values); }
|
|
258
|
+
protected:
|
|
259
|
+
Arg0 m_arg0;
|
|
260
|
+
Arg1 m_arg1;
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
template<typename Arg0, typename Arg1>
|
|
264
|
+
class ProductExpr : public BaseExpr<ProductExpr<Arg0,Arg1> >
|
|
265
|
+
{
|
|
266
|
+
public:
|
|
267
|
+
ProductExpr(const Arg0& arg0, const Arg1& arg1) : m_arg0(arg0), m_arg1(arg1) {}
|
|
268
|
+
|
|
269
|
+
template<typename T>
|
|
270
|
+
Index eval_impl(const T& values) const { return m_arg0.eval_impl(values) * m_arg1.eval_impl(values); }
|
|
271
|
+
protected:
|
|
272
|
+
Arg0 m_arg0;
|
|
273
|
+
Arg1 m_arg1;
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
template<typename Arg0, typename Arg1>
|
|
277
|
+
class QuotientExpr : public BaseExpr<QuotientExpr<Arg0,Arg1> >
|
|
278
|
+
{
|
|
279
|
+
public:
|
|
280
|
+
QuotientExpr(const Arg0& arg0, const Arg1& arg1) : m_arg0(arg0), m_arg1(arg1) {}
|
|
281
|
+
|
|
282
|
+
template<typename T>
|
|
283
|
+
Index eval_impl(const T& values) const { return m_arg0.eval_impl(values) / m_arg1.eval_impl(values); }
|
|
284
|
+
protected:
|
|
285
|
+
Arg0 m_arg0;
|
|
286
|
+
Arg1 m_arg1;
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
} // end namespace symbolic
|
|
290
|
+
|
|
291
|
+
} // end namespace Eigen
|
|
292
|
+
|
|
293
|
+
#endif // EIGEN_SYMBOLIC_INDEX_H
|
|
@@ -49,6 +49,12 @@ template<typename T> struct is_valid_index_type
|
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
+
// true if both types are not valid index types
|
|
53
|
+
template<typename RowIndices, typename ColIndices>
|
|
54
|
+
struct valid_indexed_view_overload {
|
|
55
|
+
enum { value = !(internal::is_valid_index_type<RowIndices>::value && internal::is_valid_index_type<ColIndices>::value) };
|
|
56
|
+
};
|
|
57
|
+
|
|
52
58
|
// promote_scalar_arg is an helper used in operation between an expression and a scalar, like:
|
|
53
59
|
// expression * scalar
|
|
54
60
|
// Its role is to determine how the type T of the scalar operand should be promoted given the scalar type ExprScalar of the given expression.
|
|
@@ -123,19 +129,23 @@ struct promote_index_type
|
|
|
123
129
|
template<typename T, int Value> class variable_if_dynamic
|
|
124
130
|
{
|
|
125
131
|
public:
|
|
126
|
-
|
|
132
|
+
EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(variable_if_dynamic)
|
|
127
133
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit variable_if_dynamic(T v) { EIGEN_ONLY_USED_FOR_DEBUG(v); eigen_assert(v == T(Value)); }
|
|
128
|
-
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE
|
|
129
|
-
|
|
134
|
+
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
|
|
135
|
+
T value() { return T(Value); }
|
|
136
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
|
|
137
|
+
operator T() const { return T(Value); }
|
|
138
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
139
|
+
void setValue(T v) const { EIGEN_ONLY_USED_FOR_DEBUG(v); eigen_assert(v == T(Value)); }
|
|
130
140
|
};
|
|
131
141
|
|
|
132
142
|
template<typename T> class variable_if_dynamic<T, Dynamic>
|
|
133
143
|
{
|
|
134
144
|
T m_value;
|
|
135
|
-
EIGEN_DEVICE_FUNC variable_if_dynamic() { eigen_assert(false); }
|
|
136
145
|
public:
|
|
137
|
-
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit variable_if_dynamic(T value) : m_value(value) {}
|
|
146
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit variable_if_dynamic(T value = 0) EIGEN_NO_THROW : m_value(value) {}
|
|
138
147
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T value() const { return m_value; }
|
|
148
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE operator T() const { return m_value; }
|
|
139
149
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void setValue(T value) { m_value = value; }
|
|
140
150
|
};
|
|
141
151
|
|
|
@@ -146,8 +156,10 @@ template<typename T, int Value> class variable_if_dynamicindex
|
|
|
146
156
|
public:
|
|
147
157
|
EIGEN_EMPTY_STRUCT_CTOR(variable_if_dynamicindex)
|
|
148
158
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit variable_if_dynamicindex(T v) { EIGEN_ONLY_USED_FOR_DEBUG(v); eigen_assert(v == T(Value)); }
|
|
149
|
-
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE
|
|
150
|
-
|
|
159
|
+
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
|
|
160
|
+
T value() { return T(Value); }
|
|
161
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
162
|
+
void setValue(T) {}
|
|
151
163
|
};
|
|
152
164
|
|
|
153
165
|
template<typename T> class variable_if_dynamicindex<T, DynamicIndex>
|
|
@@ -172,16 +184,7 @@ template<typename T> struct functor_traits
|
|
|
172
184
|
|
|
173
185
|
template<typename T> struct packet_traits;
|
|
174
186
|
|
|
175
|
-
template<typename T> struct unpacket_traits
|
|
176
|
-
{
|
|
177
|
-
typedef T type;
|
|
178
|
-
typedef T half;
|
|
179
|
-
enum
|
|
180
|
-
{
|
|
181
|
-
size = 1,
|
|
182
|
-
alignment = 1
|
|
183
|
-
};
|
|
184
|
-
};
|
|
187
|
+
template<typename T> struct unpacket_traits;
|
|
185
188
|
|
|
186
189
|
template<int Size, typename PacketType,
|
|
187
190
|
bool Stop = Size==Dynamic || (Size%unpacket_traits<PacketType>::size)==0 || is_same<PacketType,typename unpacket_traits<PacketType>::half>::value>
|
|
@@ -400,7 +403,7 @@ template<typename T> struct plain_matrix_type_row_major
|
|
|
400
403
|
typedef Matrix<typename traits<T>::Scalar,
|
|
401
404
|
Rows,
|
|
402
405
|
Cols,
|
|
403
|
-
(MaxCols==1&&MaxRows!=1) ?
|
|
406
|
+
(MaxCols==1&&MaxRows!=1) ? ColMajor : RowMajor,
|
|
404
407
|
MaxRows,
|
|
405
408
|
MaxCols
|
|
406
409
|
> type;
|
|
@@ -417,7 +420,7 @@ struct ref_selector
|
|
|
417
420
|
T const&,
|
|
418
421
|
const T
|
|
419
422
|
>::type type;
|
|
420
|
-
|
|
423
|
+
|
|
421
424
|
typedef typename conditional<
|
|
422
425
|
bool(traits<T>::Flags & NestByRefBit),
|
|
423
426
|
T &,
|
|
@@ -455,7 +458,7 @@ template<typename T, int n, typename PlainObject = typename plain_object_eval<T>
|
|
|
455
458
|
{
|
|
456
459
|
enum {
|
|
457
460
|
ScalarReadCost = NumTraits<typename traits<T>::Scalar>::ReadCost,
|
|
458
|
-
CoeffReadCost = evaluator<T>::CoeffReadCost, // NOTE What if an evaluator evaluate itself into a
|
|
461
|
+
CoeffReadCost = evaluator<T>::CoeffReadCost, // NOTE What if an evaluator evaluate itself into a temporary?
|
|
459
462
|
// Then CoeffReadCost will be small (e.g., 1) but we still have to evaluate, especially if n>1.
|
|
460
463
|
// This situation is already taken care by the EvalBeforeNestingBit flag, which is turned ON
|
|
461
464
|
// for all evaluator creating a temporary. This flag is then propagated by the parent evaluators.
|
|
@@ -596,14 +599,14 @@ template<typename ExpressionType, typename Scalar = typename ExpressionType::Sca
|
|
|
596
599
|
struct plain_row_type
|
|
597
600
|
{
|
|
598
601
|
typedef Matrix<Scalar, 1, ExpressionType::ColsAtCompileTime,
|
|
599
|
-
ExpressionType::PlainObject::Options | RowMajor, 1, ExpressionType::MaxColsAtCompileTime> MatrixRowType;
|
|
602
|
+
int(ExpressionType::PlainObject::Options) | int(RowMajor), 1, ExpressionType::MaxColsAtCompileTime> MatrixRowType;
|
|
600
603
|
typedef Array<Scalar, 1, ExpressionType::ColsAtCompileTime,
|
|
601
|
-
ExpressionType::PlainObject::Options | RowMajor, 1, ExpressionType::MaxColsAtCompileTime> ArrayRowType;
|
|
604
|
+
int(ExpressionType::PlainObject::Options) | int(RowMajor), 1, ExpressionType::MaxColsAtCompileTime> ArrayRowType;
|
|
602
605
|
|
|
603
606
|
typedef typename conditional<
|
|
604
607
|
is_same< typename traits<ExpressionType>::XprKind, MatrixXpr >::value,
|
|
605
608
|
MatrixRowType,
|
|
606
|
-
ArrayRowType
|
|
609
|
+
ArrayRowType
|
|
607
610
|
>::type type;
|
|
608
611
|
};
|
|
609
612
|
|
|
@@ -618,7 +621,7 @@ struct plain_col_type
|
|
|
618
621
|
typedef typename conditional<
|
|
619
622
|
is_same< typename traits<ExpressionType>::XprKind, MatrixXpr >::value,
|
|
620
623
|
MatrixColType,
|
|
621
|
-
ArrayColType
|
|
624
|
+
ArrayColType
|
|
622
625
|
>::type type;
|
|
623
626
|
};
|
|
624
627
|
|
|
@@ -634,7 +637,7 @@ struct plain_diag_type
|
|
|
634
637
|
typedef typename conditional<
|
|
635
638
|
is_same< typename traits<ExpressionType>::XprKind, MatrixXpr >::value,
|
|
636
639
|
MatrixDiagType,
|
|
637
|
-
ArrayDiagType
|
|
640
|
+
ArrayDiagType
|
|
638
641
|
>::type type;
|
|
639
642
|
};
|
|
640
643
|
|
|
@@ -671,24 +674,39 @@ template<typename T> struct is_diagonal<DiagonalWrapper<T> >
|
|
|
671
674
|
template<typename T, int S> struct is_diagonal<DiagonalMatrix<T,S> >
|
|
672
675
|
{ enum { ret = true }; };
|
|
673
676
|
|
|
677
|
+
|
|
678
|
+
template<typename T> struct is_identity
|
|
679
|
+
{ enum { value = false }; };
|
|
680
|
+
|
|
681
|
+
template<typename T> struct is_identity<CwiseNullaryOp<internal::scalar_identity_op<typename T::Scalar>, T> >
|
|
682
|
+
{ enum { value = true }; };
|
|
683
|
+
|
|
684
|
+
|
|
674
685
|
template<typename S1, typename S2> struct glue_shapes;
|
|
675
686
|
template<> struct glue_shapes<DenseShape,TriangularShape> { typedef TriangularShape type; };
|
|
676
687
|
|
|
677
688
|
template<typename T1, typename T2>
|
|
678
|
-
|
|
689
|
+
struct possibly_same_dense {
|
|
690
|
+
enum { value = has_direct_access<T1>::ret && has_direct_access<T2>::ret && is_same<typename T1::Scalar,typename T2::Scalar>::value };
|
|
691
|
+
};
|
|
692
|
+
|
|
693
|
+
template<typename T1, typename T2>
|
|
694
|
+
EIGEN_DEVICE_FUNC
|
|
695
|
+
bool is_same_dense(const T1 &mat1, const T2 &mat2, typename enable_if<possibly_same_dense<T1,T2>::value>::type * = 0)
|
|
679
696
|
{
|
|
680
697
|
return (mat1.data()==mat2.data()) && (mat1.innerStride()==mat2.innerStride()) && (mat1.outerStride()==mat2.outerStride());
|
|
681
698
|
}
|
|
682
699
|
|
|
683
700
|
template<typename T1, typename T2>
|
|
684
|
-
|
|
701
|
+
EIGEN_DEVICE_FUNC
|
|
702
|
+
bool is_same_dense(const T1 &, const T2 &, typename enable_if<!possibly_same_dense<T1,T2>::value>::type * = 0)
|
|
685
703
|
{
|
|
686
704
|
return false;
|
|
687
705
|
}
|
|
688
706
|
|
|
689
707
|
// Internal helper defining the cost of a scalar division for the type T.
|
|
690
708
|
// The default heuristic can be specialized for each scalar type and architecture.
|
|
691
|
-
template<typename T,bool Vectorized=false,typename
|
|
709
|
+
template<typename T,bool Vectorized=false,typename EnableIf = void>
|
|
692
710
|
struct scalar_div_cost {
|
|
693
711
|
enum { value = 8*NumTraits<T>::MulCost };
|
|
694
712
|
};
|
|
@@ -735,7 +753,7 @@ std::string demangle_flags(int f)
|
|
|
735
753
|
if(f&DirectAccessBit) res += " | Direct";
|
|
736
754
|
if(f&NestByRefBit) res += " | NestByRef";
|
|
737
755
|
if(f&NoPreferredStorageOrderBit) res += " | NoPreferredStorageOrderBit";
|
|
738
|
-
|
|
756
|
+
|
|
739
757
|
return res;
|
|
740
758
|
}
|
|
741
759
|
#endif
|
|
@@ -832,7 +850,7 @@ struct ScalarBinaryOpTraits<void,void,BinaryOp>
|
|
|
832
850
|
#define EIGEN_CHECK_BINARY_COMPATIBILIY(BINOP,LHS,RHS) \
|
|
833
851
|
EIGEN_STATIC_ASSERT((Eigen::internal::has_ReturnType<ScalarBinaryOpTraits<LHS, RHS,BINOP> >::value), \
|
|
834
852
|
YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
|
|
835
|
-
|
|
853
|
+
|
|
836
854
|
} // end namespace Eigen
|
|
837
855
|
|
|
838
856
|
#endif // EIGEN_XPRHELPER_H
|
|
@@ -214,7 +214,7 @@ template<typename _MatrixType> class ComplexEigenSolver
|
|
|
214
214
|
|
|
215
215
|
/** \brief Reports whether previous computation was successful.
|
|
216
216
|
*
|
|
217
|
-
* \returns \c Success if computation was
|
|
217
|
+
* \returns \c Success if computation was successful, \c NoConvergence otherwise.
|
|
218
218
|
*/
|
|
219
219
|
ComputationInfo info() const
|
|
220
220
|
{
|
|
@@ -212,7 +212,7 @@ template<typename _MatrixType> class ComplexSchur
|
|
|
212
212
|
|
|
213
213
|
/** \brief Reports whether previous computation was successful.
|
|
214
214
|
*
|
|
215
|
-
* \returns \c Success if computation was
|
|
215
|
+
* \returns \c Success if computation was successful, \c NoConvergence otherwise.
|
|
216
216
|
*/
|
|
217
217
|
ComputationInfo info() const
|
|
218
218
|
{
|
|
@@ -110,7 +110,7 @@ template<typename _MatrixType> class EigenSolver
|
|
|
110
110
|
*
|
|
111
111
|
* \sa compute() for an example.
|
|
112
112
|
*/
|
|
113
|
-
EigenSolver() : m_eivec(), m_eivalues(), m_isInitialized(false), m_realSchur(), m_matT(), m_tmp() {}
|
|
113
|
+
EigenSolver() : m_eivec(), m_eivalues(), m_isInitialized(false), m_eigenvectorsOk(false), m_realSchur(), m_matT(), m_tmp() {}
|
|
114
114
|
|
|
115
115
|
/** \brief Default constructor with memory preallocation
|
|
116
116
|
*
|
|
@@ -277,7 +277,7 @@ template<typename _MatrixType> class EigenSolver
|
|
|
277
277
|
template<typename InputType>
|
|
278
278
|
EigenSolver& compute(const EigenBase<InputType>& matrix, bool computeEigenvectors = true);
|
|
279
279
|
|
|
280
|
-
/** \returns NumericalIssue if the input contains INF or NaN values or overflow
|
|
280
|
+
/** \returns NumericalIssue if the input contains INF or NaN values or overflow occurred. Returns Success otherwise. */
|
|
281
281
|
ComputationInfo info() const
|
|
282
282
|
{
|
|
283
283
|
eigen_assert(m_isInitialized && "EigenSolver is not initialized.");
|
|
@@ -121,7 +121,7 @@ class GeneralizedSelfAdjointEigenSolver : public SelfAdjointEigenSolver<_MatrixT
|
|
|
121
121
|
*
|
|
122
122
|
* \returns Reference to \c *this
|
|
123
123
|
*
|
|
124
|
-
*
|
|
124
|
+
* According to \p options, this function computes eigenvalues and (if requested)
|
|
125
125
|
* the eigenvectors of one of the following three generalized eigenproblems:
|
|
126
126
|
* - \c Ax_lBx: \f$ Ax = \lambda B x \f$
|
|
127
127
|
* - \c ABx_lx: \f$ ABx = \lambda x \f$
|
|
@@ -267,7 +267,7 @@ template<typename _MatrixType> class HessenbergDecomposition
|
|
|
267
267
|
|
|
268
268
|
private:
|
|
269
269
|
|
|
270
|
-
typedef Matrix<Scalar, 1, Size, Options | RowMajor, 1, MaxSize> VectorType;
|
|
270
|
+
typedef Matrix<Scalar, 1, Size, int(Options) | int(RowMajor), 1, MaxSize> VectorType;
|
|
271
271
|
typedef typename NumTraits<Scalar>::Real RealScalar;
|
|
272
272
|
static void _compute(MatrixType& matA, CoeffVectorType& hCoeffs, VectorType& temp);
|
|
273
273
|
|
|
@@ -315,7 +315,7 @@ void HessenbergDecomposition<MatrixType>::_compute(MatrixType& matA, CoeffVector
|
|
|
315
315
|
|
|
316
316
|
// A = A H'
|
|
317
317
|
matA.rightCols(remainingSize)
|
|
318
|
-
.applyHouseholderOnTheRight(matA.col(i).tail(remainingSize-1)
|
|
318
|
+
.applyHouseholderOnTheRight(matA.col(i).tail(remainingSize-1), numext::conj(h), &temp.coeffRef(0));
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
321
|
|
|
@@ -84,7 +84,7 @@ MatrixBase<Derived>::eigenvalues() const
|
|
|
84
84
|
* \sa SelfAdjointEigenSolver::eigenvalues(), MatrixBase::eigenvalues()
|
|
85
85
|
*/
|
|
86
86
|
template<typename MatrixType, unsigned int UpLo>
|
|
87
|
-
inline typename SelfAdjointView<MatrixType, UpLo>::EigenvaluesReturnType
|
|
87
|
+
EIGEN_DEVICE_FUNC inline typename SelfAdjointView<MatrixType, UpLo>::EigenvaluesReturnType
|
|
88
88
|
SelfAdjointView<MatrixType, UpLo>::eigenvalues() const
|
|
89
89
|
{
|
|
90
90
|
PlainObject thisAsMatrix(*this);
|
|
@@ -147,7 +147,7 @@ MatrixBase<Derived>::operatorNorm() const
|
|
|
147
147
|
* \sa eigenvalues(), MatrixBase::operatorNorm()
|
|
148
148
|
*/
|
|
149
149
|
template<typename MatrixType, unsigned int UpLo>
|
|
150
|
-
inline typename SelfAdjointView<MatrixType, UpLo>::RealScalar
|
|
150
|
+
EIGEN_DEVICE_FUNC inline typename SelfAdjointView<MatrixType, UpLo>::RealScalar
|
|
151
151
|
SelfAdjointView<MatrixType, UpLo>::operatorNorm() const
|
|
152
152
|
{
|
|
153
153
|
return eigenvalues().cwiseAbs().maxCoeff();
|