umappp 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +25 -0
- data/README.md +110 -0
- data/ext/umappp/extconf.rb +25 -0
- data/ext/umappp/numo.hpp +867 -0
- data/ext/umappp/umappp.cpp +225 -0
- data/lib/umappp/version.rb +5 -0
- data/lib/umappp.rb +41 -0
- data/vendor/Eigen/Cholesky +45 -0
- data/vendor/Eigen/CholmodSupport +48 -0
- data/vendor/Eigen/Core +384 -0
- data/vendor/Eigen/Dense +7 -0
- data/vendor/Eigen/Eigen +2 -0
- data/vendor/Eigen/Eigenvalues +60 -0
- data/vendor/Eigen/Geometry +59 -0
- data/vendor/Eigen/Householder +29 -0
- data/vendor/Eigen/IterativeLinearSolvers +48 -0
- data/vendor/Eigen/Jacobi +32 -0
- data/vendor/Eigen/KLUSupport +41 -0
- data/vendor/Eigen/LU +47 -0
- data/vendor/Eigen/MetisSupport +35 -0
- data/vendor/Eigen/OrderingMethods +70 -0
- data/vendor/Eigen/PaStiXSupport +49 -0
- data/vendor/Eigen/PardisoSupport +35 -0
- data/vendor/Eigen/QR +50 -0
- data/vendor/Eigen/QtAlignedMalloc +39 -0
- data/vendor/Eigen/SPQRSupport +34 -0
- data/vendor/Eigen/SVD +50 -0
- data/vendor/Eigen/Sparse +34 -0
- data/vendor/Eigen/SparseCholesky +37 -0
- data/vendor/Eigen/SparseCore +69 -0
- data/vendor/Eigen/SparseLU +50 -0
- data/vendor/Eigen/SparseQR +36 -0
- data/vendor/Eigen/StdDeque +27 -0
- data/vendor/Eigen/StdList +26 -0
- data/vendor/Eigen/StdVector +27 -0
- data/vendor/Eigen/SuperLUSupport +64 -0
- data/vendor/Eigen/UmfPackSupport +40 -0
- data/vendor/Eigen/src/Cholesky/LDLT.h +688 -0
- data/vendor/Eigen/src/Cholesky/LLT.h +558 -0
- data/vendor/Eigen/src/Cholesky/LLT_LAPACKE.h +99 -0
- data/vendor/Eigen/src/CholmodSupport/CholmodSupport.h +682 -0
- data/vendor/Eigen/src/Core/ArithmeticSequence.h +413 -0
- data/vendor/Eigen/src/Core/Array.h +417 -0
- data/vendor/Eigen/src/Core/ArrayBase.h +226 -0
- data/vendor/Eigen/src/Core/ArrayWrapper.h +209 -0
- data/vendor/Eigen/src/Core/Assign.h +90 -0
- data/vendor/Eigen/src/Core/AssignEvaluator.h +1010 -0
- data/vendor/Eigen/src/Core/Assign_MKL.h +178 -0
- data/vendor/Eigen/src/Core/BandMatrix.h +353 -0
- data/vendor/Eigen/src/Core/Block.h +448 -0
- data/vendor/Eigen/src/Core/BooleanRedux.h +162 -0
- data/vendor/Eigen/src/Core/CommaInitializer.h +164 -0
- data/vendor/Eigen/src/Core/ConditionEstimator.h +175 -0
- data/vendor/Eigen/src/Core/CoreEvaluators.h +1741 -0
- data/vendor/Eigen/src/Core/CoreIterators.h +132 -0
- data/vendor/Eigen/src/Core/CwiseBinaryOp.h +183 -0
- data/vendor/Eigen/src/Core/CwiseNullaryOp.h +1001 -0
- data/vendor/Eigen/src/Core/CwiseTernaryOp.h +197 -0
- data/vendor/Eigen/src/Core/CwiseUnaryOp.h +103 -0
- data/vendor/Eigen/src/Core/CwiseUnaryView.h +132 -0
- data/vendor/Eigen/src/Core/DenseBase.h +701 -0
- data/vendor/Eigen/src/Core/DenseCoeffsBase.h +685 -0
- data/vendor/Eigen/src/Core/DenseStorage.h +652 -0
- data/vendor/Eigen/src/Core/Diagonal.h +258 -0
- data/vendor/Eigen/src/Core/DiagonalMatrix.h +391 -0
- data/vendor/Eigen/src/Core/DiagonalProduct.h +28 -0
- data/vendor/Eigen/src/Core/Dot.h +318 -0
- data/vendor/Eigen/src/Core/EigenBase.h +160 -0
- data/vendor/Eigen/src/Core/ForceAlignedAccess.h +150 -0
- data/vendor/Eigen/src/Core/Fuzzy.h +155 -0
- data/vendor/Eigen/src/Core/GeneralProduct.h +465 -0
- data/vendor/Eigen/src/Core/GenericPacketMath.h +1040 -0
- data/vendor/Eigen/src/Core/GlobalFunctions.h +194 -0
- data/vendor/Eigen/src/Core/IO.h +258 -0
- data/vendor/Eigen/src/Core/IndexedView.h +237 -0
- data/vendor/Eigen/src/Core/Inverse.h +117 -0
- data/vendor/Eigen/src/Core/Map.h +171 -0
- data/vendor/Eigen/src/Core/MapBase.h +310 -0
- data/vendor/Eigen/src/Core/MathFunctions.h +2057 -0
- data/vendor/Eigen/src/Core/MathFunctionsImpl.h +200 -0
- data/vendor/Eigen/src/Core/Matrix.h +565 -0
- data/vendor/Eigen/src/Core/MatrixBase.h +547 -0
- data/vendor/Eigen/src/Core/NestByValue.h +85 -0
- data/vendor/Eigen/src/Core/NoAlias.h +109 -0
- data/vendor/Eigen/src/Core/NumTraits.h +335 -0
- data/vendor/Eigen/src/Core/PartialReduxEvaluator.h +232 -0
- data/vendor/Eigen/src/Core/PermutationMatrix.h +605 -0
- data/vendor/Eigen/src/Core/PlainObjectBase.h +1128 -0
- data/vendor/Eigen/src/Core/Product.h +191 -0
- data/vendor/Eigen/src/Core/ProductEvaluators.h +1179 -0
- data/vendor/Eigen/src/Core/Random.h +218 -0
- data/vendor/Eigen/src/Core/Redux.h +515 -0
- data/vendor/Eigen/src/Core/Ref.h +381 -0
- data/vendor/Eigen/src/Core/Replicate.h +142 -0
- data/vendor/Eigen/src/Core/Reshaped.h +454 -0
- data/vendor/Eigen/src/Core/ReturnByValue.h +119 -0
- data/vendor/Eigen/src/Core/Reverse.h +217 -0
- data/vendor/Eigen/src/Core/Select.h +164 -0
- data/vendor/Eigen/src/Core/SelfAdjointView.h +365 -0
- data/vendor/Eigen/src/Core/SelfCwiseBinaryOp.h +47 -0
- data/vendor/Eigen/src/Core/Solve.h +188 -0
- data/vendor/Eigen/src/Core/SolveTriangular.h +235 -0
- data/vendor/Eigen/src/Core/SolverBase.h +168 -0
- data/vendor/Eigen/src/Core/StableNorm.h +251 -0
- data/vendor/Eigen/src/Core/StlIterators.h +463 -0
- data/vendor/Eigen/src/Core/Stride.h +116 -0
- data/vendor/Eigen/src/Core/Swap.h +68 -0
- data/vendor/Eigen/src/Core/Transpose.h +464 -0
- data/vendor/Eigen/src/Core/Transpositions.h +386 -0
- data/vendor/Eigen/src/Core/TriangularMatrix.h +1001 -0
- data/vendor/Eigen/src/Core/VectorBlock.h +96 -0
- data/vendor/Eigen/src/Core/VectorwiseOp.h +784 -0
- data/vendor/Eigen/src/Core/Visitor.h +381 -0
- data/vendor/Eigen/src/Core/arch/AVX/Complex.h +372 -0
- data/vendor/Eigen/src/Core/arch/AVX/MathFunctions.h +228 -0
- data/vendor/Eigen/src/Core/arch/AVX/PacketMath.h +1574 -0
- data/vendor/Eigen/src/Core/arch/AVX/TypeCasting.h +115 -0
- data/vendor/Eigen/src/Core/arch/AVX512/Complex.h +422 -0
- data/vendor/Eigen/src/Core/arch/AVX512/MathFunctions.h +362 -0
- data/vendor/Eigen/src/Core/arch/AVX512/PacketMath.h +2303 -0
- data/vendor/Eigen/src/Core/arch/AVX512/TypeCasting.h +89 -0
- data/vendor/Eigen/src/Core/arch/AltiVec/Complex.h +417 -0
- data/vendor/Eigen/src/Core/arch/AltiVec/MathFunctions.h +90 -0
- data/vendor/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +2937 -0
- data/vendor/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +221 -0
- data/vendor/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +629 -0
- data/vendor/Eigen/src/Core/arch/AltiVec/PacketMath.h +2711 -0
- data/vendor/Eigen/src/Core/arch/CUDA/Complex.h +258 -0
- data/vendor/Eigen/src/Core/arch/Default/BFloat16.h +700 -0
- data/vendor/Eigen/src/Core/arch/Default/ConjHelper.h +117 -0
- data/vendor/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +1649 -0
- data/vendor/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +110 -0
- data/vendor/Eigen/src/Core/arch/Default/Half.h +942 -0
- data/vendor/Eigen/src/Core/arch/Default/Settings.h +49 -0
- data/vendor/Eigen/src/Core/arch/Default/TypeCasting.h +120 -0
- data/vendor/Eigen/src/Core/arch/GPU/MathFunctions.h +103 -0
- data/vendor/Eigen/src/Core/arch/GPU/PacketMath.h +1685 -0
- data/vendor/Eigen/src/Core/arch/GPU/TypeCasting.h +80 -0
- data/vendor/Eigen/src/Core/arch/HIP/hcc/math_constants.h +23 -0
- data/vendor/Eigen/src/Core/arch/MSA/Complex.h +648 -0
- data/vendor/Eigen/src/Core/arch/MSA/MathFunctions.h +387 -0
- data/vendor/Eigen/src/Core/arch/MSA/PacketMath.h +1233 -0
- data/vendor/Eigen/src/Core/arch/NEON/Complex.h +584 -0
- data/vendor/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +183 -0
- data/vendor/Eigen/src/Core/arch/NEON/MathFunctions.h +75 -0
- data/vendor/Eigen/src/Core/arch/NEON/PacketMath.h +4587 -0
- data/vendor/Eigen/src/Core/arch/NEON/TypeCasting.h +1419 -0
- data/vendor/Eigen/src/Core/arch/SSE/Complex.h +351 -0
- data/vendor/Eigen/src/Core/arch/SSE/MathFunctions.h +199 -0
- data/vendor/Eigen/src/Core/arch/SSE/PacketMath.h +1505 -0
- data/vendor/Eigen/src/Core/arch/SSE/TypeCasting.h +142 -0
- data/vendor/Eigen/src/Core/arch/SVE/MathFunctions.h +44 -0
- data/vendor/Eigen/src/Core/arch/SVE/PacketMath.h +752 -0
- data/vendor/Eigen/src/Core/arch/SVE/TypeCasting.h +49 -0
- data/vendor/Eigen/src/Core/arch/SYCL/InteropHeaders.h +232 -0
- data/vendor/Eigen/src/Core/arch/SYCL/MathFunctions.h +301 -0
- data/vendor/Eigen/src/Core/arch/SYCL/PacketMath.h +670 -0
- data/vendor/Eigen/src/Core/arch/SYCL/SyclMemoryModel.h +694 -0
- data/vendor/Eigen/src/Core/arch/SYCL/TypeCasting.h +85 -0
- data/vendor/Eigen/src/Core/arch/ZVector/Complex.h +426 -0
- data/vendor/Eigen/src/Core/arch/ZVector/MathFunctions.h +233 -0
- data/vendor/Eigen/src/Core/arch/ZVector/PacketMath.h +1060 -0
- data/vendor/Eigen/src/Core/functors/AssignmentFunctors.h +177 -0
- data/vendor/Eigen/src/Core/functors/BinaryFunctors.h +541 -0
- data/vendor/Eigen/src/Core/functors/NullaryFunctors.h +189 -0
- data/vendor/Eigen/src/Core/functors/StlFunctors.h +166 -0
- data/vendor/Eigen/src/Core/functors/TernaryFunctors.h +25 -0
- data/vendor/Eigen/src/Core/functors/UnaryFunctors.h +1131 -0
- data/vendor/Eigen/src/Core/products/GeneralBlockPanelKernel.h +2645 -0
- data/vendor/Eigen/src/Core/products/GeneralMatrixMatrix.h +517 -0
- data/vendor/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +317 -0
- data/vendor/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +145 -0
- data/vendor/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +124 -0
- data/vendor/Eigen/src/Core/products/GeneralMatrixVector.h +518 -0
- data/vendor/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +136 -0
- data/vendor/Eigen/src/Core/products/Parallelizer.h +180 -0
- data/vendor/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +544 -0
- data/vendor/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +295 -0
- data/vendor/Eigen/src/Core/products/SelfadjointMatrixVector.h +262 -0
- data/vendor/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h +118 -0
- data/vendor/Eigen/src/Core/products/SelfadjointProduct.h +133 -0
- data/vendor/Eigen/src/Core/products/SelfadjointRank2Update.h +94 -0
- data/vendor/Eigen/src/Core/products/TriangularMatrixMatrix.h +472 -0
- data/vendor/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +317 -0
- data/vendor/Eigen/src/Core/products/TriangularMatrixVector.h +350 -0
- data/vendor/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h +255 -0
- data/vendor/Eigen/src/Core/products/TriangularSolverMatrix.h +337 -0
- data/vendor/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +167 -0
- data/vendor/Eigen/src/Core/products/TriangularSolverVector.h +148 -0
- data/vendor/Eigen/src/Core/util/BlasUtil.h +583 -0
- data/vendor/Eigen/src/Core/util/ConfigureVectorization.h +512 -0
- data/vendor/Eigen/src/Core/util/Constants.h +563 -0
- data/vendor/Eigen/src/Core/util/DisableStupidWarnings.h +106 -0
- data/vendor/Eigen/src/Core/util/ForwardDeclarations.h +322 -0
- data/vendor/Eigen/src/Core/util/IndexedViewHelper.h +186 -0
- data/vendor/Eigen/src/Core/util/IntegralConstant.h +272 -0
- data/vendor/Eigen/src/Core/util/MKL_support.h +137 -0
- data/vendor/Eigen/src/Core/util/Macros.h +1464 -0
- data/vendor/Eigen/src/Core/util/Memory.h +1163 -0
- data/vendor/Eigen/src/Core/util/Meta.h +812 -0
- data/vendor/Eigen/src/Core/util/NonMPL2.h +3 -0
- data/vendor/Eigen/src/Core/util/ReenableStupidWarnings.h +31 -0
- data/vendor/Eigen/src/Core/util/ReshapedHelper.h +51 -0
- data/vendor/Eigen/src/Core/util/StaticAssert.h +221 -0
- data/vendor/Eigen/src/Core/util/SymbolicIndex.h +293 -0
- data/vendor/Eigen/src/Core/util/XprHelper.h +856 -0
- data/vendor/Eigen/src/Eigenvalues/ComplexEigenSolver.h +346 -0
- data/vendor/Eigen/src/Eigenvalues/ComplexSchur.h +462 -0
- data/vendor/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h +91 -0
- data/vendor/Eigen/src/Eigenvalues/EigenSolver.h +622 -0
- data/vendor/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +418 -0
- data/vendor/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +226 -0
- data/vendor/Eigen/src/Eigenvalues/HessenbergDecomposition.h +374 -0
- data/vendor/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +158 -0
- data/vendor/Eigen/src/Eigenvalues/RealQZ.h +657 -0
- data/vendor/Eigen/src/Eigenvalues/RealSchur.h +558 -0
- data/vendor/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +77 -0
- data/vendor/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +904 -0
- data/vendor/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +87 -0
- data/vendor/Eigen/src/Eigenvalues/Tridiagonalization.h +561 -0
- data/vendor/Eigen/src/Geometry/AlignedBox.h +486 -0
- data/vendor/Eigen/src/Geometry/AngleAxis.h +247 -0
- data/vendor/Eigen/src/Geometry/EulerAngles.h +114 -0
- data/vendor/Eigen/src/Geometry/Homogeneous.h +501 -0
- data/vendor/Eigen/src/Geometry/Hyperplane.h +282 -0
- data/vendor/Eigen/src/Geometry/OrthoMethods.h +235 -0
- data/vendor/Eigen/src/Geometry/ParametrizedLine.h +232 -0
- data/vendor/Eigen/src/Geometry/Quaternion.h +870 -0
- data/vendor/Eigen/src/Geometry/Rotation2D.h +199 -0
- data/vendor/Eigen/src/Geometry/RotationBase.h +206 -0
- data/vendor/Eigen/src/Geometry/Scaling.h +188 -0
- data/vendor/Eigen/src/Geometry/Transform.h +1563 -0
- data/vendor/Eigen/src/Geometry/Translation.h +202 -0
- data/vendor/Eigen/src/Geometry/Umeyama.h +166 -0
- data/vendor/Eigen/src/Geometry/arch/Geometry_SIMD.h +168 -0
- data/vendor/Eigen/src/Householder/BlockHouseholder.h +110 -0
- data/vendor/Eigen/src/Householder/Householder.h +176 -0
- data/vendor/Eigen/src/Householder/HouseholderSequence.h +545 -0
- data/vendor/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +226 -0
- data/vendor/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +212 -0
- data/vendor/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +229 -0
- data/vendor/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +394 -0
- data/vendor/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +453 -0
- data/vendor/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +444 -0
- data/vendor/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +198 -0
- data/vendor/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +117 -0
- data/vendor/Eigen/src/Jacobi/Jacobi.h +483 -0
- data/vendor/Eigen/src/KLUSupport/KLUSupport.h +358 -0
- data/vendor/Eigen/src/LU/Determinant.h +117 -0
- data/vendor/Eigen/src/LU/FullPivLU.h +877 -0
- data/vendor/Eigen/src/LU/InverseImpl.h +432 -0
- data/vendor/Eigen/src/LU/PartialPivLU.h +624 -0
- data/vendor/Eigen/src/LU/PartialPivLU_LAPACKE.h +83 -0
- data/vendor/Eigen/src/LU/arch/InverseSize4.h +351 -0
- data/vendor/Eigen/src/MetisSupport/MetisSupport.h +137 -0
- data/vendor/Eigen/src/OrderingMethods/Amd.h +435 -0
- data/vendor/Eigen/src/OrderingMethods/Eigen_Colamd.h +1863 -0
- data/vendor/Eigen/src/OrderingMethods/Ordering.h +153 -0
- data/vendor/Eigen/src/PaStiXSupport/PaStiXSupport.h +678 -0
- data/vendor/Eigen/src/PardisoSupport/PardisoSupport.h +545 -0
- data/vendor/Eigen/src/QR/ColPivHouseholderQR.h +674 -0
- data/vendor/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +97 -0
- data/vendor/Eigen/src/QR/CompleteOrthogonalDecomposition.h +635 -0
- data/vendor/Eigen/src/QR/FullPivHouseholderQR.h +713 -0
- data/vendor/Eigen/src/QR/HouseholderQR.h +434 -0
- data/vendor/Eigen/src/QR/HouseholderQR_LAPACKE.h +68 -0
- data/vendor/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +335 -0
- data/vendor/Eigen/src/SVD/BDCSVD.h +1366 -0
- data/vendor/Eigen/src/SVD/JacobiSVD.h +812 -0
- data/vendor/Eigen/src/SVD/JacobiSVD_LAPACKE.h +91 -0
- data/vendor/Eigen/src/SVD/SVDBase.h +376 -0
- data/vendor/Eigen/src/SVD/UpperBidiagonalization.h +414 -0
- data/vendor/Eigen/src/SparseCholesky/SimplicialCholesky.h +697 -0
- data/vendor/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +174 -0
- data/vendor/Eigen/src/SparseCore/AmbiVector.h +378 -0
- data/vendor/Eigen/src/SparseCore/CompressedStorage.h +274 -0
- data/vendor/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +352 -0
- data/vendor/Eigen/src/SparseCore/MappedSparseMatrix.h +67 -0
- data/vendor/Eigen/src/SparseCore/SparseAssign.h +270 -0
- data/vendor/Eigen/src/SparseCore/SparseBlock.h +571 -0
- data/vendor/Eigen/src/SparseCore/SparseColEtree.h +206 -0
- data/vendor/Eigen/src/SparseCore/SparseCompressedBase.h +370 -0
- data/vendor/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +722 -0
- data/vendor/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +150 -0
- data/vendor/Eigen/src/SparseCore/SparseDenseProduct.h +342 -0
- data/vendor/Eigen/src/SparseCore/SparseDiagonalProduct.h +138 -0
- data/vendor/Eigen/src/SparseCore/SparseDot.h +98 -0
- data/vendor/Eigen/src/SparseCore/SparseFuzzy.h +29 -0
- data/vendor/Eigen/src/SparseCore/SparseMap.h +305 -0
- data/vendor/Eigen/src/SparseCore/SparseMatrix.h +1518 -0
- data/vendor/Eigen/src/SparseCore/SparseMatrixBase.h +398 -0
- data/vendor/Eigen/src/SparseCore/SparsePermutation.h +178 -0
- data/vendor/Eigen/src/SparseCore/SparseProduct.h +181 -0
- data/vendor/Eigen/src/SparseCore/SparseRedux.h +49 -0
- data/vendor/Eigen/src/SparseCore/SparseRef.h +397 -0
- data/vendor/Eigen/src/SparseCore/SparseSelfAdjointView.h +659 -0
- data/vendor/Eigen/src/SparseCore/SparseSolverBase.h +124 -0
- data/vendor/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +198 -0
- data/vendor/Eigen/src/SparseCore/SparseTranspose.h +92 -0
- data/vendor/Eigen/src/SparseCore/SparseTriangularView.h +189 -0
- data/vendor/Eigen/src/SparseCore/SparseUtil.h +186 -0
- data/vendor/Eigen/src/SparseCore/SparseVector.h +478 -0
- data/vendor/Eigen/src/SparseCore/SparseView.h +254 -0
- data/vendor/Eigen/src/SparseCore/TriangularSolver.h +315 -0
- data/vendor/Eigen/src/SparseLU/SparseLU.h +923 -0
- data/vendor/Eigen/src/SparseLU/SparseLUImpl.h +66 -0
- data/vendor/Eigen/src/SparseLU/SparseLU_Memory.h +226 -0
- data/vendor/Eigen/src/SparseLU/SparseLU_Structs.h +110 -0
- data/vendor/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +375 -0
- data/vendor/Eigen/src/SparseLU/SparseLU_Utils.h +80 -0
- data/vendor/Eigen/src/SparseLU/SparseLU_column_bmod.h +181 -0
- data/vendor/Eigen/src/SparseLU/SparseLU_column_dfs.h +179 -0
- data/vendor/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +107 -0
- data/vendor/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +280 -0
- data/vendor/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +126 -0
- data/vendor/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +130 -0
- data/vendor/Eigen/src/SparseLU/SparseLU_panel_bmod.h +223 -0
- data/vendor/Eigen/src/SparseLU/SparseLU_panel_dfs.h +258 -0
- data/vendor/Eigen/src/SparseLU/SparseLU_pivotL.h +137 -0
- data/vendor/Eigen/src/SparseLU/SparseLU_pruneL.h +136 -0
- data/vendor/Eigen/src/SparseLU/SparseLU_relax_snode.h +83 -0
- data/vendor/Eigen/src/SparseQR/SparseQR.h +758 -0
- data/vendor/Eigen/src/StlSupport/StdDeque.h +116 -0
- data/vendor/Eigen/src/StlSupport/StdList.h +106 -0
- data/vendor/Eigen/src/StlSupport/StdVector.h +131 -0
- data/vendor/Eigen/src/StlSupport/details.h +84 -0
- data/vendor/Eigen/src/SuperLUSupport/SuperLUSupport.h +1025 -0
- data/vendor/Eigen/src/UmfPackSupport/UmfPackSupport.h +642 -0
- data/vendor/Eigen/src/misc/Image.h +82 -0
- data/vendor/Eigen/src/misc/Kernel.h +79 -0
- data/vendor/Eigen/src/misc/RealSvd2x2.h +55 -0
- data/vendor/Eigen/src/misc/blas.h +440 -0
- data/vendor/Eigen/src/misc/lapack.h +152 -0
- data/vendor/Eigen/src/misc/lapacke.h +16292 -0
- data/vendor/Eigen/src/misc/lapacke_mangling.h +17 -0
- data/vendor/Eigen/src/plugins/ArrayCwiseBinaryOps.h +358 -0
- data/vendor/Eigen/src/plugins/ArrayCwiseUnaryOps.h +696 -0
- data/vendor/Eigen/src/plugins/BlockMethods.h +1442 -0
- data/vendor/Eigen/src/plugins/CommonCwiseBinaryOps.h +115 -0
- data/vendor/Eigen/src/plugins/CommonCwiseUnaryOps.h +177 -0
- data/vendor/Eigen/src/plugins/IndexedViewMethods.h +262 -0
- data/vendor/Eigen/src/plugins/MatrixCwiseBinaryOps.h +152 -0
- data/vendor/Eigen/src/plugins/MatrixCwiseUnaryOps.h +95 -0
- data/vendor/Eigen/src/plugins/ReshapedMethods.h +149 -0
- data/vendor/aarand/aarand.hpp +114 -0
- data/vendor/annoy/annoylib.h +1495 -0
- data/vendor/annoy/kissrandom.h +120 -0
- data/vendor/annoy/mman.h +242 -0
- data/vendor/hnswlib/bruteforce.h +152 -0
- data/vendor/hnswlib/hnswalg.h +1192 -0
- data/vendor/hnswlib/hnswlib.h +108 -0
- data/vendor/hnswlib/space_ip.h +282 -0
- data/vendor/hnswlib/space_l2.h +281 -0
- data/vendor/hnswlib/visited_list_pool.h +79 -0
- data/vendor/irlba/irlba.hpp +575 -0
- data/vendor/irlba/lanczos.hpp +212 -0
- data/vendor/irlba/parallel.hpp +474 -0
- data/vendor/irlba/utils.hpp +224 -0
- data/vendor/irlba/wrappers.hpp +228 -0
- data/vendor/kmeans/Base.hpp +75 -0
- data/vendor/kmeans/Details.hpp +79 -0
- data/vendor/kmeans/HartiganWong.hpp +492 -0
- data/vendor/kmeans/InitializeKmeansPP.hpp +144 -0
- data/vendor/kmeans/InitializeNone.hpp +44 -0
- data/vendor/kmeans/InitializePCAPartition.hpp +309 -0
- data/vendor/kmeans/InitializeRandom.hpp +91 -0
- data/vendor/kmeans/Kmeans.hpp +161 -0
- data/vendor/kmeans/Lloyd.hpp +134 -0
- data/vendor/kmeans/MiniBatch.hpp +269 -0
- data/vendor/kmeans/QuickSearch.hpp +179 -0
- data/vendor/kmeans/compute_centroids.hpp +32 -0
- data/vendor/kmeans/compute_wcss.hpp +27 -0
- data/vendor/kmeans/is_edge_case.hpp +42 -0
- data/vendor/kmeans/random.hpp +55 -0
- data/vendor/knncolle/Annoy/Annoy.hpp +193 -0
- data/vendor/knncolle/BruteForce/BruteForce.hpp +120 -0
- data/vendor/knncolle/Hnsw/Hnsw.hpp +225 -0
- data/vendor/knncolle/Kmknn/Kmknn.hpp +286 -0
- data/vendor/knncolle/VpTree/VpTree.hpp +256 -0
- data/vendor/knncolle/knncolle.hpp +34 -0
- data/vendor/knncolle/utils/Base.hpp +100 -0
- data/vendor/knncolle/utils/NeighborQueue.hpp +94 -0
- data/vendor/knncolle/utils/distances.hpp +98 -0
- data/vendor/knncolle/utils/find_nearest_neighbors.hpp +112 -0
- data/vendor/powerit/PowerIterations.hpp +157 -0
- data/vendor/umappp/NeighborList.hpp +37 -0
- data/vendor/umappp/Umap.hpp +662 -0
- data/vendor/umappp/combine_neighbor_sets.hpp +95 -0
- data/vendor/umappp/find_ab.hpp +157 -0
- data/vendor/umappp/neighbor_similarities.hpp +136 -0
- data/vendor/umappp/optimize_layout.hpp +285 -0
- data/vendor/umappp/spectral_init.hpp +181 -0
- data/vendor/umappp/umappp.hpp +13 -0
- metadata +465 -0
@@ -0,0 +1,109 @@
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
2
|
+
// for linear algebra.
|
3
|
+
//
|
4
|
+
// Copyright (C) 2009 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_NOALIAS_H
|
11
|
+
#define EIGEN_NOALIAS_H
|
12
|
+
|
13
|
+
namespace Eigen {
|
14
|
+
|
15
|
+
/** \class NoAlias
|
16
|
+
* \ingroup Core_Module
|
17
|
+
*
|
18
|
+
* \brief Pseudo expression providing an operator = assuming no aliasing
|
19
|
+
*
|
20
|
+
* \tparam ExpressionType the type of the object on which to do the lazy assignment
|
21
|
+
*
|
22
|
+
* This class represents an expression with special assignment operators
|
23
|
+
* assuming no aliasing between the target expression and the source expression.
|
24
|
+
* More precisely it alloas to bypass the EvalBeforeAssignBit flag of the source expression.
|
25
|
+
* It is the return type of MatrixBase::noalias()
|
26
|
+
* and most of the time this is the only way it is used.
|
27
|
+
*
|
28
|
+
* \sa MatrixBase::noalias()
|
29
|
+
*/
|
30
|
+
template<typename ExpressionType, template <typename> class StorageBase>
|
31
|
+
class NoAlias
|
32
|
+
{
|
33
|
+
public:
|
34
|
+
typedef typename ExpressionType::Scalar Scalar;
|
35
|
+
|
36
|
+
EIGEN_DEVICE_FUNC
|
37
|
+
explicit NoAlias(ExpressionType& expression) : m_expression(expression) {}
|
38
|
+
|
39
|
+
template<typename OtherDerived>
|
40
|
+
EIGEN_DEVICE_FUNC
|
41
|
+
EIGEN_STRONG_INLINE ExpressionType& operator=(const StorageBase<OtherDerived>& other)
|
42
|
+
{
|
43
|
+
call_assignment_no_alias(m_expression, other.derived(), internal::assign_op<Scalar,typename OtherDerived::Scalar>());
|
44
|
+
return m_expression;
|
45
|
+
}
|
46
|
+
|
47
|
+
template<typename OtherDerived>
|
48
|
+
EIGEN_DEVICE_FUNC
|
49
|
+
EIGEN_STRONG_INLINE ExpressionType& operator+=(const StorageBase<OtherDerived>& other)
|
50
|
+
{
|
51
|
+
call_assignment_no_alias(m_expression, other.derived(), internal::add_assign_op<Scalar,typename OtherDerived::Scalar>());
|
52
|
+
return m_expression;
|
53
|
+
}
|
54
|
+
|
55
|
+
template<typename OtherDerived>
|
56
|
+
EIGEN_DEVICE_FUNC
|
57
|
+
EIGEN_STRONG_INLINE ExpressionType& operator-=(const StorageBase<OtherDerived>& other)
|
58
|
+
{
|
59
|
+
call_assignment_no_alias(m_expression, other.derived(), internal::sub_assign_op<Scalar,typename OtherDerived::Scalar>());
|
60
|
+
return m_expression;
|
61
|
+
}
|
62
|
+
|
63
|
+
EIGEN_DEVICE_FUNC
|
64
|
+
ExpressionType& expression() const
|
65
|
+
{
|
66
|
+
return m_expression;
|
67
|
+
}
|
68
|
+
|
69
|
+
protected:
|
70
|
+
ExpressionType& m_expression;
|
71
|
+
};
|
72
|
+
|
73
|
+
/** \returns a pseudo expression of \c *this with an operator= assuming
|
74
|
+
* no aliasing between \c *this and the source expression.
|
75
|
+
*
|
76
|
+
* More precisely, noalias() allows to bypass the EvalBeforeAssignBit flag.
|
77
|
+
* Currently, even though several expressions may alias, only product
|
78
|
+
* expressions have this flag. Therefore, noalias() is only useful when
|
79
|
+
* the source expression contains a matrix product.
|
80
|
+
*
|
81
|
+
* Here are some examples where noalias is useful:
|
82
|
+
* \code
|
83
|
+
* D.noalias() = A * B;
|
84
|
+
* D.noalias() += A.transpose() * B;
|
85
|
+
* D.noalias() -= 2 * A * B.adjoint();
|
86
|
+
* \endcode
|
87
|
+
*
|
88
|
+
* On the other hand the following example will lead to a \b wrong result:
|
89
|
+
* \code
|
90
|
+
* A.noalias() = A * B;
|
91
|
+
* \endcode
|
92
|
+
* because the result matrix A is also an operand of the matrix product. Therefore,
|
93
|
+
* there is no alternative than evaluating A * B in a temporary, that is the default
|
94
|
+
* behavior when you write:
|
95
|
+
* \code
|
96
|
+
* A = A * B;
|
97
|
+
* \endcode
|
98
|
+
*
|
99
|
+
* \sa class NoAlias
|
100
|
+
*/
|
101
|
+
template<typename Derived>
|
102
|
+
NoAlias<Derived,MatrixBase> EIGEN_DEVICE_FUNC MatrixBase<Derived>::noalias()
|
103
|
+
{
|
104
|
+
return NoAlias<Derived, Eigen::MatrixBase >(derived());
|
105
|
+
}
|
106
|
+
|
107
|
+
} // end namespace Eigen
|
108
|
+
|
109
|
+
#endif // EIGEN_NOALIAS_H
|
@@ -0,0 +1,335 @@
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
2
|
+
// for linear algebra.
|
3
|
+
//
|
4
|
+
// Copyright (C) 2006-2010 Benoit Jacob <jacob.benoit.1@gmail.com>
|
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_NUMTRAITS_H
|
11
|
+
#define EIGEN_NUMTRAITS_H
|
12
|
+
|
13
|
+
namespace Eigen {
|
14
|
+
|
15
|
+
namespace internal {
|
16
|
+
|
17
|
+
// default implementation of digits10(), based on numeric_limits if specialized,
|
18
|
+
// 0 for integer types, and log10(epsilon()) otherwise.
|
19
|
+
template< typename T,
|
20
|
+
bool use_numeric_limits = std::numeric_limits<T>::is_specialized,
|
21
|
+
bool is_integer = NumTraits<T>::IsInteger>
|
22
|
+
struct default_digits10_impl
|
23
|
+
{
|
24
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
25
|
+
static int run() { return std::numeric_limits<T>::digits10; }
|
26
|
+
};
|
27
|
+
|
28
|
+
template<typename T>
|
29
|
+
struct default_digits10_impl<T,false,false> // Floating point
|
30
|
+
{
|
31
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
32
|
+
static int run() {
|
33
|
+
using std::log10;
|
34
|
+
using std::ceil;
|
35
|
+
typedef typename NumTraits<T>::Real Real;
|
36
|
+
return int(ceil(-log10(NumTraits<Real>::epsilon())));
|
37
|
+
}
|
38
|
+
};
|
39
|
+
|
40
|
+
template<typename T>
|
41
|
+
struct default_digits10_impl<T,false,true> // Integer
|
42
|
+
{
|
43
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
44
|
+
static int run() { return 0; }
|
45
|
+
};
|
46
|
+
|
47
|
+
|
48
|
+
// default implementation of digits(), based on numeric_limits if specialized,
|
49
|
+
// 0 for integer types, and log2(epsilon()) otherwise.
|
50
|
+
template< typename T,
|
51
|
+
bool use_numeric_limits = std::numeric_limits<T>::is_specialized,
|
52
|
+
bool is_integer = NumTraits<T>::IsInteger>
|
53
|
+
struct default_digits_impl
|
54
|
+
{
|
55
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
56
|
+
static int run() { return std::numeric_limits<T>::digits; }
|
57
|
+
};
|
58
|
+
|
59
|
+
template<typename T>
|
60
|
+
struct default_digits_impl<T,false,false> // Floating point
|
61
|
+
{
|
62
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
63
|
+
static int run() {
|
64
|
+
using std::log;
|
65
|
+
using std::ceil;
|
66
|
+
typedef typename NumTraits<T>::Real Real;
|
67
|
+
return int(ceil(-log(NumTraits<Real>::epsilon())/log(static_cast<Real>(2))));
|
68
|
+
}
|
69
|
+
};
|
70
|
+
|
71
|
+
template<typename T>
|
72
|
+
struct default_digits_impl<T,false,true> // Integer
|
73
|
+
{
|
74
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
75
|
+
static int run() { return 0; }
|
76
|
+
};
|
77
|
+
|
78
|
+
} // end namespace internal
|
79
|
+
|
80
|
+
namespace numext {
|
81
|
+
/** \internal bit-wise cast without changing the underlying bit representation. */
|
82
|
+
|
83
|
+
// TODO: Replace by std::bit_cast (available in C++20)
|
84
|
+
template <typename Tgt, typename Src>
|
85
|
+
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Tgt bit_cast(const Src& src) {
|
86
|
+
#if EIGEN_HAS_TYPE_TRAITS
|
87
|
+
// The behaviour of memcpy is not specified for non-trivially copyable types
|
88
|
+
EIGEN_STATIC_ASSERT(std::is_trivially_copyable<Src>::value, THIS_TYPE_IS_NOT_SUPPORTED);
|
89
|
+
EIGEN_STATIC_ASSERT(std::is_trivially_copyable<Tgt>::value && std::is_default_constructible<Tgt>::value,
|
90
|
+
THIS_TYPE_IS_NOT_SUPPORTED);
|
91
|
+
#endif
|
92
|
+
|
93
|
+
EIGEN_STATIC_ASSERT(sizeof(Src) == sizeof(Tgt), THIS_TYPE_IS_NOT_SUPPORTED);
|
94
|
+
Tgt tgt;
|
95
|
+
EIGEN_USING_STD(memcpy)
|
96
|
+
memcpy(&tgt, &src, sizeof(Tgt));
|
97
|
+
return tgt;
|
98
|
+
}
|
99
|
+
} // namespace numext
|
100
|
+
|
101
|
+
/** \class NumTraits
|
102
|
+
* \ingroup Core_Module
|
103
|
+
*
|
104
|
+
* \brief Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
|
105
|
+
*
|
106
|
+
* \tparam T the numeric type at hand
|
107
|
+
*
|
108
|
+
* This class stores enums, typedefs and static methods giving information about a numeric type.
|
109
|
+
*
|
110
|
+
* The provided data consists of:
|
111
|
+
* \li A typedef \c Real, giving the "real part" type of \a T. If \a T is already real,
|
112
|
+
* then \c Real is just a typedef to \a T. If \a T is \c std::complex<U> then \c Real
|
113
|
+
* is a typedef to \a U.
|
114
|
+
* \li A typedef \c NonInteger, giving the type that should be used for operations producing non-integral values,
|
115
|
+
* such as quotients, square roots, etc. If \a T is a floating-point type, then this typedef just gives
|
116
|
+
* \a T again. Note however that many Eigen functions such as internal::sqrt simply refuse to
|
117
|
+
* take integers. Outside of a few cases, Eigen doesn't do automatic type promotion. Thus, this typedef is
|
118
|
+
* only intended as a helper for code that needs to explicitly promote types.
|
119
|
+
* \li A typedef \c Literal giving the type to use for numeric literals such as "2" or "0.5". For instance, for \c std::complex<U>, Literal is defined as \c U.
|
120
|
+
* Of course, this type must be fully compatible with \a T. In doubt, just use \a T here.
|
121
|
+
* \li A typedef \a Nested giving the type to use to nest a value inside of the expression tree. If you don't know what
|
122
|
+
* this means, just use \a T here.
|
123
|
+
* \li An enum value \a IsComplex. It is equal to 1 if \a T is a \c std::complex
|
124
|
+
* type, and to 0 otherwise.
|
125
|
+
* \li An enum value \a IsInteger. It is equal to \c 1 if \a T is an integer type such as \c int,
|
126
|
+
* and to \c 0 otherwise.
|
127
|
+
* \li Enum values ReadCost, AddCost and MulCost representing a rough estimate of the number of CPU cycles needed
|
128
|
+
* to by move / add / mul instructions respectively, assuming the data is already stored in CPU registers.
|
129
|
+
* Stay vague here. No need to do architecture-specific stuff. If you don't know what this means, just use \c Eigen::HugeCost.
|
130
|
+
* \li An enum value \a IsSigned. It is equal to \c 1 if \a T is a signed type and to 0 if \a T is unsigned.
|
131
|
+
* \li An enum value \a RequireInitialization. It is equal to \c 1 if the constructor of the numeric type \a T must
|
132
|
+
* be called, and to 0 if it is safe not to call it. Default is 0 if \a T is an arithmetic type, and 1 otherwise.
|
133
|
+
* \li An epsilon() function which, unlike <a href="http://en.cppreference.com/w/cpp/types/numeric_limits/epsilon">std::numeric_limits::epsilon()</a>,
|
134
|
+
* it returns a \a Real instead of a \a T.
|
135
|
+
* \li A dummy_precision() function returning a weak epsilon value. It is mainly used as a default
|
136
|
+
* value by the fuzzy comparison operators.
|
137
|
+
* \li highest() and lowest() functions returning the highest and lowest possible values respectively.
|
138
|
+
* \li digits() function returning the number of radix digits (non-sign digits for integers, mantissa for floating-point). This is
|
139
|
+
* the analogue of <a href="http://en.cppreference.com/w/cpp/types/numeric_limits/digits">std::numeric_limits<T>::digits</a>
|
140
|
+
* which is used as the default implementation if specialized.
|
141
|
+
* \li digits10() function returning the number of decimal digits that can be represented without change. This is
|
142
|
+
* the analogue of <a href="http://en.cppreference.com/w/cpp/types/numeric_limits/digits10">std::numeric_limits<T>::digits10</a>
|
143
|
+
* which is used as the default implementation if specialized.
|
144
|
+
* \li min_exponent() and max_exponent() functions returning the highest and lowest possible values, respectively,
|
145
|
+
* such that the radix raised to the power exponent-1 is a normalized floating-point number. These are equivalent to
|
146
|
+
* <a href="http://en.cppreference.com/w/cpp/types/numeric_limits/min_exponent">std::numeric_limits<T>::min_exponent</a>/
|
147
|
+
* <a href="http://en.cppreference.com/w/cpp/types/numeric_limits/max_exponent">std::numeric_limits<T>::max_exponent</a>.
|
148
|
+
* \li infinity() function returning a representation of positive infinity, if available.
|
149
|
+
* \li quiet_NaN function returning a non-signaling "not-a-number", if available.
|
150
|
+
*/
|
151
|
+
|
152
|
+
template<typename T> struct GenericNumTraits
|
153
|
+
{
|
154
|
+
enum {
|
155
|
+
IsInteger = std::numeric_limits<T>::is_integer,
|
156
|
+
IsSigned = std::numeric_limits<T>::is_signed,
|
157
|
+
IsComplex = 0,
|
158
|
+
RequireInitialization = internal::is_arithmetic<T>::value ? 0 : 1,
|
159
|
+
ReadCost = 1,
|
160
|
+
AddCost = 1,
|
161
|
+
MulCost = 1
|
162
|
+
};
|
163
|
+
|
164
|
+
typedef T Real;
|
165
|
+
typedef typename internal::conditional<
|
166
|
+
IsInteger,
|
167
|
+
typename internal::conditional<sizeof(T)<=2, float, double>::type,
|
168
|
+
T
|
169
|
+
>::type NonInteger;
|
170
|
+
typedef T Nested;
|
171
|
+
typedef T Literal;
|
172
|
+
|
173
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
174
|
+
static inline Real epsilon()
|
175
|
+
{
|
176
|
+
return numext::numeric_limits<T>::epsilon();
|
177
|
+
}
|
178
|
+
|
179
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
180
|
+
static inline int digits10()
|
181
|
+
{
|
182
|
+
return internal::default_digits10_impl<T>::run();
|
183
|
+
}
|
184
|
+
|
185
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
186
|
+
static inline int digits()
|
187
|
+
{
|
188
|
+
return internal::default_digits_impl<T>::run();
|
189
|
+
}
|
190
|
+
|
191
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
192
|
+
static inline int min_exponent()
|
193
|
+
{
|
194
|
+
return numext::numeric_limits<T>::min_exponent;
|
195
|
+
}
|
196
|
+
|
197
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
198
|
+
static inline int max_exponent()
|
199
|
+
{
|
200
|
+
return numext::numeric_limits<T>::max_exponent;
|
201
|
+
}
|
202
|
+
|
203
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
204
|
+
static inline Real dummy_precision()
|
205
|
+
{
|
206
|
+
// make sure to override this for floating-point types
|
207
|
+
return Real(0);
|
208
|
+
}
|
209
|
+
|
210
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
211
|
+
static inline T highest() {
|
212
|
+
return (numext::numeric_limits<T>::max)();
|
213
|
+
}
|
214
|
+
|
215
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
216
|
+
static inline T lowest() {
|
217
|
+
return IsInteger ? (numext::numeric_limits<T>::min)()
|
218
|
+
: static_cast<T>(-(numext::numeric_limits<T>::max)());
|
219
|
+
}
|
220
|
+
|
221
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
222
|
+
static inline T infinity() {
|
223
|
+
return numext::numeric_limits<T>::infinity();
|
224
|
+
}
|
225
|
+
|
226
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
227
|
+
static inline T quiet_NaN() {
|
228
|
+
return numext::numeric_limits<T>::quiet_NaN();
|
229
|
+
}
|
230
|
+
};
|
231
|
+
|
232
|
+
template<typename T> struct NumTraits : GenericNumTraits<T>
|
233
|
+
{};
|
234
|
+
|
235
|
+
template<> struct NumTraits<float>
|
236
|
+
: GenericNumTraits<float>
|
237
|
+
{
|
238
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
239
|
+
static inline float dummy_precision() { return 1e-5f; }
|
240
|
+
};
|
241
|
+
|
242
|
+
template<> struct NumTraits<double> : GenericNumTraits<double>
|
243
|
+
{
|
244
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
245
|
+
static inline double dummy_precision() { return 1e-12; }
|
246
|
+
};
|
247
|
+
|
248
|
+
template<> struct NumTraits<long double>
|
249
|
+
: GenericNumTraits<long double>
|
250
|
+
{
|
251
|
+
EIGEN_CONSTEXPR
|
252
|
+
static inline long double dummy_precision() { return 1e-15l; }
|
253
|
+
};
|
254
|
+
|
255
|
+
template<typename _Real> struct NumTraits<std::complex<_Real> >
|
256
|
+
: GenericNumTraits<std::complex<_Real> >
|
257
|
+
{
|
258
|
+
typedef _Real Real;
|
259
|
+
typedef typename NumTraits<_Real>::Literal Literal;
|
260
|
+
enum {
|
261
|
+
IsComplex = 1,
|
262
|
+
RequireInitialization = NumTraits<_Real>::RequireInitialization,
|
263
|
+
ReadCost = 2 * NumTraits<_Real>::ReadCost,
|
264
|
+
AddCost = 2 * NumTraits<Real>::AddCost,
|
265
|
+
MulCost = 4 * NumTraits<Real>::MulCost + 2 * NumTraits<Real>::AddCost
|
266
|
+
};
|
267
|
+
|
268
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
269
|
+
static inline Real epsilon() { return NumTraits<Real>::epsilon(); }
|
270
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
271
|
+
static inline Real dummy_precision() { return NumTraits<Real>::dummy_precision(); }
|
272
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
273
|
+
static inline int digits10() { return NumTraits<Real>::digits10(); }
|
274
|
+
};
|
275
|
+
|
276
|
+
template<typename Scalar, int Rows, int Cols, int Options, int MaxRows, int MaxCols>
|
277
|
+
struct NumTraits<Array<Scalar, Rows, Cols, Options, MaxRows, MaxCols> >
|
278
|
+
{
|
279
|
+
typedef Array<Scalar, Rows, Cols, Options, MaxRows, MaxCols> ArrayType;
|
280
|
+
typedef typename NumTraits<Scalar>::Real RealScalar;
|
281
|
+
typedef Array<RealScalar, Rows, Cols, Options, MaxRows, MaxCols> Real;
|
282
|
+
typedef typename NumTraits<Scalar>::NonInteger NonIntegerScalar;
|
283
|
+
typedef Array<NonIntegerScalar, Rows, Cols, Options, MaxRows, MaxCols> NonInteger;
|
284
|
+
typedef ArrayType & Nested;
|
285
|
+
typedef typename NumTraits<Scalar>::Literal Literal;
|
286
|
+
|
287
|
+
enum {
|
288
|
+
IsComplex = NumTraits<Scalar>::IsComplex,
|
289
|
+
IsInteger = NumTraits<Scalar>::IsInteger,
|
290
|
+
IsSigned = NumTraits<Scalar>::IsSigned,
|
291
|
+
RequireInitialization = 1,
|
292
|
+
ReadCost = ArrayType::SizeAtCompileTime==Dynamic ? HugeCost : ArrayType::SizeAtCompileTime * int(NumTraits<Scalar>::ReadCost),
|
293
|
+
AddCost = ArrayType::SizeAtCompileTime==Dynamic ? HugeCost : ArrayType::SizeAtCompileTime * int(NumTraits<Scalar>::AddCost),
|
294
|
+
MulCost = ArrayType::SizeAtCompileTime==Dynamic ? HugeCost : ArrayType::SizeAtCompileTime * int(NumTraits<Scalar>::MulCost)
|
295
|
+
};
|
296
|
+
|
297
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
298
|
+
static inline RealScalar epsilon() { return NumTraits<RealScalar>::epsilon(); }
|
299
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
300
|
+
static inline RealScalar dummy_precision() { return NumTraits<RealScalar>::dummy_precision(); }
|
301
|
+
|
302
|
+
EIGEN_CONSTEXPR
|
303
|
+
static inline int digits10() { return NumTraits<Scalar>::digits10(); }
|
304
|
+
};
|
305
|
+
|
306
|
+
template<> struct NumTraits<std::string>
|
307
|
+
: GenericNumTraits<std::string>
|
308
|
+
{
|
309
|
+
enum {
|
310
|
+
RequireInitialization = 1,
|
311
|
+
ReadCost = HugeCost,
|
312
|
+
AddCost = HugeCost,
|
313
|
+
MulCost = HugeCost
|
314
|
+
};
|
315
|
+
|
316
|
+
EIGEN_CONSTEXPR
|
317
|
+
static inline int digits10() { return 0; }
|
318
|
+
|
319
|
+
private:
|
320
|
+
static inline std::string epsilon();
|
321
|
+
static inline std::string dummy_precision();
|
322
|
+
static inline std::string lowest();
|
323
|
+
static inline std::string highest();
|
324
|
+
static inline std::string infinity();
|
325
|
+
static inline std::string quiet_NaN();
|
326
|
+
};
|
327
|
+
|
328
|
+
// Empty specialization for void to allow template specialization based on NumTraits<T>::Real with T==void and SFINAE.
|
329
|
+
template<> struct NumTraits<void> {};
|
330
|
+
|
331
|
+
template<> struct NumTraits<bool> : GenericNumTraits<bool> {};
|
332
|
+
|
333
|
+
} // end namespace Eigen
|
334
|
+
|
335
|
+
#endif // EIGEN_NUMTRAITS_H
|
@@ -0,0 +1,232 @@
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
2
|
+
// for linear algebra.
|
3
|
+
//
|
4
|
+
// Copyright (C) 2011-2018 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_PARTIALREDUX_H
|
11
|
+
#define EIGEN_PARTIALREDUX_H
|
12
|
+
|
13
|
+
namespace Eigen {
|
14
|
+
|
15
|
+
namespace internal {
|
16
|
+
|
17
|
+
|
18
|
+
/***************************************************************************
|
19
|
+
*
|
20
|
+
* This file provides evaluators for partial reductions.
|
21
|
+
* There are two modes:
|
22
|
+
*
|
23
|
+
* - scalar path: simply calls the respective function on the column or row.
|
24
|
+
* -> nothing special here, all the tricky part is handled by the return
|
25
|
+
* types of VectorwiseOp's members. They embed the functor calling the
|
26
|
+
* respective DenseBase's member function.
|
27
|
+
*
|
28
|
+
* - vectorized path: implements a packet-wise reductions followed by
|
29
|
+
* some (optional) processing of the outcome, e.g., division by n for mean.
|
30
|
+
*
|
31
|
+
* For the vectorized path let's observe that the packet-size and outer-unrolling
|
32
|
+
* are both decided by the assignement logic. So all we have to do is to decide
|
33
|
+
* on the inner unrolling.
|
34
|
+
*
|
35
|
+
* For the unrolling, we can reuse "internal::redux_vec_unroller" from Redux.h,
|
36
|
+
* but be need to be careful to specify correct increment.
|
37
|
+
*
|
38
|
+
***************************************************************************/
|
39
|
+
|
40
|
+
|
41
|
+
/* logic deciding a strategy for unrolling of vectorized paths */
|
42
|
+
template<typename Func, typename Evaluator>
|
43
|
+
struct packetwise_redux_traits
|
44
|
+
{
|
45
|
+
enum {
|
46
|
+
OuterSize = int(Evaluator::IsRowMajor) ? Evaluator::RowsAtCompileTime : Evaluator::ColsAtCompileTime,
|
47
|
+
Cost = OuterSize == Dynamic ? HugeCost
|
48
|
+
: OuterSize * Evaluator::CoeffReadCost + (OuterSize-1) * functor_traits<Func>::Cost,
|
49
|
+
Unrolling = Cost <= EIGEN_UNROLLING_LIMIT ? CompleteUnrolling : NoUnrolling
|
50
|
+
};
|
51
|
+
|
52
|
+
};
|
53
|
+
|
54
|
+
/* Value to be returned when size==0 , by default let's return 0 */
|
55
|
+
template<typename PacketType,typename Func>
|
56
|
+
EIGEN_DEVICE_FUNC
|
57
|
+
PacketType packetwise_redux_empty_value(const Func& ) { return pset1<PacketType>(0); }
|
58
|
+
|
59
|
+
/* For products the default is 1 */
|
60
|
+
template<typename PacketType,typename Scalar>
|
61
|
+
EIGEN_DEVICE_FUNC
|
62
|
+
PacketType packetwise_redux_empty_value(const scalar_product_op<Scalar,Scalar>& ) { return pset1<PacketType>(1); }
|
63
|
+
|
64
|
+
/* Perform the actual reduction */
|
65
|
+
template<typename Func, typename Evaluator,
|
66
|
+
int Unrolling = packetwise_redux_traits<Func, Evaluator>::Unrolling
|
67
|
+
>
|
68
|
+
struct packetwise_redux_impl;
|
69
|
+
|
70
|
+
/* Perform the actual reduction with unrolling */
|
71
|
+
template<typename Func, typename Evaluator>
|
72
|
+
struct packetwise_redux_impl<Func, Evaluator, CompleteUnrolling>
|
73
|
+
{
|
74
|
+
typedef redux_novec_unroller<Func,Evaluator, 0, Evaluator::SizeAtCompileTime> Base;
|
75
|
+
typedef typename Evaluator::Scalar Scalar;
|
76
|
+
|
77
|
+
template<typename PacketType>
|
78
|
+
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE
|
79
|
+
PacketType run(const Evaluator &eval, const Func& func, Index /*size*/)
|
80
|
+
{
|
81
|
+
return redux_vec_unroller<Func, Evaluator, 0, packetwise_redux_traits<Func, Evaluator>::OuterSize>::template run<PacketType>(eval,func);
|
82
|
+
}
|
83
|
+
};
|
84
|
+
|
85
|
+
/* Add a specialization of redux_vec_unroller for size==0 at compiletime.
|
86
|
+
* This specialization is not required for general reductions, which is
|
87
|
+
* why it is defined here.
|
88
|
+
*/
|
89
|
+
template<typename Func, typename Evaluator, int Start>
|
90
|
+
struct redux_vec_unroller<Func, Evaluator, Start, 0>
|
91
|
+
{
|
92
|
+
template<typename PacketType>
|
93
|
+
EIGEN_DEVICE_FUNC
|
94
|
+
static EIGEN_STRONG_INLINE PacketType run(const Evaluator &, const Func& f)
|
95
|
+
{
|
96
|
+
return packetwise_redux_empty_value<PacketType>(f);
|
97
|
+
}
|
98
|
+
};
|
99
|
+
|
100
|
+
/* Perform the actual reduction for dynamic sizes */
|
101
|
+
template<typename Func, typename Evaluator>
|
102
|
+
struct packetwise_redux_impl<Func, Evaluator, NoUnrolling>
|
103
|
+
{
|
104
|
+
typedef typename Evaluator::Scalar Scalar;
|
105
|
+
typedef typename redux_traits<Func, Evaluator>::PacketType PacketScalar;
|
106
|
+
|
107
|
+
template<typename PacketType>
|
108
|
+
EIGEN_DEVICE_FUNC
|
109
|
+
static PacketType run(const Evaluator &eval, const Func& func, Index size)
|
110
|
+
{
|
111
|
+
if(size==0)
|
112
|
+
return packetwise_redux_empty_value<PacketType>(func);
|
113
|
+
|
114
|
+
const Index size4 = (size-1)&(~3);
|
115
|
+
PacketType p = eval.template packetByOuterInner<Unaligned,PacketType>(0,0);
|
116
|
+
Index i = 1;
|
117
|
+
// This loop is optimized for instruction pipelining:
|
118
|
+
// - each iteration generates two independent instructions
|
119
|
+
// - thanks to branch prediction and out-of-order execution we have independent instructions across loops
|
120
|
+
for(; i<size4; i+=4)
|
121
|
+
p = func.packetOp(p,
|
122
|
+
func.packetOp(
|
123
|
+
func.packetOp(eval.template packetByOuterInner<Unaligned,PacketType>(i+0,0),eval.template packetByOuterInner<Unaligned,PacketType>(i+1,0)),
|
124
|
+
func.packetOp(eval.template packetByOuterInner<Unaligned,PacketType>(i+2,0),eval.template packetByOuterInner<Unaligned,PacketType>(i+3,0))));
|
125
|
+
for(; i<size; ++i)
|
126
|
+
p = func.packetOp(p, eval.template packetByOuterInner<Unaligned,PacketType>(i,0));
|
127
|
+
return p;
|
128
|
+
}
|
129
|
+
};
|
130
|
+
|
131
|
+
template< typename ArgType, typename MemberOp, int Direction>
|
132
|
+
struct evaluator<PartialReduxExpr<ArgType, MemberOp, Direction> >
|
133
|
+
: evaluator_base<PartialReduxExpr<ArgType, MemberOp, Direction> >
|
134
|
+
{
|
135
|
+
typedef PartialReduxExpr<ArgType, MemberOp, Direction> XprType;
|
136
|
+
typedef typename internal::nested_eval<ArgType,1>::type ArgTypeNested;
|
137
|
+
typedef typename internal::add_const_on_value_type<ArgTypeNested>::type ConstArgTypeNested;
|
138
|
+
typedef typename internal::remove_all<ArgTypeNested>::type ArgTypeNestedCleaned;
|
139
|
+
typedef typename ArgType::Scalar InputScalar;
|
140
|
+
typedef typename XprType::Scalar Scalar;
|
141
|
+
enum {
|
142
|
+
TraversalSize = Direction==int(Vertical) ? int(ArgType::RowsAtCompileTime) : int(ArgType::ColsAtCompileTime)
|
143
|
+
};
|
144
|
+
typedef typename MemberOp::template Cost<int(TraversalSize)> CostOpType;
|
145
|
+
enum {
|
146
|
+
CoeffReadCost = TraversalSize==Dynamic ? HugeCost
|
147
|
+
: TraversalSize==0 ? 1
|
148
|
+
: int(TraversalSize) * int(evaluator<ArgType>::CoeffReadCost) + int(CostOpType::value),
|
149
|
+
|
150
|
+
_ArgFlags = evaluator<ArgType>::Flags,
|
151
|
+
|
152
|
+
_Vectorizable = bool(int(_ArgFlags)&PacketAccessBit)
|
153
|
+
&& bool(MemberOp::Vectorizable)
|
154
|
+
&& (Direction==int(Vertical) ? bool(_ArgFlags&RowMajorBit) : (_ArgFlags&RowMajorBit)==0)
|
155
|
+
&& (TraversalSize!=0),
|
156
|
+
|
157
|
+
Flags = (traits<XprType>::Flags&RowMajorBit)
|
158
|
+
| (evaluator<ArgType>::Flags&(HereditaryBits&(~RowMajorBit)))
|
159
|
+
| (_Vectorizable ? PacketAccessBit : 0)
|
160
|
+
| LinearAccessBit,
|
161
|
+
|
162
|
+
Alignment = 0 // FIXME this will need to be improved once PartialReduxExpr is vectorized
|
163
|
+
};
|
164
|
+
|
165
|
+
EIGEN_DEVICE_FUNC explicit evaluator(const XprType xpr)
|
166
|
+
: m_arg(xpr.nestedExpression()), m_functor(xpr.functor())
|
167
|
+
{
|
168
|
+
EIGEN_INTERNAL_CHECK_COST_VALUE(TraversalSize==Dynamic ? HugeCost : (TraversalSize==0 ? 1 : int(CostOpType::value)));
|
169
|
+
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
170
|
+
}
|
171
|
+
|
172
|
+
typedef typename XprType::CoeffReturnType CoeffReturnType;
|
173
|
+
|
174
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
175
|
+
const Scalar coeff(Index i, Index j) const
|
176
|
+
{
|
177
|
+
return coeff(Direction==Vertical ? j : i);
|
178
|
+
}
|
179
|
+
|
180
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
181
|
+
const Scalar coeff(Index index) const
|
182
|
+
{
|
183
|
+
return m_functor(m_arg.template subVector<DirectionType(Direction)>(index));
|
184
|
+
}
|
185
|
+
|
186
|
+
template<int LoadMode,typename PacketType>
|
187
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
188
|
+
PacketType packet(Index i, Index j) const
|
189
|
+
{
|
190
|
+
return packet<LoadMode,PacketType>(Direction==Vertical ? j : i);
|
191
|
+
}
|
192
|
+
|
193
|
+
template<int LoadMode,typename PacketType>
|
194
|
+
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
|
195
|
+
PacketType packet(Index idx) const
|
196
|
+
{
|
197
|
+
enum { PacketSize = internal::unpacket_traits<PacketType>::size };
|
198
|
+
typedef Block<const ArgTypeNestedCleaned,
|
199
|
+
Direction==Vertical ? int(ArgType::RowsAtCompileTime) : int(PacketSize),
|
200
|
+
Direction==Vertical ? int(PacketSize) : int(ArgType::ColsAtCompileTime),
|
201
|
+
true /* InnerPanel */> PanelType;
|
202
|
+
|
203
|
+
PanelType panel(m_arg,
|
204
|
+
Direction==Vertical ? 0 : idx,
|
205
|
+
Direction==Vertical ? idx : 0,
|
206
|
+
Direction==Vertical ? m_arg.rows() : Index(PacketSize),
|
207
|
+
Direction==Vertical ? Index(PacketSize) : m_arg.cols());
|
208
|
+
|
209
|
+
// FIXME
|
210
|
+
// See bug 1612, currently if PacketSize==1 (i.e. complex<double> with 128bits registers) then the storage-order of panel get reversed
|
211
|
+
// and methods like packetByOuterInner do not make sense anymore in this context.
|
212
|
+
// So let's just by pass "vectorization" in this case:
|
213
|
+
if(PacketSize==1)
|
214
|
+
return internal::pset1<PacketType>(coeff(idx));
|
215
|
+
|
216
|
+
typedef typename internal::redux_evaluator<PanelType> PanelEvaluator;
|
217
|
+
PanelEvaluator panel_eval(panel);
|
218
|
+
typedef typename MemberOp::BinaryOp BinaryOp;
|
219
|
+
PacketType p = internal::packetwise_redux_impl<BinaryOp,PanelEvaluator>::template run<PacketType>(panel_eval,m_functor.binaryFunc(),m_arg.outerSize());
|
220
|
+
return p;
|
221
|
+
}
|
222
|
+
|
223
|
+
protected:
|
224
|
+
ConstArgTypeNested m_arg;
|
225
|
+
const MemberOp m_functor;
|
226
|
+
};
|
227
|
+
|
228
|
+
} // end namespace internal
|
229
|
+
|
230
|
+
} // end namespace Eigen
|
231
|
+
|
232
|
+
#endif // EIGEN_PARTIALREDUX_H
|