@smake/eigen 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/eigen/Eigen/AccelerateSupport +52 -0
- package/eigen/Eigen/Cholesky +18 -20
- package/eigen/Eigen/CholmodSupport +28 -28
- package/eigen/Eigen/Core +187 -120
- package/eigen/Eigen/Eigenvalues +16 -13
- package/eigen/Eigen/Geometry +18 -18
- package/eigen/Eigen/Householder +9 -7
- package/eigen/Eigen/IterativeLinearSolvers +8 -4
- package/eigen/Eigen/Jacobi +14 -13
- package/eigen/Eigen/KLUSupport +23 -21
- package/eigen/Eigen/LU +15 -16
- package/eigen/Eigen/MetisSupport +12 -12
- package/eigen/Eigen/OrderingMethods +54 -51
- package/eigen/Eigen/PaStiXSupport +23 -21
- package/eigen/Eigen/PardisoSupport +17 -14
- package/eigen/Eigen/QR +18 -20
- package/eigen/Eigen/QtAlignedMalloc +5 -12
- package/eigen/Eigen/SPQRSupport +21 -14
- package/eigen/Eigen/SVD +23 -17
- package/eigen/Eigen/Sparse +1 -2
- package/eigen/Eigen/SparseCholesky +18 -15
- package/eigen/Eigen/SparseCore +18 -17
- package/eigen/Eigen/SparseLU +9 -9
- package/eigen/Eigen/SparseQR +16 -14
- package/eigen/Eigen/StdDeque +5 -2
- package/eigen/Eigen/StdList +5 -2
- package/eigen/Eigen/StdVector +5 -2
- package/eigen/Eigen/SuperLUSupport +30 -24
- package/eigen/Eigen/ThreadPool +80 -0
- package/eigen/Eigen/UmfPackSupport +19 -17
- package/eigen/Eigen/Version +14 -0
- package/eigen/Eigen/src/AccelerateSupport/AccelerateSupport.h +423 -0
- package/eigen/Eigen/src/AccelerateSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Cholesky/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Cholesky/LDLT.h +366 -405
- package/eigen/Eigen/src/Cholesky/LLT.h +323 -367
- package/eigen/Eigen/src/Cholesky/LLT_LAPACKE.h +81 -56
- package/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +585 -529
- package/eigen/Eigen/src/CholmodSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Core/ArithmeticSequence.h +143 -317
- package/eigen/Eigen/src/Core/Array.h +329 -370
- package/eigen/Eigen/src/Core/ArrayBase.h +190 -203
- package/eigen/Eigen/src/Core/ArrayWrapper.h +126 -170
- package/eigen/Eigen/src/Core/Assign.h +30 -40
- package/eigen/Eigen/src/Core/AssignEvaluator.h +651 -604
- package/eigen/Eigen/src/Core/Assign_MKL.h +125 -120
- package/eigen/Eigen/src/Core/BandMatrix.h +267 -282
- package/eigen/Eigen/src/Core/Block.h +371 -390
- package/eigen/Eigen/src/Core/CommaInitializer.h +85 -100
- package/eigen/Eigen/src/Core/ConditionEstimator.h +51 -53
- package/eigen/Eigen/src/Core/CoreEvaluators.h +1214 -937
- package/eigen/Eigen/src/Core/CoreIterators.h +72 -63
- package/eigen/Eigen/src/Core/CwiseBinaryOp.h +112 -129
- package/eigen/Eigen/src/Core/CwiseNullaryOp.h +676 -702
- package/eigen/Eigen/src/Core/CwiseTernaryOp.h +77 -103
- package/eigen/Eigen/src/Core/CwiseUnaryOp.h +55 -67
- package/eigen/Eigen/src/Core/CwiseUnaryView.h +127 -92
- package/eigen/Eigen/src/Core/DenseBase.h +630 -658
- package/eigen/Eigen/src/Core/DenseCoeffsBase.h +511 -628
- package/eigen/Eigen/src/Core/DenseStorage.h +511 -590
- package/eigen/Eigen/src/Core/DeviceWrapper.h +153 -0
- package/eigen/Eigen/src/Core/Diagonal.h +168 -207
- package/eigen/Eigen/src/Core/DiagonalMatrix.h +346 -317
- package/eigen/Eigen/src/Core/DiagonalProduct.h +12 -10
- package/eigen/Eigen/src/Core/Dot.h +167 -217
- package/eigen/Eigen/src/Core/EigenBase.h +74 -85
- package/eigen/Eigen/src/Core/Fill.h +138 -0
- package/eigen/Eigen/src/Core/FindCoeff.h +464 -0
- package/eigen/Eigen/src/Core/ForceAlignedAccess.h +90 -113
- package/eigen/Eigen/src/Core/Fuzzy.h +82 -105
- package/eigen/Eigen/src/Core/GeneralProduct.h +315 -261
- package/eigen/Eigen/src/Core/GenericPacketMath.h +1182 -520
- package/eigen/Eigen/src/Core/GlobalFunctions.h +193 -157
- package/eigen/Eigen/src/Core/IO.h +131 -156
- package/eigen/Eigen/src/Core/IndexedView.h +209 -125
- package/eigen/Eigen/src/Core/InnerProduct.h +260 -0
- package/eigen/Eigen/src/Core/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Core/Inverse.h +50 -59
- package/eigen/Eigen/src/Core/Map.h +123 -141
- package/eigen/Eigen/src/Core/MapBase.h +255 -282
- package/eigen/Eigen/src/Core/MathFunctions.h +1247 -1201
- package/eigen/Eigen/src/Core/MathFunctionsImpl.h +162 -99
- package/eigen/Eigen/src/Core/Matrix.h +463 -494
- package/eigen/Eigen/src/Core/MatrixBase.h +468 -470
- package/eigen/Eigen/src/Core/NestByValue.h +58 -52
- package/eigen/Eigen/src/Core/NoAlias.h +79 -86
- package/eigen/Eigen/src/Core/NumTraits.h +206 -206
- package/eigen/Eigen/src/Core/PartialReduxEvaluator.h +163 -142
- package/eigen/Eigen/src/Core/PermutationMatrix.h +461 -511
- package/eigen/Eigen/src/Core/PlainObjectBase.h +858 -972
- package/eigen/Eigen/src/Core/Product.h +246 -130
- package/eigen/Eigen/src/Core/ProductEvaluators.h +779 -671
- package/eigen/Eigen/src/Core/Random.h +153 -164
- package/eigen/Eigen/src/Core/RandomImpl.h +262 -0
- package/eigen/Eigen/src/Core/RealView.h +250 -0
- package/eigen/Eigen/src/Core/Redux.h +334 -314
- package/eigen/Eigen/src/Core/Ref.h +259 -257
- package/eigen/Eigen/src/Core/Replicate.h +92 -104
- package/eigen/Eigen/src/Core/Reshaped.h +215 -271
- package/eigen/Eigen/src/Core/ReturnByValue.h +47 -55
- package/eigen/Eigen/src/Core/Reverse.h +133 -148
- package/eigen/Eigen/src/Core/Select.h +68 -140
- package/eigen/Eigen/src/Core/SelfAdjointView.h +254 -290
- package/eigen/Eigen/src/Core/SelfCwiseBinaryOp.h +23 -20
- package/eigen/Eigen/src/Core/SkewSymmetricMatrix3.h +382 -0
- package/eigen/Eigen/src/Core/Solve.h +88 -102
- package/eigen/Eigen/src/Core/SolveTriangular.h +126 -124
- package/eigen/Eigen/src/Core/SolverBase.h +132 -133
- package/eigen/Eigen/src/Core/StableNorm.h +113 -147
- package/eigen/Eigen/src/Core/StlIterators.h +404 -248
- package/eigen/Eigen/src/Core/Stride.h +90 -92
- package/eigen/Eigen/src/Core/Swap.h +70 -39
- package/eigen/Eigen/src/Core/Transpose.h +258 -295
- package/eigen/Eigen/src/Core/Transpositions.h +270 -333
- package/eigen/Eigen/src/Core/TriangularMatrix.h +642 -743
- package/eigen/Eigen/src/Core/VectorBlock.h +59 -72
- package/eigen/Eigen/src/Core/VectorwiseOp.h +653 -704
- package/eigen/Eigen/src/Core/Visitor.h +464 -308
- package/eigen/Eigen/src/Core/arch/AVX/Complex.h +380 -187
- package/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +65 -163
- package/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +2145 -638
- package/eigen/Eigen/src/Core/arch/AVX/Reductions.h +353 -0
- package/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +253 -60
- package/eigen/Eigen/src/Core/arch/AVX512/Complex.h +278 -228
- package/eigen/Eigen/src/Core/arch/AVX512/GemmKernel.h +1245 -0
- package/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +48 -269
- package/eigen/Eigen/src/Core/arch/AVX512/MathFunctionsFP16.h +75 -0
- package/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +1597 -754
- package/eigen/Eigen/src/Core/arch/AVX512/PacketMathFP16.h +1413 -0
- package/eigen/Eigen/src/Core/arch/AVX512/Reductions.h +297 -0
- package/eigen/Eigen/src/Core/arch/AVX512/TrsmKernel.h +1167 -0
- package/eigen/Eigen/src/Core/arch/AVX512/TrsmUnrolls.inc +1219 -0
- package/eigen/Eigen/src/Core/arch/AVX512/TypeCasting.h +229 -41
- package/eigen/Eigen/src/Core/arch/AVX512/TypeCastingFP16.h +130 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +420 -184
- package/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +40 -49
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +2962 -2213
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +196 -212
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +713 -441
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMAbfloat16.h +742 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixVectorProduct.inc +2818 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h +2380 -1362
- package/eigen/Eigen/src/Core/arch/AltiVec/TypeCasting.h +153 -0
- package/eigen/Eigen/src/Core/arch/Default/BFloat16.h +390 -224
- package/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +78 -67
- package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +1784 -799
- package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +167 -50
- package/eigen/Eigen/src/Core/arch/Default/Half.h +528 -379
- package/eigen/Eigen/src/Core/arch/Default/Settings.h +10 -12
- package/eigen/Eigen/src/Core/arch/GPU/Complex.h +244 -0
- package/eigen/Eigen/src/Core/arch/GPU/MathFunctions.h +41 -40
- package/eigen/Eigen/src/Core/arch/GPU/PacketMath.h +550 -523
- package/eigen/Eigen/src/Core/arch/GPU/Tuple.h +268 -0
- package/eigen/Eigen/src/Core/arch/GPU/TypeCasting.h +27 -30
- package/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h +8 -8
- package/eigen/Eigen/src/Core/arch/HVX/PacketMath.h +1088 -0
- package/eigen/Eigen/src/Core/arch/LSX/Complex.h +520 -0
- package/eigen/Eigen/src/Core/arch/LSX/GeneralBlockPanelKernel.h +23 -0
- package/eigen/Eigen/src/Core/arch/LSX/MathFunctions.h +43 -0
- package/eigen/Eigen/src/Core/arch/LSX/PacketMath.h +2866 -0
- package/eigen/Eigen/src/Core/arch/LSX/TypeCasting.h +526 -0
- package/eigen/Eigen/src/Core/arch/MSA/Complex.h +54 -82
- package/eigen/Eigen/src/Core/arch/MSA/MathFunctions.h +84 -92
- package/eigen/Eigen/src/Core/arch/MSA/PacketMath.h +51 -47
- package/eigen/Eigen/src/Core/arch/NEON/Complex.h +454 -306
- package/eigen/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +175 -115
- package/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +23 -30
- package/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +4366 -2857
- package/eigen/Eigen/src/Core/arch/NEON/TypeCasting.h +616 -393
- package/eigen/Eigen/src/Core/arch/NEON/UnaryFunctors.h +57 -0
- package/eigen/Eigen/src/Core/arch/SSE/Complex.h +350 -198
- package/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +38 -149
- package/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +1791 -912
- package/eigen/Eigen/src/Core/arch/SSE/Reductions.h +324 -0
- package/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +128 -40
- package/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h +10 -6
- package/eigen/Eigen/src/Core/arch/SVE/PacketMath.h +156 -234
- package/eigen/Eigen/src/Core/arch/SVE/TypeCasting.h +6 -3
- package/eigen/Eigen/src/Core/arch/SYCL/InteropHeaders.h +27 -32
- package/eigen/Eigen/src/Core/arch/SYCL/MathFunctions.h +119 -117
- package/eigen/Eigen/src/Core/arch/SYCL/PacketMath.h +325 -419
- package/eigen/Eigen/src/Core/arch/SYCL/TypeCasting.h +15 -17
- package/eigen/Eigen/src/Core/arch/ZVector/Complex.h +325 -181
- package/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +94 -83
- package/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +811 -458
- package/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +121 -124
- package/eigen/Eigen/src/Core/functors/BinaryFunctors.h +576 -370
- package/eigen/Eigen/src/Core/functors/NullaryFunctors.h +194 -109
- package/eigen/Eigen/src/Core/functors/StlFunctors.h +95 -112
- package/eigen/Eigen/src/Core/functors/TernaryFunctors.h +34 -7
- package/eigen/Eigen/src/Core/functors/UnaryFunctors.h +1038 -749
- package/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +1883 -1375
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +312 -370
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +189 -176
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +84 -81
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +154 -73
- package/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +292 -337
- package/eigen/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +80 -77
- package/eigen/Eigen/src/Core/products/Parallelizer.h +207 -105
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +327 -388
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +206 -224
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +138 -147
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h +58 -61
- package/eigen/Eigen/src/Core/products/SelfadjointProduct.h +71 -71
- package/eigen/Eigen/src/Core/products/SelfadjointRank2Update.h +48 -47
- package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix.h +294 -369
- package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +246 -238
- package/eigen/Eigen/src/Core/products/TriangularMatrixVector.h +244 -247
- package/eigen/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h +212 -192
- package/eigen/Eigen/src/Core/products/TriangularSolverMatrix.h +328 -277
- package/eigen/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +108 -109
- package/eigen/Eigen/src/Core/products/TriangularSolverVector.h +68 -94
- package/eigen/Eigen/src/Core/util/Assert.h +158 -0
- package/eigen/Eigen/src/Core/util/BlasUtil.h +342 -303
- package/eigen/Eigen/src/Core/util/ConfigureVectorization.h +348 -317
- package/eigen/Eigen/src/Core/util/Constants.h +297 -262
- package/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +130 -90
- package/eigen/Eigen/src/Core/util/EmulateArray.h +270 -0
- package/eigen/Eigen/src/Core/util/ForwardDeclarations.h +449 -247
- package/eigen/Eigen/src/Core/util/GpuHipCudaDefines.inc +101 -0
- package/eigen/Eigen/src/Core/util/GpuHipCudaUndefines.inc +45 -0
- package/eigen/Eigen/src/Core/util/IndexedViewHelper.h +417 -116
- package/eigen/Eigen/src/Core/util/IntegralConstant.h +211 -204
- package/eigen/Eigen/src/Core/util/MKL_support.h +39 -37
- package/eigen/Eigen/src/Core/util/Macros.h +655 -773
- package/eigen/Eigen/src/Core/util/MaxSizeVector.h +139 -0
- package/eigen/Eigen/src/Core/util/Memory.h +970 -748
- package/eigen/Eigen/src/Core/util/Meta.h +581 -633
- package/eigen/Eigen/src/Core/util/MoreMeta.h +638 -0
- package/eigen/Eigen/src/Core/util/ReenableStupidWarnings.h +32 -19
- package/eigen/Eigen/src/Core/util/ReshapedHelper.h +17 -17
- package/eigen/Eigen/src/Core/util/Serializer.h +209 -0
- package/eigen/Eigen/src/Core/util/StaticAssert.h +50 -166
- package/eigen/Eigen/src/Core/util/SymbolicIndex.h +377 -225
- package/eigen/Eigen/src/Core/util/XprHelper.h +784 -547
- package/eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h +246 -277
- package/eigen/Eigen/src/Eigenvalues/ComplexSchur.h +299 -319
- package/eigen/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h +52 -48
- package/eigen/Eigen/src/Eigenvalues/EigenSolver.h +413 -456
- package/eigen/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +309 -325
- package/eigen/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +157 -171
- package/eigen/Eigen/src/Eigenvalues/HessenbergDecomposition.h +292 -310
- package/eigen/Eigen/src/Eigenvalues/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +89 -105
- package/eigen/Eigen/src/Eigenvalues/RealQZ.h +537 -607
- package/eigen/Eigen/src/Eigenvalues/RealSchur.h +342 -381
- package/eigen/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +41 -35
- package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +541 -595
- package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +47 -44
- package/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +430 -462
- package/eigen/Eigen/src/Geometry/AlignedBox.h +226 -227
- package/eigen/Eigen/src/Geometry/AngleAxis.h +131 -133
- package/eigen/Eigen/src/Geometry/EulerAngles.h +163 -74
- package/eigen/Eigen/src/Geometry/Homogeneous.h +285 -333
- package/eigen/Eigen/src/Geometry/Hyperplane.h +151 -160
- package/eigen/Eigen/src/Geometry/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Geometry/OrthoMethods.h +168 -146
- package/eigen/Eigen/src/Geometry/ParametrizedLine.h +127 -127
- package/eigen/Eigen/src/Geometry/Quaternion.h +566 -506
- package/eigen/Eigen/src/Geometry/Rotation2D.h +107 -105
- package/eigen/Eigen/src/Geometry/RotationBase.h +148 -145
- package/eigen/Eigen/src/Geometry/Scaling.h +113 -106
- package/eigen/Eigen/src/Geometry/Transform.h +858 -936
- package/eigen/Eigen/src/Geometry/Translation.h +94 -92
- package/eigen/Eigen/src/Geometry/Umeyama.h +79 -84
- package/eigen/Eigen/src/Geometry/arch/Geometry_SIMD.h +90 -104
- package/eigen/Eigen/src/Householder/BlockHouseholder.h +51 -46
- package/eigen/Eigen/src/Householder/Householder.h +102 -124
- package/eigen/Eigen/src/Householder/HouseholderSequence.h +412 -453
- package/eigen/Eigen/src/Householder/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +149 -162
- package/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +124 -119
- package/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +92 -104
- package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +251 -243
- package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +224 -228
- package/eigen/Eigen/src/IterativeLinearSolvers/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +178 -227
- package/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +79 -84
- package/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +54 -60
- package/eigen/Eigen/src/Jacobi/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Jacobi/Jacobi.h +252 -308
- package/eigen/Eigen/src/KLUSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/KLUSupport/KLUSupport.h +208 -227
- package/eigen/Eigen/src/LU/Determinant.h +50 -69
- package/eigen/Eigen/src/LU/FullPivLU.h +545 -596
- package/eigen/Eigen/src/LU/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/LU/InverseImpl.h +206 -285
- package/eigen/Eigen/src/LU/PartialPivLU.h +390 -428
- package/eigen/Eigen/src/LU/PartialPivLU_LAPACKE.h +54 -40
- package/eigen/Eigen/src/LU/arch/InverseSize4.h +72 -70
- package/eigen/Eigen/src/MetisSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/MetisSupport/MetisSupport.h +81 -93
- package/eigen/Eigen/src/OrderingMethods/Amd.h +243 -265
- package/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +831 -1004
- package/eigen/Eigen/src/OrderingMethods/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/OrderingMethods/Ordering.h +112 -119
- package/eigen/Eigen/src/PaStiXSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h +524 -570
- package/eigen/Eigen/src/PardisoSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/PardisoSupport/PardisoSupport.h +385 -430
- package/eigen/Eigen/src/QR/ColPivHouseholderQR.h +479 -479
- package/eigen/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +120 -56
- package/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +166 -153
- package/eigen/Eigen/src/QR/FullPivHouseholderQR.h +495 -475
- package/eigen/Eigen/src/QR/HouseholderQR.h +394 -285
- package/eigen/Eigen/src/QR/HouseholderQR_LAPACKE.h +32 -23
- package/eigen/Eigen/src/QR/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SPQRSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +244 -264
- package/eigen/Eigen/src/SVD/BDCSVD.h +817 -713
- package/eigen/Eigen/src/SVD/BDCSVD_LAPACKE.h +174 -0
- package/eigen/Eigen/src/SVD/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SVD/JacobiSVD.h +577 -543
- package/eigen/Eigen/src/SVD/JacobiSVD_LAPACKE.h +85 -49
- package/eigen/Eigen/src/SVD/SVDBase.h +242 -182
- package/eigen/Eigen/src/SVD/UpperBidiagonalization.h +200 -235
- package/eigen/Eigen/src/SparseCholesky/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +765 -594
- package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +308 -94
- package/eigen/Eigen/src/SparseCore/AmbiVector.h +202 -251
- package/eigen/Eigen/src/SparseCore/CompressedStorage.h +184 -252
- package/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +134 -178
- package/eigen/Eigen/src/SparseCore/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseCore/SparseAssign.h +149 -140
- package/eigen/Eigen/src/SparseCore/SparseBlock.h +403 -440
- package/eigen/Eigen/src/SparseCore/SparseColEtree.h +100 -112
- package/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +525 -303
- package/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +555 -339
- package/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +100 -108
- package/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +169 -197
- package/eigen/Eigen/src/SparseCore/SparseDiagonalProduct.h +71 -71
- package/eigen/Eigen/src/SparseCore/SparseDot.h +49 -47
- package/eigen/Eigen/src/SparseCore/SparseFuzzy.h +13 -11
- package/eigen/Eigen/src/SparseCore/SparseMap.h +243 -253
- package/eigen/Eigen/src/SparseCore/SparseMatrix.h +1603 -1245
- package/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +403 -350
- package/eigen/Eigen/src/SparseCore/SparsePermutation.h +186 -115
- package/eigen/Eigen/src/SparseCore/SparseProduct.h +94 -97
- package/eigen/Eigen/src/SparseCore/SparseRedux.h +22 -24
- package/eigen/Eigen/src/SparseCore/SparseRef.h +268 -295
- package/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h +370 -416
- package/eigen/Eigen/src/SparseCore/SparseSolverBase.h +78 -87
- package/eigen/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +81 -95
- package/eigen/Eigen/src/SparseCore/SparseTranspose.h +62 -71
- package/eigen/Eigen/src/SparseCore/SparseTriangularView.h +132 -144
- package/eigen/Eigen/src/SparseCore/SparseUtil.h +138 -115
- package/eigen/Eigen/src/SparseCore/SparseVector.h +426 -372
- package/eigen/Eigen/src/SparseCore/SparseView.h +164 -193
- package/eigen/Eigen/src/SparseCore/TriangularSolver.h +129 -170
- package/eigen/Eigen/src/SparseLU/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseLU/SparseLU.h +756 -710
- package/eigen/Eigen/src/SparseLU/SparseLUImpl.h +61 -48
- package/eigen/Eigen/src/SparseLU/SparseLU_Memory.h +102 -118
- package/eigen/Eigen/src/SparseLU/SparseLU_Structs.h +38 -35
- package/eigen/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +245 -301
- package/eigen/Eigen/src/SparseLU/SparseLU_Utils.h +44 -49
- package/eigen/Eigen/src/SparseLU/SparseLU_column_bmod.h +104 -108
- package/eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h +89 -100
- package/eigen/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +57 -58
- package/eigen/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +43 -55
- package/eigen/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +74 -71
- package/eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h +124 -132
- package/eigen/Eigen/src/SparseLU/SparseLU_panel_dfs.h +136 -159
- package/eigen/Eigen/src/SparseLU/SparseLU_pivotL.h +51 -52
- package/eigen/Eigen/src/SparseLU/SparseLU_pruneL.h +67 -73
- package/eigen/Eigen/src/SparseLU/SparseLU_relax_snode.h +24 -26
- package/eigen/Eigen/src/SparseQR/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseQR/SparseQR.h +450 -502
- package/eigen/Eigen/src/StlSupport/StdDeque.h +28 -93
- package/eigen/Eigen/src/StlSupport/StdList.h +28 -84
- package/eigen/Eigen/src/StlSupport/StdVector.h +28 -108
- package/eigen/Eigen/src/StlSupport/details.h +48 -50
- package/eigen/Eigen/src/SuperLUSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SuperLUSupport/SuperLUSupport.h +634 -730
- package/eigen/Eigen/src/ThreadPool/Barrier.h +70 -0
- package/eigen/Eigen/src/ThreadPool/CoreThreadPoolDevice.h +336 -0
- package/eigen/Eigen/src/ThreadPool/EventCount.h +241 -0
- package/eigen/Eigen/src/ThreadPool/ForkJoin.h +140 -0
- package/eigen/Eigen/src/ThreadPool/InternalHeaderCheck.h +4 -0
- package/eigen/Eigen/src/ThreadPool/NonBlockingThreadPool.h +587 -0
- package/eigen/Eigen/src/ThreadPool/RunQueue.h +230 -0
- package/eigen/Eigen/src/ThreadPool/ThreadCancel.h +21 -0
- package/eigen/Eigen/src/ThreadPool/ThreadEnvironment.h +43 -0
- package/eigen/Eigen/src/ThreadPool/ThreadLocal.h +289 -0
- package/eigen/Eigen/src/ThreadPool/ThreadPoolInterface.h +50 -0
- package/eigen/Eigen/src/ThreadPool/ThreadYield.h +16 -0
- package/eigen/Eigen/src/UmfPackSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/UmfPackSupport/UmfPackSupport.h +428 -464
- package/eigen/Eigen/src/misc/Image.h +41 -43
- package/eigen/Eigen/src/misc/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/misc/Kernel.h +39 -41
- package/eigen/Eigen/src/misc/RealSvd2x2.h +19 -21
- package/eigen/Eigen/src/misc/blas.h +83 -426
- package/eigen/Eigen/src/misc/lapacke.h +9972 -16179
- package/eigen/Eigen/src/misc/lapacke_helpers.h +163 -0
- package/eigen/Eigen/src/misc/lapacke_mangling.h +4 -5
- package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.inc +344 -0
- package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.inc +544 -0
- package/eigen/Eigen/src/plugins/{BlockMethods.h → BlockMethods.inc} +434 -506
- package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.inc +116 -0
- package/eigen/Eigen/src/plugins/{CommonCwiseUnaryOps.h → CommonCwiseUnaryOps.inc} +58 -68
- package/eigen/Eigen/src/plugins/IndexedViewMethods.inc +192 -0
- package/eigen/Eigen/src/plugins/InternalHeaderCheck.inc +3 -0
- package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.inc +331 -0
- package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.inc +118 -0
- package/eigen/Eigen/src/plugins/ReshapedMethods.inc +133 -0
- package/package.json +1 -1
- package/eigen/COPYING.APACHE +0 -203
- package/eigen/COPYING.BSD +0 -26
- package/eigen/COPYING.GPL +0 -674
- package/eigen/COPYING.LGPL +0 -502
- package/eigen/COPYING.MINPACK +0 -51
- package/eigen/COPYING.MPL2 +0 -373
- package/eigen/COPYING.README +0 -18
- package/eigen/Eigen/src/Core/BooleanRedux.h +0 -162
- package/eigen/Eigen/src/Core/arch/CUDA/Complex.h +0 -258
- package/eigen/Eigen/src/Core/arch/Default/TypeCasting.h +0 -120
- package/eigen/Eigen/src/Core/arch/SYCL/SyclMemoryModel.h +0 -694
- package/eigen/Eigen/src/Core/util/NonMPL2.h +0 -3
- package/eigen/Eigen/src/SparseCore/MappedSparseMatrix.h +0 -67
- package/eigen/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +0 -280
- package/eigen/Eigen/src/misc/lapack.h +0 -152
- package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.h +0 -358
- package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h +0 -696
- package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.h +0 -115
- package/eigen/Eigen/src/plugins/IndexedViewMethods.h +0 -262
- package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h +0 -152
- package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h +0 -95
- package/eigen/Eigen/src/plugins/ReshapedMethods.h +0 -149
- package/eigen/README.md +0 -5
|
@@ -11,55 +11,64 @@
|
|
|
11
11
|
#ifndef EIGEN_META_H
|
|
12
12
|
#define EIGEN_META_H
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
// IWYU pragma: private
|
|
15
|
+
#include "../InternalHeaderCheck.h"
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
#if defined(EIGEN_GPU_COMPILE_PHASE)
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
#include <math_constants.h>
|
|
20
|
-
#endif
|
|
19
|
+
#include <cfloat>
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
#if defined(EIGEN_CUDA_ARCH)
|
|
22
|
+
#include <math_constants.h>
|
|
23
|
+
#endif
|
|
25
24
|
|
|
25
|
+
#if defined(EIGEN_HIP_DEVICE_COMPILE)
|
|
26
|
+
#include "Eigen/src/Core/arch/HIP/hcc/math_constants.h"
|
|
26
27
|
#endif
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
#define EIGEN_ICC_NEEDS_CSTDINT (EIGEN_COMP_ICC>=1600 && EIGEN_COMP_CXXVER >= 11)
|
|
29
|
+
#endif
|
|
30
30
|
|
|
31
31
|
// Define portable (u)int{32,64} types
|
|
32
|
-
#if EIGEN_HAS_CXX11 || EIGEN_ICC_NEEDS_CSTDINT
|
|
33
32
|
#include <cstdint>
|
|
33
|
+
|
|
34
34
|
namespace Eigen {
|
|
35
35
|
namespace numext {
|
|
36
|
-
typedef std::uint8_t
|
|
37
|
-
typedef std::int8_t
|
|
36
|
+
typedef std::uint8_t uint8_t;
|
|
37
|
+
typedef std::int8_t int8_t;
|
|
38
38
|
typedef std::uint16_t uint16_t;
|
|
39
|
-
typedef std::int16_t
|
|
39
|
+
typedef std::int16_t int16_t;
|
|
40
40
|
typedef std::uint32_t uint32_t;
|
|
41
|
-
typedef std::int32_t
|
|
41
|
+
typedef std::int32_t int32_t;
|
|
42
42
|
typedef std::uint64_t uint64_t;
|
|
43
|
-
typedef std::int64_t
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
typedef
|
|
53
|
-
typedef
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
typedef
|
|
58
|
-
typedef
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
43
|
+
typedef std::int64_t int64_t;
|
|
44
|
+
|
|
45
|
+
template <size_t Size>
|
|
46
|
+
struct get_integer_by_size {
|
|
47
|
+
typedef void signed_type;
|
|
48
|
+
typedef void unsigned_type;
|
|
49
|
+
};
|
|
50
|
+
template <>
|
|
51
|
+
struct get_integer_by_size<1> {
|
|
52
|
+
typedef int8_t signed_type;
|
|
53
|
+
typedef uint8_t unsigned_type;
|
|
54
|
+
};
|
|
55
|
+
template <>
|
|
56
|
+
struct get_integer_by_size<2> {
|
|
57
|
+
typedef int16_t signed_type;
|
|
58
|
+
typedef uint16_t unsigned_type;
|
|
59
|
+
};
|
|
60
|
+
template <>
|
|
61
|
+
struct get_integer_by_size<4> {
|
|
62
|
+
typedef int32_t signed_type;
|
|
63
|
+
typedef uint32_t unsigned_type;
|
|
64
|
+
};
|
|
65
|
+
template <>
|
|
66
|
+
struct get_integer_by_size<8> {
|
|
67
|
+
typedef int64_t signed_type;
|
|
68
|
+
typedef uint64_t unsigned_type;
|
|
69
|
+
};
|
|
70
|
+
} // namespace numext
|
|
71
|
+
} // namespace Eigen
|
|
63
72
|
|
|
64
73
|
namespace Eigen {
|
|
65
74
|
|
|
@@ -70,743 +79,682 @@ typedef EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex;
|
|
|
70
79
|
* \details To change this, \c \#define the preprocessor symbol \c EIGEN_DEFAULT_DENSE_INDEX_TYPE.
|
|
71
80
|
* \sa \blank \ref TopicPreprocessorDirectives, StorageIndex.
|
|
72
81
|
*/
|
|
73
|
-
|
|
74
82
|
typedef EIGEN_DEFAULT_DENSE_INDEX_TYPE Index;
|
|
75
83
|
|
|
76
84
|
namespace internal {
|
|
77
85
|
|
|
78
86
|
/** \internal
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
// Only recent versions of ICC complain about using ptrdiff_t to hold pointers,
|
|
86
|
-
// and older versions do not provide *intptr_t types.
|
|
87
|
-
#if EIGEN_ICC_NEEDS_CSTDINT
|
|
88
|
-
typedef std::intptr_t IntPtr;
|
|
89
|
-
typedef std::uintptr_t UIntPtr;
|
|
90
|
-
#else
|
|
91
|
-
typedef std::ptrdiff_t IntPtr;
|
|
92
|
-
typedef std::size_t UIntPtr;
|
|
93
|
-
#endif
|
|
94
|
-
#undef EIGEN_ICC_NEEDS_CSTDINT
|
|
87
|
+
* \file Meta.h
|
|
88
|
+
* This file contains generic metaprogramming classes which are not specifically related to Eigen.
|
|
89
|
+
* \note In case you wonder, yes we're aware that Boost already provides all these features,
|
|
90
|
+
* we however don't want to add a dependency to Boost.
|
|
91
|
+
*/
|
|
95
92
|
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
using std::false_type;
|
|
94
|
+
using std::true_type;
|
|
98
95
|
|
|
99
|
-
template<bool Condition>
|
|
96
|
+
template <bool Condition>
|
|
100
97
|
struct bool_constant;
|
|
101
98
|
|
|
102
|
-
template<>
|
|
99
|
+
template <>
|
|
103
100
|
struct bool_constant<true> : true_type {};
|
|
104
101
|
|
|
105
|
-
template<>
|
|
102
|
+
template <>
|
|
106
103
|
struct bool_constant<false> : false_type {};
|
|
107
104
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
template<typename T> struct remove_reference { typedef T type; };
|
|
115
|
-
template<typename T> struct remove_reference<T&> { typedef T type; };
|
|
116
|
-
|
|
117
|
-
template<typename T> struct remove_pointer { typedef T type; };
|
|
118
|
-
template<typename T> struct remove_pointer<T*> { typedef T type; };
|
|
119
|
-
template<typename T> struct remove_pointer<T*const> { typedef T type; };
|
|
120
|
-
|
|
121
|
-
template <class T> struct remove_const { typedef T type; };
|
|
122
|
-
template <class T> struct remove_const<const T> { typedef T type; };
|
|
123
|
-
template <class T> struct remove_const<const T[]> { typedef T type[]; };
|
|
124
|
-
template <class T, unsigned int Size> struct remove_const<const T[Size]> { typedef T type[Size]; };
|
|
125
|
-
|
|
126
|
-
template<typename T> struct remove_all { typedef T type; };
|
|
127
|
-
template<typename T> struct remove_all<const T> { typedef typename remove_all<T>::type type; };
|
|
128
|
-
template<typename T> struct remove_all<T const&> { typedef typename remove_all<T>::type type; };
|
|
129
|
-
template<typename T> struct remove_all<T&> { typedef typename remove_all<T>::type type; };
|
|
130
|
-
template<typename T> struct remove_all<T const*> { typedef typename remove_all<T>::type type; };
|
|
131
|
-
template<typename T> struct remove_all<T*> { typedef typename remove_all<T>::type type; };
|
|
132
|
-
|
|
133
|
-
template<typename T> struct is_arithmetic { enum { value = false }; };
|
|
134
|
-
template<> struct is_arithmetic<float> { enum { value = true }; };
|
|
135
|
-
template<> struct is_arithmetic<double> { enum { value = true }; };
|
|
136
|
-
template<> struct is_arithmetic<long double> { enum { value = true }; };
|
|
137
|
-
template<> struct is_arithmetic<bool> { enum { value = true }; };
|
|
138
|
-
template<> struct is_arithmetic<char> { enum { value = true }; };
|
|
139
|
-
template<> struct is_arithmetic<signed char> { enum { value = true }; };
|
|
140
|
-
template<> struct is_arithmetic<unsigned char> { enum { value = true }; };
|
|
141
|
-
template<> struct is_arithmetic<signed short> { enum { value = true }; };
|
|
142
|
-
template<> struct is_arithmetic<unsigned short>{ enum { value = true }; };
|
|
143
|
-
template<> struct is_arithmetic<signed int> { enum { value = true }; };
|
|
144
|
-
template<> struct is_arithmetic<unsigned int> { enum { value = true }; };
|
|
145
|
-
template<> struct is_arithmetic<signed long> { enum { value = true }; };
|
|
146
|
-
template<> struct is_arithmetic<unsigned long> { enum { value = true }; };
|
|
147
|
-
|
|
148
|
-
template<typename T, typename U> struct is_same { enum { value = 0 }; };
|
|
149
|
-
template<typename T> struct is_same<T,T> { enum { value = 1 }; };
|
|
150
|
-
|
|
151
|
-
template< class T >
|
|
152
|
-
struct is_void : is_same<void, typename remove_const<T>::type> {};
|
|
153
|
-
|
|
154
|
-
#if EIGEN_HAS_CXX11
|
|
155
|
-
template<> struct is_arithmetic<signed long long> { enum { value = true }; };
|
|
156
|
-
template<> struct is_arithmetic<unsigned long long> { enum { value = true }; };
|
|
157
|
-
using std::is_integral;
|
|
158
|
-
#else
|
|
159
|
-
template<typename T> struct is_integral { enum { value = false }; };
|
|
160
|
-
template<> struct is_integral<bool> { enum { value = true }; };
|
|
161
|
-
template<> struct is_integral<char> { enum { value = true }; };
|
|
162
|
-
template<> struct is_integral<signed char> { enum { value = true }; };
|
|
163
|
-
template<> struct is_integral<unsigned char> { enum { value = true }; };
|
|
164
|
-
template<> struct is_integral<signed short> { enum { value = true }; };
|
|
165
|
-
template<> struct is_integral<unsigned short> { enum { value = true }; };
|
|
166
|
-
template<> struct is_integral<signed int> { enum { value = true }; };
|
|
167
|
-
template<> struct is_integral<unsigned int> { enum { value = true }; };
|
|
168
|
-
template<> struct is_integral<signed long> { enum { value = true }; };
|
|
169
|
-
template<> struct is_integral<unsigned long> { enum { value = true }; };
|
|
170
|
-
#if EIGEN_COMP_MSVC
|
|
171
|
-
template<> struct is_integral<signed __int64> { enum { value = true }; };
|
|
172
|
-
template<> struct is_integral<unsigned __int64> { enum { value = true }; };
|
|
173
|
-
#endif
|
|
174
|
-
#endif
|
|
175
|
-
|
|
176
|
-
#if EIGEN_HAS_CXX11
|
|
177
|
-
using std::make_unsigned;
|
|
178
|
-
#else
|
|
179
|
-
// TODO: Possibly improve this implementation of make_unsigned.
|
|
180
|
-
// It is currently used only by
|
|
181
|
-
// template<typename Scalar> struct random_default_impl<Scalar, false, true>.
|
|
182
|
-
template<typename> struct make_unsigned;
|
|
183
|
-
template<> struct make_unsigned<char> { typedef unsigned char type; };
|
|
184
|
-
template<> struct make_unsigned<signed char> { typedef unsigned char type; };
|
|
185
|
-
template<> struct make_unsigned<unsigned char> { typedef unsigned char type; };
|
|
186
|
-
template<> struct make_unsigned<signed short> { typedef unsigned short type; };
|
|
187
|
-
template<> struct make_unsigned<unsigned short> { typedef unsigned short type; };
|
|
188
|
-
template<> struct make_unsigned<signed int> { typedef unsigned int type; };
|
|
189
|
-
template<> struct make_unsigned<unsigned int> { typedef unsigned int type; };
|
|
190
|
-
template<> struct make_unsigned<signed long> { typedef unsigned long type; };
|
|
191
|
-
template<> struct make_unsigned<unsigned long> { typedef unsigned long type; };
|
|
192
|
-
#if EIGEN_COMP_MSVC
|
|
193
|
-
template<> struct make_unsigned<signed __int64> { typedef unsigned __int64 type; };
|
|
194
|
-
template<> struct make_unsigned<unsigned __int64> { typedef unsigned __int64 type; };
|
|
195
|
-
#endif
|
|
105
|
+
// Third-party libraries rely on these.
|
|
106
|
+
using std::conditional;
|
|
107
|
+
using std::remove_const;
|
|
108
|
+
using std::remove_pointer;
|
|
109
|
+
using std::remove_reference;
|
|
196
110
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
template <typename T>
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
template<typename T>
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
using std::is_convertible;
|
|
223
|
-
|
|
224
|
-
#else
|
|
225
|
-
|
|
226
|
-
template<typename From, typename To>
|
|
227
|
-
struct is_convertible_impl
|
|
228
|
-
{
|
|
229
|
-
private:
|
|
230
|
-
struct any_conversion
|
|
231
|
-
{
|
|
232
|
-
template <typename T> any_conversion(const volatile T&);
|
|
233
|
-
template <typename T> any_conversion(T&);
|
|
234
|
-
};
|
|
235
|
-
struct yes {int a[1];};
|
|
236
|
-
struct no {int a[2];};
|
|
237
|
-
|
|
238
|
-
template<typename T>
|
|
239
|
-
static yes test(T, int);
|
|
111
|
+
template <typename T>
|
|
112
|
+
struct remove_all {
|
|
113
|
+
typedef T type;
|
|
114
|
+
};
|
|
115
|
+
template <typename T>
|
|
116
|
+
struct remove_all<const T> {
|
|
117
|
+
typedef typename remove_all<T>::type type;
|
|
118
|
+
};
|
|
119
|
+
template <typename T>
|
|
120
|
+
struct remove_all<T const&> {
|
|
121
|
+
typedef typename remove_all<T>::type type;
|
|
122
|
+
};
|
|
123
|
+
template <typename T>
|
|
124
|
+
struct remove_all<T&> {
|
|
125
|
+
typedef typename remove_all<T>::type type;
|
|
126
|
+
};
|
|
127
|
+
template <typename T>
|
|
128
|
+
struct remove_all<T const*> {
|
|
129
|
+
typedef typename remove_all<T>::type type;
|
|
130
|
+
};
|
|
131
|
+
template <typename T>
|
|
132
|
+
struct remove_all<T*> {
|
|
133
|
+
typedef typename remove_all<T>::type type;
|
|
134
|
+
};
|
|
240
135
|
|
|
241
|
-
|
|
242
|
-
|
|
136
|
+
template <typename T>
|
|
137
|
+
using remove_all_t = typename remove_all<T>::type;
|
|
243
138
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
enum { value =
|
|
251
|
-
|
|
252
|
-
|
|
139
|
+
template <typename T>
|
|
140
|
+
struct is_arithmetic {
|
|
141
|
+
enum { value = false };
|
|
142
|
+
};
|
|
143
|
+
template <>
|
|
144
|
+
struct is_arithmetic<float> {
|
|
145
|
+
enum { value = true };
|
|
146
|
+
};
|
|
147
|
+
template <>
|
|
148
|
+
struct is_arithmetic<double> {
|
|
149
|
+
enum { value = true };
|
|
150
|
+
};
|
|
151
|
+
// GPU devices treat `long double` as `double`.
|
|
152
|
+
#ifndef EIGEN_GPU_COMPILE_PHASE
|
|
153
|
+
template <>
|
|
154
|
+
struct is_arithmetic<long double> {
|
|
155
|
+
enum { value = true };
|
|
156
|
+
};
|
|
253
157
|
#endif
|
|
158
|
+
template <>
|
|
159
|
+
struct is_arithmetic<bool> {
|
|
160
|
+
enum { value = true };
|
|
254
161
|
};
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
162
|
+
template <>
|
|
163
|
+
struct is_arithmetic<char> {
|
|
164
|
+
enum { value = true };
|
|
165
|
+
};
|
|
166
|
+
template <>
|
|
167
|
+
struct is_arithmetic<signed char> {
|
|
168
|
+
enum { value = true };
|
|
169
|
+
};
|
|
170
|
+
template <>
|
|
171
|
+
struct is_arithmetic<unsigned char> {
|
|
172
|
+
enum { value = true };
|
|
173
|
+
};
|
|
174
|
+
template <>
|
|
175
|
+
struct is_arithmetic<signed short> {
|
|
176
|
+
enum { value = true };
|
|
177
|
+
};
|
|
178
|
+
template <>
|
|
179
|
+
struct is_arithmetic<unsigned short> {
|
|
180
|
+
enum { value = true };
|
|
181
|
+
};
|
|
182
|
+
template <>
|
|
183
|
+
struct is_arithmetic<signed int> {
|
|
184
|
+
enum { value = true };
|
|
185
|
+
};
|
|
186
|
+
template <>
|
|
187
|
+
struct is_arithmetic<unsigned int> {
|
|
188
|
+
enum { value = true };
|
|
189
|
+
};
|
|
190
|
+
template <>
|
|
191
|
+
struct is_arithmetic<signed long> {
|
|
192
|
+
enum { value = true };
|
|
193
|
+
};
|
|
194
|
+
template <>
|
|
195
|
+
struct is_arithmetic<unsigned long> {
|
|
196
|
+
enum { value = true };
|
|
260
197
|
};
|
|
261
198
|
|
|
262
|
-
template<typename T>
|
|
263
|
-
struct
|
|
199
|
+
template <typename T, typename U>
|
|
200
|
+
struct is_same {
|
|
201
|
+
enum { value = 0 };
|
|
202
|
+
};
|
|
203
|
+
template <typename T>
|
|
204
|
+
struct is_same<T, T> {
|
|
205
|
+
enum { value = 1 };
|
|
206
|
+
};
|
|
264
207
|
|
|
265
|
-
template<
|
|
266
|
-
struct
|
|
208
|
+
template <class T>
|
|
209
|
+
struct is_void : is_same<void, std::remove_const_t<T>> {};
|
|
267
210
|
|
|
211
|
+
/** \internal
|
|
212
|
+
* Implementation of std::void_t for SFINAE.
|
|
213
|
+
*
|
|
214
|
+
* Pre C++17:
|
|
215
|
+
* Custom implementation.
|
|
216
|
+
*
|
|
217
|
+
* Post C++17: Uses std::void_t
|
|
218
|
+
*/
|
|
219
|
+
#if EIGEN_COMP_CXXVER >= 17 && defined(__cpp_lib_void_t) && __cpp_lib_void_t >= 201411L
|
|
220
|
+
using std::void_t;
|
|
221
|
+
#else
|
|
222
|
+
template <typename...>
|
|
223
|
+
using void_t = void;
|
|
268
224
|
#endif
|
|
269
225
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
226
|
+
template <>
|
|
227
|
+
struct is_arithmetic<signed long long> {
|
|
228
|
+
enum { value = true };
|
|
229
|
+
};
|
|
230
|
+
template <>
|
|
231
|
+
struct is_arithmetic<unsigned long long> {
|
|
232
|
+
enum { value = true };
|
|
233
|
+
};
|
|
234
|
+
using std::is_integral;
|
|
274
235
|
|
|
275
|
-
|
|
276
|
-
{ typedef T type; };
|
|
236
|
+
using std::make_unsigned;
|
|
277
237
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
238
|
+
template <typename T>
|
|
239
|
+
struct is_const {
|
|
240
|
+
enum { value = 0 };
|
|
241
|
+
};
|
|
242
|
+
template <typename T>
|
|
243
|
+
struct is_const<T const> {
|
|
244
|
+
enum { value = 1 };
|
|
245
|
+
};
|
|
283
246
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
{
|
|
288
|
-
EIGEN_DEVICE_FUNC
|
|
289
|
-
static EIGEN_CONSTEXPR T epsilon() { return 0; }
|
|
290
|
-
static T (max)() { assert(false && "Highest not supported for this type"); }
|
|
291
|
-
static T (min)() { assert(false && "Lowest not supported for this type"); }
|
|
292
|
-
static T infinity() { assert(false && "Infinity not supported for this type"); }
|
|
293
|
-
static T quiet_NaN() { assert(false && "quiet_NaN not supported for this type"); }
|
|
294
|
-
};
|
|
295
|
-
template<> struct numeric_limits<float>
|
|
296
|
-
{
|
|
297
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
298
|
-
static float epsilon() { return __FLT_EPSILON__; }
|
|
299
|
-
EIGEN_DEVICE_FUNC
|
|
300
|
-
static float (max)() {
|
|
301
|
-
#if defined(EIGEN_CUDA_ARCH)
|
|
302
|
-
return CUDART_MAX_NORMAL_F;
|
|
303
|
-
#else
|
|
304
|
-
return HIPRT_MAX_NORMAL_F;
|
|
305
|
-
#endif
|
|
306
|
-
}
|
|
307
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
308
|
-
static float (min)() { return FLT_MIN; }
|
|
309
|
-
EIGEN_DEVICE_FUNC
|
|
310
|
-
static float infinity() {
|
|
311
|
-
#if defined(EIGEN_CUDA_ARCH)
|
|
312
|
-
return CUDART_INF_F;
|
|
313
|
-
#else
|
|
314
|
-
return HIPRT_INF_F;
|
|
315
|
-
#endif
|
|
316
|
-
}
|
|
317
|
-
EIGEN_DEVICE_FUNC
|
|
318
|
-
static float quiet_NaN() {
|
|
319
|
-
#if defined(EIGEN_CUDA_ARCH)
|
|
320
|
-
return CUDART_NAN_F;
|
|
321
|
-
#else
|
|
322
|
-
return HIPRT_NAN_F;
|
|
323
|
-
#endif
|
|
324
|
-
}
|
|
247
|
+
template <typename T>
|
|
248
|
+
struct add_const_on_value_type {
|
|
249
|
+
typedef const T type;
|
|
325
250
|
};
|
|
326
|
-
template
|
|
327
|
-
{
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
static double (min)() { return DBL_MIN; }
|
|
334
|
-
EIGEN_DEVICE_FUNC
|
|
335
|
-
static double infinity() {
|
|
336
|
-
#if defined(EIGEN_CUDA_ARCH)
|
|
337
|
-
return CUDART_INF;
|
|
338
|
-
#else
|
|
339
|
-
return HIPRT_INF;
|
|
340
|
-
#endif
|
|
341
|
-
}
|
|
342
|
-
EIGEN_DEVICE_FUNC
|
|
343
|
-
static double quiet_NaN() {
|
|
344
|
-
#if defined(EIGEN_CUDA_ARCH)
|
|
345
|
-
return CUDART_NAN;
|
|
346
|
-
#else
|
|
347
|
-
return HIPRT_NAN;
|
|
348
|
-
#endif
|
|
349
|
-
}
|
|
251
|
+
template <typename T>
|
|
252
|
+
struct add_const_on_value_type<T&> {
|
|
253
|
+
typedef T const& type;
|
|
254
|
+
};
|
|
255
|
+
template <typename T>
|
|
256
|
+
struct add_const_on_value_type<T*> {
|
|
257
|
+
typedef T const* type;
|
|
350
258
|
};
|
|
351
|
-
template
|
|
352
|
-
{
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
static int (min)() { return INT_MIN; }
|
|
359
|
-
};
|
|
360
|
-
template<> struct numeric_limits<unsigned int>
|
|
361
|
-
{
|
|
362
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
363
|
-
static unsigned int epsilon() { return 0; }
|
|
364
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
365
|
-
static unsigned int (max)() { return UINT_MAX; }
|
|
366
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
367
|
-
static unsigned int (min)() { return 0; }
|
|
368
|
-
};
|
|
369
|
-
template<> struct numeric_limits<long>
|
|
370
|
-
{
|
|
371
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
372
|
-
static long epsilon() { return 0; }
|
|
373
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
374
|
-
static long (max)() { return LONG_MAX; }
|
|
375
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
376
|
-
static long (min)() { return LONG_MIN; }
|
|
377
|
-
};
|
|
378
|
-
template<> struct numeric_limits<unsigned long>
|
|
379
|
-
{
|
|
380
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
381
|
-
static unsigned long epsilon() { return 0; }
|
|
382
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
383
|
-
static unsigned long (max)() { return ULONG_MAX; }
|
|
384
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
385
|
-
static unsigned long (min)() { return 0; }
|
|
386
|
-
};
|
|
387
|
-
template<> struct numeric_limits<long long>
|
|
388
|
-
{
|
|
389
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
390
|
-
static long long epsilon() { return 0; }
|
|
391
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
392
|
-
static long long (max)() { return LLONG_MAX; }
|
|
393
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
394
|
-
static long long (min)() { return LLONG_MIN; }
|
|
395
|
-
};
|
|
396
|
-
template<> struct numeric_limits<unsigned long long>
|
|
397
|
-
{
|
|
398
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
399
|
-
static unsigned long long epsilon() { return 0; }
|
|
400
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
401
|
-
static unsigned long long (max)() { return ULLONG_MAX; }
|
|
402
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
403
|
-
static unsigned long long (min)() { return 0; }
|
|
404
|
-
};
|
|
405
|
-
template<> struct numeric_limits<bool>
|
|
406
|
-
{
|
|
407
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
408
|
-
static bool epsilon() { return false; }
|
|
409
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
410
|
-
static bool (max)() { return true; }
|
|
411
|
-
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
412
|
-
static bool (min)() { return false; }
|
|
259
|
+
template <typename T>
|
|
260
|
+
struct add_const_on_value_type<T* const> {
|
|
261
|
+
typedef T const* const type;
|
|
262
|
+
};
|
|
263
|
+
template <typename T>
|
|
264
|
+
struct add_const_on_value_type<T const* const> {
|
|
265
|
+
typedef T const* const type;
|
|
413
266
|
};
|
|
414
267
|
|
|
415
|
-
|
|
268
|
+
template <typename T>
|
|
269
|
+
using add_const_on_value_type_t = typename add_const_on_value_type<T>::type;
|
|
416
270
|
|
|
417
|
-
|
|
271
|
+
using std::is_convertible;
|
|
418
272
|
|
|
419
273
|
/** \internal
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
class noncopyable
|
|
423
|
-
{
|
|
274
|
+
* A base class do disable default copy ctor and copy assignment operator.
|
|
275
|
+
*/
|
|
276
|
+
class noncopyable {
|
|
424
277
|
EIGEN_DEVICE_FUNC noncopyable(const noncopyable&);
|
|
425
278
|
EIGEN_DEVICE_FUNC const noncopyable& operator=(const noncopyable&);
|
|
426
|
-
|
|
279
|
+
|
|
280
|
+
protected:
|
|
427
281
|
EIGEN_DEVICE_FUNC noncopyable() {}
|
|
428
282
|
EIGEN_DEVICE_FUNC ~noncopyable() {}
|
|
429
283
|
};
|
|
430
284
|
|
|
431
285
|
/** \internal
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
template<typename T, typename EnableIf = void>
|
|
446
|
-
|
|
286
|
+
* Provides access to the number of elements in the object of as a compile-time constant expression.
|
|
287
|
+
* It "returns" Eigen::Dynamic if the size cannot be resolved at compile-time (default).
|
|
288
|
+
*
|
|
289
|
+
* Similar to std::tuple_size, but more general.
|
|
290
|
+
*
|
|
291
|
+
* It currently supports:
|
|
292
|
+
* - any types T defining T::SizeAtCompileTime
|
|
293
|
+
* - plain C arrays as T[N]
|
|
294
|
+
* - std::array (c++11)
|
|
295
|
+
* - some internal types such as SingleRange and AllRange
|
|
296
|
+
*
|
|
297
|
+
* The second template parameter eases SFINAE-based specializations.
|
|
298
|
+
*/
|
|
299
|
+
template <typename T, typename EnableIf = void>
|
|
300
|
+
struct array_size {
|
|
301
|
+
static constexpr Index value = Dynamic;
|
|
447
302
|
};
|
|
448
303
|
|
|
449
|
-
template
|
|
450
|
-
|
|
304
|
+
template <typename T>
|
|
305
|
+
struct array_size<T, std::enable_if_t<((T::SizeAtCompileTime & 0) == 0)>> {
|
|
306
|
+
static constexpr Index value = T::SizeAtCompileTime;
|
|
451
307
|
};
|
|
452
308
|
|
|
453
|
-
template<typename T, int N>
|
|
454
|
-
|
|
309
|
+
template <typename T, int N>
|
|
310
|
+
struct array_size<const T (&)[N]> {
|
|
311
|
+
static constexpr Index value = N;
|
|
455
312
|
};
|
|
456
|
-
template<typename T, int N>
|
|
457
|
-
|
|
313
|
+
template <typename T, int N>
|
|
314
|
+
struct array_size<T (&)[N]> {
|
|
315
|
+
static constexpr Index value = N;
|
|
458
316
|
};
|
|
459
317
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
318
|
+
template <typename T, std::size_t N>
|
|
319
|
+
struct array_size<const std::array<T, N>> {
|
|
320
|
+
static constexpr Index value = N;
|
|
463
321
|
};
|
|
464
|
-
template<typename T, std::size_t N>
|
|
465
|
-
|
|
322
|
+
template <typename T, std::size_t N>
|
|
323
|
+
struct array_size<std::array<T, N>> {
|
|
324
|
+
static constexpr Index value = N;
|
|
466
325
|
};
|
|
467
|
-
#endif
|
|
468
326
|
|
|
469
327
|
/** \internal
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
template<typename T,std::size_t N>
|
|
482
|
-
EIGEN_CONSTEXPR Index size(const T (&) [N]) { return N; }
|
|
328
|
+
* Analogue of the std::ssize free function.
|
|
329
|
+
* It returns the signed size of the container or view \a x of type \c T
|
|
330
|
+
*
|
|
331
|
+
* It currently supports:
|
|
332
|
+
* - any types T defining a member T::size() const
|
|
333
|
+
* - plain C arrays as T[N]
|
|
334
|
+
*
|
|
335
|
+
* For C++20, this function just forwards to `std::ssize`, or any ADL discoverable `ssize` function.
|
|
336
|
+
*/
|
|
337
|
+
#if EIGEN_COMP_CXXVER >= 20 && defined(__cpp_lib_ssize) && __cpp_lib_ssize >= 201902L
|
|
483
338
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
* Supports both a Func::result_type member and templated
|
|
490
|
-
* Func::result<Func(ArgTypes...)>::type member.
|
|
491
|
-
*
|
|
492
|
-
* If none of these members is provided, then the type of the first
|
|
493
|
-
* argument is returned.
|
|
494
|
-
*
|
|
495
|
-
* Post C++11:
|
|
496
|
-
* This uses std::result_of. However, note the `type` member removes
|
|
497
|
-
* const and converts references/pointers to their corresponding value type.
|
|
498
|
-
*/
|
|
499
|
-
#if EIGEN_HAS_STD_INVOKE_RESULT
|
|
500
|
-
template<typename T> struct result_of;
|
|
339
|
+
template <typename T>
|
|
340
|
+
constexpr auto index_list_size(T&& x) {
|
|
341
|
+
using std::ssize;
|
|
342
|
+
return ssize(std::forward<T>(x));
|
|
343
|
+
}
|
|
501
344
|
|
|
502
|
-
template<typename F, typename... ArgTypes>
|
|
503
|
-
struct result_of<F(ArgTypes...)> {
|
|
504
|
-
typedef typename std::invoke_result<F, ArgTypes...>::type type1;
|
|
505
|
-
typedef typename remove_all<type1>::type type;
|
|
506
|
-
};
|
|
507
|
-
#elif EIGEN_HAS_STD_RESULT_OF
|
|
508
|
-
template<typename T> struct result_of {
|
|
509
|
-
typedef typename std::result_of<T>::type type1;
|
|
510
|
-
typedef typename remove_all<type1>::type type;
|
|
511
|
-
};
|
|
512
345
|
#else
|
|
513
|
-
template<typename T> struct result_of { };
|
|
514
|
-
|
|
515
|
-
struct has_none {int a[1];};
|
|
516
|
-
struct has_std_result_type {int a[2];};
|
|
517
|
-
struct has_tr1_result {int a[3];};
|
|
518
|
-
|
|
519
|
-
template<typename Func, int SizeOf>
|
|
520
|
-
struct nullary_result_of_select {};
|
|
521
|
-
|
|
522
|
-
template<typename Func>
|
|
523
|
-
struct nullary_result_of_select<Func, sizeof(has_std_result_type)> {typedef typename Func::result_type type;};
|
|
524
|
-
|
|
525
|
-
template<typename Func>
|
|
526
|
-
struct nullary_result_of_select<Func, sizeof(has_tr1_result)> {typedef typename Func::template result<Func()>::type type;};
|
|
527
|
-
|
|
528
|
-
template<typename Func>
|
|
529
|
-
struct result_of<Func()> {
|
|
530
|
-
template<typename T>
|
|
531
|
-
static has_std_result_type testFunctor(T const *, typename T::result_type const * = 0);
|
|
532
|
-
template<typename T>
|
|
533
|
-
static has_tr1_result testFunctor(T const *, typename T::template result<T()>::type const * = 0);
|
|
534
|
-
static has_none testFunctor(...);
|
|
535
346
|
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
template<typename Func, typename ArgType, int SizeOf=sizeof(has_none)>
|
|
542
|
-
struct unary_result_of_select {typedef typename internal::remove_all<ArgType>::type type;};
|
|
543
|
-
|
|
544
|
-
template<typename Func, typename ArgType>
|
|
545
|
-
struct unary_result_of_select<Func, ArgType, sizeof(has_std_result_type)> {typedef typename Func::result_type type;};
|
|
546
|
-
|
|
547
|
-
template<typename Func, typename ArgType>
|
|
548
|
-
struct unary_result_of_select<Func, ArgType, sizeof(has_tr1_result)> {typedef typename Func::template result<Func(ArgType)>::type type;};
|
|
549
|
-
|
|
550
|
-
template<typename Func, typename ArgType>
|
|
551
|
-
struct result_of<Func(ArgType)> {
|
|
552
|
-
template<typename T>
|
|
553
|
-
static has_std_result_type testFunctor(T const *, typename T::result_type const * = 0);
|
|
554
|
-
template<typename T>
|
|
555
|
-
static has_tr1_result testFunctor(T const *, typename T::template result<T(ArgType)>::type const * = 0);
|
|
556
|
-
static has_none testFunctor(...);
|
|
557
|
-
|
|
558
|
-
// note that the following indirection is needed for gcc-3.3
|
|
559
|
-
enum {FunctorType = sizeof(testFunctor(static_cast<Func*>(0)))};
|
|
560
|
-
typedef typename unary_result_of_select<Func, ArgType, FunctorType>::type type;
|
|
561
|
-
};
|
|
562
|
-
|
|
563
|
-
template<typename Func, typename ArgType0, typename ArgType1, int SizeOf=sizeof(has_none)>
|
|
564
|
-
struct binary_result_of_select {typedef typename internal::remove_all<ArgType0>::type type;};
|
|
565
|
-
|
|
566
|
-
template<typename Func, typename ArgType0, typename ArgType1>
|
|
567
|
-
struct binary_result_of_select<Func, ArgType0, ArgType1, sizeof(has_std_result_type)>
|
|
568
|
-
{typedef typename Func::result_type type;};
|
|
569
|
-
|
|
570
|
-
template<typename Func, typename ArgType0, typename ArgType1>
|
|
571
|
-
struct binary_result_of_select<Func, ArgType0, ArgType1, sizeof(has_tr1_result)>
|
|
572
|
-
{typedef typename Func::template result<Func(ArgType0,ArgType1)>::type type;};
|
|
573
|
-
|
|
574
|
-
template<typename Func, typename ArgType0, typename ArgType1>
|
|
575
|
-
struct result_of<Func(ArgType0,ArgType1)> {
|
|
576
|
-
template<typename T>
|
|
577
|
-
static has_std_result_type testFunctor(T const *, typename T::result_type const * = 0);
|
|
578
|
-
template<typename T>
|
|
579
|
-
static has_tr1_result testFunctor(T const *, typename T::template result<T(ArgType0,ArgType1)>::type const * = 0);
|
|
580
|
-
static has_none testFunctor(...);
|
|
581
|
-
|
|
582
|
-
// note that the following indirection is needed for gcc-3.3
|
|
583
|
-
enum {FunctorType = sizeof(testFunctor(static_cast<Func*>(0)))};
|
|
584
|
-
typedef typename binary_result_of_select<Func, ArgType0, ArgType1, FunctorType>::type type;
|
|
585
|
-
};
|
|
586
|
-
|
|
587
|
-
template<typename Func, typename ArgType0, typename ArgType1, typename ArgType2, int SizeOf=sizeof(has_none)>
|
|
588
|
-
struct ternary_result_of_select {typedef typename internal::remove_all<ArgType0>::type type;};
|
|
589
|
-
|
|
590
|
-
template<typename Func, typename ArgType0, typename ArgType1, typename ArgType2>
|
|
591
|
-
struct ternary_result_of_select<Func, ArgType0, ArgType1, ArgType2, sizeof(has_std_result_type)>
|
|
592
|
-
{typedef typename Func::result_type type;};
|
|
593
|
-
|
|
594
|
-
template<typename Func, typename ArgType0, typename ArgType1, typename ArgType2>
|
|
595
|
-
struct ternary_result_of_select<Func, ArgType0, ArgType1, ArgType2, sizeof(has_tr1_result)>
|
|
596
|
-
{typedef typename Func::template result<Func(ArgType0,ArgType1,ArgType2)>::type type;};
|
|
597
|
-
|
|
598
|
-
template<typename Func, typename ArgType0, typename ArgType1, typename ArgType2>
|
|
599
|
-
struct result_of<Func(ArgType0,ArgType1,ArgType2)> {
|
|
600
|
-
template<typename T>
|
|
601
|
-
static has_std_result_type testFunctor(T const *, typename T::result_type const * = 0);
|
|
602
|
-
template<typename T>
|
|
603
|
-
static has_tr1_result testFunctor(T const *, typename T::template result<T(ArgType0,ArgType1,ArgType2)>::type const * = 0);
|
|
604
|
-
static has_none testFunctor(...);
|
|
605
|
-
|
|
606
|
-
// note that the following indirection is needed for gcc-3.3
|
|
607
|
-
enum {FunctorType = sizeof(testFunctor(static_cast<Func*>(0)))};
|
|
608
|
-
typedef typename ternary_result_of_select<Func, ArgType0, ArgType1, ArgType2, FunctorType>::type type;
|
|
609
|
-
};
|
|
347
|
+
template <typename T>
|
|
348
|
+
constexpr auto index_list_size(const T& x) {
|
|
349
|
+
using R = std::common_type_t<std::ptrdiff_t, std::make_signed_t<decltype(x.size())>>;
|
|
350
|
+
return static_cast<R>(x.size());
|
|
351
|
+
}
|
|
610
352
|
|
|
353
|
+
template <typename T, std::ptrdiff_t N>
|
|
354
|
+
constexpr std::ptrdiff_t index_list_size(const T (&)[N]) {
|
|
355
|
+
return N;
|
|
356
|
+
}
|
|
611
357
|
#endif
|
|
612
358
|
|
|
359
|
+
/** \internal
|
|
360
|
+
* Convenient struct to get the result type of a nullary, unary, binary, or
|
|
361
|
+
* ternary functor.
|
|
362
|
+
*
|
|
363
|
+
* Pre C++17:
|
|
364
|
+
* This uses std::result_of. However, note the `type` member removes
|
|
365
|
+
* const and converts references/pointers to their corresponding value type.
|
|
366
|
+
*
|
|
367
|
+
* Post C++17: Uses std::invoke_result
|
|
368
|
+
*/
|
|
613
369
|
#if EIGEN_HAS_STD_INVOKE_RESULT
|
|
614
|
-
template<typename
|
|
615
|
-
struct
|
|
370
|
+
template <typename T>
|
|
371
|
+
struct result_of;
|
|
372
|
+
|
|
373
|
+
template <typename F, typename... ArgTypes>
|
|
374
|
+
struct result_of<F(ArgTypes...)> {
|
|
616
375
|
typedef typename std::invoke_result<F, ArgTypes...>::type type1;
|
|
617
|
-
typedef
|
|
376
|
+
typedef remove_all_t<type1> type;
|
|
618
377
|
};
|
|
619
|
-
|
|
620
|
-
template<typename F, typename... ArgTypes>
|
|
378
|
+
|
|
379
|
+
template <typename F, typename... ArgTypes>
|
|
621
380
|
struct invoke_result {
|
|
622
|
-
typedef typename
|
|
623
|
-
typedef
|
|
381
|
+
typedef typename std::invoke_result<F, ArgTypes...>::type type1;
|
|
382
|
+
typedef remove_all_t<type1> type;
|
|
624
383
|
};
|
|
625
384
|
#else
|
|
626
|
-
template<typename
|
|
627
|
-
struct
|
|
628
|
-
typedef typename result_of<
|
|
629
|
-
typedef
|
|
385
|
+
template <typename T>
|
|
386
|
+
struct result_of {
|
|
387
|
+
typedef typename std::result_of<T>::type type1;
|
|
388
|
+
typedef remove_all_t<type1> type;
|
|
630
389
|
};
|
|
631
390
|
|
|
632
|
-
template<typename F>
|
|
633
|
-
struct invoke_result
|
|
634
|
-
typedef typename result_of<F()>::type type1;
|
|
635
|
-
typedef
|
|
391
|
+
template <typename F, typename... ArgTypes>
|
|
392
|
+
struct invoke_result {
|
|
393
|
+
typedef typename result_of<F(ArgTypes...)>::type type1;
|
|
394
|
+
typedef remove_all_t<type1> type;
|
|
636
395
|
};
|
|
396
|
+
#endif
|
|
637
397
|
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
};
|
|
398
|
+
// Reduces a sequence of bools to true if all are true, false otherwise.
|
|
399
|
+
template <bool... values>
|
|
400
|
+
using reduce_all =
|
|
401
|
+
std::is_same<std::integer_sequence<bool, values..., true>, std::integer_sequence<bool, true, values...>>;
|
|
643
402
|
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
};
|
|
649
|
-
#endif
|
|
403
|
+
// Reduces a sequence of bools to true if any are true, false if all false.
|
|
404
|
+
template <bool... values>
|
|
405
|
+
using reduce_any = std::integral_constant<bool, !std::is_same<std::integer_sequence<bool, values..., false>,
|
|
406
|
+
std::integer_sequence<bool, false, values...>>::value>;
|
|
650
407
|
|
|
651
|
-
struct meta_yes {
|
|
652
|
-
|
|
408
|
+
struct meta_yes {
|
|
409
|
+
char a[1];
|
|
410
|
+
};
|
|
411
|
+
struct meta_no {
|
|
412
|
+
char a[2];
|
|
413
|
+
};
|
|
653
414
|
|
|
654
415
|
// Check whether T::ReturnType does exist
|
|
655
416
|
template <typename T>
|
|
656
|
-
struct has_ReturnType
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
template <typename C>
|
|
417
|
+
struct has_ReturnType {
|
|
418
|
+
template <typename C>
|
|
419
|
+
static meta_yes testFunctor(C const*, typename C::ReturnType const* = 0);
|
|
420
|
+
template <typename C>
|
|
421
|
+
static meta_no testFunctor(...);
|
|
660
422
|
|
|
661
423
|
enum { value = sizeof(testFunctor<T>(static_cast<T*>(0))) == sizeof(meta_yes) };
|
|
662
424
|
};
|
|
663
425
|
|
|
664
|
-
template<typename T>
|
|
426
|
+
template <typename T>
|
|
427
|
+
const T* return_ptr();
|
|
665
428
|
|
|
666
|
-
template <typename T, typename IndexType=Index>
|
|
667
|
-
struct has_nullary_operator
|
|
668
|
-
|
|
669
|
-
|
|
429
|
+
template <typename T, typename IndexType = Index>
|
|
430
|
+
struct has_nullary_operator {
|
|
431
|
+
template <typename C>
|
|
432
|
+
static meta_yes testFunctor(C const*, std::enable_if_t<(sizeof(return_ptr<C>()->operator()()) > 0)>* = 0);
|
|
670
433
|
static meta_no testFunctor(...);
|
|
671
434
|
|
|
672
435
|
enum { value = sizeof(testFunctor(static_cast<T*>(0))) == sizeof(meta_yes) };
|
|
673
436
|
};
|
|
674
437
|
|
|
675
|
-
template <typename T, typename IndexType=Index>
|
|
676
|
-
struct has_unary_operator
|
|
677
|
-
|
|
678
|
-
|
|
438
|
+
template <typename T, typename IndexType = Index>
|
|
439
|
+
struct has_unary_operator {
|
|
440
|
+
template <typename C>
|
|
441
|
+
static meta_yes testFunctor(C const*, std::enable_if_t<(sizeof(return_ptr<C>()->operator()(IndexType(0))) > 0)>* = 0);
|
|
679
442
|
static meta_no testFunctor(...);
|
|
680
443
|
|
|
681
444
|
enum { value = sizeof(testFunctor(static_cast<T*>(0))) == sizeof(meta_yes) };
|
|
682
445
|
};
|
|
683
446
|
|
|
684
|
-
template <typename T, typename IndexType=Index>
|
|
685
|
-
struct has_binary_operator
|
|
686
|
-
|
|
687
|
-
|
|
447
|
+
template <typename T, typename IndexType = Index>
|
|
448
|
+
struct has_binary_operator {
|
|
449
|
+
template <typename C>
|
|
450
|
+
static meta_yes testFunctor(
|
|
451
|
+
C const*, std::enable_if_t<(sizeof(return_ptr<C>()->operator()(IndexType(0), IndexType(0))) > 0)>* = 0);
|
|
688
452
|
static meta_no testFunctor(...);
|
|
689
453
|
|
|
690
454
|
enum { value = sizeof(testFunctor(static_cast<T*>(0))) == sizeof(meta_yes) };
|
|
691
455
|
};
|
|
692
456
|
|
|
693
457
|
/** \internal In short, it computes int(sqrt(\a Y)) with \a Y an integer.
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
template<int Y,
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
TakeInf = MidX*MidX > Y ? 1 : 0,
|
|
706
|
-
NewInf = int(TakeInf) ? InfX : int(MidX),
|
|
707
|
-
NewSup = int(TakeInf) ? int(MidX) : SupX
|
|
708
|
-
};
|
|
709
|
-
public:
|
|
710
|
-
enum { ret = meta_sqrt<Y,NewInf,NewSup>::ret };
|
|
711
|
-
};
|
|
712
|
-
|
|
713
|
-
template<int Y, int InfX, int SupX>
|
|
714
|
-
class meta_sqrt<Y, InfX, SupX, true> { public: enum { ret = (SupX*SupX <= Y) ? SupX : InfX }; };
|
|
458
|
+
* Usage example: \code meta_sqrt<1023>::ret \endcode
|
|
459
|
+
*/
|
|
460
|
+
template <int Y, int InfX = 0, int SupX = ((Y == 1) ? 1 : Y / 2),
|
|
461
|
+
bool Done = ((SupX - InfX) <= 1 || ((SupX * SupX <= Y) && ((SupX + 1) * (SupX + 1) > Y)))>
|
|
462
|
+
class meta_sqrt {
|
|
463
|
+
enum {
|
|
464
|
+
MidX = (InfX + SupX) / 2,
|
|
465
|
+
TakeInf = MidX * MidX > Y ? 1 : 0,
|
|
466
|
+
NewInf = int(TakeInf) ? InfX : int(MidX),
|
|
467
|
+
NewSup = int(TakeInf) ? int(MidX) : SupX
|
|
468
|
+
};
|
|
715
469
|
|
|
470
|
+
public:
|
|
471
|
+
enum { ret = meta_sqrt<Y, NewInf, NewSup>::ret };
|
|
472
|
+
};
|
|
473
|
+
|
|
474
|
+
template <int Y, int InfX, int SupX>
|
|
475
|
+
class meta_sqrt<Y, InfX, SupX, true> {
|
|
476
|
+
public:
|
|
477
|
+
enum { ret = (SupX * SupX <= Y) ? SupX : InfX };
|
|
478
|
+
};
|
|
716
479
|
|
|
717
480
|
/** \internal Computes the least common multiple of two positive integer A and B
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
template<int A, int B, int K=1, bool Done = ((A*K)%B)==0, bool Big=(A>=B)>
|
|
721
|
-
struct meta_least_common_multiple
|
|
722
|
-
{
|
|
723
|
-
enum { ret = meta_least_common_multiple<A,B,K+1>::ret };
|
|
481
|
+
* at compile-time.
|
|
482
|
+
*/
|
|
483
|
+
template <int A, int B, int K = 1, bool Done = ((A * K) % B) == 0, bool Big = (A >= B)>
|
|
484
|
+
struct meta_least_common_multiple {
|
|
485
|
+
enum { ret = meta_least_common_multiple<A, B, K + 1>::ret };
|
|
724
486
|
};
|
|
725
|
-
template<int A, int B, int K, bool Done>
|
|
726
|
-
struct meta_least_common_multiple<A,B,K,Done,false>
|
|
727
|
-
{
|
|
728
|
-
enum { ret = meta_least_common_multiple<B,A,K>::ret };
|
|
487
|
+
template <int A, int B, int K, bool Done>
|
|
488
|
+
struct meta_least_common_multiple<A, B, K, Done, false> {
|
|
489
|
+
enum { ret = meta_least_common_multiple<B, A, K>::ret };
|
|
729
490
|
};
|
|
730
|
-
template<int A, int B, int K>
|
|
731
|
-
struct meta_least_common_multiple<A,B,K,true,true>
|
|
732
|
-
{
|
|
733
|
-
enum { ret = A*K };
|
|
491
|
+
template <int A, int B, int K>
|
|
492
|
+
struct meta_least_common_multiple<A, B, K, true, true> {
|
|
493
|
+
enum { ret = A * K };
|
|
734
494
|
};
|
|
735
495
|
|
|
736
|
-
|
|
737
496
|
/** \internal determines whether the product of two numeric types is allowed and what the return type is */
|
|
738
|
-
template<typename T, typename U>
|
|
739
|
-
{
|
|
497
|
+
template <typename T, typename U>
|
|
498
|
+
struct scalar_product_traits {
|
|
740
499
|
enum { Defined = 0 };
|
|
741
500
|
};
|
|
742
501
|
|
|
743
502
|
// FIXME quick workaround around current limitation of result_of
|
|
744
503
|
// template<typename Scalar, typename ArgType0, typename ArgType1>
|
|
745
504
|
// struct result_of<scalar_product_op<Scalar>(ArgType0,ArgType1)> {
|
|
746
|
-
// typedef typename scalar_product_traits<
|
|
505
|
+
// typedef typename scalar_product_traits<remove_all_t<ArgType0>, remove_all_t<ArgType1>>::ReturnType type;
|
|
747
506
|
// };
|
|
748
507
|
|
|
749
508
|
/** \internal Obtains a POD type suitable to use as storage for an object of a size
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
template<unsigned Len, unsigned Align>
|
|
509
|
+
* of at most Len bytes, aligned as specified by \c Align.
|
|
510
|
+
*/
|
|
511
|
+
template <unsigned Len, unsigned Align>
|
|
753
512
|
struct aligned_storage {
|
|
754
513
|
struct type {
|
|
755
514
|
EIGEN_ALIGN_TO_BOUNDARY(Align) unsigned char data[Len];
|
|
756
515
|
};
|
|
757
516
|
};
|
|
758
517
|
|
|
759
|
-
}
|
|
518
|
+
} // end namespace internal
|
|
519
|
+
|
|
520
|
+
template <typename T>
|
|
521
|
+
struct NumTraits;
|
|
760
522
|
|
|
761
523
|
namespace numext {
|
|
762
524
|
|
|
763
525
|
#if defined(EIGEN_GPU_COMPILE_PHASE)
|
|
764
|
-
template<typename T>
|
|
526
|
+
template <typename T>
|
|
527
|
+
EIGEN_DEVICE_FUNC void swap(T& a, T& b) {
|
|
528
|
+
T tmp = b;
|
|
529
|
+
b = a;
|
|
530
|
+
a = tmp;
|
|
531
|
+
}
|
|
765
532
|
#else
|
|
766
|
-
template<typename T>
|
|
533
|
+
template <typename T>
|
|
534
|
+
EIGEN_STRONG_INLINE void swap(T& a, T& b) {
|
|
535
|
+
std::swap(a, b);
|
|
536
|
+
}
|
|
767
537
|
#endif
|
|
768
538
|
|
|
769
|
-
#if defined(EIGEN_GPU_COMPILE_PHASE) && !EIGEN_HAS_CXX11
|
|
770
|
-
using internal::device::numeric_limits;
|
|
771
|
-
#else
|
|
772
539
|
using std::numeric_limits;
|
|
773
|
-
#endif
|
|
774
540
|
|
|
775
|
-
//
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
541
|
+
// Handle integer comparisons of different signedness.
|
|
542
|
+
template <typename X, typename Y, bool XIsInteger = NumTraits<X>::IsInteger, bool XIsSigned = NumTraits<X>::IsSigned,
|
|
543
|
+
bool YIsInteger = NumTraits<Y>::IsInteger, bool YIsSigned = NumTraits<Y>::IsSigned>
|
|
544
|
+
struct equal_strict_impl {
|
|
545
|
+
static EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool run(const X& x, const Y& y) { return x == y; }
|
|
546
|
+
};
|
|
547
|
+
template <typename X, typename Y>
|
|
548
|
+
struct equal_strict_impl<X, Y, true, false, true, true> {
|
|
549
|
+
// X is an unsigned integer
|
|
550
|
+
// Y is a signed integer
|
|
551
|
+
// if Y is non-negative, it may be represented exactly as its unsigned counterpart.
|
|
552
|
+
using UnsignedY = typename internal::make_unsigned<Y>::type;
|
|
553
|
+
static EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool run(const X& x, const Y& y) {
|
|
554
|
+
return y < Y(0) ? false : (x == static_cast<UnsignedY>(y));
|
|
555
|
+
}
|
|
556
|
+
};
|
|
557
|
+
template <typename X, typename Y>
|
|
558
|
+
struct equal_strict_impl<X, Y, true, true, true, false> {
|
|
559
|
+
// X is a signed integer
|
|
560
|
+
// Y is an unsigned integer
|
|
561
|
+
static EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool run(const X& x, const Y& y) {
|
|
562
|
+
return equal_strict_impl<Y, X>::run(y, x);
|
|
563
|
+
}
|
|
564
|
+
};
|
|
783
565
|
|
|
784
566
|
// The aim of the following functions is to bypass -Wfloat-equal warnings
|
|
785
567
|
// when we really want a strict equality comparison on floating points.
|
|
786
|
-
template<typename X, typename Y>
|
|
787
|
-
bool equal_strict(const X& x,const Y& y) {
|
|
568
|
+
template <typename X, typename Y>
|
|
569
|
+
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool equal_strict(const X& x, const Y& y) {
|
|
570
|
+
return equal_strict_impl<X, Y>::run(x, y);
|
|
571
|
+
}
|
|
788
572
|
|
|
789
573
|
#if !defined(EIGEN_GPU_COMPILE_PHASE) || (!defined(EIGEN_CUDA_ARCH) && defined(EIGEN_CONSTEXPR_ARE_DEVICE_FUNC))
|
|
790
|
-
template<>
|
|
791
|
-
bool equal_strict(const float& x,const float& y) {
|
|
574
|
+
template <>
|
|
575
|
+
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool equal_strict(const float& x, const float& y) {
|
|
576
|
+
return std::equal_to<float>()(x, y);
|
|
577
|
+
}
|
|
792
578
|
|
|
793
|
-
template<>
|
|
794
|
-
bool equal_strict(const double& x,const double& y) {
|
|
579
|
+
template <>
|
|
580
|
+
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool equal_strict(const double& x, const double& y) {
|
|
581
|
+
return std::equal_to<double>()(x, y);
|
|
582
|
+
}
|
|
795
583
|
#endif
|
|
796
584
|
|
|
797
|
-
|
|
798
|
-
|
|
585
|
+
/**
|
|
586
|
+
* \internal Performs an exact comparison of x to zero, e.g. to decide whether a term can be ignored.
|
|
587
|
+
* Use this to to bypass -Wfloat-equal warnings when exact zero is what needs to be tested.
|
|
588
|
+
*/
|
|
589
|
+
template <typename X>
|
|
590
|
+
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool is_exactly_zero(const X& x) {
|
|
591
|
+
return equal_strict(x, typename NumTraits<X>::Literal{0});
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* \internal Performs an exact comparison of x to one, e.g. to decide whether a factor needs to be multiplied.
|
|
596
|
+
* Use this to to bypass -Wfloat-equal warnings when exact one is what needs to be tested.
|
|
597
|
+
*/
|
|
598
|
+
template <typename X>
|
|
599
|
+
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool is_exactly_one(const X& x) {
|
|
600
|
+
return equal_strict(x, typename NumTraits<X>::Literal{1});
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
template <typename X, typename Y>
|
|
604
|
+
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool not_equal_strict(const X& x, const Y& y) {
|
|
605
|
+
return !equal_strict_impl<X, Y>::run(x, y);
|
|
606
|
+
}
|
|
799
607
|
|
|
800
608
|
#if !defined(EIGEN_GPU_COMPILE_PHASE) || (!defined(EIGEN_CUDA_ARCH) && defined(EIGEN_CONSTEXPR_ARE_DEVICE_FUNC))
|
|
801
|
-
template<>
|
|
802
|
-
bool not_equal_strict(const float& x,const float& y) {
|
|
609
|
+
template <>
|
|
610
|
+
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool not_equal_strict(const float& x, const float& y) {
|
|
611
|
+
return std::not_equal_to<float>()(x, y);
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
template <>
|
|
615
|
+
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool not_equal_strict(const double& x, const double& y) {
|
|
616
|
+
return std::not_equal_to<double>()(x, y);
|
|
617
|
+
}
|
|
618
|
+
#endif
|
|
619
|
+
|
|
620
|
+
} // end namespace numext
|
|
621
|
+
|
|
622
|
+
namespace internal {
|
|
623
|
+
|
|
624
|
+
template <typename Scalar>
|
|
625
|
+
struct is_identically_zero_impl {
|
|
626
|
+
static inline bool run(const Scalar& s) { return numext::is_exactly_zero(s); }
|
|
627
|
+
};
|
|
628
|
+
|
|
629
|
+
template <typename Scalar>
|
|
630
|
+
EIGEN_STRONG_INLINE bool is_identically_zero(const Scalar& s) {
|
|
631
|
+
return is_identically_zero_impl<Scalar>::run(s);
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
/// \internal Returns true if its argument is of integer or enum type.
|
|
635
|
+
/// FIXME this has the same purpose as `is_valid_index_type` in XprHelper.h
|
|
636
|
+
template <typename A>
|
|
637
|
+
constexpr bool is_int_or_enum_v = std::is_enum<A>::value || std::is_integral<A>::value;
|
|
638
|
+
|
|
639
|
+
template <typename A, typename B>
|
|
640
|
+
constexpr void plain_enum_asserts(A, B) {
|
|
641
|
+
static_assert(is_int_or_enum_v<A>, "Argument a must be an integer or enum");
|
|
642
|
+
static_assert(is_int_or_enum_v<B>, "Argument b must be an integer or enum");
|
|
643
|
+
}
|
|
803
644
|
|
|
804
|
-
|
|
805
|
-
|
|
645
|
+
/// \internal Gets the minimum of two values which may be integers or enums
|
|
646
|
+
template <typename A, typename B>
|
|
647
|
+
constexpr int plain_enum_min(A a, B b) {
|
|
648
|
+
plain_enum_asserts(a, b);
|
|
649
|
+
return ((int)a <= (int)b) ? (int)a : (int)b;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
/// \internal Gets the maximum of two values which may be integers or enums
|
|
653
|
+
template <typename A, typename B>
|
|
654
|
+
constexpr int plain_enum_max(A a, B b) {
|
|
655
|
+
plain_enum_asserts(a, b);
|
|
656
|
+
return ((int)a >= (int)b) ? (int)a : (int)b;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* \internal
|
|
661
|
+
* `min_size_prefer_dynamic` gives the min between compile-time sizes. 0 has absolute priority, followed by 1,
|
|
662
|
+
* followed by Dynamic, followed by other finite values. The reason for giving Dynamic the priority over
|
|
663
|
+
* finite values is that min(3, Dynamic) should be Dynamic, since that could be anything between 0 and 3.
|
|
664
|
+
*/
|
|
665
|
+
template <typename A, typename B>
|
|
666
|
+
constexpr int min_size_prefer_dynamic(A a, B b) {
|
|
667
|
+
plain_enum_asserts(a, b);
|
|
668
|
+
if ((int)a == 0 || (int)b == 0) return 0;
|
|
669
|
+
if ((int)a == 1 || (int)b == 1) return 1;
|
|
670
|
+
if ((int)a == Dynamic || (int)b == Dynamic) return Dynamic;
|
|
671
|
+
return plain_enum_min(a, b);
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
/**
|
|
675
|
+
* \internal
|
|
676
|
+
* min_size_prefer_fixed is a variant of `min_size_prefer_dynamic` comparing MaxSizes. The difference is that finite
|
|
677
|
+
* values now have priority over Dynamic, so that min(3, Dynamic) gives 3. Indeed, whatever the actual value is (between
|
|
678
|
+
* 0 and 3), it is not more than 3.
|
|
679
|
+
*/
|
|
680
|
+
template <typename A, typename B>
|
|
681
|
+
constexpr int min_size_prefer_fixed(A a, B b) {
|
|
682
|
+
plain_enum_asserts(a, b);
|
|
683
|
+
if ((int)a == 0 || (int)b == 0) return 0;
|
|
684
|
+
if ((int)a == 1 || (int)b == 1) return 1;
|
|
685
|
+
if ((int)a == Dynamic && (int)b == Dynamic) return Dynamic;
|
|
686
|
+
if ((int)a == Dynamic) return (int)b;
|
|
687
|
+
if ((int)b == Dynamic) return (int)a;
|
|
688
|
+
return plain_enum_min(a, b);
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
/// \internal see `min_size_prefer_fixed`. No need for a separate variant for MaxSizes here.
|
|
692
|
+
template <typename A, typename B>
|
|
693
|
+
constexpr int max_size_prefer_dynamic(A a, B b) {
|
|
694
|
+
plain_enum_asserts(a, b);
|
|
695
|
+
if ((int)a == Dynamic || (int)b == Dynamic) return Dynamic;
|
|
696
|
+
return plain_enum_max(a, b);
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
template <typename A, typename B>
|
|
700
|
+
inline constexpr int size_prefer_fixed(A a, B b) {
|
|
701
|
+
plain_enum_asserts(a, b);
|
|
702
|
+
return int(a) == Dynamic ? int(b) : int(a);
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
template <typename A, typename B>
|
|
706
|
+
inline constexpr bool enum_eq_not_dynamic(A a, B b) {
|
|
707
|
+
plain_enum_asserts(a, b);
|
|
708
|
+
if ((int)a == Dynamic || (int)b == Dynamic) return false;
|
|
709
|
+
return (int)a == (int)b;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
template <typename A, typename B>
|
|
713
|
+
constexpr bool enum_lt_not_dynamic(A a, B b) {
|
|
714
|
+
plain_enum_asserts(a, b);
|
|
715
|
+
if ((int)a == Dynamic || (int)b == Dynamic) return false;
|
|
716
|
+
return (int)a < (int)b;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
template <typename A, typename B>
|
|
720
|
+
constexpr bool enum_le_not_dynamic(A a, B b) {
|
|
721
|
+
plain_enum_asserts(a, b);
|
|
722
|
+
if ((int)a == Dynamic || (int)b == Dynamic) return false;
|
|
723
|
+
return (int)a <= (int)b;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
template <typename A, typename B>
|
|
727
|
+
constexpr bool enum_gt_not_dynamic(A a, B b) {
|
|
728
|
+
plain_enum_asserts(a, b);
|
|
729
|
+
if ((int)a == Dynamic || (int)b == Dynamic) return false;
|
|
730
|
+
return (int)a > (int)b;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
template <typename A, typename B>
|
|
734
|
+
constexpr bool enum_ge_not_dynamic(A a, B b) {
|
|
735
|
+
plain_enum_asserts(a, b);
|
|
736
|
+
if ((int)a == Dynamic || (int)b == Dynamic) return false;
|
|
737
|
+
return (int)a >= (int)b;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
/// \internal Calculate logical XOR at compile time
|
|
741
|
+
constexpr bool logical_xor(bool a, bool b) { return a != b; }
|
|
742
|
+
|
|
743
|
+
/// \internal Calculate logical IMPLIES at compile time
|
|
744
|
+
constexpr bool check_implication(bool a, bool b) { return !a || b; }
|
|
745
|
+
|
|
746
|
+
/// \internal Provide fallback for std::is_constant_evaluated for pre-C++20.
|
|
747
|
+
#if EIGEN_COMP_CXXVER >= 20 && defined(__cpp_lib_is_constant_evaluated) && __cpp_lib_is_constant_evaluated >= 201811L
|
|
748
|
+
using std::is_constant_evaluated;
|
|
749
|
+
#else
|
|
750
|
+
constexpr bool is_constant_evaluated() { return false; }
|
|
806
751
|
#endif
|
|
807
752
|
|
|
808
|
-
|
|
753
|
+
template <typename Scalar>
|
|
754
|
+
using make_complex_t = std::conditional_t<NumTraits<Scalar>::IsComplex, Scalar, std::complex<Scalar>>;
|
|
755
|
+
|
|
756
|
+
} // end namespace internal
|
|
809
757
|
|
|
810
|
-
}
|
|
758
|
+
} // end namespace Eigen
|
|
811
759
|
|
|
812
|
-
#endif
|
|
760
|
+
#endif // EIGEN_META_H
|