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,114 @@
|
|
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
|
+
* Selfadjoint matrix-vector product functionality based on ?SYMV/HEMV.
|
30
|
+
********************************************************************************
|
31
|
+
*/
|
32
|
+
|
33
|
+
#ifndef EIGEN_SELFADJOINT_MATRIX_VECTOR_MKL_H
|
34
|
+
#define EIGEN_SELFADJOINT_MATRIX_VECTOR_MKL_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_MKL_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, Index rhsIncr, 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, rhsIncr, res, alpha); \
|
62
|
+
} else {\
|
63
|
+
selfadjoint_matrix_vector_product_symv<Scalar,Index,StorageOrder,UpLo,ConjugateLhs,ConjugateRhs>::run( \
|
64
|
+
size, lhs, lhsStride, _rhs, rhsIncr, res, alpha); \
|
65
|
+
}\
|
66
|
+
} \
|
67
|
+
}; \
|
68
|
+
|
69
|
+
EIGEN_MKL_SYMV_SPECIALIZE(double)
|
70
|
+
EIGEN_MKL_SYMV_SPECIALIZE(float)
|
71
|
+
EIGEN_MKL_SYMV_SPECIALIZE(dcomplex)
|
72
|
+
EIGEN_MKL_SYMV_SPECIALIZE(scomplex)
|
73
|
+
|
74
|
+
#define EIGEN_MKL_SYMV_SPECIALIZATION(EIGTYPE,MKLTYPE,MKLFUNC) \
|
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, Index rhsIncr, EIGTYPE* res, EIGTYPE alpha) \
|
83
|
+
{ \
|
84
|
+
enum {\
|
85
|
+
IsRowMajor = StorageOrder==RowMajor ? 1 : 0, \
|
86
|
+
IsLower = UpLo == Lower ? 1 : 0 \
|
87
|
+
}; \
|
88
|
+
MKL_INT n=size, lda=lhsStride, incx=rhsIncr, incy=1; \
|
89
|
+
MKLTYPE alpha_, beta_; \
|
90
|
+
const EIGTYPE *x_ptr, myone(1); \
|
91
|
+
char uplo=(IsRowMajor) ? (IsLower ? 'U' : 'L') : (IsLower ? 'L' : 'U'); \
|
92
|
+
assign_scalar_eig2mkl(alpha_, alpha); \
|
93
|
+
assign_scalar_eig2mkl(beta_, myone); \
|
94
|
+
SYMVVector x_tmp; \
|
95
|
+
if (ConjugateRhs) { \
|
96
|
+
Map<const SYMVVector, 0, InnerStride<> > map_x(_rhs,size,1,InnerStride<>(incx)); \
|
97
|
+
x_tmp=map_x.conjugate(); \
|
98
|
+
x_ptr=x_tmp.data(); \
|
99
|
+
incx=1; \
|
100
|
+
} else x_ptr=_rhs; \
|
101
|
+
MKLFUNC(&uplo, &n, &alpha_, (const MKLTYPE*)lhs, &lda, (const MKLTYPE*)x_ptr, &incx, &beta_, (MKLTYPE*)res, &incy); \
|
102
|
+
}\
|
103
|
+
};
|
104
|
+
|
105
|
+
EIGEN_MKL_SYMV_SPECIALIZATION(double, double, dsymv)
|
106
|
+
EIGEN_MKL_SYMV_SPECIALIZATION(float, float, ssymv)
|
107
|
+
EIGEN_MKL_SYMV_SPECIALIZATION(dcomplex, MKL_Complex16, zhemv)
|
108
|
+
EIGEN_MKL_SYMV_SPECIALIZATION(scomplex, MKL_Complex8, chemv)
|
109
|
+
|
110
|
+
} // end namespace internal
|
111
|
+
|
112
|
+
} // end namespace Eigen
|
113
|
+
|
114
|
+
#endif // EIGEN_SELFADJOINT_MATRIX_VECTOR_MKL_H
|
@@ -0,0 +1,123 @@
|
|
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_SELFADJOINT_PRODUCT_H
|
11
|
+
#define EIGEN_SELFADJOINT_PRODUCT_H
|
12
|
+
|
13
|
+
/**********************************************************************
|
14
|
+
* This file implements a self adjoint product: C += A A^T updating only
|
15
|
+
* half of the selfadjoint matrix C.
|
16
|
+
* It corresponds to the level 3 SYRK and level 2 SYR Blas routines.
|
17
|
+
**********************************************************************/
|
18
|
+
|
19
|
+
namespace Eigen {
|
20
|
+
|
21
|
+
|
22
|
+
template<typename Scalar, typename Index, int UpLo, bool ConjLhs, bool ConjRhs>
|
23
|
+
struct selfadjoint_rank1_update<Scalar,Index,ColMajor,UpLo,ConjLhs,ConjRhs>
|
24
|
+
{
|
25
|
+
static void run(Index size, Scalar* mat, Index stride, const Scalar* vecX, const Scalar* vecY, const Scalar& alpha)
|
26
|
+
{
|
27
|
+
internal::conj_if<ConjRhs> cj;
|
28
|
+
typedef Map<const Matrix<Scalar,Dynamic,1> > OtherMap;
|
29
|
+
typedef typename internal::conditional<ConjLhs,typename OtherMap::ConjugateReturnType,const OtherMap&>::type ConjLhsType;
|
30
|
+
for (Index i=0; i<size; ++i)
|
31
|
+
{
|
32
|
+
Map<Matrix<Scalar,Dynamic,1> >(mat+stride*i+(UpLo==Lower ? i : 0), (UpLo==Lower ? size-i : (i+1)))
|
33
|
+
+= (alpha * cj(vecY[i])) * ConjLhsType(OtherMap(vecX+(UpLo==Lower ? i : 0),UpLo==Lower ? size-i : (i+1)));
|
34
|
+
}
|
35
|
+
}
|
36
|
+
};
|
37
|
+
|
38
|
+
template<typename Scalar, typename Index, int UpLo, bool ConjLhs, bool ConjRhs>
|
39
|
+
struct selfadjoint_rank1_update<Scalar,Index,RowMajor,UpLo,ConjLhs,ConjRhs>
|
40
|
+
{
|
41
|
+
static void run(Index size, Scalar* mat, Index stride, const Scalar* vecX, const Scalar* vecY, const Scalar& alpha)
|
42
|
+
{
|
43
|
+
selfadjoint_rank1_update<Scalar,Index,ColMajor,UpLo==Lower?Upper:Lower,ConjRhs,ConjLhs>::run(size,mat,stride,vecY,vecX,alpha);
|
44
|
+
}
|
45
|
+
};
|
46
|
+
|
47
|
+
template<typename MatrixType, typename OtherType, int UpLo, bool OtherIsVector = OtherType::IsVectorAtCompileTime>
|
48
|
+
struct selfadjoint_product_selector;
|
49
|
+
|
50
|
+
template<typename MatrixType, typename OtherType, int UpLo>
|
51
|
+
struct selfadjoint_product_selector<MatrixType,OtherType,UpLo,true>
|
52
|
+
{
|
53
|
+
static void run(MatrixType& mat, const OtherType& other, const typename MatrixType::Scalar& alpha)
|
54
|
+
{
|
55
|
+
typedef typename MatrixType::Scalar Scalar;
|
56
|
+
typedef typename MatrixType::Index Index;
|
57
|
+
typedef internal::blas_traits<OtherType> OtherBlasTraits;
|
58
|
+
typedef typename OtherBlasTraits::DirectLinearAccessType ActualOtherType;
|
59
|
+
typedef typename internal::remove_all<ActualOtherType>::type _ActualOtherType;
|
60
|
+
typename internal::add_const_on_value_type<ActualOtherType>::type actualOther = OtherBlasTraits::extract(other.derived());
|
61
|
+
|
62
|
+
Scalar actualAlpha = alpha * OtherBlasTraits::extractScalarFactor(other.derived());
|
63
|
+
|
64
|
+
enum {
|
65
|
+
StorageOrder = (internal::traits<MatrixType>::Flags&RowMajorBit) ? RowMajor : ColMajor,
|
66
|
+
UseOtherDirectly = _ActualOtherType::InnerStrideAtCompileTime==1
|
67
|
+
};
|
68
|
+
internal::gemv_static_vector_if<Scalar,OtherType::SizeAtCompileTime,OtherType::MaxSizeAtCompileTime,!UseOtherDirectly> static_other;
|
69
|
+
|
70
|
+
ei_declare_aligned_stack_constructed_variable(Scalar, actualOtherPtr, other.size(),
|
71
|
+
(UseOtherDirectly ? const_cast<Scalar*>(actualOther.data()) : static_other.data()));
|
72
|
+
|
73
|
+
if(!UseOtherDirectly)
|
74
|
+
Map<typename _ActualOtherType::PlainObject>(actualOtherPtr, actualOther.size()) = actualOther;
|
75
|
+
|
76
|
+
selfadjoint_rank1_update<Scalar,Index,StorageOrder,UpLo,
|
77
|
+
OtherBlasTraits::NeedToConjugate && NumTraits<Scalar>::IsComplex,
|
78
|
+
(!OtherBlasTraits::NeedToConjugate) && NumTraits<Scalar>::IsComplex>
|
79
|
+
::run(other.size(), mat.data(), mat.outerStride(), actualOtherPtr, actualOtherPtr, actualAlpha);
|
80
|
+
}
|
81
|
+
};
|
82
|
+
|
83
|
+
template<typename MatrixType, typename OtherType, int UpLo>
|
84
|
+
struct selfadjoint_product_selector<MatrixType,OtherType,UpLo,false>
|
85
|
+
{
|
86
|
+
static void run(MatrixType& mat, const OtherType& other, const typename MatrixType::Scalar& alpha)
|
87
|
+
{
|
88
|
+
typedef typename MatrixType::Scalar Scalar;
|
89
|
+
typedef typename MatrixType::Index Index;
|
90
|
+
typedef internal::blas_traits<OtherType> OtherBlasTraits;
|
91
|
+
typedef typename OtherBlasTraits::DirectLinearAccessType ActualOtherType;
|
92
|
+
typedef typename internal::remove_all<ActualOtherType>::type _ActualOtherType;
|
93
|
+
typename internal::add_const_on_value_type<ActualOtherType>::type actualOther = OtherBlasTraits::extract(other.derived());
|
94
|
+
|
95
|
+
Scalar actualAlpha = alpha * OtherBlasTraits::extractScalarFactor(other.derived());
|
96
|
+
|
97
|
+
enum { IsRowMajor = (internal::traits<MatrixType>::Flags&RowMajorBit) ? 1 : 0 };
|
98
|
+
|
99
|
+
internal::general_matrix_matrix_triangular_product<Index,
|
100
|
+
Scalar, _ActualOtherType::Flags&RowMajorBit ? RowMajor : ColMajor, OtherBlasTraits::NeedToConjugate && NumTraits<Scalar>::IsComplex,
|
101
|
+
Scalar, _ActualOtherType::Flags&RowMajorBit ? ColMajor : RowMajor, (!OtherBlasTraits::NeedToConjugate) && NumTraits<Scalar>::IsComplex,
|
102
|
+
MatrixType::Flags&RowMajorBit ? RowMajor : ColMajor, UpLo>
|
103
|
+
::run(mat.cols(), actualOther.cols(),
|
104
|
+
&actualOther.coeffRef(0,0), actualOther.outerStride(), &actualOther.coeffRef(0,0), actualOther.outerStride(),
|
105
|
+
mat.data(), mat.outerStride(), actualAlpha);
|
106
|
+
}
|
107
|
+
};
|
108
|
+
|
109
|
+
// high level API
|
110
|
+
|
111
|
+
template<typename MatrixType, unsigned int UpLo>
|
112
|
+
template<typename DerivedU>
|
113
|
+
SelfAdjointView<MatrixType,UpLo>& SelfAdjointView<MatrixType,UpLo>
|
114
|
+
::rankUpdate(const MatrixBase<DerivedU>& u, const Scalar& alpha)
|
115
|
+
{
|
116
|
+
selfadjoint_product_selector<MatrixType,DerivedU,UpLo>::run(_expression().const_cast_derived(), u.derived(), alpha);
|
117
|
+
|
118
|
+
return *this;
|
119
|
+
}
|
120
|
+
|
121
|
+
} // end namespace Eigen
|
122
|
+
|
123
|
+
#endif // EIGEN_SELFADJOINT_PRODUCT_H
|
@@ -0,0 +1,93 @@
|
|
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_SELFADJOINTRANK2UPTADE_H
|
11
|
+
#define EIGEN_SELFADJOINTRANK2UPTADE_H
|
12
|
+
|
13
|
+
namespace Eigen {
|
14
|
+
|
15
|
+
namespace internal {
|
16
|
+
|
17
|
+
/* Optimized selfadjoint matrix += alpha * uv' + conj(alpha)*vu'
|
18
|
+
* It corresponds to the Level2 syr2 BLAS routine
|
19
|
+
*/
|
20
|
+
|
21
|
+
template<typename Scalar, typename Index, typename UType, typename VType, int UpLo>
|
22
|
+
struct selfadjoint_rank2_update_selector;
|
23
|
+
|
24
|
+
template<typename Scalar, typename Index, typename UType, typename VType>
|
25
|
+
struct selfadjoint_rank2_update_selector<Scalar,Index,UType,VType,Lower>
|
26
|
+
{
|
27
|
+
static void run(Scalar* mat, Index stride, const UType& u, const VType& v, const Scalar& alpha)
|
28
|
+
{
|
29
|
+
const Index size = u.size();
|
30
|
+
for (Index i=0; i<size; ++i)
|
31
|
+
{
|
32
|
+
Map<Matrix<Scalar,Dynamic,1> >(mat+stride*i+i, size-i) +=
|
33
|
+
(numext::conj(alpha) * numext::conj(u.coeff(i))) * v.tail(size-i)
|
34
|
+
+ (alpha * numext::conj(v.coeff(i))) * u.tail(size-i);
|
35
|
+
}
|
36
|
+
}
|
37
|
+
};
|
38
|
+
|
39
|
+
template<typename Scalar, typename Index, typename UType, typename VType>
|
40
|
+
struct selfadjoint_rank2_update_selector<Scalar,Index,UType,VType,Upper>
|
41
|
+
{
|
42
|
+
static void run(Scalar* mat, Index stride, const UType& u, const VType& v, const Scalar& alpha)
|
43
|
+
{
|
44
|
+
const Index size = u.size();
|
45
|
+
for (Index i=0; i<size; ++i)
|
46
|
+
Map<Matrix<Scalar,Dynamic,1> >(mat+stride*i, i+1) +=
|
47
|
+
(numext::conj(alpha) * numext::conj(u.coeff(i))) * v.head(i+1)
|
48
|
+
+ (alpha * numext::conj(v.coeff(i))) * u.head(i+1);
|
49
|
+
}
|
50
|
+
};
|
51
|
+
|
52
|
+
template<bool Cond, typename T> struct conj_expr_if
|
53
|
+
: conditional<!Cond, const T&,
|
54
|
+
CwiseUnaryOp<scalar_conjugate_op<typename traits<T>::Scalar>,T> > {};
|
55
|
+
|
56
|
+
} // end namespace internal
|
57
|
+
|
58
|
+
template<typename MatrixType, unsigned int UpLo>
|
59
|
+
template<typename DerivedU, typename DerivedV>
|
60
|
+
SelfAdjointView<MatrixType,UpLo>& SelfAdjointView<MatrixType,UpLo>
|
61
|
+
::rankUpdate(const MatrixBase<DerivedU>& u, const MatrixBase<DerivedV>& v, const Scalar& alpha)
|
62
|
+
{
|
63
|
+
typedef internal::blas_traits<DerivedU> UBlasTraits;
|
64
|
+
typedef typename UBlasTraits::DirectLinearAccessType ActualUType;
|
65
|
+
typedef typename internal::remove_all<ActualUType>::type _ActualUType;
|
66
|
+
typename internal::add_const_on_value_type<ActualUType>::type actualU = UBlasTraits::extract(u.derived());
|
67
|
+
|
68
|
+
typedef internal::blas_traits<DerivedV> VBlasTraits;
|
69
|
+
typedef typename VBlasTraits::DirectLinearAccessType ActualVType;
|
70
|
+
typedef typename internal::remove_all<ActualVType>::type _ActualVType;
|
71
|
+
typename internal::add_const_on_value_type<ActualVType>::type actualV = VBlasTraits::extract(v.derived());
|
72
|
+
|
73
|
+
// If MatrixType is row major, then we use the routine for lower triangular in the upper triangular case and
|
74
|
+
// vice versa, and take the complex conjugate of all coefficients and vector entries.
|
75
|
+
|
76
|
+
enum { IsRowMajor = (internal::traits<MatrixType>::Flags&RowMajorBit) ? 1 : 0 };
|
77
|
+
Scalar actualAlpha = alpha * UBlasTraits::extractScalarFactor(u.derived())
|
78
|
+
* numext::conj(VBlasTraits::extractScalarFactor(v.derived()));
|
79
|
+
if (IsRowMajor)
|
80
|
+
actualAlpha = numext::conj(actualAlpha);
|
81
|
+
|
82
|
+
internal::selfadjoint_rank2_update_selector<Scalar, Index,
|
83
|
+
typename internal::remove_all<typename internal::conj_expr_if<IsRowMajor ^ UBlasTraits::NeedToConjugate,_ActualUType>::type>::type,
|
84
|
+
typename internal::remove_all<typename internal::conj_expr_if<IsRowMajor ^ VBlasTraits::NeedToConjugate,_ActualVType>::type>::type,
|
85
|
+
(IsRowMajor ? int(UpLo==Upper ? Lower : Upper) : UpLo)>
|
86
|
+
::run(_expression().const_cast_derived().data(),_expression().outerStride(),actualU,actualV,actualAlpha);
|
87
|
+
|
88
|
+
return *this;
|
89
|
+
}
|
90
|
+
|
91
|
+
} // end namespace Eigen
|
92
|
+
|
93
|
+
#endif // EIGEN_SELFADJOINTRANK2UPTADE_H
|
@@ -0,0 +1,427 @@
|
|
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_MATRIX_MATRIX_H
|
11
|
+
#define EIGEN_TRIANGULAR_MATRIX_MATRIX_H
|
12
|
+
|
13
|
+
namespace Eigen {
|
14
|
+
|
15
|
+
namespace internal {
|
16
|
+
|
17
|
+
// template<typename Scalar, int mr, int StorageOrder, bool Conjugate, int Mode>
|
18
|
+
// struct gemm_pack_lhs_triangular
|
19
|
+
// {
|
20
|
+
// Matrix<Scalar,mr,mr,
|
21
|
+
// void operator()(Scalar* blockA, const EIGEN_RESTRICT Scalar* _lhs, int lhsStride, int depth, int rows)
|
22
|
+
// {
|
23
|
+
// conj_if<NumTraits<Scalar>::IsComplex && Conjugate> cj;
|
24
|
+
// const_blas_data_mapper<Scalar, StorageOrder> lhs(_lhs,lhsStride);
|
25
|
+
// int count = 0;
|
26
|
+
// const int peeled_mc = (rows/mr)*mr;
|
27
|
+
// for(int i=0; i<peeled_mc; i+=mr)
|
28
|
+
// {
|
29
|
+
// for(int k=0; k<depth; k++)
|
30
|
+
// for(int w=0; w<mr; w++)
|
31
|
+
// blockA[count++] = cj(lhs(i+w, k));
|
32
|
+
// }
|
33
|
+
// for(int i=peeled_mc; i<rows; i++)
|
34
|
+
// {
|
35
|
+
// for(int k=0; k<depth; k++)
|
36
|
+
// blockA[count++] = cj(lhs(i, k));
|
37
|
+
// }
|
38
|
+
// }
|
39
|
+
// };
|
40
|
+
|
41
|
+
/* Optimized triangular matrix * matrix (_TRMM++) product built on top of
|
42
|
+
* the general matrix matrix product.
|
43
|
+
*/
|
44
|
+
template <typename Scalar, typename Index,
|
45
|
+
int Mode, bool LhsIsTriangular,
|
46
|
+
int LhsStorageOrder, bool ConjugateLhs,
|
47
|
+
int RhsStorageOrder, bool ConjugateRhs,
|
48
|
+
int ResStorageOrder, int Version = Specialized>
|
49
|
+
struct product_triangular_matrix_matrix;
|
50
|
+
|
51
|
+
template <typename Scalar, typename Index,
|
52
|
+
int Mode, bool LhsIsTriangular,
|
53
|
+
int LhsStorageOrder, bool ConjugateLhs,
|
54
|
+
int RhsStorageOrder, bool ConjugateRhs, int Version>
|
55
|
+
struct product_triangular_matrix_matrix<Scalar,Index,Mode,LhsIsTriangular,
|
56
|
+
LhsStorageOrder,ConjugateLhs,
|
57
|
+
RhsStorageOrder,ConjugateRhs,RowMajor,Version>
|
58
|
+
{
|
59
|
+
static EIGEN_STRONG_INLINE void run(
|
60
|
+
Index rows, Index cols, Index depth,
|
61
|
+
const Scalar* lhs, Index lhsStride,
|
62
|
+
const Scalar* rhs, Index rhsStride,
|
63
|
+
Scalar* res, Index resStride,
|
64
|
+
const Scalar& alpha, level3_blocking<Scalar,Scalar>& blocking)
|
65
|
+
{
|
66
|
+
product_triangular_matrix_matrix<Scalar, Index,
|
67
|
+
(Mode&(UnitDiag|ZeroDiag)) | ((Mode&Upper) ? Lower : Upper),
|
68
|
+
(!LhsIsTriangular),
|
69
|
+
RhsStorageOrder==RowMajor ? ColMajor : RowMajor,
|
70
|
+
ConjugateRhs,
|
71
|
+
LhsStorageOrder==RowMajor ? ColMajor : RowMajor,
|
72
|
+
ConjugateLhs,
|
73
|
+
ColMajor>
|
74
|
+
::run(cols, rows, depth, rhs, rhsStride, lhs, lhsStride, res, resStride, alpha, blocking);
|
75
|
+
}
|
76
|
+
};
|
77
|
+
|
78
|
+
// implements col-major += alpha * op(triangular) * op(general)
|
79
|
+
template <typename Scalar, typename Index, int Mode,
|
80
|
+
int LhsStorageOrder, bool ConjugateLhs,
|
81
|
+
int RhsStorageOrder, bool ConjugateRhs, int Version>
|
82
|
+
struct product_triangular_matrix_matrix<Scalar,Index,Mode,true,
|
83
|
+
LhsStorageOrder,ConjugateLhs,
|
84
|
+
RhsStorageOrder,ConjugateRhs,ColMajor,Version>
|
85
|
+
{
|
86
|
+
|
87
|
+
typedef gebp_traits<Scalar,Scalar> Traits;
|
88
|
+
enum {
|
89
|
+
SmallPanelWidth = 2 * EIGEN_PLAIN_ENUM_MAX(Traits::mr,Traits::nr),
|
90
|
+
IsLower = (Mode&Lower) == Lower,
|
91
|
+
SetDiag = (Mode&(ZeroDiag|UnitDiag)) ? 0 : 1
|
92
|
+
};
|
93
|
+
|
94
|
+
static EIGEN_DONT_INLINE void run(
|
95
|
+
Index _rows, Index _cols, Index _depth,
|
96
|
+
const Scalar* _lhs, Index lhsStride,
|
97
|
+
const Scalar* _rhs, Index rhsStride,
|
98
|
+
Scalar* res, Index resStride,
|
99
|
+
const Scalar& alpha, level3_blocking<Scalar,Scalar>& blocking);
|
100
|
+
};
|
101
|
+
|
102
|
+
template <typename Scalar, typename Index, int Mode,
|
103
|
+
int LhsStorageOrder, bool ConjugateLhs,
|
104
|
+
int RhsStorageOrder, bool ConjugateRhs, int Version>
|
105
|
+
EIGEN_DONT_INLINE void product_triangular_matrix_matrix<Scalar,Index,Mode,true,
|
106
|
+
LhsStorageOrder,ConjugateLhs,
|
107
|
+
RhsStorageOrder,ConjugateRhs,ColMajor,Version>::run(
|
108
|
+
Index _rows, Index _cols, Index _depth,
|
109
|
+
const Scalar* _lhs, Index lhsStride,
|
110
|
+
const Scalar* _rhs, Index rhsStride,
|
111
|
+
Scalar* res, Index resStride,
|
112
|
+
const Scalar& alpha, level3_blocking<Scalar,Scalar>& blocking)
|
113
|
+
{
|
114
|
+
// strip zeros
|
115
|
+
Index diagSize = (std::min)(_rows,_depth);
|
116
|
+
Index rows = IsLower ? _rows : diagSize;
|
117
|
+
Index depth = IsLower ? diagSize : _depth;
|
118
|
+
Index cols = _cols;
|
119
|
+
|
120
|
+
const_blas_data_mapper<Scalar, Index, LhsStorageOrder> lhs(_lhs,lhsStride);
|
121
|
+
const_blas_data_mapper<Scalar, Index, RhsStorageOrder> rhs(_rhs,rhsStride);
|
122
|
+
|
123
|
+
Index kc = blocking.kc(); // cache block size along the K direction
|
124
|
+
Index mc = (std::min)(rows,blocking.mc()); // cache block size along the M direction
|
125
|
+
|
126
|
+
std::size_t sizeA = kc*mc;
|
127
|
+
std::size_t sizeB = kc*cols;
|
128
|
+
std::size_t sizeW = kc*Traits::WorkSpaceFactor;
|
129
|
+
|
130
|
+
ei_declare_aligned_stack_constructed_variable(Scalar, blockA, sizeA, blocking.blockA());
|
131
|
+
ei_declare_aligned_stack_constructed_variable(Scalar, blockB, sizeB, blocking.blockB());
|
132
|
+
ei_declare_aligned_stack_constructed_variable(Scalar, blockW, sizeW, blocking.blockW());
|
133
|
+
|
134
|
+
Matrix<Scalar,SmallPanelWidth,SmallPanelWidth,LhsStorageOrder> triangularBuffer;
|
135
|
+
triangularBuffer.setZero();
|
136
|
+
if((Mode&ZeroDiag)==ZeroDiag)
|
137
|
+
triangularBuffer.diagonal().setZero();
|
138
|
+
else
|
139
|
+
triangularBuffer.diagonal().setOnes();
|
140
|
+
|
141
|
+
gebp_kernel<Scalar, Scalar, Index, Traits::mr, Traits::nr, ConjugateLhs, ConjugateRhs> gebp_kernel;
|
142
|
+
gemm_pack_lhs<Scalar, Index, Traits::mr, Traits::LhsProgress, LhsStorageOrder> pack_lhs;
|
143
|
+
gemm_pack_rhs<Scalar, Index, Traits::nr,RhsStorageOrder> pack_rhs;
|
144
|
+
|
145
|
+
for(Index k2=IsLower ? depth : 0;
|
146
|
+
IsLower ? k2>0 : k2<depth;
|
147
|
+
IsLower ? k2-=kc : k2+=kc)
|
148
|
+
{
|
149
|
+
Index actual_kc = (std::min)(IsLower ? k2 : depth-k2, kc);
|
150
|
+
Index actual_k2 = IsLower ? k2-actual_kc : k2;
|
151
|
+
|
152
|
+
// align blocks with the end of the triangular part for trapezoidal lhs
|
153
|
+
if((!IsLower)&&(k2<rows)&&(k2+actual_kc>rows))
|
154
|
+
{
|
155
|
+
actual_kc = rows-k2;
|
156
|
+
k2 = k2+actual_kc-kc;
|
157
|
+
}
|
158
|
+
|
159
|
+
pack_rhs(blockB, &rhs(actual_k2,0), rhsStride, actual_kc, cols);
|
160
|
+
|
161
|
+
// the selected lhs's panel has to be split in three different parts:
|
162
|
+
// 1 - the part which is zero => skip it
|
163
|
+
// 2 - the diagonal block => special kernel
|
164
|
+
// 3 - the dense panel below (lower case) or above (upper case) the diagonal block => GEPP
|
165
|
+
|
166
|
+
// the block diagonal, if any:
|
167
|
+
if(IsLower || actual_k2<rows)
|
168
|
+
{
|
169
|
+
// for each small vertical panels of lhs
|
170
|
+
for (Index k1=0; k1<actual_kc; k1+=SmallPanelWidth)
|
171
|
+
{
|
172
|
+
Index actualPanelWidth = std::min<Index>(actual_kc-k1, SmallPanelWidth);
|
173
|
+
Index lengthTarget = IsLower ? actual_kc-k1-actualPanelWidth : k1;
|
174
|
+
Index startBlock = actual_k2+k1;
|
175
|
+
Index blockBOffset = k1;
|
176
|
+
|
177
|
+
// => GEBP with the micro triangular block
|
178
|
+
// The trick is to pack this micro block while filling the opposite triangular part with zeros.
|
179
|
+
// To this end we do an extra triangular copy to a small temporary buffer
|
180
|
+
for (Index k=0;k<actualPanelWidth;++k)
|
181
|
+
{
|
182
|
+
if (SetDiag)
|
183
|
+
triangularBuffer.coeffRef(k,k) = lhs(startBlock+k,startBlock+k);
|
184
|
+
for (Index i=IsLower ? k+1 : 0; IsLower ? i<actualPanelWidth : i<k; ++i)
|
185
|
+
triangularBuffer.coeffRef(i,k) = lhs(startBlock+i,startBlock+k);
|
186
|
+
}
|
187
|
+
pack_lhs(blockA, triangularBuffer.data(), triangularBuffer.outerStride(), actualPanelWidth, actualPanelWidth);
|
188
|
+
|
189
|
+
gebp_kernel(res+startBlock, resStride, blockA, blockB, actualPanelWidth, actualPanelWidth, cols, alpha,
|
190
|
+
actualPanelWidth, actual_kc, 0, blockBOffset, blockW);
|
191
|
+
|
192
|
+
// GEBP with remaining micro panel
|
193
|
+
if (lengthTarget>0)
|
194
|
+
{
|
195
|
+
Index startTarget = IsLower ? actual_k2+k1+actualPanelWidth : actual_k2;
|
196
|
+
|
197
|
+
pack_lhs(blockA, &lhs(startTarget,startBlock), lhsStride, actualPanelWidth, lengthTarget);
|
198
|
+
|
199
|
+
gebp_kernel(res+startTarget, resStride, blockA, blockB, lengthTarget, actualPanelWidth, cols, alpha,
|
200
|
+
actualPanelWidth, actual_kc, 0, blockBOffset, blockW);
|
201
|
+
}
|
202
|
+
}
|
203
|
+
}
|
204
|
+
// the part below (lower case) or above (upper case) the diagonal => GEPP
|
205
|
+
{
|
206
|
+
Index start = IsLower ? k2 : 0;
|
207
|
+
Index end = IsLower ? rows : (std::min)(actual_k2,rows);
|
208
|
+
for(Index i2=start; i2<end; i2+=mc)
|
209
|
+
{
|
210
|
+
const Index actual_mc = (std::min)(i2+mc,end)-i2;
|
211
|
+
gemm_pack_lhs<Scalar, Index, Traits::mr,Traits::LhsProgress, LhsStorageOrder,false>()
|
212
|
+
(blockA, &lhs(i2, actual_k2), lhsStride, actual_kc, actual_mc);
|
213
|
+
|
214
|
+
gebp_kernel(res+i2, resStride, blockA, blockB, actual_mc, actual_kc, cols, alpha, -1, -1, 0, 0, blockW);
|
215
|
+
}
|
216
|
+
}
|
217
|
+
}
|
218
|
+
}
|
219
|
+
|
220
|
+
// implements col-major += alpha * op(general) * op(triangular)
|
221
|
+
template <typename Scalar, typename Index, int Mode,
|
222
|
+
int LhsStorageOrder, bool ConjugateLhs,
|
223
|
+
int RhsStorageOrder, bool ConjugateRhs, int Version>
|
224
|
+
struct product_triangular_matrix_matrix<Scalar,Index,Mode,false,
|
225
|
+
LhsStorageOrder,ConjugateLhs,
|
226
|
+
RhsStorageOrder,ConjugateRhs,ColMajor,Version>
|
227
|
+
{
|
228
|
+
typedef gebp_traits<Scalar,Scalar> Traits;
|
229
|
+
enum {
|
230
|
+
SmallPanelWidth = EIGEN_PLAIN_ENUM_MAX(Traits::mr,Traits::nr),
|
231
|
+
IsLower = (Mode&Lower) == Lower,
|
232
|
+
SetDiag = (Mode&(ZeroDiag|UnitDiag)) ? 0 : 1
|
233
|
+
};
|
234
|
+
|
235
|
+
static EIGEN_DONT_INLINE void run(
|
236
|
+
Index _rows, Index _cols, Index _depth,
|
237
|
+
const Scalar* _lhs, Index lhsStride,
|
238
|
+
const Scalar* _rhs, Index rhsStride,
|
239
|
+
Scalar* res, Index resStride,
|
240
|
+
const Scalar& alpha, level3_blocking<Scalar,Scalar>& blocking);
|
241
|
+
};
|
242
|
+
|
243
|
+
template <typename Scalar, typename Index, int Mode,
|
244
|
+
int LhsStorageOrder, bool ConjugateLhs,
|
245
|
+
int RhsStorageOrder, bool ConjugateRhs, int Version>
|
246
|
+
EIGEN_DONT_INLINE void product_triangular_matrix_matrix<Scalar,Index,Mode,false,
|
247
|
+
LhsStorageOrder,ConjugateLhs,
|
248
|
+
RhsStorageOrder,ConjugateRhs,ColMajor,Version>::run(
|
249
|
+
Index _rows, Index _cols, Index _depth,
|
250
|
+
const Scalar* _lhs, Index lhsStride,
|
251
|
+
const Scalar* _rhs, Index rhsStride,
|
252
|
+
Scalar* res, Index resStride,
|
253
|
+
const Scalar& alpha, level3_blocking<Scalar,Scalar>& blocking)
|
254
|
+
{
|
255
|
+
// strip zeros
|
256
|
+
Index diagSize = (std::min)(_cols,_depth);
|
257
|
+
Index rows = _rows;
|
258
|
+
Index depth = IsLower ? _depth : diagSize;
|
259
|
+
Index cols = IsLower ? diagSize : _cols;
|
260
|
+
|
261
|
+
const_blas_data_mapper<Scalar, Index, LhsStorageOrder> lhs(_lhs,lhsStride);
|
262
|
+
const_blas_data_mapper<Scalar, Index, RhsStorageOrder> rhs(_rhs,rhsStride);
|
263
|
+
|
264
|
+
Index kc = blocking.kc(); // cache block size along the K direction
|
265
|
+
Index mc = (std::min)(rows,blocking.mc()); // cache block size along the M direction
|
266
|
+
|
267
|
+
std::size_t sizeA = kc*mc;
|
268
|
+
std::size_t sizeB = kc*cols;
|
269
|
+
std::size_t sizeW = kc*Traits::WorkSpaceFactor;
|
270
|
+
|
271
|
+
ei_declare_aligned_stack_constructed_variable(Scalar, blockA, sizeA, blocking.blockA());
|
272
|
+
ei_declare_aligned_stack_constructed_variable(Scalar, blockB, sizeB, blocking.blockB());
|
273
|
+
ei_declare_aligned_stack_constructed_variable(Scalar, blockW, sizeW, blocking.blockW());
|
274
|
+
|
275
|
+
Matrix<Scalar,SmallPanelWidth,SmallPanelWidth,RhsStorageOrder> triangularBuffer;
|
276
|
+
triangularBuffer.setZero();
|
277
|
+
if((Mode&ZeroDiag)==ZeroDiag)
|
278
|
+
triangularBuffer.diagonal().setZero();
|
279
|
+
else
|
280
|
+
triangularBuffer.diagonal().setOnes();
|
281
|
+
|
282
|
+
gebp_kernel<Scalar, Scalar, Index, Traits::mr, Traits::nr, ConjugateLhs, ConjugateRhs> gebp_kernel;
|
283
|
+
gemm_pack_lhs<Scalar, Index, Traits::mr, Traits::LhsProgress, LhsStorageOrder> pack_lhs;
|
284
|
+
gemm_pack_rhs<Scalar, Index, Traits::nr,RhsStorageOrder> pack_rhs;
|
285
|
+
gemm_pack_rhs<Scalar, Index, Traits::nr,RhsStorageOrder,false,true> pack_rhs_panel;
|
286
|
+
|
287
|
+
for(Index k2=IsLower ? 0 : depth;
|
288
|
+
IsLower ? k2<depth : k2>0;
|
289
|
+
IsLower ? k2+=kc : k2-=kc)
|
290
|
+
{
|
291
|
+
Index actual_kc = (std::min)(IsLower ? depth-k2 : k2, kc);
|
292
|
+
Index actual_k2 = IsLower ? k2 : k2-actual_kc;
|
293
|
+
|
294
|
+
// align blocks with the end of the triangular part for trapezoidal rhs
|
295
|
+
if(IsLower && (k2<cols) && (actual_k2+actual_kc>cols))
|
296
|
+
{
|
297
|
+
actual_kc = cols-k2;
|
298
|
+
k2 = actual_k2 + actual_kc - kc;
|
299
|
+
}
|
300
|
+
|
301
|
+
// remaining size
|
302
|
+
Index rs = IsLower ? (std::min)(cols,actual_k2) : cols - k2;
|
303
|
+
// size of the triangular part
|
304
|
+
Index ts = (IsLower && actual_k2>=cols) ? 0 : actual_kc;
|
305
|
+
|
306
|
+
Scalar* geb = blockB+ts*ts;
|
307
|
+
|
308
|
+
pack_rhs(geb, &rhs(actual_k2,IsLower ? 0 : k2), rhsStride, actual_kc, rs);
|
309
|
+
|
310
|
+
// pack the triangular part of the rhs padding the unrolled blocks with zeros
|
311
|
+
if(ts>0)
|
312
|
+
{
|
313
|
+
for (Index j2=0; j2<actual_kc; j2+=SmallPanelWidth)
|
314
|
+
{
|
315
|
+
Index actualPanelWidth = std::min<Index>(actual_kc-j2, SmallPanelWidth);
|
316
|
+
Index actual_j2 = actual_k2 + j2;
|
317
|
+
Index panelOffset = IsLower ? j2+actualPanelWidth : 0;
|
318
|
+
Index panelLength = IsLower ? actual_kc-j2-actualPanelWidth : j2;
|
319
|
+
// general part
|
320
|
+
pack_rhs_panel(blockB+j2*actual_kc,
|
321
|
+
&rhs(actual_k2+panelOffset, actual_j2), rhsStride,
|
322
|
+
panelLength, actualPanelWidth,
|
323
|
+
actual_kc, panelOffset);
|
324
|
+
|
325
|
+
// append the triangular part via a temporary buffer
|
326
|
+
for (Index j=0;j<actualPanelWidth;++j)
|
327
|
+
{
|
328
|
+
if (SetDiag)
|
329
|
+
triangularBuffer.coeffRef(j,j) = rhs(actual_j2+j,actual_j2+j);
|
330
|
+
for (Index k=IsLower ? j+1 : 0; IsLower ? k<actualPanelWidth : k<j; ++k)
|
331
|
+
triangularBuffer.coeffRef(k,j) = rhs(actual_j2+k,actual_j2+j);
|
332
|
+
}
|
333
|
+
|
334
|
+
pack_rhs_panel(blockB+j2*actual_kc,
|
335
|
+
triangularBuffer.data(), triangularBuffer.outerStride(),
|
336
|
+
actualPanelWidth, actualPanelWidth,
|
337
|
+
actual_kc, j2);
|
338
|
+
}
|
339
|
+
}
|
340
|
+
|
341
|
+
for (Index i2=0; i2<rows; i2+=mc)
|
342
|
+
{
|
343
|
+
const Index actual_mc = (std::min)(mc,rows-i2);
|
344
|
+
pack_lhs(blockA, &lhs(i2, actual_k2), lhsStride, actual_kc, actual_mc);
|
345
|
+
|
346
|
+
// triangular kernel
|
347
|
+
if(ts>0)
|
348
|
+
{
|
349
|
+
for (Index j2=0; j2<actual_kc; j2+=SmallPanelWidth)
|
350
|
+
{
|
351
|
+
Index actualPanelWidth = std::min<Index>(actual_kc-j2, SmallPanelWidth);
|
352
|
+
Index panelLength = IsLower ? actual_kc-j2 : j2+actualPanelWidth;
|
353
|
+
Index blockOffset = IsLower ? j2 : 0;
|
354
|
+
|
355
|
+
gebp_kernel(res+i2+(actual_k2+j2)*resStride, resStride,
|
356
|
+
blockA, blockB+j2*actual_kc,
|
357
|
+
actual_mc, panelLength, actualPanelWidth,
|
358
|
+
alpha,
|
359
|
+
actual_kc, actual_kc, // strides
|
360
|
+
blockOffset, blockOffset,// offsets
|
361
|
+
blockW); // workspace
|
362
|
+
}
|
363
|
+
}
|
364
|
+
gebp_kernel(res+i2+(IsLower ? 0 : k2)*resStride, resStride,
|
365
|
+
blockA, geb, actual_mc, actual_kc, rs,
|
366
|
+
alpha,
|
367
|
+
-1, -1, 0, 0, blockW);
|
368
|
+
}
|
369
|
+
}
|
370
|
+
}
|
371
|
+
|
372
|
+
/***************************************************************************
|
373
|
+
* Wrapper to product_triangular_matrix_matrix
|
374
|
+
***************************************************************************/
|
375
|
+
|
376
|
+
template<int Mode, bool LhsIsTriangular, typename Lhs, typename Rhs>
|
377
|
+
struct traits<TriangularProduct<Mode,LhsIsTriangular,Lhs,false,Rhs,false> >
|
378
|
+
: traits<ProductBase<TriangularProduct<Mode,LhsIsTriangular,Lhs,false,Rhs,false>, Lhs, Rhs> >
|
379
|
+
{};
|
380
|
+
|
381
|
+
} // end namespace internal
|
382
|
+
|
383
|
+
template<int Mode, bool LhsIsTriangular, typename Lhs, typename Rhs>
|
384
|
+
struct TriangularProduct<Mode,LhsIsTriangular,Lhs,false,Rhs,false>
|
385
|
+
: public ProductBase<TriangularProduct<Mode,LhsIsTriangular,Lhs,false,Rhs,false>, Lhs, Rhs >
|
386
|
+
{
|
387
|
+
EIGEN_PRODUCT_PUBLIC_INTERFACE(TriangularProduct)
|
388
|
+
|
389
|
+
TriangularProduct(const Lhs& lhs, const Rhs& rhs) : Base(lhs,rhs) {}
|
390
|
+
|
391
|
+
template<typename Dest> void scaleAndAddTo(Dest& dst, const Scalar& alpha) const
|
392
|
+
{
|
393
|
+
typename internal::add_const_on_value_type<ActualLhsType>::type lhs = LhsBlasTraits::extract(m_lhs);
|
394
|
+
typename internal::add_const_on_value_type<ActualRhsType>::type rhs = RhsBlasTraits::extract(m_rhs);
|
395
|
+
|
396
|
+
Scalar actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(m_lhs)
|
397
|
+
* RhsBlasTraits::extractScalarFactor(m_rhs);
|
398
|
+
|
399
|
+
typedef internal::gemm_blocking_space<(Dest::Flags&RowMajorBit) ? RowMajor : ColMajor,Scalar,Scalar,
|
400
|
+
Lhs::MaxRowsAtCompileTime, Rhs::MaxColsAtCompileTime, Lhs::MaxColsAtCompileTime,4> BlockingType;
|
401
|
+
|
402
|
+
enum { IsLower = (Mode&Lower) == Lower };
|
403
|
+
Index stripedRows = ((!LhsIsTriangular) || (IsLower)) ? lhs.rows() : (std::min)(lhs.rows(),lhs.cols());
|
404
|
+
Index stripedCols = ((LhsIsTriangular) || (!IsLower)) ? rhs.cols() : (std::min)(rhs.cols(),rhs.rows());
|
405
|
+
Index stripedDepth = LhsIsTriangular ? ((!IsLower) ? lhs.cols() : (std::min)(lhs.cols(),lhs.rows()))
|
406
|
+
: ((IsLower) ? rhs.rows() : (std::min)(rhs.rows(),rhs.cols()));
|
407
|
+
|
408
|
+
BlockingType blocking(stripedRows, stripedCols, stripedDepth);
|
409
|
+
|
410
|
+
internal::product_triangular_matrix_matrix<Scalar, Index,
|
411
|
+
Mode, LhsIsTriangular,
|
412
|
+
(internal::traits<_ActualLhsType>::Flags&RowMajorBit) ? RowMajor : ColMajor, LhsBlasTraits::NeedToConjugate,
|
413
|
+
(internal::traits<_ActualRhsType>::Flags&RowMajorBit) ? RowMajor : ColMajor, RhsBlasTraits::NeedToConjugate,
|
414
|
+
(internal::traits<Dest >::Flags&RowMajorBit) ? RowMajor : ColMajor>
|
415
|
+
::run(
|
416
|
+
stripedRows, stripedCols, stripedDepth, // sizes
|
417
|
+
&lhs.coeffRef(0,0), lhs.outerStride(), // lhs info
|
418
|
+
&rhs.coeffRef(0,0), rhs.outerStride(), // rhs info
|
419
|
+
&dst.coeffRef(0,0), dst.outerStride(), // result info
|
420
|
+
actualAlpha, blocking
|
421
|
+
);
|
422
|
+
}
|
423
|
+
};
|
424
|
+
|
425
|
+
} // end namespace Eigen
|
426
|
+
|
427
|
+
#endif // EIGEN_TRIANGULAR_MATRIX_MATRIX_H
|