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,463 @@
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
2
|
+
// for linear algebra.
|
3
|
+
//
|
4
|
+
// Copyright (C) 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_STLITERATORS_H
|
11
|
+
#define EIGEN_STLITERATORS_H
|
12
|
+
|
13
|
+
namespace Eigen {
|
14
|
+
|
15
|
+
namespace internal {
|
16
|
+
|
17
|
+
template<typename IteratorType>
|
18
|
+
struct indexed_based_stl_iterator_traits;
|
19
|
+
|
20
|
+
template<typename Derived>
|
21
|
+
class indexed_based_stl_iterator_base
|
22
|
+
{
|
23
|
+
protected:
|
24
|
+
typedef indexed_based_stl_iterator_traits<Derived> traits;
|
25
|
+
typedef typename traits::XprType XprType;
|
26
|
+
typedef indexed_based_stl_iterator_base<typename traits::non_const_iterator> non_const_iterator;
|
27
|
+
typedef indexed_based_stl_iterator_base<typename traits::const_iterator> const_iterator;
|
28
|
+
typedef typename internal::conditional<internal::is_const<XprType>::value,non_const_iterator,const_iterator>::type other_iterator;
|
29
|
+
// NOTE: in C++03 we cannot declare friend classes through typedefs because we need to write friend class:
|
30
|
+
friend class indexed_based_stl_iterator_base<typename traits::const_iterator>;
|
31
|
+
friend class indexed_based_stl_iterator_base<typename traits::non_const_iterator>;
|
32
|
+
public:
|
33
|
+
typedef Index difference_type;
|
34
|
+
typedef std::random_access_iterator_tag iterator_category;
|
35
|
+
|
36
|
+
indexed_based_stl_iterator_base() EIGEN_NO_THROW : mp_xpr(0), m_index(0) {}
|
37
|
+
indexed_based_stl_iterator_base(XprType& xpr, Index index) EIGEN_NO_THROW : mp_xpr(&xpr), m_index(index) {}
|
38
|
+
|
39
|
+
indexed_based_stl_iterator_base(const non_const_iterator& other) EIGEN_NO_THROW
|
40
|
+
: mp_xpr(other.mp_xpr), m_index(other.m_index)
|
41
|
+
{}
|
42
|
+
|
43
|
+
indexed_based_stl_iterator_base& operator=(const non_const_iterator& other)
|
44
|
+
{
|
45
|
+
mp_xpr = other.mp_xpr;
|
46
|
+
m_index = other.m_index;
|
47
|
+
return *this;
|
48
|
+
}
|
49
|
+
|
50
|
+
Derived& operator++() { ++m_index; return derived(); }
|
51
|
+
Derived& operator--() { --m_index; return derived(); }
|
52
|
+
|
53
|
+
Derived operator++(int) { Derived prev(derived()); operator++(); return prev;}
|
54
|
+
Derived operator--(int) { Derived prev(derived()); operator--(); return prev;}
|
55
|
+
|
56
|
+
friend Derived operator+(const indexed_based_stl_iterator_base& a, Index b) { Derived ret(a.derived()); ret += b; return ret; }
|
57
|
+
friend Derived operator-(const indexed_based_stl_iterator_base& a, Index b) { Derived ret(a.derived()); ret -= b; return ret; }
|
58
|
+
friend Derived operator+(Index a, const indexed_based_stl_iterator_base& b) { Derived ret(b.derived()); ret += a; return ret; }
|
59
|
+
friend Derived operator-(Index a, const indexed_based_stl_iterator_base& b) { Derived ret(b.derived()); ret -= a; return ret; }
|
60
|
+
|
61
|
+
Derived& operator+=(Index b) { m_index += b; return derived(); }
|
62
|
+
Derived& operator-=(Index b) { m_index -= b; return derived(); }
|
63
|
+
|
64
|
+
difference_type operator-(const indexed_based_stl_iterator_base& other) const
|
65
|
+
{
|
66
|
+
eigen_assert(mp_xpr == other.mp_xpr);
|
67
|
+
return m_index - other.m_index;
|
68
|
+
}
|
69
|
+
|
70
|
+
difference_type operator-(const other_iterator& other) const
|
71
|
+
{
|
72
|
+
eigen_assert(mp_xpr == other.mp_xpr);
|
73
|
+
return m_index - other.m_index;
|
74
|
+
}
|
75
|
+
|
76
|
+
bool operator==(const indexed_based_stl_iterator_base& other) const { eigen_assert(mp_xpr == other.mp_xpr); return m_index == other.m_index; }
|
77
|
+
bool operator!=(const indexed_based_stl_iterator_base& other) const { eigen_assert(mp_xpr == other.mp_xpr); return m_index != other.m_index; }
|
78
|
+
bool operator< (const indexed_based_stl_iterator_base& other) const { eigen_assert(mp_xpr == other.mp_xpr); return m_index < other.m_index; }
|
79
|
+
bool operator<=(const indexed_based_stl_iterator_base& other) const { eigen_assert(mp_xpr == other.mp_xpr); return m_index <= other.m_index; }
|
80
|
+
bool operator> (const indexed_based_stl_iterator_base& other) const { eigen_assert(mp_xpr == other.mp_xpr); return m_index > other.m_index; }
|
81
|
+
bool operator>=(const indexed_based_stl_iterator_base& other) const { eigen_assert(mp_xpr == other.mp_xpr); return m_index >= other.m_index; }
|
82
|
+
|
83
|
+
bool operator==(const other_iterator& other) const { eigen_assert(mp_xpr == other.mp_xpr); return m_index == other.m_index; }
|
84
|
+
bool operator!=(const other_iterator& other) const { eigen_assert(mp_xpr == other.mp_xpr); return m_index != other.m_index; }
|
85
|
+
bool operator< (const other_iterator& other) const { eigen_assert(mp_xpr == other.mp_xpr); return m_index < other.m_index; }
|
86
|
+
bool operator<=(const other_iterator& other) const { eigen_assert(mp_xpr == other.mp_xpr); return m_index <= other.m_index; }
|
87
|
+
bool operator> (const other_iterator& other) const { eigen_assert(mp_xpr == other.mp_xpr); return m_index > other.m_index; }
|
88
|
+
bool operator>=(const other_iterator& other) const { eigen_assert(mp_xpr == other.mp_xpr); return m_index >= other.m_index; }
|
89
|
+
|
90
|
+
protected:
|
91
|
+
|
92
|
+
Derived& derived() { return static_cast<Derived&>(*this); }
|
93
|
+
const Derived& derived() const { return static_cast<const Derived&>(*this); }
|
94
|
+
|
95
|
+
XprType *mp_xpr;
|
96
|
+
Index m_index;
|
97
|
+
};
|
98
|
+
|
99
|
+
template<typename Derived>
|
100
|
+
class indexed_based_stl_reverse_iterator_base
|
101
|
+
{
|
102
|
+
protected:
|
103
|
+
typedef indexed_based_stl_iterator_traits<Derived> traits;
|
104
|
+
typedef typename traits::XprType XprType;
|
105
|
+
typedef indexed_based_stl_reverse_iterator_base<typename traits::non_const_iterator> non_const_iterator;
|
106
|
+
typedef indexed_based_stl_reverse_iterator_base<typename traits::const_iterator> const_iterator;
|
107
|
+
typedef typename internal::conditional<internal::is_const<XprType>::value,non_const_iterator,const_iterator>::type other_iterator;
|
108
|
+
// NOTE: in C++03 we cannot declare friend classes through typedefs because we need to write friend class:
|
109
|
+
friend class indexed_based_stl_reverse_iterator_base<typename traits::const_iterator>;
|
110
|
+
friend class indexed_based_stl_reverse_iterator_base<typename traits::non_const_iterator>;
|
111
|
+
public:
|
112
|
+
typedef Index difference_type;
|
113
|
+
typedef std::random_access_iterator_tag iterator_category;
|
114
|
+
|
115
|
+
indexed_based_stl_reverse_iterator_base() : mp_xpr(0), m_index(0) {}
|
116
|
+
indexed_based_stl_reverse_iterator_base(XprType& xpr, Index index) : mp_xpr(&xpr), m_index(index) {}
|
117
|
+
|
118
|
+
indexed_based_stl_reverse_iterator_base(const non_const_iterator& other)
|
119
|
+
: mp_xpr(other.mp_xpr), m_index(other.m_index)
|
120
|
+
{}
|
121
|
+
|
122
|
+
indexed_based_stl_reverse_iterator_base& operator=(const non_const_iterator& other)
|
123
|
+
{
|
124
|
+
mp_xpr = other.mp_xpr;
|
125
|
+
m_index = other.m_index;
|
126
|
+
return *this;
|
127
|
+
}
|
128
|
+
|
129
|
+
Derived& operator++() { --m_index; return derived(); }
|
130
|
+
Derived& operator--() { ++m_index; return derived(); }
|
131
|
+
|
132
|
+
Derived operator++(int) { Derived prev(derived()); operator++(); return prev;}
|
133
|
+
Derived operator--(int) { Derived prev(derived()); operator--(); return prev;}
|
134
|
+
|
135
|
+
friend Derived operator+(const indexed_based_stl_reverse_iterator_base& a, Index b) { Derived ret(a.derived()); ret += b; return ret; }
|
136
|
+
friend Derived operator-(const indexed_based_stl_reverse_iterator_base& a, Index b) { Derived ret(a.derived()); ret -= b; return ret; }
|
137
|
+
friend Derived operator+(Index a, const indexed_based_stl_reverse_iterator_base& b) { Derived ret(b.derived()); ret += a; return ret; }
|
138
|
+
friend Derived operator-(Index a, const indexed_based_stl_reverse_iterator_base& b) { Derived ret(b.derived()); ret -= a; return ret; }
|
139
|
+
|
140
|
+
Derived& operator+=(Index b) { m_index -= b; return derived(); }
|
141
|
+
Derived& operator-=(Index b) { m_index += b; return derived(); }
|
142
|
+
|
143
|
+
difference_type operator-(const indexed_based_stl_reverse_iterator_base& other) const
|
144
|
+
{
|
145
|
+
eigen_assert(mp_xpr == other.mp_xpr);
|
146
|
+
return other.m_index - m_index;
|
147
|
+
}
|
148
|
+
|
149
|
+
difference_type operator-(const other_iterator& other) const
|
150
|
+
{
|
151
|
+
eigen_assert(mp_xpr == other.mp_xpr);
|
152
|
+
return other.m_index - m_index;
|
153
|
+
}
|
154
|
+
|
155
|
+
bool operator==(const indexed_based_stl_reverse_iterator_base& other) const { eigen_assert(mp_xpr == other.mp_xpr); return m_index == other.m_index; }
|
156
|
+
bool operator!=(const indexed_based_stl_reverse_iterator_base& other) const { eigen_assert(mp_xpr == other.mp_xpr); return m_index != other.m_index; }
|
157
|
+
bool operator< (const indexed_based_stl_reverse_iterator_base& other) const { eigen_assert(mp_xpr == other.mp_xpr); return m_index > other.m_index; }
|
158
|
+
bool operator<=(const indexed_based_stl_reverse_iterator_base& other) const { eigen_assert(mp_xpr == other.mp_xpr); return m_index >= other.m_index; }
|
159
|
+
bool operator> (const indexed_based_stl_reverse_iterator_base& other) const { eigen_assert(mp_xpr == other.mp_xpr); return m_index < other.m_index; }
|
160
|
+
bool operator>=(const indexed_based_stl_reverse_iterator_base& other) const { eigen_assert(mp_xpr == other.mp_xpr); return m_index <= other.m_index; }
|
161
|
+
|
162
|
+
bool operator==(const other_iterator& other) const { eigen_assert(mp_xpr == other.mp_xpr); return m_index == other.m_index; }
|
163
|
+
bool operator!=(const other_iterator& other) const { eigen_assert(mp_xpr == other.mp_xpr); return m_index != other.m_index; }
|
164
|
+
bool operator< (const other_iterator& other) const { eigen_assert(mp_xpr == other.mp_xpr); return m_index > other.m_index; }
|
165
|
+
bool operator<=(const other_iterator& other) const { eigen_assert(mp_xpr == other.mp_xpr); return m_index >= other.m_index; }
|
166
|
+
bool operator> (const other_iterator& other) const { eigen_assert(mp_xpr == other.mp_xpr); return m_index < other.m_index; }
|
167
|
+
bool operator>=(const other_iterator& other) const { eigen_assert(mp_xpr == other.mp_xpr); return m_index <= other.m_index; }
|
168
|
+
|
169
|
+
protected:
|
170
|
+
|
171
|
+
Derived& derived() { return static_cast<Derived&>(*this); }
|
172
|
+
const Derived& derived() const { return static_cast<const Derived&>(*this); }
|
173
|
+
|
174
|
+
XprType *mp_xpr;
|
175
|
+
Index m_index;
|
176
|
+
};
|
177
|
+
|
178
|
+
template<typename XprType>
|
179
|
+
class pointer_based_stl_iterator
|
180
|
+
{
|
181
|
+
enum { is_lvalue = internal::is_lvalue<XprType>::value };
|
182
|
+
typedef pointer_based_stl_iterator<typename internal::remove_const<XprType>::type> non_const_iterator;
|
183
|
+
typedef pointer_based_stl_iterator<typename internal::add_const<XprType>::type> const_iterator;
|
184
|
+
typedef typename internal::conditional<internal::is_const<XprType>::value,non_const_iterator,const_iterator>::type other_iterator;
|
185
|
+
// NOTE: in C++03 we cannot declare friend classes through typedefs because we need to write friend class:
|
186
|
+
friend class pointer_based_stl_iterator<typename internal::add_const<XprType>::type>;
|
187
|
+
friend class pointer_based_stl_iterator<typename internal::remove_const<XprType>::type>;
|
188
|
+
public:
|
189
|
+
typedef Index difference_type;
|
190
|
+
typedef typename XprType::Scalar value_type;
|
191
|
+
typedef std::random_access_iterator_tag iterator_category;
|
192
|
+
typedef typename internal::conditional<bool(is_lvalue), value_type*, const value_type*>::type pointer;
|
193
|
+
typedef typename internal::conditional<bool(is_lvalue), value_type&, const value_type&>::type reference;
|
194
|
+
|
195
|
+
|
196
|
+
pointer_based_stl_iterator() EIGEN_NO_THROW : m_ptr(0) {}
|
197
|
+
pointer_based_stl_iterator(XprType& xpr, Index index) EIGEN_NO_THROW : m_incr(xpr.innerStride())
|
198
|
+
{
|
199
|
+
m_ptr = xpr.data() + index * m_incr.value();
|
200
|
+
}
|
201
|
+
|
202
|
+
pointer_based_stl_iterator(const non_const_iterator& other) EIGEN_NO_THROW
|
203
|
+
: m_ptr(other.m_ptr), m_incr(other.m_incr)
|
204
|
+
{}
|
205
|
+
|
206
|
+
pointer_based_stl_iterator& operator=(const non_const_iterator& other) EIGEN_NO_THROW
|
207
|
+
{
|
208
|
+
m_ptr = other.m_ptr;
|
209
|
+
m_incr.setValue(other.m_incr);
|
210
|
+
return *this;
|
211
|
+
}
|
212
|
+
|
213
|
+
reference operator*() const { return *m_ptr; }
|
214
|
+
reference operator[](Index i) const { return *(m_ptr+i*m_incr.value()); }
|
215
|
+
pointer operator->() const { return m_ptr; }
|
216
|
+
|
217
|
+
pointer_based_stl_iterator& operator++() { m_ptr += m_incr.value(); return *this; }
|
218
|
+
pointer_based_stl_iterator& operator--() { m_ptr -= m_incr.value(); return *this; }
|
219
|
+
|
220
|
+
pointer_based_stl_iterator operator++(int) { pointer_based_stl_iterator prev(*this); operator++(); return prev;}
|
221
|
+
pointer_based_stl_iterator operator--(int) { pointer_based_stl_iterator prev(*this); operator--(); return prev;}
|
222
|
+
|
223
|
+
friend pointer_based_stl_iterator operator+(const pointer_based_stl_iterator& a, Index b) { pointer_based_stl_iterator ret(a); ret += b; return ret; }
|
224
|
+
friend pointer_based_stl_iterator operator-(const pointer_based_stl_iterator& a, Index b) { pointer_based_stl_iterator ret(a); ret -= b; return ret; }
|
225
|
+
friend pointer_based_stl_iterator operator+(Index a, const pointer_based_stl_iterator& b) { pointer_based_stl_iterator ret(b); ret += a; return ret; }
|
226
|
+
friend pointer_based_stl_iterator operator-(Index a, const pointer_based_stl_iterator& b) { pointer_based_stl_iterator ret(b); ret -= a; return ret; }
|
227
|
+
|
228
|
+
pointer_based_stl_iterator& operator+=(Index b) { m_ptr += b*m_incr.value(); return *this; }
|
229
|
+
pointer_based_stl_iterator& operator-=(Index b) { m_ptr -= b*m_incr.value(); return *this; }
|
230
|
+
|
231
|
+
difference_type operator-(const pointer_based_stl_iterator& other) const {
|
232
|
+
return (m_ptr - other.m_ptr)/m_incr.value();
|
233
|
+
}
|
234
|
+
|
235
|
+
difference_type operator-(const other_iterator& other) const {
|
236
|
+
return (m_ptr - other.m_ptr)/m_incr.value();
|
237
|
+
}
|
238
|
+
|
239
|
+
bool operator==(const pointer_based_stl_iterator& other) const { return m_ptr == other.m_ptr; }
|
240
|
+
bool operator!=(const pointer_based_stl_iterator& other) const { return m_ptr != other.m_ptr; }
|
241
|
+
bool operator< (const pointer_based_stl_iterator& other) const { return m_ptr < other.m_ptr; }
|
242
|
+
bool operator<=(const pointer_based_stl_iterator& other) const { return m_ptr <= other.m_ptr; }
|
243
|
+
bool operator> (const pointer_based_stl_iterator& other) const { return m_ptr > other.m_ptr; }
|
244
|
+
bool operator>=(const pointer_based_stl_iterator& other) const { return m_ptr >= other.m_ptr; }
|
245
|
+
|
246
|
+
bool operator==(const other_iterator& other) const { return m_ptr == other.m_ptr; }
|
247
|
+
bool operator!=(const other_iterator& other) const { return m_ptr != other.m_ptr; }
|
248
|
+
bool operator< (const other_iterator& other) const { return m_ptr < other.m_ptr; }
|
249
|
+
bool operator<=(const other_iterator& other) const { return m_ptr <= other.m_ptr; }
|
250
|
+
bool operator> (const other_iterator& other) const { return m_ptr > other.m_ptr; }
|
251
|
+
bool operator>=(const other_iterator& other) const { return m_ptr >= other.m_ptr; }
|
252
|
+
|
253
|
+
protected:
|
254
|
+
|
255
|
+
pointer m_ptr;
|
256
|
+
internal::variable_if_dynamic<Index, XprType::InnerStrideAtCompileTime> m_incr;
|
257
|
+
};
|
258
|
+
|
259
|
+
template<typename _XprType>
|
260
|
+
struct indexed_based_stl_iterator_traits<generic_randaccess_stl_iterator<_XprType> >
|
261
|
+
{
|
262
|
+
typedef _XprType XprType;
|
263
|
+
typedef generic_randaccess_stl_iterator<typename internal::remove_const<XprType>::type> non_const_iterator;
|
264
|
+
typedef generic_randaccess_stl_iterator<typename internal::add_const<XprType>::type> const_iterator;
|
265
|
+
};
|
266
|
+
|
267
|
+
template<typename XprType>
|
268
|
+
class generic_randaccess_stl_iterator : public indexed_based_stl_iterator_base<generic_randaccess_stl_iterator<XprType> >
|
269
|
+
{
|
270
|
+
public:
|
271
|
+
typedef typename XprType::Scalar value_type;
|
272
|
+
|
273
|
+
protected:
|
274
|
+
|
275
|
+
enum {
|
276
|
+
has_direct_access = (internal::traits<XprType>::Flags & DirectAccessBit) ? 1 : 0,
|
277
|
+
is_lvalue = internal::is_lvalue<XprType>::value
|
278
|
+
};
|
279
|
+
|
280
|
+
typedef indexed_based_stl_iterator_base<generic_randaccess_stl_iterator> Base;
|
281
|
+
using Base::m_index;
|
282
|
+
using Base::mp_xpr;
|
283
|
+
|
284
|
+
// TODO currently const Transpose/Reshape expressions never returns const references,
|
285
|
+
// so lets return by value too.
|
286
|
+
//typedef typename internal::conditional<bool(has_direct_access), const value_type&, const value_type>::type read_only_ref_t;
|
287
|
+
typedef const value_type read_only_ref_t;
|
288
|
+
|
289
|
+
public:
|
290
|
+
|
291
|
+
typedef typename internal::conditional<bool(is_lvalue), value_type *, const value_type *>::type pointer;
|
292
|
+
typedef typename internal::conditional<bool(is_lvalue), value_type&, read_only_ref_t>::type reference;
|
293
|
+
|
294
|
+
generic_randaccess_stl_iterator() : Base() {}
|
295
|
+
generic_randaccess_stl_iterator(XprType& xpr, Index index) : Base(xpr,index) {}
|
296
|
+
generic_randaccess_stl_iterator(const typename Base::non_const_iterator& other) : Base(other) {}
|
297
|
+
using Base::operator=;
|
298
|
+
|
299
|
+
reference operator*() const { return (*mp_xpr)(m_index); }
|
300
|
+
reference operator[](Index i) const { return (*mp_xpr)(m_index+i); }
|
301
|
+
pointer operator->() const { return &((*mp_xpr)(m_index)); }
|
302
|
+
};
|
303
|
+
|
304
|
+
template<typename _XprType, DirectionType Direction>
|
305
|
+
struct indexed_based_stl_iterator_traits<subvector_stl_iterator<_XprType,Direction> >
|
306
|
+
{
|
307
|
+
typedef _XprType XprType;
|
308
|
+
typedef subvector_stl_iterator<typename internal::remove_const<XprType>::type, Direction> non_const_iterator;
|
309
|
+
typedef subvector_stl_iterator<typename internal::add_const<XprType>::type, Direction> const_iterator;
|
310
|
+
};
|
311
|
+
|
312
|
+
template<typename XprType, DirectionType Direction>
|
313
|
+
class subvector_stl_iterator : public indexed_based_stl_iterator_base<subvector_stl_iterator<XprType,Direction> >
|
314
|
+
{
|
315
|
+
protected:
|
316
|
+
|
317
|
+
enum { is_lvalue = internal::is_lvalue<XprType>::value };
|
318
|
+
|
319
|
+
typedef indexed_based_stl_iterator_base<subvector_stl_iterator> Base;
|
320
|
+
using Base::m_index;
|
321
|
+
using Base::mp_xpr;
|
322
|
+
|
323
|
+
typedef typename internal::conditional<Direction==Vertical,typename XprType::ColXpr,typename XprType::RowXpr>::type SubVectorType;
|
324
|
+
typedef typename internal::conditional<Direction==Vertical,typename XprType::ConstColXpr,typename XprType::ConstRowXpr>::type ConstSubVectorType;
|
325
|
+
|
326
|
+
|
327
|
+
public:
|
328
|
+
typedef typename internal::conditional<bool(is_lvalue), SubVectorType, ConstSubVectorType>::type reference;
|
329
|
+
typedef typename reference::PlainObject value_type;
|
330
|
+
|
331
|
+
private:
|
332
|
+
class subvector_stl_iterator_ptr
|
333
|
+
{
|
334
|
+
public:
|
335
|
+
subvector_stl_iterator_ptr(const reference &subvector) : m_subvector(subvector) {}
|
336
|
+
reference* operator->() { return &m_subvector; }
|
337
|
+
private:
|
338
|
+
reference m_subvector;
|
339
|
+
};
|
340
|
+
public:
|
341
|
+
|
342
|
+
typedef subvector_stl_iterator_ptr pointer;
|
343
|
+
|
344
|
+
subvector_stl_iterator() : Base() {}
|
345
|
+
subvector_stl_iterator(XprType& xpr, Index index) : Base(xpr,index) {}
|
346
|
+
|
347
|
+
reference operator*() const { return (*mp_xpr).template subVector<Direction>(m_index); }
|
348
|
+
reference operator[](Index i) const { return (*mp_xpr).template subVector<Direction>(m_index+i); }
|
349
|
+
pointer operator->() const { return (*mp_xpr).template subVector<Direction>(m_index); }
|
350
|
+
};
|
351
|
+
|
352
|
+
template<typename _XprType, DirectionType Direction>
|
353
|
+
struct indexed_based_stl_iterator_traits<subvector_stl_reverse_iterator<_XprType,Direction> >
|
354
|
+
{
|
355
|
+
typedef _XprType XprType;
|
356
|
+
typedef subvector_stl_reverse_iterator<typename internal::remove_const<XprType>::type, Direction> non_const_iterator;
|
357
|
+
typedef subvector_stl_reverse_iterator<typename internal::add_const<XprType>::type, Direction> const_iterator;
|
358
|
+
};
|
359
|
+
|
360
|
+
template<typename XprType, DirectionType Direction>
|
361
|
+
class subvector_stl_reverse_iterator : public indexed_based_stl_reverse_iterator_base<subvector_stl_reverse_iterator<XprType,Direction> >
|
362
|
+
{
|
363
|
+
protected:
|
364
|
+
|
365
|
+
enum { is_lvalue = internal::is_lvalue<XprType>::value };
|
366
|
+
|
367
|
+
typedef indexed_based_stl_reverse_iterator_base<subvector_stl_reverse_iterator> Base;
|
368
|
+
using Base::m_index;
|
369
|
+
using Base::mp_xpr;
|
370
|
+
|
371
|
+
typedef typename internal::conditional<Direction==Vertical,typename XprType::ColXpr,typename XprType::RowXpr>::type SubVectorType;
|
372
|
+
typedef typename internal::conditional<Direction==Vertical,typename XprType::ConstColXpr,typename XprType::ConstRowXpr>::type ConstSubVectorType;
|
373
|
+
|
374
|
+
|
375
|
+
public:
|
376
|
+
typedef typename internal::conditional<bool(is_lvalue), SubVectorType, ConstSubVectorType>::type reference;
|
377
|
+
typedef typename reference::PlainObject value_type;
|
378
|
+
|
379
|
+
private:
|
380
|
+
class subvector_stl_reverse_iterator_ptr
|
381
|
+
{
|
382
|
+
public:
|
383
|
+
subvector_stl_reverse_iterator_ptr(const reference &subvector) : m_subvector(subvector) {}
|
384
|
+
reference* operator->() { return &m_subvector; }
|
385
|
+
private:
|
386
|
+
reference m_subvector;
|
387
|
+
};
|
388
|
+
public:
|
389
|
+
|
390
|
+
typedef subvector_stl_reverse_iterator_ptr pointer;
|
391
|
+
|
392
|
+
subvector_stl_reverse_iterator() : Base() {}
|
393
|
+
subvector_stl_reverse_iterator(XprType& xpr, Index index) : Base(xpr,index) {}
|
394
|
+
|
395
|
+
reference operator*() const { return (*mp_xpr).template subVector<Direction>(m_index); }
|
396
|
+
reference operator[](Index i) const { return (*mp_xpr).template subVector<Direction>(m_index+i); }
|
397
|
+
pointer operator->() const { return (*mp_xpr).template subVector<Direction>(m_index); }
|
398
|
+
};
|
399
|
+
|
400
|
+
} // namespace internal
|
401
|
+
|
402
|
+
|
403
|
+
/** returns an iterator to the first element of the 1D vector or array
|
404
|
+
* \only_for_vectors
|
405
|
+
* \sa end(), cbegin()
|
406
|
+
*/
|
407
|
+
template<typename Derived>
|
408
|
+
inline typename DenseBase<Derived>::iterator DenseBase<Derived>::begin()
|
409
|
+
{
|
410
|
+
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived);
|
411
|
+
return iterator(derived(), 0);
|
412
|
+
}
|
413
|
+
|
414
|
+
/** const version of begin() */
|
415
|
+
template<typename Derived>
|
416
|
+
inline typename DenseBase<Derived>::const_iterator DenseBase<Derived>::begin() const
|
417
|
+
{
|
418
|
+
return cbegin();
|
419
|
+
}
|
420
|
+
|
421
|
+
/** returns a read-only const_iterator to the first element of the 1D vector or array
|
422
|
+
* \only_for_vectors
|
423
|
+
* \sa cend(), begin()
|
424
|
+
*/
|
425
|
+
template<typename Derived>
|
426
|
+
inline typename DenseBase<Derived>::const_iterator DenseBase<Derived>::cbegin() const
|
427
|
+
{
|
428
|
+
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived);
|
429
|
+
return const_iterator(derived(), 0);
|
430
|
+
}
|
431
|
+
|
432
|
+
/** returns an iterator to the element following the last element of the 1D vector or array
|
433
|
+
* \only_for_vectors
|
434
|
+
* \sa begin(), cend()
|
435
|
+
*/
|
436
|
+
template<typename Derived>
|
437
|
+
inline typename DenseBase<Derived>::iterator DenseBase<Derived>::end()
|
438
|
+
{
|
439
|
+
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived);
|
440
|
+
return iterator(derived(), size());
|
441
|
+
}
|
442
|
+
|
443
|
+
/** const version of end() */
|
444
|
+
template<typename Derived>
|
445
|
+
inline typename DenseBase<Derived>::const_iterator DenseBase<Derived>::end() const
|
446
|
+
{
|
447
|
+
return cend();
|
448
|
+
}
|
449
|
+
|
450
|
+
/** returns a read-only const_iterator to the element following the last element of the 1D vector or array
|
451
|
+
* \only_for_vectors
|
452
|
+
* \sa begin(), cend()
|
453
|
+
*/
|
454
|
+
template<typename Derived>
|
455
|
+
inline typename DenseBase<Derived>::const_iterator DenseBase<Derived>::cend() const
|
456
|
+
{
|
457
|
+
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived);
|
458
|
+
return const_iterator(derived(), size());
|
459
|
+
}
|
460
|
+
|
461
|
+
} // namespace Eigen
|
462
|
+
|
463
|
+
#endif // EIGEN_STLITERATORS_H
|
@@ -0,0 +1,116 @@
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
2
|
+
// for linear algebra.
|
3
|
+
//
|
4
|
+
// Copyright (C) 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_STRIDE_H
|
11
|
+
#define EIGEN_STRIDE_H
|
12
|
+
|
13
|
+
namespace Eigen {
|
14
|
+
|
15
|
+
/** \class Stride
|
16
|
+
* \ingroup Core_Module
|
17
|
+
*
|
18
|
+
* \brief Holds strides information for Map
|
19
|
+
*
|
20
|
+
* This class holds the strides information for mapping arrays with strides with class Map.
|
21
|
+
*
|
22
|
+
* It holds two values: the inner stride and the outer stride.
|
23
|
+
*
|
24
|
+
* The inner stride is the pointer increment between two consecutive entries within a given row of a
|
25
|
+
* row-major matrix or within a given column of a column-major matrix.
|
26
|
+
*
|
27
|
+
* The outer stride is the pointer increment between two consecutive rows of a row-major matrix or
|
28
|
+
* between two consecutive columns of a column-major matrix.
|
29
|
+
*
|
30
|
+
* These two values can be passed either at compile-time as template parameters, or at runtime as
|
31
|
+
* arguments to the constructor.
|
32
|
+
*
|
33
|
+
* Indeed, this class takes two template parameters:
|
34
|
+
* \tparam _OuterStrideAtCompileTime the outer stride, or Dynamic if you want to specify it at runtime.
|
35
|
+
* \tparam _InnerStrideAtCompileTime the inner stride, or Dynamic if you want to specify it at runtime.
|
36
|
+
*
|
37
|
+
* Here is an example:
|
38
|
+
* \include Map_general_stride.cpp
|
39
|
+
* Output: \verbinclude Map_general_stride.out
|
40
|
+
*
|
41
|
+
* Both strides can be negative, however, a negative stride of -1 cannot be specified at compiletime
|
42
|
+
* because of the ambiguity with Dynamic which is defined to -1 (historically, negative strides were
|
43
|
+
* not allowed).
|
44
|
+
*
|
45
|
+
* \sa class InnerStride, class OuterStride, \ref TopicStorageOrders
|
46
|
+
*/
|
47
|
+
template<int _OuterStrideAtCompileTime, int _InnerStrideAtCompileTime>
|
48
|
+
class Stride
|
49
|
+
{
|
50
|
+
public:
|
51
|
+
typedef Eigen::Index Index; ///< \deprecated since Eigen 3.3
|
52
|
+
enum {
|
53
|
+
InnerStrideAtCompileTime = _InnerStrideAtCompileTime,
|
54
|
+
OuterStrideAtCompileTime = _OuterStrideAtCompileTime
|
55
|
+
};
|
56
|
+
|
57
|
+
/** Default constructor, for use when strides are fixed at compile time */
|
58
|
+
EIGEN_DEVICE_FUNC
|
59
|
+
Stride()
|
60
|
+
: m_outer(OuterStrideAtCompileTime), m_inner(InnerStrideAtCompileTime)
|
61
|
+
{
|
62
|
+
// FIXME: for Eigen 4 we should use DynamicIndex instead of Dynamic.
|
63
|
+
// FIXME: for Eigen 4 we should also unify this API with fix<>
|
64
|
+
eigen_assert(InnerStrideAtCompileTime != Dynamic && OuterStrideAtCompileTime != Dynamic);
|
65
|
+
}
|
66
|
+
|
67
|
+
/** Constructor allowing to pass the strides at runtime */
|
68
|
+
EIGEN_DEVICE_FUNC
|
69
|
+
Stride(Index outerStride, Index innerStride)
|
70
|
+
: m_outer(outerStride), m_inner(innerStride)
|
71
|
+
{
|
72
|
+
}
|
73
|
+
|
74
|
+
/** Copy constructor */
|
75
|
+
EIGEN_DEVICE_FUNC
|
76
|
+
Stride(const Stride& other)
|
77
|
+
: m_outer(other.outer()), m_inner(other.inner())
|
78
|
+
{}
|
79
|
+
|
80
|
+
/** \returns the outer stride */
|
81
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
82
|
+
inline Index outer() const { return m_outer.value(); }
|
83
|
+
/** \returns the inner stride */
|
84
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
85
|
+
inline Index inner() const { return m_inner.value(); }
|
86
|
+
|
87
|
+
protected:
|
88
|
+
internal::variable_if_dynamic<Index, OuterStrideAtCompileTime> m_outer;
|
89
|
+
internal::variable_if_dynamic<Index, InnerStrideAtCompileTime> m_inner;
|
90
|
+
};
|
91
|
+
|
92
|
+
/** \brief Convenience specialization of Stride to specify only an inner stride
|
93
|
+
* See class Map for some examples */
|
94
|
+
template<int Value>
|
95
|
+
class InnerStride : public Stride<0, Value>
|
96
|
+
{
|
97
|
+
typedef Stride<0, Value> Base;
|
98
|
+
public:
|
99
|
+
EIGEN_DEVICE_FUNC InnerStride() : Base() {}
|
100
|
+
EIGEN_DEVICE_FUNC InnerStride(Index v) : Base(0, v) {} // FIXME making this explicit could break valid code
|
101
|
+
};
|
102
|
+
|
103
|
+
/** \brief Convenience specialization of Stride to specify only an outer stride
|
104
|
+
* See class Map for some examples */
|
105
|
+
template<int Value>
|
106
|
+
class OuterStride : public Stride<Value, 0>
|
107
|
+
{
|
108
|
+
typedef Stride<Value, 0> Base;
|
109
|
+
public:
|
110
|
+
EIGEN_DEVICE_FUNC OuterStride() : Base() {}
|
111
|
+
EIGEN_DEVICE_FUNC OuterStride(Index v) : Base(v,0) {} // FIXME making this explicit could break valid code
|
112
|
+
};
|
113
|
+
|
114
|
+
} // end namespace Eigen
|
115
|
+
|
116
|
+
#endif // EIGEN_STRIDE_H
|
@@ -0,0 +1,68 @@
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
2
|
+
// for linear algebra.
|
3
|
+
//
|
4
|
+
// Copyright (C) 2006-2008 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_SWAP_H
|
11
|
+
#define EIGEN_SWAP_H
|
12
|
+
|
13
|
+
namespace Eigen {
|
14
|
+
|
15
|
+
namespace internal {
|
16
|
+
|
17
|
+
// Overload default assignPacket behavior for swapping them
|
18
|
+
template<typename DstEvaluatorTypeT, typename SrcEvaluatorTypeT>
|
19
|
+
class generic_dense_assignment_kernel<DstEvaluatorTypeT, SrcEvaluatorTypeT, swap_assign_op<typename DstEvaluatorTypeT::Scalar>, Specialized>
|
20
|
+
: public generic_dense_assignment_kernel<DstEvaluatorTypeT, SrcEvaluatorTypeT, swap_assign_op<typename DstEvaluatorTypeT::Scalar>, BuiltIn>
|
21
|
+
{
|
22
|
+
protected:
|
23
|
+
typedef generic_dense_assignment_kernel<DstEvaluatorTypeT, SrcEvaluatorTypeT, swap_assign_op<typename DstEvaluatorTypeT::Scalar>, BuiltIn> Base;
|
24
|
+
using Base::m_dst;
|
25
|
+
using Base::m_src;
|
26
|
+
using Base::m_functor;
|
27
|
+
|
28
|
+
public:
|
29
|
+
typedef typename Base::Scalar Scalar;
|
30
|
+
typedef typename Base::DstXprType DstXprType;
|
31
|
+
typedef swap_assign_op<Scalar> Functor;
|
32
|
+
|
33
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
34
|
+
generic_dense_assignment_kernel(DstEvaluatorTypeT &dst, const SrcEvaluatorTypeT &src, const Functor &func, DstXprType& dstExpr)
|
35
|
+
: Base(dst, src, func, dstExpr)
|
36
|
+
{}
|
37
|
+
|
38
|
+
template<int StoreMode, int LoadMode, typename PacketType>
|
39
|
+
EIGEN_STRONG_INLINE void assignPacket(Index row, Index col)
|
40
|
+
{
|
41
|
+
PacketType tmp = m_src.template packet<LoadMode,PacketType>(row,col);
|
42
|
+
const_cast<SrcEvaluatorTypeT&>(m_src).template writePacket<LoadMode>(row,col, m_dst.template packet<StoreMode,PacketType>(row,col));
|
43
|
+
m_dst.template writePacket<StoreMode>(row,col,tmp);
|
44
|
+
}
|
45
|
+
|
46
|
+
template<int StoreMode, int LoadMode, typename PacketType>
|
47
|
+
EIGEN_STRONG_INLINE void assignPacket(Index index)
|
48
|
+
{
|
49
|
+
PacketType tmp = m_src.template packet<LoadMode,PacketType>(index);
|
50
|
+
const_cast<SrcEvaluatorTypeT&>(m_src).template writePacket<LoadMode>(index, m_dst.template packet<StoreMode,PacketType>(index));
|
51
|
+
m_dst.template writePacket<StoreMode>(index,tmp);
|
52
|
+
}
|
53
|
+
|
54
|
+
// TODO find a simple way not to have to copy/paste this function from generic_dense_assignment_kernel, by simple I mean no CRTP (Gael)
|
55
|
+
template<int StoreMode, int LoadMode, typename PacketType>
|
56
|
+
EIGEN_STRONG_INLINE void assignPacketByOuterInner(Index outer, Index inner)
|
57
|
+
{
|
58
|
+
Index row = Base::rowIndexByOuterInner(outer, inner);
|
59
|
+
Index col = Base::colIndexByOuterInner(outer, inner);
|
60
|
+
assignPacket<StoreMode,LoadMode,PacketType>(row, col);
|
61
|
+
}
|
62
|
+
};
|
63
|
+
|
64
|
+
} // namespace internal
|
65
|
+
|
66
|
+
} // end namespace Eigen
|
67
|
+
|
68
|
+
#endif // EIGEN_SWAP_H
|