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,295 @@
|
|
1
|
+
/*
|
2
|
+
Copyright (c) 2011, Intel Corporation. All rights reserved.
|
3
|
+
|
4
|
+
Redistribution and use in source and binary forms, with or without modification,
|
5
|
+
are permitted provided that the following conditions are met:
|
6
|
+
|
7
|
+
* Redistributions of source code must retain the above copyright notice, this
|
8
|
+
list of conditions and the following disclaimer.
|
9
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
10
|
+
this list of conditions and the following disclaimer in the documentation
|
11
|
+
and/or other materials provided with the distribution.
|
12
|
+
* Neither the name of Intel Corporation nor the names of its contributors may
|
13
|
+
be used to endorse or promote products derived from this software without
|
14
|
+
specific prior written permission.
|
15
|
+
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
17
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
18
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
19
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
20
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
21
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
22
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
23
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
24
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
25
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
26
|
+
//
|
27
|
+
********************************************************************************
|
28
|
+
* Content : Eigen bindings to BLAS F77
|
29
|
+
* Self adjoint matrix * matrix product functionality based on ?SYMM/?HEMM.
|
30
|
+
********************************************************************************
|
31
|
+
*/
|
32
|
+
|
33
|
+
#ifndef EIGEN_SELFADJOINT_MATRIX_MATRIX_BLAS_H
|
34
|
+
#define EIGEN_SELFADJOINT_MATRIX_MATRIX_BLAS_H
|
35
|
+
|
36
|
+
namespace Eigen {
|
37
|
+
|
38
|
+
namespace internal {
|
39
|
+
|
40
|
+
|
41
|
+
/* Optimized selfadjoint matrix * matrix (?SYMM/?HEMM) product */
|
42
|
+
|
43
|
+
#define EIGEN_BLAS_SYMM_L(EIGTYPE, BLASTYPE, EIGPREFIX, BLASFUNC) \
|
44
|
+
template <typename Index, \
|
45
|
+
int LhsStorageOrder, bool ConjugateLhs, \
|
46
|
+
int RhsStorageOrder, bool ConjugateRhs> \
|
47
|
+
struct product_selfadjoint_matrix<EIGTYPE,Index,LhsStorageOrder,true,ConjugateLhs,RhsStorageOrder,false,ConjugateRhs,ColMajor,1> \
|
48
|
+
{\
|
49
|
+
\
|
50
|
+
static void run( \
|
51
|
+
Index rows, Index cols, \
|
52
|
+
const EIGTYPE* _lhs, Index lhsStride, \
|
53
|
+
const EIGTYPE* _rhs, Index rhsStride, \
|
54
|
+
EIGTYPE* res, Index resIncr, Index resStride, \
|
55
|
+
EIGTYPE alpha, level3_blocking<EIGTYPE, EIGTYPE>& /*blocking*/) \
|
56
|
+
{ \
|
57
|
+
EIGEN_ONLY_USED_FOR_DEBUG(resIncr); \
|
58
|
+
eigen_assert(resIncr == 1); \
|
59
|
+
char side='L', uplo='L'; \
|
60
|
+
BlasIndex m, n, lda, ldb, ldc; \
|
61
|
+
const EIGTYPE *a, *b; \
|
62
|
+
EIGTYPE beta(1); \
|
63
|
+
MatrixX##EIGPREFIX b_tmp; \
|
64
|
+
\
|
65
|
+
/* Set transpose options */ \
|
66
|
+
/* Set m, n, k */ \
|
67
|
+
m = convert_index<BlasIndex>(rows); \
|
68
|
+
n = convert_index<BlasIndex>(cols); \
|
69
|
+
\
|
70
|
+
/* Set lda, ldb, ldc */ \
|
71
|
+
lda = convert_index<BlasIndex>(lhsStride); \
|
72
|
+
ldb = convert_index<BlasIndex>(rhsStride); \
|
73
|
+
ldc = convert_index<BlasIndex>(resStride); \
|
74
|
+
\
|
75
|
+
/* Set a, b, c */ \
|
76
|
+
if (LhsStorageOrder==RowMajor) uplo='U'; \
|
77
|
+
a = _lhs; \
|
78
|
+
\
|
79
|
+
if (RhsStorageOrder==RowMajor) { \
|
80
|
+
Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > rhs(_rhs,n,m,OuterStride<>(rhsStride)); \
|
81
|
+
b_tmp = rhs.adjoint(); \
|
82
|
+
b = b_tmp.data(); \
|
83
|
+
ldb = convert_index<BlasIndex>(b_tmp.outerStride()); \
|
84
|
+
} else b = _rhs; \
|
85
|
+
\
|
86
|
+
BLASFUNC(&side, &uplo, &m, &n, (const BLASTYPE*)&numext::real_ref(alpha), (const BLASTYPE*)a, &lda, (const BLASTYPE*)b, &ldb, (const BLASTYPE*)&numext::real_ref(beta), (BLASTYPE*)res, &ldc); \
|
87
|
+
\
|
88
|
+
} \
|
89
|
+
};
|
90
|
+
|
91
|
+
|
92
|
+
#define EIGEN_BLAS_HEMM_L(EIGTYPE, BLASTYPE, EIGPREFIX, BLASFUNC) \
|
93
|
+
template <typename Index, \
|
94
|
+
int LhsStorageOrder, bool ConjugateLhs, \
|
95
|
+
int RhsStorageOrder, bool ConjugateRhs> \
|
96
|
+
struct product_selfadjoint_matrix<EIGTYPE,Index,LhsStorageOrder,true,ConjugateLhs,RhsStorageOrder,false,ConjugateRhs,ColMajor,1> \
|
97
|
+
{\
|
98
|
+
static void run( \
|
99
|
+
Index rows, Index cols, \
|
100
|
+
const EIGTYPE* _lhs, Index lhsStride, \
|
101
|
+
const EIGTYPE* _rhs, Index rhsStride, \
|
102
|
+
EIGTYPE* res, Index resIncr, Index resStride, \
|
103
|
+
EIGTYPE alpha, level3_blocking<EIGTYPE, EIGTYPE>& /*blocking*/) \
|
104
|
+
{ \
|
105
|
+
EIGEN_ONLY_USED_FOR_DEBUG(resIncr); \
|
106
|
+
eigen_assert(resIncr == 1); \
|
107
|
+
char side='L', uplo='L'; \
|
108
|
+
BlasIndex m, n, lda, ldb, ldc; \
|
109
|
+
const EIGTYPE *a, *b; \
|
110
|
+
EIGTYPE beta(1); \
|
111
|
+
MatrixX##EIGPREFIX b_tmp; \
|
112
|
+
Matrix<EIGTYPE, Dynamic, Dynamic, LhsStorageOrder> a_tmp; \
|
113
|
+
\
|
114
|
+
/* Set transpose options */ \
|
115
|
+
/* Set m, n, k */ \
|
116
|
+
m = convert_index<BlasIndex>(rows); \
|
117
|
+
n = convert_index<BlasIndex>(cols); \
|
118
|
+
\
|
119
|
+
/* Set lda, ldb, ldc */ \
|
120
|
+
lda = convert_index<BlasIndex>(lhsStride); \
|
121
|
+
ldb = convert_index<BlasIndex>(rhsStride); \
|
122
|
+
ldc = convert_index<BlasIndex>(resStride); \
|
123
|
+
\
|
124
|
+
/* Set a, b, c */ \
|
125
|
+
if (((LhsStorageOrder==ColMajor) && ConjugateLhs) || ((LhsStorageOrder==RowMajor) && (!ConjugateLhs))) { \
|
126
|
+
Map<const Matrix<EIGTYPE, Dynamic, Dynamic, LhsStorageOrder>, 0, OuterStride<> > lhs(_lhs,m,m,OuterStride<>(lhsStride)); \
|
127
|
+
a_tmp = lhs.conjugate(); \
|
128
|
+
a = a_tmp.data(); \
|
129
|
+
lda = convert_index<BlasIndex>(a_tmp.outerStride()); \
|
130
|
+
} else a = _lhs; \
|
131
|
+
if (LhsStorageOrder==RowMajor) uplo='U'; \
|
132
|
+
\
|
133
|
+
if (RhsStorageOrder==ColMajor && (!ConjugateRhs)) { \
|
134
|
+
b = _rhs; } \
|
135
|
+
else { \
|
136
|
+
if (RhsStorageOrder==ColMajor && ConjugateRhs) { \
|
137
|
+
Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > rhs(_rhs,m,n,OuterStride<>(rhsStride)); \
|
138
|
+
b_tmp = rhs.conjugate(); \
|
139
|
+
} else \
|
140
|
+
if (ConjugateRhs) { \
|
141
|
+
Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > rhs(_rhs,n,m,OuterStride<>(rhsStride)); \
|
142
|
+
b_tmp = rhs.adjoint(); \
|
143
|
+
} else { \
|
144
|
+
Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > rhs(_rhs,n,m,OuterStride<>(rhsStride)); \
|
145
|
+
b_tmp = rhs.transpose(); \
|
146
|
+
} \
|
147
|
+
b = b_tmp.data(); \
|
148
|
+
ldb = convert_index<BlasIndex>(b_tmp.outerStride()); \
|
149
|
+
} \
|
150
|
+
\
|
151
|
+
BLASFUNC(&side, &uplo, &m, &n, (const BLASTYPE*)&numext::real_ref(alpha), (const BLASTYPE*)a, &lda, (const BLASTYPE*)b, &ldb, (const BLASTYPE*)&numext::real_ref(beta), (BLASTYPE*)res, &ldc); \
|
152
|
+
\
|
153
|
+
} \
|
154
|
+
};
|
155
|
+
|
156
|
+
#ifdef EIGEN_USE_MKL
|
157
|
+
EIGEN_BLAS_SYMM_L(double, double, d, dsymm)
|
158
|
+
EIGEN_BLAS_SYMM_L(float, float, f, ssymm)
|
159
|
+
EIGEN_BLAS_HEMM_L(dcomplex, MKL_Complex16, cd, zhemm)
|
160
|
+
EIGEN_BLAS_HEMM_L(scomplex, MKL_Complex8, cf, chemm)
|
161
|
+
#else
|
162
|
+
EIGEN_BLAS_SYMM_L(double, double, d, dsymm_)
|
163
|
+
EIGEN_BLAS_SYMM_L(float, float, f, ssymm_)
|
164
|
+
EIGEN_BLAS_HEMM_L(dcomplex, double, cd, zhemm_)
|
165
|
+
EIGEN_BLAS_HEMM_L(scomplex, float, cf, chemm_)
|
166
|
+
#endif
|
167
|
+
|
168
|
+
/* Optimized matrix * selfadjoint matrix (?SYMM/?HEMM) product */
|
169
|
+
|
170
|
+
#define EIGEN_BLAS_SYMM_R(EIGTYPE, BLASTYPE, EIGPREFIX, BLASFUNC) \
|
171
|
+
template <typename Index, \
|
172
|
+
int LhsStorageOrder, bool ConjugateLhs, \
|
173
|
+
int RhsStorageOrder, bool ConjugateRhs> \
|
174
|
+
struct product_selfadjoint_matrix<EIGTYPE,Index,LhsStorageOrder,false,ConjugateLhs,RhsStorageOrder,true,ConjugateRhs,ColMajor,1> \
|
175
|
+
{\
|
176
|
+
\
|
177
|
+
static void run( \
|
178
|
+
Index rows, Index cols, \
|
179
|
+
const EIGTYPE* _lhs, Index lhsStride, \
|
180
|
+
const EIGTYPE* _rhs, Index rhsStride, \
|
181
|
+
EIGTYPE* res, Index resIncr, Index resStride, \
|
182
|
+
EIGTYPE alpha, level3_blocking<EIGTYPE, EIGTYPE>& /*blocking*/) \
|
183
|
+
{ \
|
184
|
+
EIGEN_ONLY_USED_FOR_DEBUG(resIncr); \
|
185
|
+
eigen_assert(resIncr == 1); \
|
186
|
+
char side='R', uplo='L'; \
|
187
|
+
BlasIndex m, n, lda, ldb, ldc; \
|
188
|
+
const EIGTYPE *a, *b; \
|
189
|
+
EIGTYPE beta(1); \
|
190
|
+
MatrixX##EIGPREFIX b_tmp; \
|
191
|
+
\
|
192
|
+
/* Set m, n, k */ \
|
193
|
+
m = convert_index<BlasIndex>(rows); \
|
194
|
+
n = convert_index<BlasIndex>(cols); \
|
195
|
+
\
|
196
|
+
/* Set lda, ldb, ldc */ \
|
197
|
+
lda = convert_index<BlasIndex>(rhsStride); \
|
198
|
+
ldb = convert_index<BlasIndex>(lhsStride); \
|
199
|
+
ldc = convert_index<BlasIndex>(resStride); \
|
200
|
+
\
|
201
|
+
/* Set a, b, c */ \
|
202
|
+
if (RhsStorageOrder==RowMajor) uplo='U'; \
|
203
|
+
a = _rhs; \
|
204
|
+
\
|
205
|
+
if (LhsStorageOrder==RowMajor) { \
|
206
|
+
Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > lhs(_lhs,n,m,OuterStride<>(rhsStride)); \
|
207
|
+
b_tmp = lhs.adjoint(); \
|
208
|
+
b = b_tmp.data(); \
|
209
|
+
ldb = convert_index<BlasIndex>(b_tmp.outerStride()); \
|
210
|
+
} else b = _lhs; \
|
211
|
+
\
|
212
|
+
BLASFUNC(&side, &uplo, &m, &n, (const BLASTYPE*)&numext::real_ref(alpha), (const BLASTYPE*)a, &lda, (const BLASTYPE*)b, &ldb, (const BLASTYPE*)&numext::real_ref(beta), (BLASTYPE*)res, &ldc); \
|
213
|
+
\
|
214
|
+
} \
|
215
|
+
};
|
216
|
+
|
217
|
+
|
218
|
+
#define EIGEN_BLAS_HEMM_R(EIGTYPE, BLASTYPE, EIGPREFIX, BLASFUNC) \
|
219
|
+
template <typename Index, \
|
220
|
+
int LhsStorageOrder, bool ConjugateLhs, \
|
221
|
+
int RhsStorageOrder, bool ConjugateRhs> \
|
222
|
+
struct product_selfadjoint_matrix<EIGTYPE,Index,LhsStorageOrder,false,ConjugateLhs,RhsStorageOrder,true,ConjugateRhs,ColMajor,1> \
|
223
|
+
{\
|
224
|
+
static void run( \
|
225
|
+
Index rows, Index cols, \
|
226
|
+
const EIGTYPE* _lhs, Index lhsStride, \
|
227
|
+
const EIGTYPE* _rhs, Index rhsStride, \
|
228
|
+
EIGTYPE* res, Index resIncr, Index resStride, \
|
229
|
+
EIGTYPE alpha, level3_blocking<EIGTYPE, EIGTYPE>& /*blocking*/) \
|
230
|
+
{ \
|
231
|
+
EIGEN_ONLY_USED_FOR_DEBUG(resIncr); \
|
232
|
+
eigen_assert(resIncr == 1); \
|
233
|
+
char side='R', uplo='L'; \
|
234
|
+
BlasIndex m, n, lda, ldb, ldc; \
|
235
|
+
const EIGTYPE *a, *b; \
|
236
|
+
EIGTYPE beta(1); \
|
237
|
+
MatrixX##EIGPREFIX b_tmp; \
|
238
|
+
Matrix<EIGTYPE, Dynamic, Dynamic, RhsStorageOrder> a_tmp; \
|
239
|
+
\
|
240
|
+
/* Set m, n, k */ \
|
241
|
+
m = convert_index<BlasIndex>(rows); \
|
242
|
+
n = convert_index<BlasIndex>(cols); \
|
243
|
+
\
|
244
|
+
/* Set lda, ldb, ldc */ \
|
245
|
+
lda = convert_index<BlasIndex>(rhsStride); \
|
246
|
+
ldb = convert_index<BlasIndex>(lhsStride); \
|
247
|
+
ldc = convert_index<BlasIndex>(resStride); \
|
248
|
+
\
|
249
|
+
/* Set a, b, c */ \
|
250
|
+
if (((RhsStorageOrder==ColMajor) && ConjugateRhs) || ((RhsStorageOrder==RowMajor) && (!ConjugateRhs))) { \
|
251
|
+
Map<const Matrix<EIGTYPE, Dynamic, Dynamic, RhsStorageOrder>, 0, OuterStride<> > rhs(_rhs,n,n,OuterStride<>(rhsStride)); \
|
252
|
+
a_tmp = rhs.conjugate(); \
|
253
|
+
a = a_tmp.data(); \
|
254
|
+
lda = convert_index<BlasIndex>(a_tmp.outerStride()); \
|
255
|
+
} else a = _rhs; \
|
256
|
+
if (RhsStorageOrder==RowMajor) uplo='U'; \
|
257
|
+
\
|
258
|
+
if (LhsStorageOrder==ColMajor && (!ConjugateLhs)) { \
|
259
|
+
b = _lhs; } \
|
260
|
+
else { \
|
261
|
+
if (LhsStorageOrder==ColMajor && ConjugateLhs) { \
|
262
|
+
Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > lhs(_lhs,m,n,OuterStride<>(lhsStride)); \
|
263
|
+
b_tmp = lhs.conjugate(); \
|
264
|
+
} else \
|
265
|
+
if (ConjugateLhs) { \
|
266
|
+
Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > lhs(_lhs,n,m,OuterStride<>(lhsStride)); \
|
267
|
+
b_tmp = lhs.adjoint(); \
|
268
|
+
} else { \
|
269
|
+
Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > lhs(_lhs,n,m,OuterStride<>(lhsStride)); \
|
270
|
+
b_tmp = lhs.transpose(); \
|
271
|
+
} \
|
272
|
+
b = b_tmp.data(); \
|
273
|
+
ldb = convert_index<BlasIndex>(b_tmp.outerStride()); \
|
274
|
+
} \
|
275
|
+
\
|
276
|
+
BLASFUNC(&side, &uplo, &m, &n, (const BLASTYPE*)&numext::real_ref(alpha), (const BLASTYPE*)a, &lda, (const BLASTYPE*)b, &ldb, (const BLASTYPE*)&numext::real_ref(beta), (BLASTYPE*)res, &ldc); \
|
277
|
+
} \
|
278
|
+
};
|
279
|
+
|
280
|
+
#ifdef EIGEN_USE_MKL
|
281
|
+
EIGEN_BLAS_SYMM_R(double, double, d, dsymm)
|
282
|
+
EIGEN_BLAS_SYMM_R(float, float, f, ssymm)
|
283
|
+
EIGEN_BLAS_HEMM_R(dcomplex, MKL_Complex16, cd, zhemm)
|
284
|
+
EIGEN_BLAS_HEMM_R(scomplex, MKL_Complex8, cf, chemm)
|
285
|
+
#else
|
286
|
+
EIGEN_BLAS_SYMM_R(double, double, d, dsymm_)
|
287
|
+
EIGEN_BLAS_SYMM_R(float, float, f, ssymm_)
|
288
|
+
EIGEN_BLAS_HEMM_R(dcomplex, double, cd, zhemm_)
|
289
|
+
EIGEN_BLAS_HEMM_R(scomplex, float, cf, chemm_)
|
290
|
+
#endif
|
291
|
+
} // end namespace internal
|
292
|
+
|
293
|
+
} // end namespace Eigen
|
294
|
+
|
295
|
+
#endif // EIGEN_SELFADJOINT_MATRIX_MATRIX_BLAS_H
|
@@ -0,0 +1,262 @@
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
2
|
+
// for linear algebra.
|
3
|
+
//
|
4
|
+
// Copyright (C) 2008-2009 Gael Guennebaud <gael.guennebaud@inria.fr>
|
5
|
+
//
|
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_SELFADJOINT_MATRIX_VECTOR_H
|
11
|
+
#define EIGEN_SELFADJOINT_MATRIX_VECTOR_H
|
12
|
+
|
13
|
+
namespace Eigen {
|
14
|
+
|
15
|
+
namespace internal {
|
16
|
+
|
17
|
+
/* Optimized selfadjoint matrix * vector product:
|
18
|
+
* This algorithm processes 2 columns at once that allows to both reduce
|
19
|
+
* the number of load/stores of the result by a factor 2 and to reduce
|
20
|
+
* the instruction dependency.
|
21
|
+
*/
|
22
|
+
|
23
|
+
template<typename Scalar, typename Index, int StorageOrder, int UpLo, bool ConjugateLhs, bool ConjugateRhs, int Version=Specialized>
|
24
|
+
struct selfadjoint_matrix_vector_product;
|
25
|
+
|
26
|
+
template<typename Scalar, typename Index, int StorageOrder, int UpLo, bool ConjugateLhs, bool ConjugateRhs, int Version>
|
27
|
+
struct selfadjoint_matrix_vector_product
|
28
|
+
|
29
|
+
{
|
30
|
+
static EIGEN_DONT_INLINE EIGEN_DEVICE_FUNC
|
31
|
+
void run(
|
32
|
+
Index size,
|
33
|
+
const Scalar* lhs, Index lhsStride,
|
34
|
+
const Scalar* rhs,
|
35
|
+
Scalar* res,
|
36
|
+
Scalar alpha);
|
37
|
+
};
|
38
|
+
|
39
|
+
template<typename Scalar, typename Index, int StorageOrder, int UpLo, bool ConjugateLhs, bool ConjugateRhs, int Version>
|
40
|
+
EIGEN_DONT_INLINE EIGEN_DEVICE_FUNC
|
41
|
+
void selfadjoint_matrix_vector_product<Scalar,Index,StorageOrder,UpLo,ConjugateLhs,ConjugateRhs,Version>::run(
|
42
|
+
Index size,
|
43
|
+
const Scalar* lhs, Index lhsStride,
|
44
|
+
const Scalar* rhs,
|
45
|
+
Scalar* res,
|
46
|
+
Scalar alpha)
|
47
|
+
{
|
48
|
+
typedef typename packet_traits<Scalar>::type Packet;
|
49
|
+
typedef typename NumTraits<Scalar>::Real RealScalar;
|
50
|
+
const Index PacketSize = sizeof(Packet)/sizeof(Scalar);
|
51
|
+
|
52
|
+
enum {
|
53
|
+
IsRowMajor = StorageOrder==RowMajor ? 1 : 0,
|
54
|
+
IsLower = UpLo == Lower ? 1 : 0,
|
55
|
+
FirstTriangular = IsRowMajor == IsLower
|
56
|
+
};
|
57
|
+
|
58
|
+
conj_helper<Scalar,Scalar,NumTraits<Scalar>::IsComplex && EIGEN_LOGICAL_XOR(ConjugateLhs, IsRowMajor), ConjugateRhs> cj0;
|
59
|
+
conj_helper<Scalar,Scalar,NumTraits<Scalar>::IsComplex && EIGEN_LOGICAL_XOR(ConjugateLhs, !IsRowMajor), ConjugateRhs> cj1;
|
60
|
+
conj_helper<RealScalar,Scalar,false, ConjugateRhs> cjd;
|
61
|
+
|
62
|
+
conj_helper<Packet,Packet,NumTraits<Scalar>::IsComplex && EIGEN_LOGICAL_XOR(ConjugateLhs, IsRowMajor), ConjugateRhs> pcj0;
|
63
|
+
conj_helper<Packet,Packet,NumTraits<Scalar>::IsComplex && EIGEN_LOGICAL_XOR(ConjugateLhs, !IsRowMajor), ConjugateRhs> pcj1;
|
64
|
+
|
65
|
+
Scalar cjAlpha = ConjugateRhs ? numext::conj(alpha) : alpha;
|
66
|
+
|
67
|
+
Index bound = numext::maxi(Index(0), size-8) & 0xfffffffe;
|
68
|
+
if (FirstTriangular)
|
69
|
+
bound = size - bound;
|
70
|
+
|
71
|
+
for (Index j=FirstTriangular ? bound : 0;
|
72
|
+
j<(FirstTriangular ? size : bound);j+=2)
|
73
|
+
{
|
74
|
+
const Scalar* EIGEN_RESTRICT A0 = lhs + j*lhsStride;
|
75
|
+
const Scalar* EIGEN_RESTRICT A1 = lhs + (j+1)*lhsStride;
|
76
|
+
|
77
|
+
Scalar t0 = cjAlpha * rhs[j];
|
78
|
+
Packet ptmp0 = pset1<Packet>(t0);
|
79
|
+
Scalar t1 = cjAlpha * rhs[j+1];
|
80
|
+
Packet ptmp1 = pset1<Packet>(t1);
|
81
|
+
|
82
|
+
Scalar t2(0);
|
83
|
+
Packet ptmp2 = pset1<Packet>(t2);
|
84
|
+
Scalar t3(0);
|
85
|
+
Packet ptmp3 = pset1<Packet>(t3);
|
86
|
+
|
87
|
+
Index starti = FirstTriangular ? 0 : j+2;
|
88
|
+
Index endi = FirstTriangular ? j : size;
|
89
|
+
Index alignedStart = (starti) + internal::first_default_aligned(&res[starti], endi-starti);
|
90
|
+
Index alignedEnd = alignedStart + ((endi-alignedStart)/(PacketSize))*(PacketSize);
|
91
|
+
|
92
|
+
res[j] += cjd.pmul(numext::real(A0[j]), t0);
|
93
|
+
res[j+1] += cjd.pmul(numext::real(A1[j+1]), t1);
|
94
|
+
if(FirstTriangular)
|
95
|
+
{
|
96
|
+
res[j] += cj0.pmul(A1[j], t1);
|
97
|
+
t3 += cj1.pmul(A1[j], rhs[j]);
|
98
|
+
}
|
99
|
+
else
|
100
|
+
{
|
101
|
+
res[j+1] += cj0.pmul(A0[j+1],t0);
|
102
|
+
t2 += cj1.pmul(A0[j+1], rhs[j+1]);
|
103
|
+
}
|
104
|
+
|
105
|
+
for (Index i=starti; i<alignedStart; ++i)
|
106
|
+
{
|
107
|
+
res[i] += cj0.pmul(A0[i], t0) + cj0.pmul(A1[i],t1);
|
108
|
+
t2 += cj1.pmul(A0[i], rhs[i]);
|
109
|
+
t3 += cj1.pmul(A1[i], rhs[i]);
|
110
|
+
}
|
111
|
+
// Yes this an optimization for gcc 4.3 and 4.4 (=> huge speed up)
|
112
|
+
// gcc 4.2 does this optimization automatically.
|
113
|
+
const Scalar* EIGEN_RESTRICT a0It = A0 + alignedStart;
|
114
|
+
const Scalar* EIGEN_RESTRICT a1It = A1 + alignedStart;
|
115
|
+
const Scalar* EIGEN_RESTRICT rhsIt = rhs + alignedStart;
|
116
|
+
Scalar* EIGEN_RESTRICT resIt = res + alignedStart;
|
117
|
+
for (Index i=alignedStart; i<alignedEnd; i+=PacketSize)
|
118
|
+
{
|
119
|
+
Packet A0i = ploadu<Packet>(a0It); a0It += PacketSize;
|
120
|
+
Packet A1i = ploadu<Packet>(a1It); a1It += PacketSize;
|
121
|
+
Packet Bi = ploadu<Packet>(rhsIt); rhsIt += PacketSize; // FIXME should be aligned in most cases
|
122
|
+
Packet Xi = pload <Packet>(resIt);
|
123
|
+
|
124
|
+
Xi = pcj0.pmadd(A0i,ptmp0, pcj0.pmadd(A1i,ptmp1,Xi));
|
125
|
+
ptmp2 = pcj1.pmadd(A0i, Bi, ptmp2);
|
126
|
+
ptmp3 = pcj1.pmadd(A1i, Bi, ptmp3);
|
127
|
+
pstore(resIt,Xi); resIt += PacketSize;
|
128
|
+
}
|
129
|
+
for (Index i=alignedEnd; i<endi; i++)
|
130
|
+
{
|
131
|
+
res[i] += cj0.pmul(A0[i], t0) + cj0.pmul(A1[i],t1);
|
132
|
+
t2 += cj1.pmul(A0[i], rhs[i]);
|
133
|
+
t3 += cj1.pmul(A1[i], rhs[i]);
|
134
|
+
}
|
135
|
+
|
136
|
+
res[j] += alpha * (t2 + predux(ptmp2));
|
137
|
+
res[j+1] += alpha * (t3 + predux(ptmp3));
|
138
|
+
}
|
139
|
+
for (Index j=FirstTriangular ? 0 : bound;j<(FirstTriangular ? bound : size);j++)
|
140
|
+
{
|
141
|
+
const Scalar* EIGEN_RESTRICT A0 = lhs + j*lhsStride;
|
142
|
+
|
143
|
+
Scalar t1 = cjAlpha * rhs[j];
|
144
|
+
Scalar t2(0);
|
145
|
+
res[j] += cjd.pmul(numext::real(A0[j]), t1);
|
146
|
+
for (Index i=FirstTriangular ? 0 : j+1; i<(FirstTriangular ? j : size); i++)
|
147
|
+
{
|
148
|
+
res[i] += cj0.pmul(A0[i], t1);
|
149
|
+
t2 += cj1.pmul(A0[i], rhs[i]);
|
150
|
+
}
|
151
|
+
res[j] += alpha * t2;
|
152
|
+
}
|
153
|
+
}
|
154
|
+
|
155
|
+
} // end namespace internal
|
156
|
+
|
157
|
+
/***************************************************************************
|
158
|
+
* Wrapper to product_selfadjoint_vector
|
159
|
+
***************************************************************************/
|
160
|
+
|
161
|
+
namespace internal {
|
162
|
+
|
163
|
+
template<typename Lhs, int LhsMode, typename Rhs>
|
164
|
+
struct selfadjoint_product_impl<Lhs,LhsMode,false,Rhs,0,true>
|
165
|
+
{
|
166
|
+
typedef typename Product<Lhs,Rhs>::Scalar Scalar;
|
167
|
+
|
168
|
+
typedef internal::blas_traits<Lhs> LhsBlasTraits;
|
169
|
+
typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhsType;
|
170
|
+
typedef typename internal::remove_all<ActualLhsType>::type ActualLhsTypeCleaned;
|
171
|
+
|
172
|
+
typedef internal::blas_traits<Rhs> RhsBlasTraits;
|
173
|
+
typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhsType;
|
174
|
+
typedef typename internal::remove_all<ActualRhsType>::type ActualRhsTypeCleaned;
|
175
|
+
|
176
|
+
enum { LhsUpLo = LhsMode&(Upper|Lower) };
|
177
|
+
|
178
|
+
template<typename Dest>
|
179
|
+
static EIGEN_DEVICE_FUNC
|
180
|
+
void run(Dest& dest, const Lhs &a_lhs, const Rhs &a_rhs, const Scalar& alpha)
|
181
|
+
{
|
182
|
+
typedef typename Dest::Scalar ResScalar;
|
183
|
+
typedef typename Rhs::Scalar RhsScalar;
|
184
|
+
typedef Map<Matrix<ResScalar,Dynamic,1>, EIGEN_PLAIN_ENUM_MIN(AlignedMax,internal::packet_traits<ResScalar>::size)> MappedDest;
|
185
|
+
|
186
|
+
eigen_assert(dest.rows()==a_lhs.rows() && dest.cols()==a_rhs.cols());
|
187
|
+
|
188
|
+
typename internal::add_const_on_value_type<ActualLhsType>::type lhs = LhsBlasTraits::extract(a_lhs);
|
189
|
+
typename internal::add_const_on_value_type<ActualRhsType>::type rhs = RhsBlasTraits::extract(a_rhs);
|
190
|
+
|
191
|
+
Scalar actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(a_lhs)
|
192
|
+
* RhsBlasTraits::extractScalarFactor(a_rhs);
|
193
|
+
|
194
|
+
enum {
|
195
|
+
EvalToDest = (Dest::InnerStrideAtCompileTime==1),
|
196
|
+
UseRhs = (ActualRhsTypeCleaned::InnerStrideAtCompileTime==1)
|
197
|
+
};
|
198
|
+
|
199
|
+
internal::gemv_static_vector_if<ResScalar,Dest::SizeAtCompileTime,Dest::MaxSizeAtCompileTime,!EvalToDest> static_dest;
|
200
|
+
internal::gemv_static_vector_if<RhsScalar,ActualRhsTypeCleaned::SizeAtCompileTime,ActualRhsTypeCleaned::MaxSizeAtCompileTime,!UseRhs> static_rhs;
|
201
|
+
|
202
|
+
ei_declare_aligned_stack_constructed_variable(ResScalar,actualDestPtr,dest.size(),
|
203
|
+
EvalToDest ? dest.data() : static_dest.data());
|
204
|
+
|
205
|
+
ei_declare_aligned_stack_constructed_variable(RhsScalar,actualRhsPtr,rhs.size(),
|
206
|
+
UseRhs ? const_cast<RhsScalar*>(rhs.data()) : static_rhs.data());
|
207
|
+
|
208
|
+
if(!EvalToDest)
|
209
|
+
{
|
210
|
+
#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
|
211
|
+
Index size = dest.size();
|
212
|
+
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
|
213
|
+
#endif
|
214
|
+
MappedDest(actualDestPtr, dest.size()) = dest;
|
215
|
+
}
|
216
|
+
|
217
|
+
if(!UseRhs)
|
218
|
+
{
|
219
|
+
#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
|
220
|
+
Index size = rhs.size();
|
221
|
+
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
|
222
|
+
#endif
|
223
|
+
Map<typename ActualRhsTypeCleaned::PlainObject>(actualRhsPtr, rhs.size()) = rhs;
|
224
|
+
}
|
225
|
+
|
226
|
+
|
227
|
+
internal::selfadjoint_matrix_vector_product<Scalar, Index, (internal::traits<ActualLhsTypeCleaned>::Flags&RowMajorBit) ? RowMajor : ColMajor,
|
228
|
+
int(LhsUpLo), bool(LhsBlasTraits::NeedToConjugate), bool(RhsBlasTraits::NeedToConjugate)>::run
|
229
|
+
(
|
230
|
+
lhs.rows(), // size
|
231
|
+
&lhs.coeffRef(0,0), lhs.outerStride(), // lhs info
|
232
|
+
actualRhsPtr, // rhs info
|
233
|
+
actualDestPtr, // result info
|
234
|
+
actualAlpha // scale factor
|
235
|
+
);
|
236
|
+
|
237
|
+
if(!EvalToDest)
|
238
|
+
dest = MappedDest(actualDestPtr, dest.size());
|
239
|
+
}
|
240
|
+
};
|
241
|
+
|
242
|
+
template<typename Lhs, typename Rhs, int RhsMode>
|
243
|
+
struct selfadjoint_product_impl<Lhs,0,true,Rhs,RhsMode,false>
|
244
|
+
{
|
245
|
+
typedef typename Product<Lhs,Rhs>::Scalar Scalar;
|
246
|
+
enum { RhsUpLo = RhsMode&(Upper|Lower) };
|
247
|
+
|
248
|
+
template<typename Dest>
|
249
|
+
static void run(Dest& dest, const Lhs &a_lhs, const Rhs &a_rhs, const Scalar& alpha)
|
250
|
+
{
|
251
|
+
// let's simply transpose the product
|
252
|
+
Transpose<Dest> destT(dest);
|
253
|
+
selfadjoint_product_impl<Transpose<const Rhs>, int(RhsUpLo)==Upper ? Lower : Upper, false,
|
254
|
+
Transpose<const Lhs>, 0, true>::run(destT, a_rhs.transpose(), a_lhs.transpose(), alpha);
|
255
|
+
}
|
256
|
+
};
|
257
|
+
|
258
|
+
} // end namespace internal
|
259
|
+
|
260
|
+
} // end namespace Eigen
|
261
|
+
|
262
|
+
#endif // EIGEN_SELFADJOINT_MATRIX_VECTOR_H
|
@@ -0,0 +1,118 @@
|
|
1
|
+
/*
|
2
|
+
Copyright (c) 2011, Intel Corporation. All rights reserved.
|
3
|
+
|
4
|
+
Redistribution and use in source and binary forms, with or without modification,
|
5
|
+
are permitted provided that the following conditions are met:
|
6
|
+
|
7
|
+
* Redistributions of source code must retain the above copyright notice, this
|
8
|
+
list of conditions and the following disclaimer.
|
9
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
10
|
+
this list of conditions and the following disclaimer in the documentation
|
11
|
+
and/or other materials provided with the distribution.
|
12
|
+
* Neither the name of Intel Corporation nor the names of its contributors may
|
13
|
+
be used to endorse or promote products derived from this software without
|
14
|
+
specific prior written permission.
|
15
|
+
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
17
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
18
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
19
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
20
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
21
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
22
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
23
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
24
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
25
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
26
|
+
|
27
|
+
********************************************************************************
|
28
|
+
* Content : Eigen bindings to BLAS F77
|
29
|
+
* Selfadjoint matrix-vector product functionality based on ?SYMV/HEMV.
|
30
|
+
********************************************************************************
|
31
|
+
*/
|
32
|
+
|
33
|
+
#ifndef EIGEN_SELFADJOINT_MATRIX_VECTOR_BLAS_H
|
34
|
+
#define EIGEN_SELFADJOINT_MATRIX_VECTOR_BLAS_H
|
35
|
+
|
36
|
+
namespace Eigen {
|
37
|
+
|
38
|
+
namespace internal {
|
39
|
+
|
40
|
+
/**********************************************************************
|
41
|
+
* This file implements selfadjoint matrix-vector multiplication using BLAS
|
42
|
+
**********************************************************************/
|
43
|
+
|
44
|
+
// symv/hemv specialization
|
45
|
+
|
46
|
+
template<typename Scalar, typename Index, int StorageOrder, int UpLo, bool ConjugateLhs, bool ConjugateRhs>
|
47
|
+
struct selfadjoint_matrix_vector_product_symv :
|
48
|
+
selfadjoint_matrix_vector_product<Scalar,Index,StorageOrder,UpLo,ConjugateLhs,ConjugateRhs,BuiltIn> {};
|
49
|
+
|
50
|
+
#define EIGEN_BLAS_SYMV_SPECIALIZE(Scalar) \
|
51
|
+
template<typename Index, int StorageOrder, int UpLo, bool ConjugateLhs, bool ConjugateRhs> \
|
52
|
+
struct selfadjoint_matrix_vector_product<Scalar,Index,StorageOrder,UpLo,ConjugateLhs,ConjugateRhs,Specialized> { \
|
53
|
+
static void run( \
|
54
|
+
Index size, const Scalar* lhs, Index lhsStride, \
|
55
|
+
const Scalar* _rhs, Scalar* res, Scalar alpha) { \
|
56
|
+
enum {\
|
57
|
+
IsColMajor = StorageOrder==ColMajor \
|
58
|
+
}; \
|
59
|
+
if (IsColMajor == ConjugateLhs) {\
|
60
|
+
selfadjoint_matrix_vector_product<Scalar,Index,StorageOrder,UpLo,ConjugateLhs,ConjugateRhs,BuiltIn>::run( \
|
61
|
+
size, lhs, lhsStride, _rhs, res, alpha); \
|
62
|
+
} else {\
|
63
|
+
selfadjoint_matrix_vector_product_symv<Scalar,Index,StorageOrder,UpLo,ConjugateLhs,ConjugateRhs>::run( \
|
64
|
+
size, lhs, lhsStride, _rhs, res, alpha); \
|
65
|
+
}\
|
66
|
+
} \
|
67
|
+
}; \
|
68
|
+
|
69
|
+
EIGEN_BLAS_SYMV_SPECIALIZE(double)
|
70
|
+
EIGEN_BLAS_SYMV_SPECIALIZE(float)
|
71
|
+
EIGEN_BLAS_SYMV_SPECIALIZE(dcomplex)
|
72
|
+
EIGEN_BLAS_SYMV_SPECIALIZE(scomplex)
|
73
|
+
|
74
|
+
#define EIGEN_BLAS_SYMV_SPECIALIZATION(EIGTYPE,BLASTYPE,BLASFUNC) \
|
75
|
+
template<typename Index, int StorageOrder, int UpLo, bool ConjugateLhs, bool ConjugateRhs> \
|
76
|
+
struct selfadjoint_matrix_vector_product_symv<EIGTYPE,Index,StorageOrder,UpLo,ConjugateLhs,ConjugateRhs> \
|
77
|
+
{ \
|
78
|
+
typedef Matrix<EIGTYPE,Dynamic,1,ColMajor> SYMVVector;\
|
79
|
+
\
|
80
|
+
static void run( \
|
81
|
+
Index size, const EIGTYPE* lhs, Index lhsStride, \
|
82
|
+
const EIGTYPE* _rhs, EIGTYPE* res, EIGTYPE alpha) \
|
83
|
+
{ \
|
84
|
+
enum {\
|
85
|
+
IsRowMajor = StorageOrder==RowMajor ? 1 : 0, \
|
86
|
+
IsLower = UpLo == Lower ? 1 : 0 \
|
87
|
+
}; \
|
88
|
+
BlasIndex n=convert_index<BlasIndex>(size), lda=convert_index<BlasIndex>(lhsStride), incx=1, incy=1; \
|
89
|
+
EIGTYPE beta(1); \
|
90
|
+
const EIGTYPE *x_ptr; \
|
91
|
+
char uplo=(IsRowMajor) ? (IsLower ? 'U' : 'L') : (IsLower ? 'L' : 'U'); \
|
92
|
+
SYMVVector x_tmp; \
|
93
|
+
if (ConjugateRhs) { \
|
94
|
+
Map<const SYMVVector, 0 > map_x(_rhs,size,1); \
|
95
|
+
x_tmp=map_x.conjugate(); \
|
96
|
+
x_ptr=x_tmp.data(); \
|
97
|
+
} else x_ptr=_rhs; \
|
98
|
+
BLASFUNC(&uplo, &n, (const BLASTYPE*)&numext::real_ref(alpha), (const BLASTYPE*)lhs, &lda, (const BLASTYPE*)x_ptr, &incx, (const BLASTYPE*)&numext::real_ref(beta), (BLASTYPE*)res, &incy); \
|
99
|
+
}\
|
100
|
+
};
|
101
|
+
|
102
|
+
#ifdef EIGEN_USE_MKL
|
103
|
+
EIGEN_BLAS_SYMV_SPECIALIZATION(double, double, dsymv)
|
104
|
+
EIGEN_BLAS_SYMV_SPECIALIZATION(float, float, ssymv)
|
105
|
+
EIGEN_BLAS_SYMV_SPECIALIZATION(dcomplex, MKL_Complex16, zhemv)
|
106
|
+
EIGEN_BLAS_SYMV_SPECIALIZATION(scomplex, MKL_Complex8, chemv)
|
107
|
+
#else
|
108
|
+
EIGEN_BLAS_SYMV_SPECIALIZATION(double, double, dsymv_)
|
109
|
+
EIGEN_BLAS_SYMV_SPECIALIZATION(float, float, ssymv_)
|
110
|
+
EIGEN_BLAS_SYMV_SPECIALIZATION(dcomplex, double, zhemv_)
|
111
|
+
EIGEN_BLAS_SYMV_SPECIALIZATION(scomplex, float, chemv_)
|
112
|
+
#endif
|
113
|
+
|
114
|
+
} // end namespace internal
|
115
|
+
|
116
|
+
} // end namespace Eigen
|
117
|
+
|
118
|
+
#endif // EIGEN_SELFADJOINT_MATRIX_VECTOR_BLAS_H
|