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,318 @@
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
2
|
+
// for linear algebra.
|
3
|
+
//
|
4
|
+
// Copyright (C) 2006-2008, 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_DOT_H
|
11
|
+
#define EIGEN_DOT_H
|
12
|
+
|
13
|
+
namespace Eigen {
|
14
|
+
|
15
|
+
namespace internal {
|
16
|
+
|
17
|
+
// helper function for dot(). The problem is that if we put that in the body of dot(), then upon calling dot
|
18
|
+
// with mismatched types, the compiler emits errors about failing to instantiate cwiseProduct BEFORE
|
19
|
+
// looking at the static assertions. Thus this is a trick to get better compile errors.
|
20
|
+
template<typename T, typename U,
|
21
|
+
// the NeedToTranspose condition here is taken straight from Assign.h
|
22
|
+
bool NeedToTranspose = T::IsVectorAtCompileTime
|
23
|
+
&& U::IsVectorAtCompileTime
|
24
|
+
&& ((int(T::RowsAtCompileTime) == 1 && int(U::ColsAtCompileTime) == 1)
|
25
|
+
| // FIXME | instead of || to please GCC 4.4.0 stupid warning "suggest parentheses around &&".
|
26
|
+
// revert to || as soon as not needed anymore.
|
27
|
+
(int(T::ColsAtCompileTime) == 1 && int(U::RowsAtCompileTime) == 1))
|
28
|
+
>
|
29
|
+
struct dot_nocheck
|
30
|
+
{
|
31
|
+
typedef scalar_conj_product_op<typename traits<T>::Scalar,typename traits<U>::Scalar> conj_prod;
|
32
|
+
typedef typename conj_prod::result_type ResScalar;
|
33
|
+
EIGEN_DEVICE_FUNC
|
34
|
+
EIGEN_STRONG_INLINE
|
35
|
+
static ResScalar run(const MatrixBase<T>& a, const MatrixBase<U>& b)
|
36
|
+
{
|
37
|
+
return a.template binaryExpr<conj_prod>(b).sum();
|
38
|
+
}
|
39
|
+
};
|
40
|
+
|
41
|
+
template<typename T, typename U>
|
42
|
+
struct dot_nocheck<T, U, true>
|
43
|
+
{
|
44
|
+
typedef scalar_conj_product_op<typename traits<T>::Scalar,typename traits<U>::Scalar> conj_prod;
|
45
|
+
typedef typename conj_prod::result_type ResScalar;
|
46
|
+
EIGEN_DEVICE_FUNC
|
47
|
+
EIGEN_STRONG_INLINE
|
48
|
+
static ResScalar run(const MatrixBase<T>& a, const MatrixBase<U>& b)
|
49
|
+
{
|
50
|
+
return a.transpose().template binaryExpr<conj_prod>(b).sum();
|
51
|
+
}
|
52
|
+
};
|
53
|
+
|
54
|
+
} // end namespace internal
|
55
|
+
|
56
|
+
/** \fn MatrixBase::dot
|
57
|
+
* \returns the dot product of *this with other.
|
58
|
+
*
|
59
|
+
* \only_for_vectors
|
60
|
+
*
|
61
|
+
* \note If the scalar type is complex numbers, then this function returns the hermitian
|
62
|
+
* (sesquilinear) dot product, conjugate-linear in the first variable and linear in the
|
63
|
+
* second variable.
|
64
|
+
*
|
65
|
+
* \sa squaredNorm(), norm()
|
66
|
+
*/
|
67
|
+
template<typename Derived>
|
68
|
+
template<typename OtherDerived>
|
69
|
+
EIGEN_DEVICE_FUNC
|
70
|
+
EIGEN_STRONG_INLINE
|
71
|
+
typename ScalarBinaryOpTraits<typename internal::traits<Derived>::Scalar,typename internal::traits<OtherDerived>::Scalar>::ReturnType
|
72
|
+
MatrixBase<Derived>::dot(const MatrixBase<OtherDerived>& other) const
|
73
|
+
{
|
74
|
+
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
|
75
|
+
EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
|
76
|
+
EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(Derived,OtherDerived)
|
77
|
+
#if !(defined(EIGEN_NO_STATIC_ASSERT) && defined(EIGEN_NO_DEBUG))
|
78
|
+
typedef internal::scalar_conj_product_op<Scalar,typename OtherDerived::Scalar> func;
|
79
|
+
EIGEN_CHECK_BINARY_COMPATIBILIY(func,Scalar,typename OtherDerived::Scalar);
|
80
|
+
#endif
|
81
|
+
|
82
|
+
eigen_assert(size() == other.size());
|
83
|
+
|
84
|
+
return internal::dot_nocheck<Derived,OtherDerived>::run(*this, other);
|
85
|
+
}
|
86
|
+
|
87
|
+
//---------- implementation of L2 norm and related functions ----------
|
88
|
+
|
89
|
+
/** \returns, for vectors, the squared \em l2 norm of \c *this, and for matrices the squared Frobenius norm.
|
90
|
+
* In both cases, it consists in the sum of the square of all the matrix entries.
|
91
|
+
* For vectors, this is also equals to the dot product of \c *this with itself.
|
92
|
+
*
|
93
|
+
* \sa dot(), norm(), lpNorm()
|
94
|
+
*/
|
95
|
+
template<typename Derived>
|
96
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename NumTraits<typename internal::traits<Derived>::Scalar>::Real MatrixBase<Derived>::squaredNorm() const
|
97
|
+
{
|
98
|
+
return numext::real((*this).cwiseAbs2().sum());
|
99
|
+
}
|
100
|
+
|
101
|
+
/** \returns, for vectors, the \em l2 norm of \c *this, and for matrices the Frobenius norm.
|
102
|
+
* In both cases, it consists in the square root of the sum of the square of all the matrix entries.
|
103
|
+
* For vectors, this is also equals to the square root of the dot product of \c *this with itself.
|
104
|
+
*
|
105
|
+
* \sa lpNorm(), dot(), squaredNorm()
|
106
|
+
*/
|
107
|
+
template<typename Derived>
|
108
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename NumTraits<typename internal::traits<Derived>::Scalar>::Real MatrixBase<Derived>::norm() const
|
109
|
+
{
|
110
|
+
return numext::sqrt(squaredNorm());
|
111
|
+
}
|
112
|
+
|
113
|
+
/** \returns an expression of the quotient of \c *this by its own norm.
|
114
|
+
*
|
115
|
+
* \warning If the input vector is too small (i.e., this->norm()==0),
|
116
|
+
* then this function returns a copy of the input.
|
117
|
+
*
|
118
|
+
* \only_for_vectors
|
119
|
+
*
|
120
|
+
* \sa norm(), normalize()
|
121
|
+
*/
|
122
|
+
template<typename Derived>
|
123
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase<Derived>::PlainObject
|
124
|
+
MatrixBase<Derived>::normalized() const
|
125
|
+
{
|
126
|
+
typedef typename internal::nested_eval<Derived,2>::type _Nested;
|
127
|
+
_Nested n(derived());
|
128
|
+
RealScalar z = n.squaredNorm();
|
129
|
+
// NOTE: after extensive benchmarking, this conditional does not impact performance, at least on recent x86 CPU
|
130
|
+
if(z>RealScalar(0))
|
131
|
+
return n / numext::sqrt(z);
|
132
|
+
else
|
133
|
+
return n;
|
134
|
+
}
|
135
|
+
|
136
|
+
/** Normalizes the vector, i.e. divides it by its own norm.
|
137
|
+
*
|
138
|
+
* \only_for_vectors
|
139
|
+
*
|
140
|
+
* \warning If the input vector is too small (i.e., this->norm()==0), then \c *this is left unchanged.
|
141
|
+
*
|
142
|
+
* \sa norm(), normalized()
|
143
|
+
*/
|
144
|
+
template<typename Derived>
|
145
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void MatrixBase<Derived>::normalize()
|
146
|
+
{
|
147
|
+
RealScalar z = squaredNorm();
|
148
|
+
// NOTE: after extensive benchmarking, this conditional does not impact performance, at least on recent x86 CPU
|
149
|
+
if(z>RealScalar(0))
|
150
|
+
derived() /= numext::sqrt(z);
|
151
|
+
}
|
152
|
+
|
153
|
+
/** \returns an expression of the quotient of \c *this by its own norm while avoiding underflow and overflow.
|
154
|
+
*
|
155
|
+
* \only_for_vectors
|
156
|
+
*
|
157
|
+
* This method is analogue to the normalized() method, but it reduces the risk of
|
158
|
+
* underflow and overflow when computing the norm.
|
159
|
+
*
|
160
|
+
* \warning If the input vector is too small (i.e., this->norm()==0),
|
161
|
+
* then this function returns a copy of the input.
|
162
|
+
*
|
163
|
+
* \sa stableNorm(), stableNormalize(), normalized()
|
164
|
+
*/
|
165
|
+
template<typename Derived>
|
166
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase<Derived>::PlainObject
|
167
|
+
MatrixBase<Derived>::stableNormalized() const
|
168
|
+
{
|
169
|
+
typedef typename internal::nested_eval<Derived,3>::type _Nested;
|
170
|
+
_Nested n(derived());
|
171
|
+
RealScalar w = n.cwiseAbs().maxCoeff();
|
172
|
+
RealScalar z = (n/w).squaredNorm();
|
173
|
+
if(z>RealScalar(0))
|
174
|
+
return n / (numext::sqrt(z)*w);
|
175
|
+
else
|
176
|
+
return n;
|
177
|
+
}
|
178
|
+
|
179
|
+
/** Normalizes the vector while avoid underflow and overflow
|
180
|
+
*
|
181
|
+
* \only_for_vectors
|
182
|
+
*
|
183
|
+
* This method is analogue to the normalize() method, but it reduces the risk of
|
184
|
+
* underflow and overflow when computing the norm.
|
185
|
+
*
|
186
|
+
* \warning If the input vector is too small (i.e., this->norm()==0), then \c *this is left unchanged.
|
187
|
+
*
|
188
|
+
* \sa stableNorm(), stableNormalized(), normalize()
|
189
|
+
*/
|
190
|
+
template<typename Derived>
|
191
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void MatrixBase<Derived>::stableNormalize()
|
192
|
+
{
|
193
|
+
RealScalar w = cwiseAbs().maxCoeff();
|
194
|
+
RealScalar z = (derived()/w).squaredNorm();
|
195
|
+
if(z>RealScalar(0))
|
196
|
+
derived() /= numext::sqrt(z)*w;
|
197
|
+
}
|
198
|
+
|
199
|
+
//---------- implementation of other norms ----------
|
200
|
+
|
201
|
+
namespace internal {
|
202
|
+
|
203
|
+
template<typename Derived, int p>
|
204
|
+
struct lpNorm_selector
|
205
|
+
{
|
206
|
+
typedef typename NumTraits<typename traits<Derived>::Scalar>::Real RealScalar;
|
207
|
+
EIGEN_DEVICE_FUNC
|
208
|
+
static inline RealScalar run(const MatrixBase<Derived>& m)
|
209
|
+
{
|
210
|
+
EIGEN_USING_STD(pow)
|
211
|
+
return pow(m.cwiseAbs().array().pow(p).sum(), RealScalar(1)/p);
|
212
|
+
}
|
213
|
+
};
|
214
|
+
|
215
|
+
template<typename Derived>
|
216
|
+
struct lpNorm_selector<Derived, 1>
|
217
|
+
{
|
218
|
+
EIGEN_DEVICE_FUNC
|
219
|
+
static inline typename NumTraits<typename traits<Derived>::Scalar>::Real run(const MatrixBase<Derived>& m)
|
220
|
+
{
|
221
|
+
return m.cwiseAbs().sum();
|
222
|
+
}
|
223
|
+
};
|
224
|
+
|
225
|
+
template<typename Derived>
|
226
|
+
struct lpNorm_selector<Derived, 2>
|
227
|
+
{
|
228
|
+
EIGEN_DEVICE_FUNC
|
229
|
+
static inline typename NumTraits<typename traits<Derived>::Scalar>::Real run(const MatrixBase<Derived>& m)
|
230
|
+
{
|
231
|
+
return m.norm();
|
232
|
+
}
|
233
|
+
};
|
234
|
+
|
235
|
+
template<typename Derived>
|
236
|
+
struct lpNorm_selector<Derived, Infinity>
|
237
|
+
{
|
238
|
+
typedef typename NumTraits<typename traits<Derived>::Scalar>::Real RealScalar;
|
239
|
+
EIGEN_DEVICE_FUNC
|
240
|
+
static inline RealScalar run(const MatrixBase<Derived>& m)
|
241
|
+
{
|
242
|
+
if(Derived::SizeAtCompileTime==0 || (Derived::SizeAtCompileTime==Dynamic && m.size()==0))
|
243
|
+
return RealScalar(0);
|
244
|
+
return m.cwiseAbs().maxCoeff();
|
245
|
+
}
|
246
|
+
};
|
247
|
+
|
248
|
+
} // end namespace internal
|
249
|
+
|
250
|
+
/** \returns the \b coefficient-wise \f$ \ell^p \f$ norm of \c *this, that is, returns the p-th root of the sum of the p-th powers of the absolute values
|
251
|
+
* of the coefficients of \c *this. If \a p is the special value \a Eigen::Infinity, this function returns the \f$ \ell^\infty \f$
|
252
|
+
* norm, that is the maximum of the absolute values of the coefficients of \c *this.
|
253
|
+
*
|
254
|
+
* In all cases, if \c *this is empty, then the value 0 is returned.
|
255
|
+
*
|
256
|
+
* \note For matrices, this function does not compute the <a href="https://en.wikipedia.org/wiki/Operator_norm">operator-norm</a>. That is, if \c *this is a matrix, then its coefficients are interpreted as a 1D vector. Nonetheless, you can easily compute the 1-norm and \f$\infty\f$-norm matrix operator norms using \link TutorialReductionsVisitorsBroadcastingReductionsNorm partial reductions \endlink.
|
257
|
+
*
|
258
|
+
* \sa norm()
|
259
|
+
*/
|
260
|
+
template<typename Derived>
|
261
|
+
template<int p>
|
262
|
+
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
263
|
+
EIGEN_DEVICE_FUNC inline typename NumTraits<typename internal::traits<Derived>::Scalar>::Real
|
264
|
+
#else
|
265
|
+
EIGEN_DEVICE_FUNC MatrixBase<Derived>::RealScalar
|
266
|
+
#endif
|
267
|
+
MatrixBase<Derived>::lpNorm() const
|
268
|
+
{
|
269
|
+
return internal::lpNorm_selector<Derived, p>::run(*this);
|
270
|
+
}
|
271
|
+
|
272
|
+
//---------- implementation of isOrthogonal / isUnitary ----------
|
273
|
+
|
274
|
+
/** \returns true if *this is approximately orthogonal to \a other,
|
275
|
+
* within the precision given by \a prec.
|
276
|
+
*
|
277
|
+
* Example: \include MatrixBase_isOrthogonal.cpp
|
278
|
+
* Output: \verbinclude MatrixBase_isOrthogonal.out
|
279
|
+
*/
|
280
|
+
template<typename Derived>
|
281
|
+
template<typename OtherDerived>
|
282
|
+
bool MatrixBase<Derived>::isOrthogonal
|
283
|
+
(const MatrixBase<OtherDerived>& other, const RealScalar& prec) const
|
284
|
+
{
|
285
|
+
typename internal::nested_eval<Derived,2>::type nested(derived());
|
286
|
+
typename internal::nested_eval<OtherDerived,2>::type otherNested(other.derived());
|
287
|
+
return numext::abs2(nested.dot(otherNested)) <= prec * prec * nested.squaredNorm() * otherNested.squaredNorm();
|
288
|
+
}
|
289
|
+
|
290
|
+
/** \returns true if *this is approximately an unitary matrix,
|
291
|
+
* within the precision given by \a prec. In the case where the \a Scalar
|
292
|
+
* type is real numbers, a unitary matrix is an orthogonal matrix, whence the name.
|
293
|
+
*
|
294
|
+
* \note This can be used to check whether a family of vectors forms an orthonormal basis.
|
295
|
+
* Indeed, \c m.isUnitary() returns true if and only if the columns (equivalently, the rows) of m form an
|
296
|
+
* orthonormal basis.
|
297
|
+
*
|
298
|
+
* Example: \include MatrixBase_isUnitary.cpp
|
299
|
+
* Output: \verbinclude MatrixBase_isUnitary.out
|
300
|
+
*/
|
301
|
+
template<typename Derived>
|
302
|
+
bool MatrixBase<Derived>::isUnitary(const RealScalar& prec) const
|
303
|
+
{
|
304
|
+
typename internal::nested_eval<Derived,1>::type self(derived());
|
305
|
+
for(Index i = 0; i < cols(); ++i)
|
306
|
+
{
|
307
|
+
if(!internal::isApprox(self.col(i).squaredNorm(), static_cast<RealScalar>(1), prec))
|
308
|
+
return false;
|
309
|
+
for(Index j = 0; j < i; ++j)
|
310
|
+
if(!internal::isMuchSmallerThan(self.col(i).dot(self.col(j)), static_cast<Scalar>(1), prec))
|
311
|
+
return false;
|
312
|
+
}
|
313
|
+
return true;
|
314
|
+
}
|
315
|
+
|
316
|
+
} // end namespace Eigen
|
317
|
+
|
318
|
+
#endif // EIGEN_DOT_H
|
@@ -0,0 +1,160 @@
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
2
|
+
// for linear algebra.
|
3
|
+
//
|
4
|
+
// Copyright (C) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
|
5
|
+
// Copyright (C) 2009 Gael Guennebaud <gael.guennebaud@inria.fr>
|
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
|
+
#ifndef EIGEN_EIGENBASE_H
|
12
|
+
#define EIGEN_EIGENBASE_H
|
13
|
+
|
14
|
+
namespace Eigen {
|
15
|
+
|
16
|
+
/** \class EigenBase
|
17
|
+
* \ingroup Core_Module
|
18
|
+
*
|
19
|
+
* Common base class for all classes T such that MatrixBase has an operator=(T) and a constructor MatrixBase(T).
|
20
|
+
*
|
21
|
+
* In other words, an EigenBase object is an object that can be copied into a MatrixBase.
|
22
|
+
*
|
23
|
+
* Besides MatrixBase-derived classes, this also includes special matrix classes such as diagonal matrices, etc.
|
24
|
+
*
|
25
|
+
* Notice that this class is trivial, it is only used to disambiguate overloaded functions.
|
26
|
+
*
|
27
|
+
* \sa \blank \ref TopicClassHierarchy
|
28
|
+
*/
|
29
|
+
template<typename Derived> struct EigenBase
|
30
|
+
{
|
31
|
+
// typedef typename internal::plain_matrix_type<Derived>::type PlainObject;
|
32
|
+
|
33
|
+
/** \brief The interface type of indices
|
34
|
+
* \details To change this, \c \#define the preprocessor symbol \c EIGEN_DEFAULT_DENSE_INDEX_TYPE.
|
35
|
+
* \sa StorageIndex, \ref TopicPreprocessorDirectives.
|
36
|
+
* DEPRECATED: Since Eigen 3.3, its usage is deprecated. Use Eigen::Index instead.
|
37
|
+
* Deprecation is not marked with a doxygen comment because there are too many existing usages to add the deprecation attribute.
|
38
|
+
*/
|
39
|
+
typedef Eigen::Index Index;
|
40
|
+
|
41
|
+
// FIXME is it needed?
|
42
|
+
typedef typename internal::traits<Derived>::StorageKind StorageKind;
|
43
|
+
|
44
|
+
/** \returns a reference to the derived object */
|
45
|
+
EIGEN_DEVICE_FUNC
|
46
|
+
Derived& derived() { return *static_cast<Derived*>(this); }
|
47
|
+
/** \returns a const reference to the derived object */
|
48
|
+
EIGEN_DEVICE_FUNC
|
49
|
+
const Derived& derived() const { return *static_cast<const Derived*>(this); }
|
50
|
+
|
51
|
+
EIGEN_DEVICE_FUNC
|
52
|
+
inline Derived& const_cast_derived() const
|
53
|
+
{ return *static_cast<Derived*>(const_cast<EigenBase*>(this)); }
|
54
|
+
EIGEN_DEVICE_FUNC
|
55
|
+
inline const Derived& const_derived() const
|
56
|
+
{ return *static_cast<const Derived*>(this); }
|
57
|
+
|
58
|
+
/** \returns the number of rows. \sa cols(), RowsAtCompileTime */
|
59
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
60
|
+
inline Index rows() const EIGEN_NOEXCEPT { return derived().rows(); }
|
61
|
+
/** \returns the number of columns. \sa rows(), ColsAtCompileTime*/
|
62
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
63
|
+
inline Index cols() const EIGEN_NOEXCEPT { return derived().cols(); }
|
64
|
+
/** \returns the number of coefficients, which is rows()*cols().
|
65
|
+
* \sa rows(), cols(), SizeAtCompileTime. */
|
66
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
67
|
+
inline Index size() const EIGEN_NOEXCEPT { return rows() * cols(); }
|
68
|
+
|
69
|
+
/** \internal Don't use it, but do the equivalent: \code dst = *this; \endcode */
|
70
|
+
template<typename Dest>
|
71
|
+
EIGEN_DEVICE_FUNC
|
72
|
+
inline void evalTo(Dest& dst) const
|
73
|
+
{ derived().evalTo(dst); }
|
74
|
+
|
75
|
+
/** \internal Don't use it, but do the equivalent: \code dst += *this; \endcode */
|
76
|
+
template<typename Dest>
|
77
|
+
EIGEN_DEVICE_FUNC
|
78
|
+
inline void addTo(Dest& dst) const
|
79
|
+
{
|
80
|
+
// This is the default implementation,
|
81
|
+
// derived class can reimplement it in a more optimized way.
|
82
|
+
typename Dest::PlainObject res(rows(),cols());
|
83
|
+
evalTo(res);
|
84
|
+
dst += res;
|
85
|
+
}
|
86
|
+
|
87
|
+
/** \internal Don't use it, but do the equivalent: \code dst -= *this; \endcode */
|
88
|
+
template<typename Dest>
|
89
|
+
EIGEN_DEVICE_FUNC
|
90
|
+
inline void subTo(Dest& dst) const
|
91
|
+
{
|
92
|
+
// This is the default implementation,
|
93
|
+
// derived class can reimplement it in a more optimized way.
|
94
|
+
typename Dest::PlainObject res(rows(),cols());
|
95
|
+
evalTo(res);
|
96
|
+
dst -= res;
|
97
|
+
}
|
98
|
+
|
99
|
+
/** \internal Don't use it, but do the equivalent: \code dst.applyOnTheRight(*this); \endcode */
|
100
|
+
template<typename Dest>
|
101
|
+
EIGEN_DEVICE_FUNC inline void applyThisOnTheRight(Dest& dst) const
|
102
|
+
{
|
103
|
+
// This is the default implementation,
|
104
|
+
// derived class can reimplement it in a more optimized way.
|
105
|
+
dst = dst * this->derived();
|
106
|
+
}
|
107
|
+
|
108
|
+
/** \internal Don't use it, but do the equivalent: \code dst.applyOnTheLeft(*this); \endcode */
|
109
|
+
template<typename Dest>
|
110
|
+
EIGEN_DEVICE_FUNC inline void applyThisOnTheLeft(Dest& dst) const
|
111
|
+
{
|
112
|
+
// This is the default implementation,
|
113
|
+
// derived class can reimplement it in a more optimized way.
|
114
|
+
dst = this->derived() * dst;
|
115
|
+
}
|
116
|
+
|
117
|
+
};
|
118
|
+
|
119
|
+
/***************************************************************************
|
120
|
+
* Implementation of matrix base methods
|
121
|
+
***************************************************************************/
|
122
|
+
|
123
|
+
/** \brief Copies the generic expression \a other into *this.
|
124
|
+
*
|
125
|
+
* \details The expression must provide a (templated) evalTo(Derived& dst) const
|
126
|
+
* function which does the actual job. In practice, this allows any user to write
|
127
|
+
* its own special matrix without having to modify MatrixBase
|
128
|
+
*
|
129
|
+
* \returns a reference to *this.
|
130
|
+
*/
|
131
|
+
template<typename Derived>
|
132
|
+
template<typename OtherDerived>
|
133
|
+
EIGEN_DEVICE_FUNC
|
134
|
+
Derived& DenseBase<Derived>::operator=(const EigenBase<OtherDerived> &other)
|
135
|
+
{
|
136
|
+
call_assignment(derived(), other.derived());
|
137
|
+
return derived();
|
138
|
+
}
|
139
|
+
|
140
|
+
template<typename Derived>
|
141
|
+
template<typename OtherDerived>
|
142
|
+
EIGEN_DEVICE_FUNC
|
143
|
+
Derived& DenseBase<Derived>::operator+=(const EigenBase<OtherDerived> &other)
|
144
|
+
{
|
145
|
+
call_assignment(derived(), other.derived(), internal::add_assign_op<Scalar,typename OtherDerived::Scalar>());
|
146
|
+
return derived();
|
147
|
+
}
|
148
|
+
|
149
|
+
template<typename Derived>
|
150
|
+
template<typename OtherDerived>
|
151
|
+
EIGEN_DEVICE_FUNC
|
152
|
+
Derived& DenseBase<Derived>::operator-=(const EigenBase<OtherDerived> &other)
|
153
|
+
{
|
154
|
+
call_assignment(derived(), other.derived(), internal::sub_assign_op<Scalar,typename OtherDerived::Scalar>());
|
155
|
+
return derived();
|
156
|
+
}
|
157
|
+
|
158
|
+
} // end namespace Eigen
|
159
|
+
|
160
|
+
#endif // EIGEN_EIGENBASE_H
|
@@ -0,0 +1,150 @@
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
2
|
+
// for linear algebra.
|
3
|
+
//
|
4
|
+
// Copyright (C) 2009-2010 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_FORCEALIGNEDACCESS_H
|
11
|
+
#define EIGEN_FORCEALIGNEDACCESS_H
|
12
|
+
|
13
|
+
namespace Eigen {
|
14
|
+
|
15
|
+
/** \class ForceAlignedAccess
|
16
|
+
* \ingroup Core_Module
|
17
|
+
*
|
18
|
+
* \brief Enforce aligned packet loads and stores regardless of what is requested
|
19
|
+
*
|
20
|
+
* \param ExpressionType the type of the object of which we are forcing aligned packet access
|
21
|
+
*
|
22
|
+
* This class is the return type of MatrixBase::forceAlignedAccess()
|
23
|
+
* and most of the time this is the only way it is used.
|
24
|
+
*
|
25
|
+
* \sa MatrixBase::forceAlignedAccess()
|
26
|
+
*/
|
27
|
+
|
28
|
+
namespace internal {
|
29
|
+
template<typename ExpressionType>
|
30
|
+
struct traits<ForceAlignedAccess<ExpressionType> > : public traits<ExpressionType>
|
31
|
+
{};
|
32
|
+
}
|
33
|
+
|
34
|
+
template<typename ExpressionType> class ForceAlignedAccess
|
35
|
+
: public internal::dense_xpr_base< ForceAlignedAccess<ExpressionType> >::type
|
36
|
+
{
|
37
|
+
public:
|
38
|
+
|
39
|
+
typedef typename internal::dense_xpr_base<ForceAlignedAccess>::type Base;
|
40
|
+
EIGEN_DENSE_PUBLIC_INTERFACE(ForceAlignedAccess)
|
41
|
+
|
42
|
+
EIGEN_DEVICE_FUNC explicit inline ForceAlignedAccess(const ExpressionType& matrix) : m_expression(matrix) {}
|
43
|
+
|
44
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
45
|
+
inline Index rows() const EIGEN_NOEXCEPT { return m_expression.rows(); }
|
46
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
47
|
+
inline Index cols() const EIGEN_NOEXCEPT { return m_expression.cols(); }
|
48
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
49
|
+
inline Index outerStride() const EIGEN_NOEXCEPT { return m_expression.outerStride(); }
|
50
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
51
|
+
inline Index innerStride() const EIGEN_NOEXCEPT { return m_expression.innerStride(); }
|
52
|
+
|
53
|
+
EIGEN_DEVICE_FUNC inline const CoeffReturnType coeff(Index row, Index col) const
|
54
|
+
{
|
55
|
+
return m_expression.coeff(row, col);
|
56
|
+
}
|
57
|
+
|
58
|
+
EIGEN_DEVICE_FUNC inline Scalar& coeffRef(Index row, Index col)
|
59
|
+
{
|
60
|
+
return m_expression.const_cast_derived().coeffRef(row, col);
|
61
|
+
}
|
62
|
+
|
63
|
+
EIGEN_DEVICE_FUNC inline const CoeffReturnType coeff(Index index) const
|
64
|
+
{
|
65
|
+
return m_expression.coeff(index);
|
66
|
+
}
|
67
|
+
|
68
|
+
EIGEN_DEVICE_FUNC inline Scalar& coeffRef(Index index)
|
69
|
+
{
|
70
|
+
return m_expression.const_cast_derived().coeffRef(index);
|
71
|
+
}
|
72
|
+
|
73
|
+
template<int LoadMode>
|
74
|
+
inline const PacketScalar packet(Index row, Index col) const
|
75
|
+
{
|
76
|
+
return m_expression.template packet<Aligned>(row, col);
|
77
|
+
}
|
78
|
+
|
79
|
+
template<int LoadMode>
|
80
|
+
inline void writePacket(Index row, Index col, const PacketScalar& x)
|
81
|
+
{
|
82
|
+
m_expression.const_cast_derived().template writePacket<Aligned>(row, col, x);
|
83
|
+
}
|
84
|
+
|
85
|
+
template<int LoadMode>
|
86
|
+
inline const PacketScalar packet(Index index) const
|
87
|
+
{
|
88
|
+
return m_expression.template packet<Aligned>(index);
|
89
|
+
}
|
90
|
+
|
91
|
+
template<int LoadMode>
|
92
|
+
inline void writePacket(Index index, const PacketScalar& x)
|
93
|
+
{
|
94
|
+
m_expression.const_cast_derived().template writePacket<Aligned>(index, x);
|
95
|
+
}
|
96
|
+
|
97
|
+
EIGEN_DEVICE_FUNC operator const ExpressionType&() const { return m_expression; }
|
98
|
+
|
99
|
+
protected:
|
100
|
+
const ExpressionType& m_expression;
|
101
|
+
|
102
|
+
private:
|
103
|
+
ForceAlignedAccess& operator=(const ForceAlignedAccess&);
|
104
|
+
};
|
105
|
+
|
106
|
+
/** \returns an expression of *this with forced aligned access
|
107
|
+
* \sa forceAlignedAccessIf(),class ForceAlignedAccess
|
108
|
+
*/
|
109
|
+
template<typename Derived>
|
110
|
+
inline const ForceAlignedAccess<Derived>
|
111
|
+
MatrixBase<Derived>::forceAlignedAccess() const
|
112
|
+
{
|
113
|
+
return ForceAlignedAccess<Derived>(derived());
|
114
|
+
}
|
115
|
+
|
116
|
+
/** \returns an expression of *this with forced aligned access
|
117
|
+
* \sa forceAlignedAccessIf(), class ForceAlignedAccess
|
118
|
+
*/
|
119
|
+
template<typename Derived>
|
120
|
+
inline ForceAlignedAccess<Derived>
|
121
|
+
MatrixBase<Derived>::forceAlignedAccess()
|
122
|
+
{
|
123
|
+
return ForceAlignedAccess<Derived>(derived());
|
124
|
+
}
|
125
|
+
|
126
|
+
/** \returns an expression of *this with forced aligned access if \a Enable is true.
|
127
|
+
* \sa forceAlignedAccess(), class ForceAlignedAccess
|
128
|
+
*/
|
129
|
+
template<typename Derived>
|
130
|
+
template<bool Enable>
|
131
|
+
inline typename internal::add_const_on_value_type<typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type>::type
|
132
|
+
MatrixBase<Derived>::forceAlignedAccessIf() const
|
133
|
+
{
|
134
|
+
return derived(); // FIXME This should not work but apparently is never used
|
135
|
+
}
|
136
|
+
|
137
|
+
/** \returns an expression of *this with forced aligned access if \a Enable is true.
|
138
|
+
* \sa forceAlignedAccess(), class ForceAlignedAccess
|
139
|
+
*/
|
140
|
+
template<typename Derived>
|
141
|
+
template<bool Enable>
|
142
|
+
inline typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type
|
143
|
+
MatrixBase<Derived>::forceAlignedAccessIf()
|
144
|
+
{
|
145
|
+
return derived(); // FIXME This should not work but apparently is never used
|
146
|
+
}
|
147
|
+
|
148
|
+
} // end namespace Eigen
|
149
|
+
|
150
|
+
#endif // EIGEN_FORCEALIGNEDACCESS_H
|