ruby-eigen 0.0.9 → 0.0.10.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +22 -0
- data/README.md +21 -0
- data/ext/eigen/eigen3/COPYING.BSD +26 -0
- data/ext/eigen/eigen3/COPYING.MPL2 +373 -0
- data/ext/eigen/eigen3/COPYING.README +18 -0
- data/ext/eigen/eigen3/Eigen/Array +11 -0
- data/ext/eigen/eigen3/Eigen/Cholesky +32 -0
- data/ext/eigen/eigen3/Eigen/CholmodSupport +45 -0
- data/ext/eigen/eigen3/Eigen/Core +376 -0
- data/ext/eigen/eigen3/Eigen/Dense +7 -0
- data/ext/eigen/eigen3/Eigen/Eigen +2 -0
- data/ext/eigen/eigen3/Eigen/Eigen2Support +95 -0
- data/ext/eigen/eigen3/Eigen/Eigenvalues +48 -0
- data/ext/eigen/eigen3/Eigen/Geometry +63 -0
- data/ext/eigen/eigen3/Eigen/Householder +23 -0
- data/ext/eigen/eigen3/Eigen/IterativeLinearSolvers +40 -0
- data/ext/eigen/eigen3/Eigen/Jacobi +26 -0
- data/ext/eigen/eigen3/Eigen/LU +41 -0
- data/ext/eigen/eigen3/Eigen/LeastSquares +32 -0
- data/ext/eigen/eigen3/Eigen/MetisSupport +28 -0
- data/ext/eigen/eigen3/Eigen/PaStiXSupport +46 -0
- data/ext/eigen/eigen3/Eigen/PardisoSupport +30 -0
- data/ext/eigen/eigen3/Eigen/QR +45 -0
- data/ext/eigen/eigen3/Eigen/QtAlignedMalloc +34 -0
- data/ext/eigen/eigen3/Eigen/SPQRSupport +29 -0
- data/ext/eigen/eigen3/Eigen/SVD +37 -0
- data/ext/eigen/eigen3/Eigen/Sparse +27 -0
- data/ext/eigen/eigen3/Eigen/SparseCore +64 -0
- data/ext/eigen/eigen3/Eigen/SparseLU +49 -0
- data/ext/eigen/eigen3/Eigen/SparseQR +33 -0
- data/ext/eigen/eigen3/Eigen/StdDeque +27 -0
- data/ext/eigen/eigen3/Eigen/StdList +26 -0
- data/ext/eigen/eigen3/Eigen/StdVector +27 -0
- data/ext/eigen/eigen3/Eigen/SuperLUSupport +59 -0
- data/ext/eigen/eigen3/Eigen/UmfPackSupport +36 -0
- data/ext/eigen/eigen3/Eigen/src/Cholesky/LDLT.h +611 -0
- data/ext/eigen/eigen3/Eigen/src/Cholesky/LLT.h +498 -0
- data/ext/eigen/eigen3/Eigen/src/Cholesky/LLT_MKL.h +102 -0
- data/ext/eigen/eigen3/Eigen/src/CholmodSupport/CholmodSupport.h +607 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Array.h +323 -0
- data/ext/eigen/eigen3/Eigen/src/Core/ArrayBase.h +226 -0
- data/ext/eigen/eigen3/Eigen/src/Core/ArrayWrapper.h +264 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Assign.h +590 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Assign_MKL.h +224 -0
- data/ext/eigen/eigen3/Eigen/src/Core/BandMatrix.h +334 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Block.h +406 -0
- data/ext/eigen/eigen3/Eigen/src/Core/BooleanRedux.h +154 -0
- data/ext/eigen/eigen3/Eigen/src/Core/CommaInitializer.h +154 -0
- data/ext/eigen/eigen3/Eigen/src/Core/CoreIterators.h +61 -0
- data/ext/eigen/eigen3/Eigen/src/Core/CwiseBinaryOp.h +230 -0
- data/ext/eigen/eigen3/Eigen/src/Core/CwiseNullaryOp.h +864 -0
- data/ext/eigen/eigen3/Eigen/src/Core/CwiseUnaryOp.h +126 -0
- data/ext/eigen/eigen3/Eigen/src/Core/CwiseUnaryView.h +139 -0
- data/ext/eigen/eigen3/Eigen/src/Core/DenseBase.h +521 -0
- data/ext/eigen/eigen3/Eigen/src/Core/DenseCoeffsBase.h +754 -0
- data/ext/eigen/eigen3/Eigen/src/Core/DenseStorage.h +434 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Diagonal.h +237 -0
- data/ext/eigen/eigen3/Eigen/src/Core/DiagonalMatrix.h +313 -0
- data/ext/eigen/eigen3/Eigen/src/Core/DiagonalProduct.h +131 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Dot.h +263 -0
- data/ext/eigen/eigen3/Eigen/src/Core/EigenBase.h +131 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Flagged.h +140 -0
- data/ext/eigen/eigen3/Eigen/src/Core/ForceAlignedAccess.h +146 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Functors.h +1026 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Fuzzy.h +150 -0
- data/ext/eigen/eigen3/Eigen/src/Core/GeneralProduct.h +635 -0
- data/ext/eigen/eigen3/Eigen/src/Core/GenericPacketMath.h +350 -0
- data/ext/eigen/eigen3/Eigen/src/Core/GlobalFunctions.h +92 -0
- data/ext/eigen/eigen3/Eigen/src/Core/IO.h +250 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Map.h +192 -0
- data/ext/eigen/eigen3/Eigen/src/Core/MapBase.h +247 -0
- data/ext/eigen/eigen3/Eigen/src/Core/MathFunctions.h +768 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Matrix.h +420 -0
- data/ext/eigen/eigen3/Eigen/src/Core/MatrixBase.h +563 -0
- data/ext/eigen/eigen3/Eigen/src/Core/NestByValue.h +111 -0
- data/ext/eigen/eigen3/Eigen/src/Core/NoAlias.h +134 -0
- data/ext/eigen/eigen3/Eigen/src/Core/NumTraits.h +150 -0
- data/ext/eigen/eigen3/Eigen/src/Core/PermutationMatrix.h +721 -0
- data/ext/eigen/eigen3/Eigen/src/Core/PlainObjectBase.h +822 -0
- data/ext/eigen/eigen3/Eigen/src/Core/ProductBase.h +290 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Random.h +152 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Redux.h +409 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Ref.h +278 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Replicate.h +177 -0
- data/ext/eigen/eigen3/Eigen/src/Core/ReturnByValue.h +99 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Reverse.h +224 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Select.h +162 -0
- data/ext/eigen/eigen3/Eigen/src/Core/SelfAdjointView.h +314 -0
- data/ext/eigen/eigen3/Eigen/src/Core/SelfCwiseBinaryOp.h +191 -0
- data/ext/eigen/eigen3/Eigen/src/Core/SolveTriangular.h +260 -0
- data/ext/eigen/eigen3/Eigen/src/Core/StableNorm.h +203 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Stride.h +108 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Swap.h +126 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Transpose.h +419 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Transpositions.h +436 -0
- data/ext/eigen/eigen3/Eigen/src/Core/TriangularMatrix.h +839 -0
- data/ext/eigen/eigen3/Eigen/src/Core/VectorBlock.h +95 -0
- data/ext/eigen/eigen3/Eigen/src/Core/VectorwiseOp.h +642 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Visitor.h +237 -0
- data/ext/eigen/eigen3/Eigen/src/Core/arch/AltiVec/Complex.h +217 -0
- data/ext/eigen/eigen3/Eigen/src/Core/arch/AltiVec/PacketMath.h +501 -0
- data/ext/eigen/eigen3/Eigen/src/Core/arch/Default/Settings.h +49 -0
- data/ext/eigen/eigen3/Eigen/src/Core/arch/NEON/Complex.h +253 -0
- data/ext/eigen/eigen3/Eigen/src/Core/arch/NEON/PacketMath.h +420 -0
- data/ext/eigen/eigen3/Eigen/src/Core/arch/SSE/Complex.h +442 -0
- data/ext/eigen/eigen3/Eigen/src/Core/arch/SSE/MathFunctions.h +475 -0
- data/ext/eigen/eigen3/Eigen/src/Core/arch/SSE/PacketMath.h +649 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/CoeffBasedProduct.h +476 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralBlockPanelKernel.h +1341 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixMatrix.h +427 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +278 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_MKL.h +146 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixMatrix_MKL.h +118 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixVector.h +566 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixVector_MKL.h +131 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/Parallelizer.h +162 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +436 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointMatrixMatrix_MKL.h +295 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointMatrixVector.h +281 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointMatrixVector_MKL.h +114 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointProduct.h +123 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointRank2Update.h +93 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularMatrixMatrix.h +427 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularMatrixMatrix_MKL.h +309 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularMatrixVector.h +348 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularMatrixVector_MKL.h +247 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularSolverMatrix.h +332 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h +155 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularSolverVector.h +139 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/BlasUtil.h +264 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/Constants.h +451 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/DisableStupidWarnings.h +40 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/ForwardDeclarations.h +302 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/MKL_support.h +158 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/Macros.h +451 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/Memory.h +977 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/Meta.h +243 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/NonMPL2.h +3 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/ReenableStupidWarnings.h +14 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/StaticAssert.h +208 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/XprHelper.h +469 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Block.h +126 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Cwise.h +192 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/CwiseOperators.h +298 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/AlignedBox.h +159 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/All.h +115 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/AngleAxis.h +214 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Hyperplane.h +254 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/ParametrizedLine.h +141 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Quaternion.h +495 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Rotation2D.h +145 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/RotationBase.h +123 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Scaling.h +167 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Transform.h +786 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Translation.h +184 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/LU.h +120 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Lazy.h +71 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/LeastSquares.h +169 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Macros.h +20 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/MathFunctions.h +57 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Memory.h +45 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Meta.h +75 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Minor.h +117 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/QR.h +67 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/SVD.h +637 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/TriangularSolver.h +42 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/VectorBlock.h +94 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/ComplexEigenSolver.h +341 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/ComplexSchur.h +456 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/ComplexSchur_MKL.h +94 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/EigenSolver.h +607 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +350 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +227 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/HessenbergDecomposition.h +373 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +160 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/RealQZ.h +624 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/RealSchur.h +525 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/RealSchur_MKL.h +83 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +801 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_MKL.h +92 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/Tridiagonalization.h +557 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/AlignedBox.h +392 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/AngleAxis.h +233 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/EulerAngles.h +104 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/Homogeneous.h +307 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/Hyperplane.h +280 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/OrthoMethods.h +218 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/ParametrizedLine.h +195 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/Quaternion.h +776 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/Rotation2D.h +160 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/RotationBase.h +206 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/Scaling.h +166 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/Transform.h +1455 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/Translation.h +206 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/Umeyama.h +177 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/arch/Geometry_SSE.h +115 -0
- data/ext/eigen/eigen3/Eigen/src/Householder/BlockHouseholder.h +68 -0
- data/ext/eigen/eigen3/Eigen/src/Householder/Householder.h +171 -0
- data/ext/eigen/eigen3/Eigen/src/Householder/HouseholderSequence.h +441 -0
- data/ext/eigen/eigen3/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +149 -0
- data/ext/eigen/eigen3/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +263 -0
- data/ext/eigen/eigen3/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +256 -0
- data/ext/eigen/eigen3/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +282 -0
- data/ext/eigen/eigen3/Eigen/src/Jacobi/Jacobi.h +433 -0
- data/ext/eigen/eigen3/Eigen/src/LU/Determinant.h +101 -0
- data/ext/eigen/eigen3/Eigen/src/LU/FullPivLU.h +751 -0
- data/ext/eigen/eigen3/Eigen/src/LU/Inverse.h +400 -0
- data/ext/eigen/eigen3/Eigen/src/LU/PartialPivLU.h +509 -0
- data/ext/eigen/eigen3/Eigen/src/LU/PartialPivLU_MKL.h +85 -0
- data/ext/eigen/eigen3/Eigen/src/LU/arch/Inverse_SSE.h +329 -0
- data/ext/eigen/eigen3/Eigen/src/MetisSupport/MetisSupport.h +137 -0
- data/ext/eigen/eigen3/Eigen/src/OrderingMethods/Amd.h +444 -0
- data/ext/eigen/eigen3/Eigen/src/OrderingMethods/Eigen_Colamd.h +1850 -0
- data/ext/eigen/eigen3/Eigen/src/PaStiXSupport/PaStiXSupport.h +721 -0
- data/ext/eigen/eigen3/Eigen/src/PardisoSupport/PardisoSupport.h +592 -0
- data/ext/eigen/eigen3/Eigen/src/QR/ColPivHouseholderQR.h +580 -0
- data/ext/eigen/eigen3/Eigen/src/QR/ColPivHouseholderQR_MKL.h +99 -0
- data/ext/eigen/eigen3/Eigen/src/QR/FullPivHouseholderQR.h +622 -0
- data/ext/eigen/eigen3/Eigen/src/QR/HouseholderQR.h +388 -0
- data/ext/eigen/eigen3/Eigen/src/QR/HouseholderQR_MKL.h +71 -0
- data/ext/eigen/eigen3/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +338 -0
- data/ext/eigen/eigen3/Eigen/src/SVD/JacobiSVD.h +976 -0
- data/ext/eigen/eigen3/Eigen/src/SVD/JacobiSVD_MKL.h +92 -0
- data/ext/eigen/eigen3/Eigen/src/SVD/UpperBidiagonalization.h +148 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCholesky/SimplicialCholesky.h +671 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +199 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/AmbiVector.h +373 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/CompressedStorage.h +233 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +245 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/MappedSparseMatrix.h +181 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseBlock.h +537 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseColEtree.h +206 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +325 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +163 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseDenseProduct.h +311 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseDiagonalProduct.h +196 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseDot.h +101 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseFuzzy.h +26 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseMatrix.h +1262 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseMatrixBase.h +461 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparsePermutation.h +148 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseProduct.h +188 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseRedux.h +45 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseSelfAdjointView.h +507 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +150 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseTranspose.h +63 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseTriangularView.h +179 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseUtil.h +172 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseVector.h +448 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseView.h +99 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/TriangularSolver.h +334 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU.h +806 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLUImpl.h +66 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_Memory.h +227 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_Structs.h +111 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +298 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_Utils.h +80 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_column_bmod.h +180 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_column_dfs.h +177 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +106 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +279 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +127 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +130 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_panel_bmod.h +223 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_panel_dfs.h +258 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_pivotL.h +137 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_pruneL.h +135 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_relax_snode.h +83 -0
- data/ext/eigen/eigen3/Eigen/src/SparseQR/SparseQR.h +714 -0
- data/ext/eigen/eigen3/Eigen/src/StlSupport/StdDeque.h +134 -0
- data/ext/eigen/eigen3/Eigen/src/StlSupport/StdList.h +114 -0
- data/ext/eigen/eigen3/Eigen/src/StlSupport/StdVector.h +126 -0
- data/ext/eigen/eigen3/Eigen/src/StlSupport/details.h +84 -0
- data/ext/eigen/eigen3/Eigen/src/SuperLUSupport/SuperLUSupport.h +1026 -0
- data/ext/eigen/eigen3/Eigen/src/UmfPackSupport/UmfPackSupport.h +474 -0
- data/ext/eigen/eigen3/Eigen/src/misc/Image.h +84 -0
- data/ext/eigen/eigen3/Eigen/src/misc/Kernel.h +81 -0
- data/ext/eigen/eigen3/Eigen/src/misc/Solve.h +76 -0
- data/ext/eigen/eigen3/Eigen/src/misc/SparseSolve.h +128 -0
- data/ext/eigen/eigen3/Eigen/src/misc/blas.h +658 -0
- data/ext/eigen/eigen3/Eigen/src/plugins/ArrayCwiseBinaryOps.h +253 -0
- data/ext/eigen/eigen3/Eigen/src/plugins/ArrayCwiseUnaryOps.h +187 -0
- data/ext/eigen/eigen3/Eigen/src/plugins/BlockMethods.h +935 -0
- data/ext/eigen/eigen3/Eigen/src/plugins/CommonCwiseBinaryOps.h +46 -0
- data/ext/eigen/eigen3/Eigen/src/plugins/CommonCwiseUnaryOps.h +172 -0
- data/ext/eigen/eigen3/Eigen/src/plugins/MatrixCwiseBinaryOps.h +143 -0
- data/ext/eigen/eigen3/Eigen/src/plugins/MatrixCwiseUnaryOps.h +52 -0
- data/ext/eigen/eigen3/signature_of_eigen3_matrix_library +1 -0
- data/ext/eigen/eigen_wrap.cxx +19420 -10396
- data/ext/eigen/extconf.rb +37 -2
- data/lib/eigen.rb +146 -3
- metadata +294 -7
@@ -0,0 +1,247 @@
|
|
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 Intel(R) MKL
|
29
|
+
* Triangular matrix-vector product functionality based on ?TRMV.
|
30
|
+
********************************************************************************
|
31
|
+
*/
|
32
|
+
|
33
|
+
#ifndef EIGEN_TRIANGULAR_MATRIX_VECTOR_MKL_H
|
34
|
+
#define EIGEN_TRIANGULAR_MATRIX_VECTOR_MKL_H
|
35
|
+
|
36
|
+
namespace Eigen {
|
37
|
+
|
38
|
+
namespace internal {
|
39
|
+
|
40
|
+
/**********************************************************************
|
41
|
+
* This file implements triangular matrix-vector multiplication using BLAS
|
42
|
+
**********************************************************************/
|
43
|
+
|
44
|
+
// trmv/hemv specialization
|
45
|
+
|
46
|
+
template<typename Index, int Mode, typename LhsScalar, bool ConjLhs, typename RhsScalar, bool ConjRhs, int StorageOrder>
|
47
|
+
struct triangular_matrix_vector_product_trmv :
|
48
|
+
triangular_matrix_vector_product<Index,Mode,LhsScalar,ConjLhs,RhsScalar,ConjRhs,StorageOrder,BuiltIn> {};
|
49
|
+
|
50
|
+
#define EIGEN_MKL_TRMV_SPECIALIZE(Scalar) \
|
51
|
+
template<typename Index, int Mode, bool ConjLhs, bool ConjRhs> \
|
52
|
+
struct triangular_matrix_vector_product<Index,Mode,Scalar,ConjLhs,Scalar,ConjRhs,ColMajor,Specialized> { \
|
53
|
+
static void run(Index _rows, Index _cols, const Scalar* _lhs, Index lhsStride, \
|
54
|
+
const Scalar* _rhs, Index rhsIncr, Scalar* _res, Index resIncr, Scalar alpha) { \
|
55
|
+
triangular_matrix_vector_product_trmv<Index,Mode,Scalar,ConjLhs,Scalar,ConjRhs,ColMajor>::run( \
|
56
|
+
_rows, _cols, _lhs, lhsStride, _rhs, rhsIncr, _res, resIncr, alpha); \
|
57
|
+
} \
|
58
|
+
}; \
|
59
|
+
template<typename Index, int Mode, bool ConjLhs, bool ConjRhs> \
|
60
|
+
struct triangular_matrix_vector_product<Index,Mode,Scalar,ConjLhs,Scalar,ConjRhs,RowMajor,Specialized> { \
|
61
|
+
static void run(Index _rows, Index _cols, const Scalar* _lhs, Index lhsStride, \
|
62
|
+
const Scalar* _rhs, Index rhsIncr, Scalar* _res, Index resIncr, Scalar alpha) { \
|
63
|
+
triangular_matrix_vector_product_trmv<Index,Mode,Scalar,ConjLhs,Scalar,ConjRhs,RowMajor>::run( \
|
64
|
+
_rows, _cols, _lhs, lhsStride, _rhs, rhsIncr, _res, resIncr, alpha); \
|
65
|
+
} \
|
66
|
+
};
|
67
|
+
|
68
|
+
EIGEN_MKL_TRMV_SPECIALIZE(double)
|
69
|
+
EIGEN_MKL_TRMV_SPECIALIZE(float)
|
70
|
+
EIGEN_MKL_TRMV_SPECIALIZE(dcomplex)
|
71
|
+
EIGEN_MKL_TRMV_SPECIALIZE(scomplex)
|
72
|
+
|
73
|
+
// implements col-major: res += alpha * op(triangular) * vector
|
74
|
+
#define EIGEN_MKL_TRMV_CM(EIGTYPE, MKLTYPE, EIGPREFIX, MKLPREFIX) \
|
75
|
+
template<typename Index, int Mode, bool ConjLhs, bool ConjRhs> \
|
76
|
+
struct triangular_matrix_vector_product_trmv<Index,Mode,EIGTYPE,ConjLhs,EIGTYPE,ConjRhs,ColMajor> { \
|
77
|
+
enum { \
|
78
|
+
IsLower = (Mode&Lower) == Lower, \
|
79
|
+
SetDiag = (Mode&(ZeroDiag|UnitDiag)) ? 0 : 1, \
|
80
|
+
IsUnitDiag = (Mode&UnitDiag) ? 1 : 0, \
|
81
|
+
IsZeroDiag = (Mode&ZeroDiag) ? 1 : 0, \
|
82
|
+
LowUp = IsLower ? Lower : Upper \
|
83
|
+
}; \
|
84
|
+
static void run(Index _rows, Index _cols, const EIGTYPE* _lhs, Index lhsStride, \
|
85
|
+
const EIGTYPE* _rhs, Index rhsIncr, EIGTYPE* _res, Index resIncr, EIGTYPE alpha) \
|
86
|
+
{ \
|
87
|
+
if (ConjLhs || IsZeroDiag) { \
|
88
|
+
triangular_matrix_vector_product<Index,Mode,EIGTYPE,ConjLhs,EIGTYPE,ConjRhs,ColMajor,BuiltIn>::run( \
|
89
|
+
_rows, _cols, _lhs, lhsStride, _rhs, rhsIncr, _res, resIncr, alpha); \
|
90
|
+
return; \
|
91
|
+
}\
|
92
|
+
Index size = (std::min)(_rows,_cols); \
|
93
|
+
Index rows = IsLower ? _rows : size; \
|
94
|
+
Index cols = IsLower ? size : _cols; \
|
95
|
+
\
|
96
|
+
typedef VectorX##EIGPREFIX VectorRhs; \
|
97
|
+
EIGTYPE *x, *y;\
|
98
|
+
\
|
99
|
+
/* Set x*/ \
|
100
|
+
Map<const VectorRhs, 0, InnerStride<> > rhs(_rhs,cols,InnerStride<>(rhsIncr)); \
|
101
|
+
VectorRhs x_tmp; \
|
102
|
+
if (ConjRhs) x_tmp = rhs.conjugate(); else x_tmp = rhs; \
|
103
|
+
x = x_tmp.data(); \
|
104
|
+
\
|
105
|
+
/* Square part handling */\
|
106
|
+
\
|
107
|
+
char trans, uplo, diag; \
|
108
|
+
MKL_INT m, n, lda, incx, incy; \
|
109
|
+
EIGTYPE const *a; \
|
110
|
+
MKLTYPE alpha_, beta_; \
|
111
|
+
assign_scalar_eig2mkl<MKLTYPE, EIGTYPE>(alpha_, alpha); \
|
112
|
+
assign_scalar_eig2mkl<MKLTYPE, EIGTYPE>(beta_, EIGTYPE(1)); \
|
113
|
+
\
|
114
|
+
/* Set m, n */ \
|
115
|
+
n = (MKL_INT)size; \
|
116
|
+
lda = lhsStride; \
|
117
|
+
incx = 1; \
|
118
|
+
incy = resIncr; \
|
119
|
+
\
|
120
|
+
/* Set uplo, trans and diag*/ \
|
121
|
+
trans = 'N'; \
|
122
|
+
uplo = IsLower ? 'L' : 'U'; \
|
123
|
+
diag = IsUnitDiag ? 'U' : 'N'; \
|
124
|
+
\
|
125
|
+
/* call ?TRMV*/ \
|
126
|
+
MKLPREFIX##trmv(&uplo, &trans, &diag, &n, (const MKLTYPE*)_lhs, &lda, (MKLTYPE*)x, &incx); \
|
127
|
+
\
|
128
|
+
/* Add op(a_tr)rhs into res*/ \
|
129
|
+
MKLPREFIX##axpy(&n, &alpha_,(const MKLTYPE*)x, &incx, (MKLTYPE*)_res, &incy); \
|
130
|
+
/* Non-square case - doesn't fit to MKL ?TRMV. Fall to default triangular product*/ \
|
131
|
+
if (size<(std::max)(rows,cols)) { \
|
132
|
+
typedef Matrix<EIGTYPE, Dynamic, Dynamic> MatrixLhs; \
|
133
|
+
if (ConjRhs) x_tmp = rhs.conjugate(); else x_tmp = rhs; \
|
134
|
+
x = x_tmp.data(); \
|
135
|
+
if (size<rows) { \
|
136
|
+
y = _res + size*resIncr; \
|
137
|
+
a = _lhs + size; \
|
138
|
+
m = rows-size; \
|
139
|
+
n = size; \
|
140
|
+
} \
|
141
|
+
else { \
|
142
|
+
x += size; \
|
143
|
+
y = _res; \
|
144
|
+
a = _lhs + size*lda; \
|
145
|
+
m = size; \
|
146
|
+
n = cols-size; \
|
147
|
+
} \
|
148
|
+
MKLPREFIX##gemv(&trans, &m, &n, &alpha_, (const MKLTYPE*)a, &lda, (const MKLTYPE*)x, &incx, &beta_, (MKLTYPE*)y, &incy); \
|
149
|
+
} \
|
150
|
+
} \
|
151
|
+
};
|
152
|
+
|
153
|
+
EIGEN_MKL_TRMV_CM(double, double, d, d)
|
154
|
+
EIGEN_MKL_TRMV_CM(dcomplex, MKL_Complex16, cd, z)
|
155
|
+
EIGEN_MKL_TRMV_CM(float, float, f, s)
|
156
|
+
EIGEN_MKL_TRMV_CM(scomplex, MKL_Complex8, cf, c)
|
157
|
+
|
158
|
+
// implements row-major: res += alpha * op(triangular) * vector
|
159
|
+
#define EIGEN_MKL_TRMV_RM(EIGTYPE, MKLTYPE, EIGPREFIX, MKLPREFIX) \
|
160
|
+
template<typename Index, int Mode, bool ConjLhs, bool ConjRhs> \
|
161
|
+
struct triangular_matrix_vector_product_trmv<Index,Mode,EIGTYPE,ConjLhs,EIGTYPE,ConjRhs,RowMajor> { \
|
162
|
+
enum { \
|
163
|
+
IsLower = (Mode&Lower) == Lower, \
|
164
|
+
SetDiag = (Mode&(ZeroDiag|UnitDiag)) ? 0 : 1, \
|
165
|
+
IsUnitDiag = (Mode&UnitDiag) ? 1 : 0, \
|
166
|
+
IsZeroDiag = (Mode&ZeroDiag) ? 1 : 0, \
|
167
|
+
LowUp = IsLower ? Lower : Upper \
|
168
|
+
}; \
|
169
|
+
static void run(Index _rows, Index _cols, const EIGTYPE* _lhs, Index lhsStride, \
|
170
|
+
const EIGTYPE* _rhs, Index rhsIncr, EIGTYPE* _res, Index resIncr, EIGTYPE alpha) \
|
171
|
+
{ \
|
172
|
+
if (IsZeroDiag) { \
|
173
|
+
triangular_matrix_vector_product<Index,Mode,EIGTYPE,ConjLhs,EIGTYPE,ConjRhs,RowMajor,BuiltIn>::run( \
|
174
|
+
_rows, _cols, _lhs, lhsStride, _rhs, rhsIncr, _res, resIncr, alpha); \
|
175
|
+
return; \
|
176
|
+
}\
|
177
|
+
Index size = (std::min)(_rows,_cols); \
|
178
|
+
Index rows = IsLower ? _rows : size; \
|
179
|
+
Index cols = IsLower ? size : _cols; \
|
180
|
+
\
|
181
|
+
typedef VectorX##EIGPREFIX VectorRhs; \
|
182
|
+
EIGTYPE *x, *y;\
|
183
|
+
\
|
184
|
+
/* Set x*/ \
|
185
|
+
Map<const VectorRhs, 0, InnerStride<> > rhs(_rhs,cols,InnerStride<>(rhsIncr)); \
|
186
|
+
VectorRhs x_tmp; \
|
187
|
+
if (ConjRhs) x_tmp = rhs.conjugate(); else x_tmp = rhs; \
|
188
|
+
x = x_tmp.data(); \
|
189
|
+
\
|
190
|
+
/* Square part handling */\
|
191
|
+
\
|
192
|
+
char trans, uplo, diag; \
|
193
|
+
MKL_INT m, n, lda, incx, incy; \
|
194
|
+
EIGTYPE const *a; \
|
195
|
+
MKLTYPE alpha_, beta_; \
|
196
|
+
assign_scalar_eig2mkl<MKLTYPE, EIGTYPE>(alpha_, alpha); \
|
197
|
+
assign_scalar_eig2mkl<MKLTYPE, EIGTYPE>(beta_, EIGTYPE(1)); \
|
198
|
+
\
|
199
|
+
/* Set m, n */ \
|
200
|
+
n = (MKL_INT)size; \
|
201
|
+
lda = lhsStride; \
|
202
|
+
incx = 1; \
|
203
|
+
incy = resIncr; \
|
204
|
+
\
|
205
|
+
/* Set uplo, trans and diag*/ \
|
206
|
+
trans = ConjLhs ? 'C' : 'T'; \
|
207
|
+
uplo = IsLower ? 'U' : 'L'; \
|
208
|
+
diag = IsUnitDiag ? 'U' : 'N'; \
|
209
|
+
\
|
210
|
+
/* call ?TRMV*/ \
|
211
|
+
MKLPREFIX##trmv(&uplo, &trans, &diag, &n, (const MKLTYPE*)_lhs, &lda, (MKLTYPE*)x, &incx); \
|
212
|
+
\
|
213
|
+
/* Add op(a_tr)rhs into res*/ \
|
214
|
+
MKLPREFIX##axpy(&n, &alpha_,(const MKLTYPE*)x, &incx, (MKLTYPE*)_res, &incy); \
|
215
|
+
/* Non-square case - doesn't fit to MKL ?TRMV. Fall to default triangular product*/ \
|
216
|
+
if (size<(std::max)(rows,cols)) { \
|
217
|
+
typedef Matrix<EIGTYPE, Dynamic, Dynamic> MatrixLhs; \
|
218
|
+
if (ConjRhs) x_tmp = rhs.conjugate(); else x_tmp = rhs; \
|
219
|
+
x = x_tmp.data(); \
|
220
|
+
if (size<rows) { \
|
221
|
+
y = _res + size*resIncr; \
|
222
|
+
a = _lhs + size*lda; \
|
223
|
+
m = rows-size; \
|
224
|
+
n = size; \
|
225
|
+
} \
|
226
|
+
else { \
|
227
|
+
x += size; \
|
228
|
+
y = _res; \
|
229
|
+
a = _lhs + size; \
|
230
|
+
m = size; \
|
231
|
+
n = cols-size; \
|
232
|
+
} \
|
233
|
+
MKLPREFIX##gemv(&trans, &n, &m, &alpha_, (const MKLTYPE*)a, &lda, (const MKLTYPE*)x, &incx, &beta_, (MKLTYPE*)y, &incy); \
|
234
|
+
} \
|
235
|
+
} \
|
236
|
+
};
|
237
|
+
|
238
|
+
EIGEN_MKL_TRMV_RM(double, double, d, d)
|
239
|
+
EIGEN_MKL_TRMV_RM(dcomplex, MKL_Complex16, cd, z)
|
240
|
+
EIGEN_MKL_TRMV_RM(float, float, f, s)
|
241
|
+
EIGEN_MKL_TRMV_RM(scomplex, MKL_Complex8, cf, c)
|
242
|
+
|
243
|
+
} // end namespase internal
|
244
|
+
|
245
|
+
} // end namespace Eigen
|
246
|
+
|
247
|
+
#endif // EIGEN_TRIANGULAR_MATRIX_VECTOR_MKL_H
|
@@ -0,0 +1,332 @@
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
2
|
+
// for linear algebra.
|
3
|
+
//
|
4
|
+
// Copyright (C) 2009 Gael Guennebaud <gael.guennebaud@inria.fr>
|
5
|
+
//
|
6
|
+
// This Source Code Form is subject to the terms of the Mozilla
|
7
|
+
// Public License v. 2.0. If a copy of the MPL was not distributed
|
8
|
+
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
9
|
+
|
10
|
+
#ifndef EIGEN_TRIANGULAR_SOLVER_MATRIX_H
|
11
|
+
#define EIGEN_TRIANGULAR_SOLVER_MATRIX_H
|
12
|
+
|
13
|
+
namespace Eigen {
|
14
|
+
|
15
|
+
namespace internal {
|
16
|
+
|
17
|
+
// if the rhs is row major, let's transpose the product
|
18
|
+
template <typename Scalar, typename Index, int Side, int Mode, bool Conjugate, int TriStorageOrder>
|
19
|
+
struct triangular_solve_matrix<Scalar,Index,Side,Mode,Conjugate,TriStorageOrder,RowMajor>
|
20
|
+
{
|
21
|
+
static void run(
|
22
|
+
Index size, Index cols,
|
23
|
+
const Scalar* tri, Index triStride,
|
24
|
+
Scalar* _other, Index otherStride,
|
25
|
+
level3_blocking<Scalar,Scalar>& blocking)
|
26
|
+
{
|
27
|
+
triangular_solve_matrix<
|
28
|
+
Scalar, Index, Side==OnTheLeft?OnTheRight:OnTheLeft,
|
29
|
+
(Mode&UnitDiag) | ((Mode&Upper) ? Lower : Upper),
|
30
|
+
NumTraits<Scalar>::IsComplex && Conjugate,
|
31
|
+
TriStorageOrder==RowMajor ? ColMajor : RowMajor, ColMajor>
|
32
|
+
::run(size, cols, tri, triStride, _other, otherStride, blocking);
|
33
|
+
}
|
34
|
+
};
|
35
|
+
|
36
|
+
/* Optimized triangular solver with multiple right hand side and the triangular matrix on the left
|
37
|
+
*/
|
38
|
+
template <typename Scalar, typename Index, int Mode, bool Conjugate, int TriStorageOrder>
|
39
|
+
struct triangular_solve_matrix<Scalar,Index,OnTheLeft,Mode,Conjugate,TriStorageOrder,ColMajor>
|
40
|
+
{
|
41
|
+
static EIGEN_DONT_INLINE void run(
|
42
|
+
Index size, Index otherSize,
|
43
|
+
const Scalar* _tri, Index triStride,
|
44
|
+
Scalar* _other, Index otherStride,
|
45
|
+
level3_blocking<Scalar,Scalar>& blocking);
|
46
|
+
};
|
47
|
+
template <typename Scalar, typename Index, int Mode, bool Conjugate, int TriStorageOrder>
|
48
|
+
EIGEN_DONT_INLINE void triangular_solve_matrix<Scalar,Index,OnTheLeft,Mode,Conjugate,TriStorageOrder,ColMajor>::run(
|
49
|
+
Index size, Index otherSize,
|
50
|
+
const Scalar* _tri, Index triStride,
|
51
|
+
Scalar* _other, Index otherStride,
|
52
|
+
level3_blocking<Scalar,Scalar>& blocking)
|
53
|
+
{
|
54
|
+
Index cols = otherSize;
|
55
|
+
const_blas_data_mapper<Scalar, Index, TriStorageOrder> tri(_tri,triStride);
|
56
|
+
blas_data_mapper<Scalar, Index, ColMajor> other(_other,otherStride);
|
57
|
+
|
58
|
+
typedef gebp_traits<Scalar,Scalar> Traits;
|
59
|
+
enum {
|
60
|
+
SmallPanelWidth = EIGEN_PLAIN_ENUM_MAX(Traits::mr,Traits::nr),
|
61
|
+
IsLower = (Mode&Lower) == Lower
|
62
|
+
};
|
63
|
+
|
64
|
+
Index kc = blocking.kc(); // cache block size along the K direction
|
65
|
+
Index mc = (std::min)(size,blocking.mc()); // cache block size along the M direction
|
66
|
+
|
67
|
+
std::size_t sizeA = kc*mc;
|
68
|
+
std::size_t sizeB = kc*cols;
|
69
|
+
std::size_t sizeW = kc*Traits::WorkSpaceFactor;
|
70
|
+
|
71
|
+
ei_declare_aligned_stack_constructed_variable(Scalar, blockA, sizeA, blocking.blockA());
|
72
|
+
ei_declare_aligned_stack_constructed_variable(Scalar, blockB, sizeB, blocking.blockB());
|
73
|
+
ei_declare_aligned_stack_constructed_variable(Scalar, blockW, sizeW, blocking.blockW());
|
74
|
+
|
75
|
+
conj_if<Conjugate> conj;
|
76
|
+
gebp_kernel<Scalar, Scalar, Index, Traits::mr, Traits::nr, Conjugate, false> gebp_kernel;
|
77
|
+
gemm_pack_lhs<Scalar, Index, Traits::mr, Traits::LhsProgress, TriStorageOrder> pack_lhs;
|
78
|
+
gemm_pack_rhs<Scalar, Index, Traits::nr, ColMajor, false, true> pack_rhs;
|
79
|
+
|
80
|
+
// the goal here is to subdivise the Rhs panels such that we keep some cache
|
81
|
+
// coherence when accessing the rhs elements
|
82
|
+
std::ptrdiff_t l1, l2;
|
83
|
+
manage_caching_sizes(GetAction, &l1, &l2);
|
84
|
+
Index subcols = cols>0 ? l2/(4 * sizeof(Scalar) * otherStride) : 0;
|
85
|
+
subcols = std::max<Index>((subcols/Traits::nr)*Traits::nr, Traits::nr);
|
86
|
+
|
87
|
+
for(Index k2=IsLower ? 0 : size;
|
88
|
+
IsLower ? k2<size : k2>0;
|
89
|
+
IsLower ? k2+=kc : k2-=kc)
|
90
|
+
{
|
91
|
+
const Index actual_kc = (std::min)(IsLower ? size-k2 : k2, kc);
|
92
|
+
|
93
|
+
// We have selected and packed a big horizontal panel R1 of rhs. Let B be the packed copy of this panel,
|
94
|
+
// and R2 the remaining part of rhs. The corresponding vertical panel of lhs is split into
|
95
|
+
// A11 (the triangular part) and A21 the remaining rectangular part.
|
96
|
+
// Then the high level algorithm is:
|
97
|
+
// - B = R1 => general block copy (done during the next step)
|
98
|
+
// - R1 = A11^-1 B => tricky part
|
99
|
+
// - update B from the new R1 => actually this has to be performed continuously during the above step
|
100
|
+
// - R2 -= A21 * B => GEPP
|
101
|
+
|
102
|
+
// The tricky part: compute R1 = A11^-1 B while updating B from R1
|
103
|
+
// The idea is to split A11 into multiple small vertical panels.
|
104
|
+
// Each panel can be split into a small triangular part T1k which is processed without optimization,
|
105
|
+
// and the remaining small part T2k which is processed using gebp with appropriate block strides
|
106
|
+
for(Index j2=0; j2<cols; j2+=subcols)
|
107
|
+
{
|
108
|
+
Index actual_cols = (std::min)(cols-j2,subcols);
|
109
|
+
// for each small vertical panels [T1k^T, T2k^T]^T of lhs
|
110
|
+
for (Index k1=0; k1<actual_kc; k1+=SmallPanelWidth)
|
111
|
+
{
|
112
|
+
Index actualPanelWidth = std::min<Index>(actual_kc-k1, SmallPanelWidth);
|
113
|
+
// tr solve
|
114
|
+
for (Index k=0; k<actualPanelWidth; ++k)
|
115
|
+
{
|
116
|
+
// TODO write a small kernel handling this (can be shared with trsv)
|
117
|
+
Index i = IsLower ? k2+k1+k : k2-k1-k-1;
|
118
|
+
Index s = IsLower ? k2+k1 : i+1;
|
119
|
+
Index rs = actualPanelWidth - k - 1; // remaining size
|
120
|
+
|
121
|
+
Scalar a = (Mode & UnitDiag) ? Scalar(1) : Scalar(1)/conj(tri(i,i));
|
122
|
+
for (Index j=j2; j<j2+actual_cols; ++j)
|
123
|
+
{
|
124
|
+
if (TriStorageOrder==RowMajor)
|
125
|
+
{
|
126
|
+
Scalar b(0);
|
127
|
+
const Scalar* l = &tri(i,s);
|
128
|
+
Scalar* r = &other(s,j);
|
129
|
+
for (Index i3=0; i3<k; ++i3)
|
130
|
+
b += conj(l[i3]) * r[i3];
|
131
|
+
|
132
|
+
other(i,j) = (other(i,j) - b)*a;
|
133
|
+
}
|
134
|
+
else
|
135
|
+
{
|
136
|
+
Index s = IsLower ? i+1 : i-rs;
|
137
|
+
Scalar b = (other(i,j) *= a);
|
138
|
+
Scalar* r = &other(s,j);
|
139
|
+
const Scalar* l = &tri(s,i);
|
140
|
+
for (Index i3=0;i3<rs;++i3)
|
141
|
+
r[i3] -= b * conj(l[i3]);
|
142
|
+
}
|
143
|
+
}
|
144
|
+
}
|
145
|
+
|
146
|
+
Index lengthTarget = actual_kc-k1-actualPanelWidth;
|
147
|
+
Index startBlock = IsLower ? k2+k1 : k2-k1-actualPanelWidth;
|
148
|
+
Index blockBOffset = IsLower ? k1 : lengthTarget;
|
149
|
+
|
150
|
+
// update the respective rows of B from other
|
151
|
+
pack_rhs(blockB+actual_kc*j2, &other(startBlock,j2), otherStride, actualPanelWidth, actual_cols, actual_kc, blockBOffset);
|
152
|
+
|
153
|
+
// GEBP
|
154
|
+
if (lengthTarget>0)
|
155
|
+
{
|
156
|
+
Index startTarget = IsLower ? k2+k1+actualPanelWidth : k2-actual_kc;
|
157
|
+
|
158
|
+
pack_lhs(blockA, &tri(startTarget,startBlock), triStride, actualPanelWidth, lengthTarget);
|
159
|
+
|
160
|
+
gebp_kernel(&other(startTarget,j2), otherStride, blockA, blockB+actual_kc*j2, lengthTarget, actualPanelWidth, actual_cols, Scalar(-1),
|
161
|
+
actualPanelWidth, actual_kc, 0, blockBOffset, blockW);
|
162
|
+
}
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
// R2 -= A21 * B => GEPP
|
167
|
+
{
|
168
|
+
Index start = IsLower ? k2+kc : 0;
|
169
|
+
Index end = IsLower ? size : k2-kc;
|
170
|
+
for(Index i2=start; i2<end; i2+=mc)
|
171
|
+
{
|
172
|
+
const Index actual_mc = (std::min)(mc,end-i2);
|
173
|
+
if (actual_mc>0)
|
174
|
+
{
|
175
|
+
pack_lhs(blockA, &tri(i2, IsLower ? k2 : k2-kc), triStride, actual_kc, actual_mc);
|
176
|
+
|
177
|
+
gebp_kernel(_other+i2, otherStride, blockA, blockB, actual_mc, actual_kc, cols, Scalar(-1), -1, -1, 0, 0, blockW);
|
178
|
+
}
|
179
|
+
}
|
180
|
+
}
|
181
|
+
}
|
182
|
+
}
|
183
|
+
|
184
|
+
/* Optimized triangular solver with multiple left hand sides and the trinagular matrix on the right
|
185
|
+
*/
|
186
|
+
template <typename Scalar, typename Index, int Mode, bool Conjugate, int TriStorageOrder>
|
187
|
+
struct triangular_solve_matrix<Scalar,Index,OnTheRight,Mode,Conjugate,TriStorageOrder,ColMajor>
|
188
|
+
{
|
189
|
+
static EIGEN_DONT_INLINE void run(
|
190
|
+
Index size, Index otherSize,
|
191
|
+
const Scalar* _tri, Index triStride,
|
192
|
+
Scalar* _other, Index otherStride,
|
193
|
+
level3_blocking<Scalar,Scalar>& blocking);
|
194
|
+
};
|
195
|
+
template <typename Scalar, typename Index, int Mode, bool Conjugate, int TriStorageOrder>
|
196
|
+
EIGEN_DONT_INLINE void triangular_solve_matrix<Scalar,Index,OnTheRight,Mode,Conjugate,TriStorageOrder,ColMajor>::run(
|
197
|
+
Index size, Index otherSize,
|
198
|
+
const Scalar* _tri, Index triStride,
|
199
|
+
Scalar* _other, Index otherStride,
|
200
|
+
level3_blocking<Scalar,Scalar>& blocking)
|
201
|
+
{
|
202
|
+
Index rows = otherSize;
|
203
|
+
const_blas_data_mapper<Scalar, Index, TriStorageOrder> rhs(_tri,triStride);
|
204
|
+
blas_data_mapper<Scalar, Index, ColMajor> lhs(_other,otherStride);
|
205
|
+
|
206
|
+
typedef gebp_traits<Scalar,Scalar> Traits;
|
207
|
+
enum {
|
208
|
+
RhsStorageOrder = TriStorageOrder,
|
209
|
+
SmallPanelWidth = EIGEN_PLAIN_ENUM_MAX(Traits::mr,Traits::nr),
|
210
|
+
IsLower = (Mode&Lower) == Lower
|
211
|
+
};
|
212
|
+
|
213
|
+
Index kc = blocking.kc(); // cache block size along the K direction
|
214
|
+
Index mc = (std::min)(rows,blocking.mc()); // cache block size along the M direction
|
215
|
+
|
216
|
+
std::size_t sizeA = kc*mc;
|
217
|
+
std::size_t sizeB = kc*size;
|
218
|
+
std::size_t sizeW = kc*Traits::WorkSpaceFactor;
|
219
|
+
|
220
|
+
ei_declare_aligned_stack_constructed_variable(Scalar, blockA, sizeA, blocking.blockA());
|
221
|
+
ei_declare_aligned_stack_constructed_variable(Scalar, blockB, sizeB, blocking.blockB());
|
222
|
+
ei_declare_aligned_stack_constructed_variable(Scalar, blockW, sizeW, blocking.blockW());
|
223
|
+
|
224
|
+
conj_if<Conjugate> conj;
|
225
|
+
gebp_kernel<Scalar,Scalar, Index, Traits::mr, Traits::nr, false, Conjugate> gebp_kernel;
|
226
|
+
gemm_pack_rhs<Scalar, Index, Traits::nr,RhsStorageOrder> pack_rhs;
|
227
|
+
gemm_pack_rhs<Scalar, Index, Traits::nr,RhsStorageOrder,false,true> pack_rhs_panel;
|
228
|
+
gemm_pack_lhs<Scalar, Index, Traits::mr, Traits::LhsProgress, ColMajor, false, true> pack_lhs_panel;
|
229
|
+
|
230
|
+
for(Index k2=IsLower ? size : 0;
|
231
|
+
IsLower ? k2>0 : k2<size;
|
232
|
+
IsLower ? k2-=kc : k2+=kc)
|
233
|
+
{
|
234
|
+
const Index actual_kc = (std::min)(IsLower ? k2 : size-k2, kc);
|
235
|
+
Index actual_k2 = IsLower ? k2-actual_kc : k2 ;
|
236
|
+
|
237
|
+
Index startPanel = IsLower ? 0 : k2+actual_kc;
|
238
|
+
Index rs = IsLower ? actual_k2 : size - actual_k2 - actual_kc;
|
239
|
+
Scalar* geb = blockB+actual_kc*actual_kc;
|
240
|
+
|
241
|
+
if (rs>0) pack_rhs(geb, &rhs(actual_k2,startPanel), triStride, actual_kc, rs);
|
242
|
+
|
243
|
+
// triangular packing (we only pack the panels off the diagonal,
|
244
|
+
// neglecting the blocks overlapping the diagonal
|
245
|
+
{
|
246
|
+
for (Index j2=0; j2<actual_kc; j2+=SmallPanelWidth)
|
247
|
+
{
|
248
|
+
Index actualPanelWidth = std::min<Index>(actual_kc-j2, SmallPanelWidth);
|
249
|
+
Index actual_j2 = actual_k2 + j2;
|
250
|
+
Index panelOffset = IsLower ? j2+actualPanelWidth : 0;
|
251
|
+
Index panelLength = IsLower ? actual_kc-j2-actualPanelWidth : j2;
|
252
|
+
|
253
|
+
if (panelLength>0)
|
254
|
+
pack_rhs_panel(blockB+j2*actual_kc,
|
255
|
+
&rhs(actual_k2+panelOffset, actual_j2), triStride,
|
256
|
+
panelLength, actualPanelWidth,
|
257
|
+
actual_kc, panelOffset);
|
258
|
+
}
|
259
|
+
}
|
260
|
+
|
261
|
+
for(Index i2=0; i2<rows; i2+=mc)
|
262
|
+
{
|
263
|
+
const Index actual_mc = (std::min)(mc,rows-i2);
|
264
|
+
|
265
|
+
// triangular solver kernel
|
266
|
+
{
|
267
|
+
// for each small block of the diagonal (=> vertical panels of rhs)
|
268
|
+
for (Index j2 = IsLower
|
269
|
+
? (actual_kc - ((actual_kc%SmallPanelWidth) ? Index(actual_kc%SmallPanelWidth)
|
270
|
+
: Index(SmallPanelWidth)))
|
271
|
+
: 0;
|
272
|
+
IsLower ? j2>=0 : j2<actual_kc;
|
273
|
+
IsLower ? j2-=SmallPanelWidth : j2+=SmallPanelWidth)
|
274
|
+
{
|
275
|
+
Index actualPanelWidth = std::min<Index>(actual_kc-j2, SmallPanelWidth);
|
276
|
+
Index absolute_j2 = actual_k2 + j2;
|
277
|
+
Index panelOffset = IsLower ? j2+actualPanelWidth : 0;
|
278
|
+
Index panelLength = IsLower ? actual_kc - j2 - actualPanelWidth : j2;
|
279
|
+
|
280
|
+
// GEBP
|
281
|
+
if(panelLength>0)
|
282
|
+
{
|
283
|
+
gebp_kernel(&lhs(i2,absolute_j2), otherStride,
|
284
|
+
blockA, blockB+j2*actual_kc,
|
285
|
+
actual_mc, panelLength, actualPanelWidth,
|
286
|
+
Scalar(-1),
|
287
|
+
actual_kc, actual_kc, // strides
|
288
|
+
panelOffset, panelOffset, // offsets
|
289
|
+
blockW); // workspace
|
290
|
+
}
|
291
|
+
|
292
|
+
// unblocked triangular solve
|
293
|
+
for (Index k=0; k<actualPanelWidth; ++k)
|
294
|
+
{
|
295
|
+
Index j = IsLower ? absolute_j2+actualPanelWidth-k-1 : absolute_j2+k;
|
296
|
+
|
297
|
+
Scalar* r = &lhs(i2,j);
|
298
|
+
for (Index k3=0; k3<k; ++k3)
|
299
|
+
{
|
300
|
+
Scalar b = conj(rhs(IsLower ? j+1+k3 : absolute_j2+k3,j));
|
301
|
+
Scalar* a = &lhs(i2,IsLower ? j+1+k3 : absolute_j2+k3);
|
302
|
+
for (Index i=0; i<actual_mc; ++i)
|
303
|
+
r[i] -= a[i] * b;
|
304
|
+
}
|
305
|
+
if((Mode & UnitDiag)==0)
|
306
|
+
{
|
307
|
+
Scalar b = conj(rhs(j,j));
|
308
|
+
for (Index i=0; i<actual_mc; ++i)
|
309
|
+
r[i] /= b;
|
310
|
+
}
|
311
|
+
}
|
312
|
+
|
313
|
+
// pack the just computed part of lhs to A
|
314
|
+
pack_lhs_panel(blockA, _other+absolute_j2*otherStride+i2, otherStride,
|
315
|
+
actualPanelWidth, actual_mc,
|
316
|
+
actual_kc, j2);
|
317
|
+
}
|
318
|
+
}
|
319
|
+
|
320
|
+
if (rs>0)
|
321
|
+
gebp_kernel(_other+i2+startPanel*otherStride, otherStride, blockA, geb,
|
322
|
+
actual_mc, actual_kc, rs, Scalar(-1),
|
323
|
+
-1, -1, 0, 0, blockW);
|
324
|
+
}
|
325
|
+
}
|
326
|
+
}
|
327
|
+
|
328
|
+
} // end namespace internal
|
329
|
+
|
330
|
+
} // end namespace Eigen
|
331
|
+
|
332
|
+
#endif // EIGEN_TRIANGULAR_SOLVER_MATRIX_H
|