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,152 @@
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
2
|
+
// for linear algebra.
|
3
|
+
//
|
4
|
+
// Copyright (C) 2008-2009 Gael Guennebaud <gael.guennebaud@inria.fr>
|
5
|
+
// Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
|
6
|
+
//
|
7
|
+
// This Source Code Form is subject to the terms of the Mozilla
|
8
|
+
// Public License v. 2.0. If a copy of the MPL was not distributed
|
9
|
+
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
10
|
+
|
11
|
+
// This file is a base class plugin containing matrix specifics coefficient wise functions.
|
12
|
+
|
13
|
+
/** \returns an expression of the Schur product (coefficient wise product) of *this and \a other
|
14
|
+
*
|
15
|
+
* Example: \include MatrixBase_cwiseProduct.cpp
|
16
|
+
* Output: \verbinclude MatrixBase_cwiseProduct.out
|
17
|
+
*
|
18
|
+
* \sa class CwiseBinaryOp, cwiseAbs2
|
19
|
+
*/
|
20
|
+
template<typename OtherDerived>
|
21
|
+
EIGEN_DEVICE_FUNC
|
22
|
+
EIGEN_STRONG_INLINE const EIGEN_CWISE_BINARY_RETURN_TYPE(Derived,OtherDerived,product)
|
23
|
+
cwiseProduct(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
|
24
|
+
{
|
25
|
+
return EIGEN_CWISE_BINARY_RETURN_TYPE(Derived,OtherDerived,product)(derived(), other.derived());
|
26
|
+
}
|
27
|
+
|
28
|
+
/** \returns an expression of the coefficient-wise == operator of *this and \a other
|
29
|
+
*
|
30
|
+
* \warning this performs an exact comparison, which is generally a bad idea with floating-point types.
|
31
|
+
* In order to check for equality between two vectors or matrices with floating-point coefficients, it is
|
32
|
+
* generally a far better idea to use a fuzzy comparison as provided by isApprox() and
|
33
|
+
* isMuchSmallerThan().
|
34
|
+
*
|
35
|
+
* Example: \include MatrixBase_cwiseEqual.cpp
|
36
|
+
* Output: \verbinclude MatrixBase_cwiseEqual.out
|
37
|
+
*
|
38
|
+
* \sa cwiseNotEqual(), isApprox(), isMuchSmallerThan()
|
39
|
+
*/
|
40
|
+
template<typename OtherDerived>
|
41
|
+
EIGEN_DEVICE_FUNC
|
42
|
+
inline const CwiseBinaryOp<numext::equal_to<Scalar>, const Derived, const OtherDerived>
|
43
|
+
cwiseEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
|
44
|
+
{
|
45
|
+
return CwiseBinaryOp<numext::equal_to<Scalar>, const Derived, const OtherDerived>(derived(), other.derived());
|
46
|
+
}
|
47
|
+
|
48
|
+
/** \returns an expression of the coefficient-wise != operator of *this and \a other
|
49
|
+
*
|
50
|
+
* \warning this performs an exact comparison, which is generally a bad idea with floating-point types.
|
51
|
+
* In order to check for equality between two vectors or matrices with floating-point coefficients, it is
|
52
|
+
* generally a far better idea to use a fuzzy comparison as provided by isApprox() and
|
53
|
+
* isMuchSmallerThan().
|
54
|
+
*
|
55
|
+
* Example: \include MatrixBase_cwiseNotEqual.cpp
|
56
|
+
* Output: \verbinclude MatrixBase_cwiseNotEqual.out
|
57
|
+
*
|
58
|
+
* \sa cwiseEqual(), isApprox(), isMuchSmallerThan()
|
59
|
+
*/
|
60
|
+
template<typename OtherDerived>
|
61
|
+
EIGEN_DEVICE_FUNC
|
62
|
+
inline const CwiseBinaryOp<numext::not_equal_to<Scalar>, const Derived, const OtherDerived>
|
63
|
+
cwiseNotEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
|
64
|
+
{
|
65
|
+
return CwiseBinaryOp<numext::not_equal_to<Scalar>, const Derived, const OtherDerived>(derived(), other.derived());
|
66
|
+
}
|
67
|
+
|
68
|
+
/** \returns an expression of the coefficient-wise min of *this and \a other
|
69
|
+
*
|
70
|
+
* Example: \include MatrixBase_cwiseMin.cpp
|
71
|
+
* Output: \verbinclude MatrixBase_cwiseMin.out
|
72
|
+
*
|
73
|
+
* \sa class CwiseBinaryOp, max()
|
74
|
+
*/
|
75
|
+
template<typename OtherDerived>
|
76
|
+
EIGEN_DEVICE_FUNC
|
77
|
+
EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_min_op<Scalar,Scalar>, const Derived, const OtherDerived>
|
78
|
+
cwiseMin(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
|
79
|
+
{
|
80
|
+
return CwiseBinaryOp<internal::scalar_min_op<Scalar,Scalar>, const Derived, const OtherDerived>(derived(), other.derived());
|
81
|
+
}
|
82
|
+
|
83
|
+
/** \returns an expression of the coefficient-wise min of *this and scalar \a other
|
84
|
+
*
|
85
|
+
* \sa class CwiseBinaryOp, min()
|
86
|
+
*/
|
87
|
+
EIGEN_DEVICE_FUNC
|
88
|
+
EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_min_op<Scalar,Scalar>, const Derived, const ConstantReturnType>
|
89
|
+
cwiseMin(const Scalar &other) const
|
90
|
+
{
|
91
|
+
return cwiseMin(Derived::Constant(rows(), cols(), other));
|
92
|
+
}
|
93
|
+
|
94
|
+
/** \returns an expression of the coefficient-wise max of *this and \a other
|
95
|
+
*
|
96
|
+
* Example: \include MatrixBase_cwiseMax.cpp
|
97
|
+
* Output: \verbinclude MatrixBase_cwiseMax.out
|
98
|
+
*
|
99
|
+
* \sa class CwiseBinaryOp, min()
|
100
|
+
*/
|
101
|
+
template<typename OtherDerived>
|
102
|
+
EIGEN_DEVICE_FUNC
|
103
|
+
EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_max_op<Scalar,Scalar>, const Derived, const OtherDerived>
|
104
|
+
cwiseMax(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
|
105
|
+
{
|
106
|
+
return CwiseBinaryOp<internal::scalar_max_op<Scalar,Scalar>, const Derived, const OtherDerived>(derived(), other.derived());
|
107
|
+
}
|
108
|
+
|
109
|
+
/** \returns an expression of the coefficient-wise max of *this and scalar \a other
|
110
|
+
*
|
111
|
+
* \sa class CwiseBinaryOp, min()
|
112
|
+
*/
|
113
|
+
EIGEN_DEVICE_FUNC
|
114
|
+
EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_max_op<Scalar,Scalar>, const Derived, const ConstantReturnType>
|
115
|
+
cwiseMax(const Scalar &other) const
|
116
|
+
{
|
117
|
+
return cwiseMax(Derived::Constant(rows(), cols(), other));
|
118
|
+
}
|
119
|
+
|
120
|
+
|
121
|
+
/** \returns an expression of the coefficient-wise quotient of *this and \a other
|
122
|
+
*
|
123
|
+
* Example: \include MatrixBase_cwiseQuotient.cpp
|
124
|
+
* Output: \verbinclude MatrixBase_cwiseQuotient.out
|
125
|
+
*
|
126
|
+
* \sa class CwiseBinaryOp, cwiseProduct(), cwiseInverse()
|
127
|
+
*/
|
128
|
+
template<typename OtherDerived>
|
129
|
+
EIGEN_DEVICE_FUNC
|
130
|
+
EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_quotient_op<Scalar>, const Derived, const OtherDerived>
|
131
|
+
cwiseQuotient(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
|
132
|
+
{
|
133
|
+
return CwiseBinaryOp<internal::scalar_quotient_op<Scalar>, const Derived, const OtherDerived>(derived(), other.derived());
|
134
|
+
}
|
135
|
+
|
136
|
+
typedef CwiseBinaryOp<internal::scalar_cmp_op<Scalar,Scalar,internal::cmp_EQ>, const Derived, const ConstantReturnType> CwiseScalarEqualReturnType;
|
137
|
+
|
138
|
+
/** \returns an expression of the coefficient-wise == operator of \c *this and a scalar \a s
|
139
|
+
*
|
140
|
+
* \warning this performs an exact comparison, which is generally a bad idea with floating-point types.
|
141
|
+
* In order to check for equality between two vectors or matrices with floating-point coefficients, it is
|
142
|
+
* generally a far better idea to use a fuzzy comparison as provided by isApprox() and
|
143
|
+
* isMuchSmallerThan().
|
144
|
+
*
|
145
|
+
* \sa cwiseEqual(const MatrixBase<OtherDerived> &) const
|
146
|
+
*/
|
147
|
+
EIGEN_DEVICE_FUNC
|
148
|
+
inline const CwiseScalarEqualReturnType
|
149
|
+
cwiseEqual(const Scalar& s) const
|
150
|
+
{
|
151
|
+
return CwiseScalarEqualReturnType(derived(), Derived::Constant(rows(), cols(), s), internal::scalar_cmp_op<Scalar,Scalar,internal::cmp_EQ>());
|
152
|
+
}
|
@@ -0,0 +1,95 @@
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
2
|
+
// for linear algebra.
|
3
|
+
//
|
4
|
+
// Copyright (C) 2008-2009 Gael Guennebaud <gael.guennebaud@inria.fr>
|
5
|
+
// Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
|
6
|
+
//
|
7
|
+
// This Source Code Form is subject to the terms of the Mozilla
|
8
|
+
// Public License v. 2.0. If a copy of the MPL was not distributed
|
9
|
+
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
10
|
+
|
11
|
+
// This file is included into the body of the base classes supporting matrix specific coefficient-wise functions.
|
12
|
+
// This include MatrixBase and SparseMatrixBase.
|
13
|
+
|
14
|
+
|
15
|
+
typedef CwiseUnaryOp<internal::scalar_abs_op<Scalar>, const Derived> CwiseAbsReturnType;
|
16
|
+
typedef CwiseUnaryOp<internal::scalar_abs2_op<Scalar>, const Derived> CwiseAbs2ReturnType;
|
17
|
+
typedef CwiseUnaryOp<internal::scalar_arg_op<Scalar>, const Derived> CwiseArgReturnType;
|
18
|
+
typedef CwiseUnaryOp<internal::scalar_sqrt_op<Scalar>, const Derived> CwiseSqrtReturnType;
|
19
|
+
typedef CwiseUnaryOp<internal::scalar_sign_op<Scalar>, const Derived> CwiseSignReturnType;
|
20
|
+
typedef CwiseUnaryOp<internal::scalar_inverse_op<Scalar>, const Derived> CwiseInverseReturnType;
|
21
|
+
|
22
|
+
/// \returns an expression of the coefficient-wise absolute value of \c *this
|
23
|
+
///
|
24
|
+
/// Example: \include MatrixBase_cwiseAbs.cpp
|
25
|
+
/// Output: \verbinclude MatrixBase_cwiseAbs.out
|
26
|
+
///
|
27
|
+
EIGEN_DOC_UNARY_ADDONS(cwiseAbs,absolute value)
|
28
|
+
///
|
29
|
+
/// \sa cwiseAbs2()
|
30
|
+
///
|
31
|
+
EIGEN_DEVICE_FUNC
|
32
|
+
EIGEN_STRONG_INLINE const CwiseAbsReturnType
|
33
|
+
cwiseAbs() const { return CwiseAbsReturnType(derived()); }
|
34
|
+
|
35
|
+
/// \returns an expression of the coefficient-wise squared absolute value of \c *this
|
36
|
+
///
|
37
|
+
/// Example: \include MatrixBase_cwiseAbs2.cpp
|
38
|
+
/// Output: \verbinclude MatrixBase_cwiseAbs2.out
|
39
|
+
///
|
40
|
+
EIGEN_DOC_UNARY_ADDONS(cwiseAbs2,squared absolute value)
|
41
|
+
///
|
42
|
+
/// \sa cwiseAbs()
|
43
|
+
///
|
44
|
+
EIGEN_DEVICE_FUNC
|
45
|
+
EIGEN_STRONG_INLINE const CwiseAbs2ReturnType
|
46
|
+
cwiseAbs2() const { return CwiseAbs2ReturnType(derived()); }
|
47
|
+
|
48
|
+
/// \returns an expression of the coefficient-wise square root of *this.
|
49
|
+
///
|
50
|
+
/// Example: \include MatrixBase_cwiseSqrt.cpp
|
51
|
+
/// Output: \verbinclude MatrixBase_cwiseSqrt.out
|
52
|
+
///
|
53
|
+
EIGEN_DOC_UNARY_ADDONS(cwiseSqrt,square-root)
|
54
|
+
///
|
55
|
+
/// \sa cwisePow(), cwiseSquare()
|
56
|
+
///
|
57
|
+
EIGEN_DEVICE_FUNC
|
58
|
+
inline const CwiseSqrtReturnType
|
59
|
+
cwiseSqrt() const { return CwiseSqrtReturnType(derived()); }
|
60
|
+
|
61
|
+
/// \returns an expression of the coefficient-wise signum of *this.
|
62
|
+
///
|
63
|
+
/// Example: \include MatrixBase_cwiseSign.cpp
|
64
|
+
/// Output: \verbinclude MatrixBase_cwiseSign.out
|
65
|
+
///
|
66
|
+
EIGEN_DOC_UNARY_ADDONS(cwiseSign,sign function)
|
67
|
+
///
|
68
|
+
EIGEN_DEVICE_FUNC
|
69
|
+
inline const CwiseSignReturnType
|
70
|
+
cwiseSign() const { return CwiseSignReturnType(derived()); }
|
71
|
+
|
72
|
+
|
73
|
+
/// \returns an expression of the coefficient-wise inverse of *this.
|
74
|
+
///
|
75
|
+
/// Example: \include MatrixBase_cwiseInverse.cpp
|
76
|
+
/// Output: \verbinclude MatrixBase_cwiseInverse.out
|
77
|
+
///
|
78
|
+
EIGEN_DOC_UNARY_ADDONS(cwiseInverse,inverse)
|
79
|
+
///
|
80
|
+
/// \sa cwiseProduct()
|
81
|
+
///
|
82
|
+
EIGEN_DEVICE_FUNC
|
83
|
+
inline const CwiseInverseReturnType
|
84
|
+
cwiseInverse() const { return CwiseInverseReturnType(derived()); }
|
85
|
+
|
86
|
+
/// \returns an expression of the coefficient-wise phase angle of \c *this
|
87
|
+
///
|
88
|
+
/// Example: \include MatrixBase_cwiseArg.cpp
|
89
|
+
/// Output: \verbinclude MatrixBase_cwiseArg.out
|
90
|
+
///
|
91
|
+
EIGEN_DOC_UNARY_ADDONS(cwiseArg,arg)
|
92
|
+
|
93
|
+
EIGEN_DEVICE_FUNC
|
94
|
+
inline const CwiseArgReturnType
|
95
|
+
cwiseArg() const { return CwiseArgReturnType(derived()); }
|
@@ -0,0 +1,149 @@
|
|
1
|
+
|
2
|
+
#ifdef EIGEN_PARSED_BY_DOXYGEN
|
3
|
+
|
4
|
+
/// \returns an expression of \c *this with reshaped sizes.
|
5
|
+
///
|
6
|
+
/// \param nRows the number of rows in the reshaped expression, specified at either run-time or compile-time, or AutoSize
|
7
|
+
/// \param nCols the number of columns in the reshaped expression, specified at either run-time or compile-time, or AutoSize
|
8
|
+
/// \tparam Order specifies whether the coefficients should be processed in column-major-order (ColMajor), in row-major-order (RowMajor),
|
9
|
+
/// or follows the \em natural order of the nested expression (AutoOrder). The default is ColMajor.
|
10
|
+
/// \tparam NRowsType the type of the value handling the number of rows, typically Index.
|
11
|
+
/// \tparam NColsType the type of the value handling the number of columns, typically Index.
|
12
|
+
///
|
13
|
+
/// Dynamic size example: \include MatrixBase_reshaped_int_int.cpp
|
14
|
+
/// Output: \verbinclude MatrixBase_reshaped_int_int.out
|
15
|
+
///
|
16
|
+
/// The number of rows \a nRows and columns \a nCols can also be specified at compile-time by passing Eigen::fix<N>,
|
17
|
+
/// or Eigen::fix<N>(n) as arguments. In the later case, \c n plays the role of a runtime fallback value in case \c N equals Eigen::Dynamic.
|
18
|
+
/// Here is an example with a fixed number of rows and columns:
|
19
|
+
/// \include MatrixBase_reshaped_fixed.cpp
|
20
|
+
/// Output: \verbinclude MatrixBase_reshaped_fixed.out
|
21
|
+
///
|
22
|
+
/// Finally, one of the sizes parameter can be automatically deduced from the other one by passing AutoSize as in the following example:
|
23
|
+
/// \include MatrixBase_reshaped_auto.cpp
|
24
|
+
/// Output: \verbinclude MatrixBase_reshaped_auto.out
|
25
|
+
/// AutoSize does preserve compile-time sizes when possible, i.e., when the sizes of the input are known at compile time \b and
|
26
|
+
/// that the other size is passed at compile-time using Eigen::fix<N> as above.
|
27
|
+
///
|
28
|
+
/// \sa class Reshaped, fix, fix<N>(int)
|
29
|
+
///
|
30
|
+
template<int Order = ColMajor, typename NRowsType, typename NColsType>
|
31
|
+
EIGEN_DEVICE_FUNC
|
32
|
+
inline Reshaped<Derived,...>
|
33
|
+
reshaped(NRowsType nRows, NColsType nCols);
|
34
|
+
|
35
|
+
/// This is the const version of reshaped(NRowsType,NColsType).
|
36
|
+
template<int Order = ColMajor, typename NRowsType, typename NColsType>
|
37
|
+
EIGEN_DEVICE_FUNC
|
38
|
+
inline const Reshaped<const Derived,...>
|
39
|
+
reshaped(NRowsType nRows, NColsType nCols) const;
|
40
|
+
|
41
|
+
/// \returns an expression of \c *this with columns (or rows) stacked to a linear column vector
|
42
|
+
///
|
43
|
+
/// \tparam Order specifies whether the coefficients should be processed in column-major-order (ColMajor), in row-major-order (RowMajor),
|
44
|
+
/// or follows the \em natural order of the nested expression (AutoOrder). The default is ColMajor.
|
45
|
+
///
|
46
|
+
/// This overloads is essentially a shortcut for `A.reshaped<Order>(AutoSize,fix<1>)`.
|
47
|
+
///
|
48
|
+
/// - If `Order==ColMajor` (the default), then it returns a column-vector from the stacked columns of \c *this.
|
49
|
+
/// - If `Order==RowMajor`, then it returns a column-vector from the stacked rows of \c *this.
|
50
|
+
/// - If `Order==AutoOrder`, then it returns a column-vector with elements stacked following the storage order of \c *this.
|
51
|
+
/// This mode is the recommended one when the particular ordering of the element is not relevant.
|
52
|
+
///
|
53
|
+
/// Example:
|
54
|
+
/// \include MatrixBase_reshaped_to_vector.cpp
|
55
|
+
/// Output: \verbinclude MatrixBase_reshaped_to_vector.out
|
56
|
+
///
|
57
|
+
/// If you want more control, you can still fall back to reshaped(NRowsType,NColsType).
|
58
|
+
///
|
59
|
+
/// \sa reshaped(NRowsType,NColsType), class Reshaped
|
60
|
+
///
|
61
|
+
template<int Order = ColMajor>
|
62
|
+
EIGEN_DEVICE_FUNC
|
63
|
+
inline Reshaped<Derived,...>
|
64
|
+
reshaped();
|
65
|
+
|
66
|
+
/// This is the const version of reshaped().
|
67
|
+
template<int Order = ColMajor>
|
68
|
+
EIGEN_DEVICE_FUNC
|
69
|
+
inline const Reshaped<const Derived,...>
|
70
|
+
reshaped() const;
|
71
|
+
|
72
|
+
#else
|
73
|
+
|
74
|
+
// This file is automatically included twice to generate const and non-const versions
|
75
|
+
|
76
|
+
#ifndef EIGEN_RESHAPED_METHOD_2ND_PASS
|
77
|
+
#define EIGEN_RESHAPED_METHOD_CONST const
|
78
|
+
#else
|
79
|
+
#define EIGEN_RESHAPED_METHOD_CONST
|
80
|
+
#endif
|
81
|
+
|
82
|
+
#ifndef EIGEN_RESHAPED_METHOD_2ND_PASS
|
83
|
+
|
84
|
+
// This part is included once
|
85
|
+
|
86
|
+
#endif
|
87
|
+
|
88
|
+
template<typename NRowsType, typename NColsType>
|
89
|
+
EIGEN_DEVICE_FUNC
|
90
|
+
inline Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived,
|
91
|
+
internal::get_compiletime_reshape_size<NRowsType,NColsType,SizeAtCompileTime>::value,
|
92
|
+
internal::get_compiletime_reshape_size<NColsType,NRowsType,SizeAtCompileTime>::value>
|
93
|
+
reshaped(NRowsType nRows, NColsType nCols) EIGEN_RESHAPED_METHOD_CONST
|
94
|
+
{
|
95
|
+
return Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived,
|
96
|
+
internal::get_compiletime_reshape_size<NRowsType,NColsType,SizeAtCompileTime>::value,
|
97
|
+
internal::get_compiletime_reshape_size<NColsType,NRowsType,SizeAtCompileTime>::value>
|
98
|
+
(derived(),
|
99
|
+
internal::get_runtime_reshape_size(nRows,internal::get_runtime_value(nCols),size()),
|
100
|
+
internal::get_runtime_reshape_size(nCols,internal::get_runtime_value(nRows),size()));
|
101
|
+
}
|
102
|
+
|
103
|
+
template<int Order, typename NRowsType, typename NColsType>
|
104
|
+
EIGEN_DEVICE_FUNC
|
105
|
+
inline Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived,
|
106
|
+
internal::get_compiletime_reshape_size<NRowsType,NColsType,SizeAtCompileTime>::value,
|
107
|
+
internal::get_compiletime_reshape_size<NColsType,NRowsType,SizeAtCompileTime>::value,
|
108
|
+
internal::get_compiletime_reshape_order<Flags,Order>::value>
|
109
|
+
reshaped(NRowsType nRows, NColsType nCols) EIGEN_RESHAPED_METHOD_CONST
|
110
|
+
{
|
111
|
+
return Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived,
|
112
|
+
internal::get_compiletime_reshape_size<NRowsType,NColsType,SizeAtCompileTime>::value,
|
113
|
+
internal::get_compiletime_reshape_size<NColsType,NRowsType,SizeAtCompileTime>::value,
|
114
|
+
internal::get_compiletime_reshape_order<Flags,Order>::value>
|
115
|
+
(derived(),
|
116
|
+
internal::get_runtime_reshape_size(nRows,internal::get_runtime_value(nCols),size()),
|
117
|
+
internal::get_runtime_reshape_size(nCols,internal::get_runtime_value(nRows),size()));
|
118
|
+
}
|
119
|
+
|
120
|
+
// Views as linear vectors
|
121
|
+
|
122
|
+
EIGEN_DEVICE_FUNC
|
123
|
+
inline Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived,SizeAtCompileTime,1>
|
124
|
+
reshaped() EIGEN_RESHAPED_METHOD_CONST
|
125
|
+
{
|
126
|
+
return Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived,SizeAtCompileTime,1>(derived(),size(),1);
|
127
|
+
}
|
128
|
+
|
129
|
+
template<int Order>
|
130
|
+
EIGEN_DEVICE_FUNC
|
131
|
+
inline Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived, SizeAtCompileTime, 1,
|
132
|
+
internal::get_compiletime_reshape_order<Flags,Order>::value>
|
133
|
+
reshaped() EIGEN_RESHAPED_METHOD_CONST
|
134
|
+
{
|
135
|
+
EIGEN_STATIC_ASSERT(Order==RowMajor || Order==ColMajor || Order==AutoOrder, INVALID_TEMPLATE_PARAMETER);
|
136
|
+
return Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived, SizeAtCompileTime, 1,
|
137
|
+
internal::get_compiletime_reshape_order<Flags,Order>::value>
|
138
|
+
(derived(), size(), 1);
|
139
|
+
}
|
140
|
+
|
141
|
+
#undef EIGEN_RESHAPED_METHOD_CONST
|
142
|
+
|
143
|
+
#ifndef EIGEN_RESHAPED_METHOD_2ND_PASS
|
144
|
+
#define EIGEN_RESHAPED_METHOD_2ND_PASS
|
145
|
+
#include "ReshapedMethods.h"
|
146
|
+
#undef EIGEN_RESHAPED_METHOD_2ND_PASS
|
147
|
+
#endif
|
148
|
+
|
149
|
+
#endif // EIGEN_PARSED_BY_DOXYGEN
|
@@ -0,0 +1,114 @@
|
|
1
|
+
#ifndef AARAND_AARAND_HPP
|
2
|
+
#define AARAND_AARAND_HPP
|
3
|
+
|
4
|
+
#include <cmath>
|
5
|
+
#include <limits>
|
6
|
+
#include <stdexcept>
|
7
|
+
|
8
|
+
namespace aarand {
|
9
|
+
|
10
|
+
/**
|
11
|
+
* @tparam T Floating point type.
|
12
|
+
* @tparam Engine A random number generator class with `operator()`, `min()` (static) and `max()` (static) methods,
|
13
|
+
* where the `result_type` is an unsigned integer value.
|
14
|
+
*
|
15
|
+
* @param eng Instance of an RNG class like `std::mt19937_64`.
|
16
|
+
*
|
17
|
+
* @return Draw from a standard uniform distribution.
|
18
|
+
*/
|
19
|
+
template<typename T = double, class Engine>
|
20
|
+
T standard_uniform(Engine& eng) {
|
21
|
+
static_assert(!std::numeric_limits<typename Engine::result_type>::is_signed);
|
22
|
+
static_assert(std::numeric_limits<typename Engine::result_type>::is_integer);
|
23
|
+
|
24
|
+
// Stolen from Boost, see https://www.boost.org/doc/libs/1_67_0/boost/random/uniform_01.hpp
|
25
|
+
// The +1 probably doesn't matter for 64-bit generators, but is helpful for engines with
|
26
|
+
// fewer output bits, to reduce the (small) probability of sampling 1's.
|
27
|
+
constexpr double factor = 1.0 / (static_cast<T>(Engine::max() - Engine::min()) + 1.0);
|
28
|
+
double result;
|
29
|
+
do {
|
30
|
+
result = static_cast<T>(eng() - Engine::min()) * factor;
|
31
|
+
} while (result == 1.0);
|
32
|
+
return result;
|
33
|
+
}
|
34
|
+
|
35
|
+
/**
|
36
|
+
* @tparam T Floating point type.
|
37
|
+
* @tparam Engine A random number generator class with `operator()`, `min()` (static) and `max()` (static) methods,
|
38
|
+
* where the `result_type` is an unsigned integer value.
|
39
|
+
*
|
40
|
+
* @param eng Instance of an RNG class like `std::mt19937_64`.
|
41
|
+
*
|
42
|
+
* @return A pair of independent draws from a standard normal distribution with mean 0 and variance 1.
|
43
|
+
*/
|
44
|
+
template<typename T = double, class Engine>
|
45
|
+
std::pair<T, T> standard_normal(Engine& eng) {
|
46
|
+
constexpr double pi = 3.14159265358979323846;
|
47
|
+
|
48
|
+
// Box-Muller gives us two random values at a time.
|
49
|
+
double constant = std::sqrt(-2 * std::log(standard_uniform<T>(eng)));
|
50
|
+
double angle = 2 * pi * standard_uniform<T>(eng);
|
51
|
+
return std::make_pair(constant * std::sin(angle), constant * std::cos(angle));
|
52
|
+
}
|
53
|
+
|
54
|
+
/**
|
55
|
+
* @tparam T Floating point type.
|
56
|
+
* @tparam Engine A random number generator class with `operator()`, `min()` (static) and `max()` (static) methods,
|
57
|
+
* where the `result_type` is an unsigned integer value.
|
58
|
+
*
|
59
|
+
* @param eng Instance of an RNG class like `std::mt19937_64`.
|
60
|
+
*
|
61
|
+
* @return Draw from a standard exponential distribution.
|
62
|
+
*/
|
63
|
+
template<typename T = double, class Engine>
|
64
|
+
T standard_exponential(Engine& eng) {
|
65
|
+
return -std::log(standard_uniform(eng));
|
66
|
+
}
|
67
|
+
|
68
|
+
/**
|
69
|
+
* @tparam T Integer type.
|
70
|
+
* @tparam Engine A random number generator class with `operator()`, `min()` (static) and `max()` (static) methods,
|
71
|
+
* where the `result_type` is an unsigned integer value.
|
72
|
+
*
|
73
|
+
* @param eng Instance of an RNG class like `std::mt19937_64`.
|
74
|
+
* @param bound Positive integer specifying the upper bound of the discrete distribution.
|
75
|
+
*
|
76
|
+
* @return Draw from a discrete uniform distribution in `[0, bound)`.
|
77
|
+
*/
|
78
|
+
template<typename T = int, class Engine>
|
79
|
+
T discrete_uniform(Engine& eng, T bound) {
|
80
|
+
typedef typename Engine::result_type R;
|
81
|
+
static_assert(std::numeric_limits<R>::is_integer);
|
82
|
+
static_assert(!std::numeric_limits<R>::is_signed);
|
83
|
+
|
84
|
+
constexpr R range = Engine::max() - Engine::min();
|
85
|
+
if (bound > range) {
|
86
|
+
throw std::runtime_error("'bound' should be less than the RNG range");
|
87
|
+
}
|
88
|
+
|
89
|
+
static_assert(std::numeric_limits<T>::is_integer);
|
90
|
+
if (bound <= 0) {
|
91
|
+
throw std::runtime_error("'bound' should be a positive integer");
|
92
|
+
}
|
93
|
+
|
94
|
+
// The limit is necessary to provide uniformity in the presence of the
|
95
|
+
// modulus. The idea is to re-sample if we get a draw above the limit.
|
96
|
+
// Technically this can have problems as bound approaches range, in which
|
97
|
+
// case we might end up discarding a lot of the sample space... but this
|
98
|
+
// is unlikely to happen in practice, so whatever. Note that the +1 is
|
99
|
+
// necessary because range is inclusive but bound is not.
|
100
|
+
const R limit = range - (range % bound + 1);
|
101
|
+
|
102
|
+
// In addition, we don't have to deal with the crap about combining draws
|
103
|
+
// to get enough entropy, which is 90% of the Boost implementation.
|
104
|
+
T draw;
|
105
|
+
do {
|
106
|
+
draw = (eng() - Engine::min()) % bound;
|
107
|
+
} while (draw > limit);
|
108
|
+
|
109
|
+
return draw;
|
110
|
+
}
|
111
|
+
|
112
|
+
}
|
113
|
+
|
114
|
+
#endif
|