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,206 @@
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
2
|
+
// for linear algebra.
|
3
|
+
//
|
4
|
+
// Copyright (C) 2012 Désiré Nuentsa-Wakam <desire.nuentsa_wakam@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
|
+
|
11
|
+
/*
|
12
|
+
|
13
|
+
* NOTE: This file is the modified version of sp_coletree.c file in SuperLU
|
14
|
+
|
15
|
+
* -- SuperLU routine (version 3.1) --
|
16
|
+
* Univ. of California Berkeley, Xerox Palo Alto Research Center,
|
17
|
+
* and Lawrence Berkeley National Lab.
|
18
|
+
* August 1, 2008
|
19
|
+
*
|
20
|
+
* Copyright (c) 1994 by Xerox Corporation. All rights reserved.
|
21
|
+
*
|
22
|
+
* THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
|
23
|
+
* EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
|
24
|
+
*
|
25
|
+
* Permission is hereby granted to use or copy this program for any
|
26
|
+
* purpose, provided the above notices are retained on all copies.
|
27
|
+
* Permission to modify the code and to distribute modified code is
|
28
|
+
* granted, provided the above notices are retained, and a notice that
|
29
|
+
* the code was modified is included with the above copyright notice.
|
30
|
+
*/
|
31
|
+
#ifndef SPARSE_COLETREE_H
|
32
|
+
#define SPARSE_COLETREE_H
|
33
|
+
|
34
|
+
namespace Eigen {
|
35
|
+
|
36
|
+
namespace internal {
|
37
|
+
|
38
|
+
/** Find the root of the tree/set containing the vertex i : Use Path halving */
|
39
|
+
template<typename Index, typename IndexVector>
|
40
|
+
Index etree_find (Index i, IndexVector& pp)
|
41
|
+
{
|
42
|
+
Index p = pp(i); // Parent
|
43
|
+
Index gp = pp(p); // Grand parent
|
44
|
+
while (gp != p)
|
45
|
+
{
|
46
|
+
pp(i) = gp; // Parent pointer on find path is changed to former grand parent
|
47
|
+
i = gp;
|
48
|
+
p = pp(i);
|
49
|
+
gp = pp(p);
|
50
|
+
}
|
51
|
+
return p;
|
52
|
+
}
|
53
|
+
|
54
|
+
/** Compute the column elimination tree of a sparse matrix
|
55
|
+
* \param mat The matrix in column-major format.
|
56
|
+
* \param parent The elimination tree
|
57
|
+
* \param firstRowElt The column index of the first element in each row
|
58
|
+
* \param perm The permutation to apply to the column of \b mat
|
59
|
+
*/
|
60
|
+
template <typename MatrixType, typename IndexVector>
|
61
|
+
int coletree(const MatrixType& mat, IndexVector& parent, IndexVector& firstRowElt, typename MatrixType::Index *perm=0)
|
62
|
+
{
|
63
|
+
typedef typename MatrixType::Index Index;
|
64
|
+
Index nc = mat.cols(); // Number of columns
|
65
|
+
Index m = mat.rows();
|
66
|
+
Index diagSize = (std::min)(nc,m);
|
67
|
+
IndexVector root(nc); // root of subtree of etree
|
68
|
+
root.setZero();
|
69
|
+
IndexVector pp(nc); // disjoint sets
|
70
|
+
pp.setZero(); // Initialize disjoint sets
|
71
|
+
parent.resize(mat.cols());
|
72
|
+
//Compute first nonzero column in each row
|
73
|
+
Index row,col;
|
74
|
+
firstRowElt.resize(m);
|
75
|
+
firstRowElt.setConstant(nc);
|
76
|
+
firstRowElt.segment(0, diagSize).setLinSpaced(diagSize, 0, diagSize-1);
|
77
|
+
bool found_diag;
|
78
|
+
for (col = 0; col < nc; col++)
|
79
|
+
{
|
80
|
+
Index pcol = col;
|
81
|
+
if(perm) pcol = perm[col];
|
82
|
+
for (typename MatrixType::InnerIterator it(mat, pcol); it; ++it)
|
83
|
+
{
|
84
|
+
row = it.row();
|
85
|
+
firstRowElt(row) = (std::min)(firstRowElt(row), col);
|
86
|
+
}
|
87
|
+
}
|
88
|
+
/* Compute etree by Liu's algorithm for symmetric matrices,
|
89
|
+
except use (firstRowElt[r],c) in place of an edge (r,c) of A.
|
90
|
+
Thus each row clique in A'*A is replaced by a star
|
91
|
+
centered at its first vertex, which has the same fill. */
|
92
|
+
Index rset, cset, rroot;
|
93
|
+
for (col = 0; col < nc; col++)
|
94
|
+
{
|
95
|
+
found_diag = col>=m;
|
96
|
+
pp(col) = col;
|
97
|
+
cset = col;
|
98
|
+
root(cset) = col;
|
99
|
+
parent(col) = nc;
|
100
|
+
/* The diagonal element is treated here even if it does not exist in the matrix
|
101
|
+
* hence the loop is executed once more */
|
102
|
+
Index pcol = col;
|
103
|
+
if(perm) pcol = perm[col];
|
104
|
+
for (typename MatrixType::InnerIterator it(mat, pcol); it||!found_diag; ++it)
|
105
|
+
{ // A sequence of interleaved find and union is performed
|
106
|
+
Index i = col;
|
107
|
+
if(it) i = it.index();
|
108
|
+
if (i == col) found_diag = true;
|
109
|
+
|
110
|
+
row = firstRowElt(i);
|
111
|
+
if (row >= col) continue;
|
112
|
+
rset = internal::etree_find(row, pp); // Find the name of the set containing row
|
113
|
+
rroot = root(rset);
|
114
|
+
if (rroot != col)
|
115
|
+
{
|
116
|
+
parent(rroot) = col;
|
117
|
+
pp(cset) = rset;
|
118
|
+
cset = rset;
|
119
|
+
root(cset) = col;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
}
|
123
|
+
return 0;
|
124
|
+
}
|
125
|
+
|
126
|
+
/**
|
127
|
+
* Depth-first search from vertex n. No recursion.
|
128
|
+
* This routine was contributed by Cédric Doucet, CEDRAT Group, Meylan, France.
|
129
|
+
*/
|
130
|
+
template <typename Index, typename IndexVector>
|
131
|
+
void nr_etdfs (Index n, IndexVector& parent, IndexVector& first_kid, IndexVector& next_kid, IndexVector& post, Index postnum)
|
132
|
+
{
|
133
|
+
Index current = n, first, next;
|
134
|
+
while (postnum != n)
|
135
|
+
{
|
136
|
+
// No kid for the current node
|
137
|
+
first = first_kid(current);
|
138
|
+
|
139
|
+
// no kid for the current node
|
140
|
+
if (first == -1)
|
141
|
+
{
|
142
|
+
// Numbering this node because it has no kid
|
143
|
+
post(current) = postnum++;
|
144
|
+
|
145
|
+
// looking for the next kid
|
146
|
+
next = next_kid(current);
|
147
|
+
while (next == -1)
|
148
|
+
{
|
149
|
+
// No more kids : back to the parent node
|
150
|
+
current = parent(current);
|
151
|
+
// numbering the parent node
|
152
|
+
post(current) = postnum++;
|
153
|
+
|
154
|
+
// Get the next kid
|
155
|
+
next = next_kid(current);
|
156
|
+
}
|
157
|
+
// stopping criterion
|
158
|
+
if (postnum == n+1) return;
|
159
|
+
|
160
|
+
// Updating current node
|
161
|
+
current = next;
|
162
|
+
}
|
163
|
+
else
|
164
|
+
{
|
165
|
+
current = first;
|
166
|
+
}
|
167
|
+
}
|
168
|
+
}
|
169
|
+
|
170
|
+
|
171
|
+
/**
|
172
|
+
* \brief Post order a tree
|
173
|
+
* \param n the number of nodes
|
174
|
+
* \param parent Input tree
|
175
|
+
* \param post postordered tree
|
176
|
+
*/
|
177
|
+
template <typename Index, typename IndexVector>
|
178
|
+
void treePostorder(Index n, IndexVector& parent, IndexVector& post)
|
179
|
+
{
|
180
|
+
IndexVector first_kid, next_kid; // Linked list of children
|
181
|
+
Index postnum;
|
182
|
+
// Allocate storage for working arrays and results
|
183
|
+
first_kid.resize(n+1);
|
184
|
+
next_kid.setZero(n+1);
|
185
|
+
post.setZero(n+1);
|
186
|
+
|
187
|
+
// Set up structure describing children
|
188
|
+
Index v, dad;
|
189
|
+
first_kid.setConstant(-1);
|
190
|
+
for (v = n-1; v >= 0; v--)
|
191
|
+
{
|
192
|
+
dad = parent(v);
|
193
|
+
next_kid(v) = first_kid(dad);
|
194
|
+
first_kid(dad) = v;
|
195
|
+
}
|
196
|
+
|
197
|
+
// Depth-first search from dummy root vertex #n
|
198
|
+
postnum = 0;
|
199
|
+
internal::nr_etdfs(n, parent, first_kid, next_kid, post, postnum);
|
200
|
+
}
|
201
|
+
|
202
|
+
} // end namespace internal
|
203
|
+
|
204
|
+
} // end namespace Eigen
|
205
|
+
|
206
|
+
#endif // SPARSE_COLETREE_H
|
@@ -0,0 +1,325 @@
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
2
|
+
// for linear algebra.
|
3
|
+
//
|
4
|
+
// Copyright (C) 2008 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_SPARSE_CWISE_BINARY_OP_H
|
11
|
+
#define EIGEN_SPARSE_CWISE_BINARY_OP_H
|
12
|
+
|
13
|
+
namespace Eigen {
|
14
|
+
|
15
|
+
// Here we have to handle 3 cases:
|
16
|
+
// 1 - sparse op dense
|
17
|
+
// 2 - dense op sparse
|
18
|
+
// 3 - sparse op sparse
|
19
|
+
// We also need to implement a 4th iterator for:
|
20
|
+
// 4 - dense op dense
|
21
|
+
// Finally, we also need to distinguish between the product and other operations :
|
22
|
+
// configuration returned mode
|
23
|
+
// 1 - sparse op dense product sparse
|
24
|
+
// generic dense
|
25
|
+
// 2 - dense op sparse product sparse
|
26
|
+
// generic dense
|
27
|
+
// 3 - sparse op sparse product sparse
|
28
|
+
// generic sparse
|
29
|
+
// 4 - dense op dense product dense
|
30
|
+
// generic dense
|
31
|
+
|
32
|
+
namespace internal {
|
33
|
+
|
34
|
+
template<> struct promote_storage_type<Dense,Sparse>
|
35
|
+
{ typedef Sparse ret; };
|
36
|
+
|
37
|
+
template<> struct promote_storage_type<Sparse,Dense>
|
38
|
+
{ typedef Sparse ret; };
|
39
|
+
|
40
|
+
template<typename BinaryOp, typename Lhs, typename Rhs, typename Derived,
|
41
|
+
typename _LhsStorageMode = typename traits<Lhs>::StorageKind,
|
42
|
+
typename _RhsStorageMode = typename traits<Rhs>::StorageKind>
|
43
|
+
class sparse_cwise_binary_op_inner_iterator_selector;
|
44
|
+
|
45
|
+
} // end namespace internal
|
46
|
+
|
47
|
+
template<typename BinaryOp, typename Lhs, typename Rhs>
|
48
|
+
class CwiseBinaryOpImpl<BinaryOp, Lhs, Rhs, Sparse>
|
49
|
+
: public SparseMatrixBase<CwiseBinaryOp<BinaryOp, Lhs, Rhs> >
|
50
|
+
{
|
51
|
+
public:
|
52
|
+
class InnerIterator;
|
53
|
+
class ReverseInnerIterator;
|
54
|
+
typedef CwiseBinaryOp<BinaryOp, Lhs, Rhs> Derived;
|
55
|
+
EIGEN_SPARSE_PUBLIC_INTERFACE(Derived)
|
56
|
+
CwiseBinaryOpImpl()
|
57
|
+
{
|
58
|
+
typedef typename internal::traits<Lhs>::StorageKind LhsStorageKind;
|
59
|
+
typedef typename internal::traits<Rhs>::StorageKind RhsStorageKind;
|
60
|
+
EIGEN_STATIC_ASSERT((
|
61
|
+
(!internal::is_same<LhsStorageKind,RhsStorageKind>::value)
|
62
|
+
|| ((Lhs::Flags&RowMajorBit) == (Rhs::Flags&RowMajorBit))),
|
63
|
+
THE_STORAGE_ORDER_OF_BOTH_SIDES_MUST_MATCH);
|
64
|
+
}
|
65
|
+
};
|
66
|
+
|
67
|
+
template<typename BinaryOp, typename Lhs, typename Rhs>
|
68
|
+
class CwiseBinaryOpImpl<BinaryOp,Lhs,Rhs,Sparse>::InnerIterator
|
69
|
+
: public internal::sparse_cwise_binary_op_inner_iterator_selector<BinaryOp,Lhs,Rhs,typename CwiseBinaryOpImpl<BinaryOp,Lhs,Rhs,Sparse>::InnerIterator>
|
70
|
+
{
|
71
|
+
public:
|
72
|
+
typedef typename Lhs::Index Index;
|
73
|
+
typedef internal::sparse_cwise_binary_op_inner_iterator_selector<
|
74
|
+
BinaryOp,Lhs,Rhs, InnerIterator> Base;
|
75
|
+
|
76
|
+
// NOTE: we have to prefix Index by "typename Lhs::" to avoid an ICE with VC11
|
77
|
+
EIGEN_STRONG_INLINE InnerIterator(const CwiseBinaryOpImpl& binOp, typename Lhs::Index outer)
|
78
|
+
: Base(binOp.derived(),outer)
|
79
|
+
{}
|
80
|
+
};
|
81
|
+
|
82
|
+
/***************************************************************************
|
83
|
+
* Implementation of inner-iterators
|
84
|
+
***************************************************************************/
|
85
|
+
|
86
|
+
// template<typename T> struct internal::func_is_conjunction { enum { ret = false }; };
|
87
|
+
// template<typename T> struct internal::func_is_conjunction<internal::scalar_product_op<T> > { enum { ret = true }; };
|
88
|
+
|
89
|
+
// TODO generalize the internal::scalar_product_op specialization to all conjunctions if any !
|
90
|
+
|
91
|
+
namespace internal {
|
92
|
+
|
93
|
+
// sparse - sparse (generic)
|
94
|
+
template<typename BinaryOp, typename Lhs, typename Rhs, typename Derived>
|
95
|
+
class sparse_cwise_binary_op_inner_iterator_selector<BinaryOp, Lhs, Rhs, Derived, Sparse, Sparse>
|
96
|
+
{
|
97
|
+
typedef CwiseBinaryOp<BinaryOp, Lhs, Rhs> CwiseBinaryXpr;
|
98
|
+
typedef typename traits<CwiseBinaryXpr>::Scalar Scalar;
|
99
|
+
typedef typename traits<CwiseBinaryXpr>::_LhsNested _LhsNested;
|
100
|
+
typedef typename traits<CwiseBinaryXpr>::_RhsNested _RhsNested;
|
101
|
+
typedef typename _LhsNested::InnerIterator LhsIterator;
|
102
|
+
typedef typename _RhsNested::InnerIterator RhsIterator;
|
103
|
+
typedef typename Lhs::Index Index;
|
104
|
+
|
105
|
+
public:
|
106
|
+
|
107
|
+
EIGEN_STRONG_INLINE sparse_cwise_binary_op_inner_iterator_selector(const CwiseBinaryXpr& xpr, Index outer)
|
108
|
+
: m_lhsIter(xpr.lhs(),outer), m_rhsIter(xpr.rhs(),outer), m_functor(xpr.functor())
|
109
|
+
{
|
110
|
+
this->operator++();
|
111
|
+
}
|
112
|
+
|
113
|
+
EIGEN_STRONG_INLINE Derived& operator++()
|
114
|
+
{
|
115
|
+
if (m_lhsIter && m_rhsIter && (m_lhsIter.index() == m_rhsIter.index()))
|
116
|
+
{
|
117
|
+
m_id = m_lhsIter.index();
|
118
|
+
m_value = m_functor(m_lhsIter.value(), m_rhsIter.value());
|
119
|
+
++m_lhsIter;
|
120
|
+
++m_rhsIter;
|
121
|
+
}
|
122
|
+
else if (m_lhsIter && (!m_rhsIter || (m_lhsIter.index() < m_rhsIter.index())))
|
123
|
+
{
|
124
|
+
m_id = m_lhsIter.index();
|
125
|
+
m_value = m_functor(m_lhsIter.value(), Scalar(0));
|
126
|
+
++m_lhsIter;
|
127
|
+
}
|
128
|
+
else if (m_rhsIter && (!m_lhsIter || (m_lhsIter.index() > m_rhsIter.index())))
|
129
|
+
{
|
130
|
+
m_id = m_rhsIter.index();
|
131
|
+
m_value = m_functor(Scalar(0), m_rhsIter.value());
|
132
|
+
++m_rhsIter;
|
133
|
+
}
|
134
|
+
else
|
135
|
+
{
|
136
|
+
m_value = 0; // this is to avoid a compilation warning
|
137
|
+
m_id = -1;
|
138
|
+
}
|
139
|
+
return *static_cast<Derived*>(this);
|
140
|
+
}
|
141
|
+
|
142
|
+
EIGEN_STRONG_INLINE Scalar value() const { return m_value; }
|
143
|
+
|
144
|
+
EIGEN_STRONG_INLINE Index index() const { return m_id; }
|
145
|
+
EIGEN_STRONG_INLINE Index row() const { return Lhs::IsRowMajor ? m_lhsIter.row() : index(); }
|
146
|
+
EIGEN_STRONG_INLINE Index col() const { return Lhs::IsRowMajor ? index() : m_lhsIter.col(); }
|
147
|
+
|
148
|
+
EIGEN_STRONG_INLINE operator bool() const { return m_id>=0; }
|
149
|
+
|
150
|
+
protected:
|
151
|
+
LhsIterator m_lhsIter;
|
152
|
+
RhsIterator m_rhsIter;
|
153
|
+
const BinaryOp& m_functor;
|
154
|
+
Scalar m_value;
|
155
|
+
Index m_id;
|
156
|
+
};
|
157
|
+
|
158
|
+
// sparse - sparse (product)
|
159
|
+
template<typename T, typename Lhs, typename Rhs, typename Derived>
|
160
|
+
class sparse_cwise_binary_op_inner_iterator_selector<scalar_product_op<T>, Lhs, Rhs, Derived, Sparse, Sparse>
|
161
|
+
{
|
162
|
+
typedef scalar_product_op<T> BinaryFunc;
|
163
|
+
typedef CwiseBinaryOp<BinaryFunc, Lhs, Rhs> CwiseBinaryXpr;
|
164
|
+
typedef typename CwiseBinaryXpr::Scalar Scalar;
|
165
|
+
typedef typename traits<CwiseBinaryXpr>::_LhsNested _LhsNested;
|
166
|
+
typedef typename _LhsNested::InnerIterator LhsIterator;
|
167
|
+
typedef typename traits<CwiseBinaryXpr>::_RhsNested _RhsNested;
|
168
|
+
typedef typename _RhsNested::InnerIterator RhsIterator;
|
169
|
+
typedef typename Lhs::Index Index;
|
170
|
+
public:
|
171
|
+
|
172
|
+
EIGEN_STRONG_INLINE sparse_cwise_binary_op_inner_iterator_selector(const CwiseBinaryXpr& xpr, Index outer)
|
173
|
+
: m_lhsIter(xpr.lhs(),outer), m_rhsIter(xpr.rhs(),outer), m_functor(xpr.functor())
|
174
|
+
{
|
175
|
+
while (m_lhsIter && m_rhsIter && (m_lhsIter.index() != m_rhsIter.index()))
|
176
|
+
{
|
177
|
+
if (m_lhsIter.index() < m_rhsIter.index())
|
178
|
+
++m_lhsIter;
|
179
|
+
else
|
180
|
+
++m_rhsIter;
|
181
|
+
}
|
182
|
+
}
|
183
|
+
|
184
|
+
EIGEN_STRONG_INLINE Derived& operator++()
|
185
|
+
{
|
186
|
+
++m_lhsIter;
|
187
|
+
++m_rhsIter;
|
188
|
+
while (m_lhsIter && m_rhsIter && (m_lhsIter.index() != m_rhsIter.index()))
|
189
|
+
{
|
190
|
+
if (m_lhsIter.index() < m_rhsIter.index())
|
191
|
+
++m_lhsIter;
|
192
|
+
else
|
193
|
+
++m_rhsIter;
|
194
|
+
}
|
195
|
+
return *static_cast<Derived*>(this);
|
196
|
+
}
|
197
|
+
|
198
|
+
EIGEN_STRONG_INLINE Scalar value() const { return m_functor(m_lhsIter.value(), m_rhsIter.value()); }
|
199
|
+
|
200
|
+
EIGEN_STRONG_INLINE Index index() const { return m_lhsIter.index(); }
|
201
|
+
EIGEN_STRONG_INLINE Index row() const { return m_lhsIter.row(); }
|
202
|
+
EIGEN_STRONG_INLINE Index col() const { return m_lhsIter.col(); }
|
203
|
+
|
204
|
+
EIGEN_STRONG_INLINE operator bool() const { return (m_lhsIter && m_rhsIter); }
|
205
|
+
|
206
|
+
protected:
|
207
|
+
LhsIterator m_lhsIter;
|
208
|
+
RhsIterator m_rhsIter;
|
209
|
+
const BinaryFunc& m_functor;
|
210
|
+
};
|
211
|
+
|
212
|
+
// sparse - dense (product)
|
213
|
+
template<typename T, typename Lhs, typename Rhs, typename Derived>
|
214
|
+
class sparse_cwise_binary_op_inner_iterator_selector<scalar_product_op<T>, Lhs, Rhs, Derived, Sparse, Dense>
|
215
|
+
{
|
216
|
+
typedef scalar_product_op<T> BinaryFunc;
|
217
|
+
typedef CwiseBinaryOp<BinaryFunc, Lhs, Rhs> CwiseBinaryXpr;
|
218
|
+
typedef typename CwiseBinaryXpr::Scalar Scalar;
|
219
|
+
typedef typename traits<CwiseBinaryXpr>::_LhsNested _LhsNested;
|
220
|
+
typedef typename traits<CwiseBinaryXpr>::RhsNested RhsNested;
|
221
|
+
typedef typename _LhsNested::InnerIterator LhsIterator;
|
222
|
+
typedef typename Lhs::Index Index;
|
223
|
+
enum { IsRowMajor = (int(Lhs::Flags)&RowMajorBit)==RowMajorBit };
|
224
|
+
public:
|
225
|
+
|
226
|
+
EIGEN_STRONG_INLINE sparse_cwise_binary_op_inner_iterator_selector(const CwiseBinaryXpr& xpr, Index outer)
|
227
|
+
: m_rhs(xpr.rhs()), m_lhsIter(xpr.lhs(),outer), m_functor(xpr.functor()), m_outer(outer)
|
228
|
+
{}
|
229
|
+
|
230
|
+
EIGEN_STRONG_INLINE Derived& operator++()
|
231
|
+
{
|
232
|
+
++m_lhsIter;
|
233
|
+
return *static_cast<Derived*>(this);
|
234
|
+
}
|
235
|
+
|
236
|
+
EIGEN_STRONG_INLINE Scalar value() const
|
237
|
+
{ return m_functor(m_lhsIter.value(),
|
238
|
+
m_rhs.coeff(IsRowMajor?m_outer:m_lhsIter.index(),IsRowMajor?m_lhsIter.index():m_outer)); }
|
239
|
+
|
240
|
+
EIGEN_STRONG_INLINE Index index() const { return m_lhsIter.index(); }
|
241
|
+
EIGEN_STRONG_INLINE Index row() const { return m_lhsIter.row(); }
|
242
|
+
EIGEN_STRONG_INLINE Index col() const { return m_lhsIter.col(); }
|
243
|
+
|
244
|
+
EIGEN_STRONG_INLINE operator bool() const { return m_lhsIter; }
|
245
|
+
|
246
|
+
protected:
|
247
|
+
RhsNested m_rhs;
|
248
|
+
LhsIterator m_lhsIter;
|
249
|
+
const BinaryFunc m_functor;
|
250
|
+
const Index m_outer;
|
251
|
+
};
|
252
|
+
|
253
|
+
// sparse - dense (product)
|
254
|
+
template<typename T, typename Lhs, typename Rhs, typename Derived>
|
255
|
+
class sparse_cwise_binary_op_inner_iterator_selector<scalar_product_op<T>, Lhs, Rhs, Derived, Dense, Sparse>
|
256
|
+
{
|
257
|
+
typedef scalar_product_op<T> BinaryFunc;
|
258
|
+
typedef CwiseBinaryOp<BinaryFunc, Lhs, Rhs> CwiseBinaryXpr;
|
259
|
+
typedef typename CwiseBinaryXpr::Scalar Scalar;
|
260
|
+
typedef typename traits<CwiseBinaryXpr>::_RhsNested _RhsNested;
|
261
|
+
typedef typename _RhsNested::InnerIterator RhsIterator;
|
262
|
+
typedef typename Lhs::Index Index;
|
263
|
+
|
264
|
+
enum { IsRowMajor = (int(Rhs::Flags)&RowMajorBit)==RowMajorBit };
|
265
|
+
public:
|
266
|
+
|
267
|
+
EIGEN_STRONG_INLINE sparse_cwise_binary_op_inner_iterator_selector(const CwiseBinaryXpr& xpr, Index outer)
|
268
|
+
: m_xpr(xpr), m_rhsIter(xpr.rhs(),outer), m_functor(xpr.functor()), m_outer(outer)
|
269
|
+
{}
|
270
|
+
|
271
|
+
EIGEN_STRONG_INLINE Derived& operator++()
|
272
|
+
{
|
273
|
+
++m_rhsIter;
|
274
|
+
return *static_cast<Derived*>(this);
|
275
|
+
}
|
276
|
+
|
277
|
+
EIGEN_STRONG_INLINE Scalar value() const
|
278
|
+
{ return m_functor(m_xpr.lhs().coeff(IsRowMajor?m_outer:m_rhsIter.index(),IsRowMajor?m_rhsIter.index():m_outer), m_rhsIter.value()); }
|
279
|
+
|
280
|
+
EIGEN_STRONG_INLINE Index index() const { return m_rhsIter.index(); }
|
281
|
+
EIGEN_STRONG_INLINE Index row() const { return m_rhsIter.row(); }
|
282
|
+
EIGEN_STRONG_INLINE Index col() const { return m_rhsIter.col(); }
|
283
|
+
|
284
|
+
EIGEN_STRONG_INLINE operator bool() const { return m_rhsIter; }
|
285
|
+
|
286
|
+
protected:
|
287
|
+
const CwiseBinaryXpr& m_xpr;
|
288
|
+
RhsIterator m_rhsIter;
|
289
|
+
const BinaryFunc& m_functor;
|
290
|
+
const Index m_outer;
|
291
|
+
};
|
292
|
+
|
293
|
+
} // end namespace internal
|
294
|
+
|
295
|
+
/***************************************************************************
|
296
|
+
* Implementation of SparseMatrixBase and SparseCwise functions/operators
|
297
|
+
***************************************************************************/
|
298
|
+
|
299
|
+
template<typename Derived>
|
300
|
+
template<typename OtherDerived>
|
301
|
+
EIGEN_STRONG_INLINE Derived &
|
302
|
+
SparseMatrixBase<Derived>::operator-=(const SparseMatrixBase<OtherDerived> &other)
|
303
|
+
{
|
304
|
+
return derived() = derived() - other.derived();
|
305
|
+
}
|
306
|
+
|
307
|
+
template<typename Derived>
|
308
|
+
template<typename OtherDerived>
|
309
|
+
EIGEN_STRONG_INLINE Derived &
|
310
|
+
SparseMatrixBase<Derived>::operator+=(const SparseMatrixBase<OtherDerived>& other)
|
311
|
+
{
|
312
|
+
return derived() = derived() + other.derived();
|
313
|
+
}
|
314
|
+
|
315
|
+
template<typename Derived>
|
316
|
+
template<typename OtherDerived>
|
317
|
+
EIGEN_STRONG_INLINE const typename SparseMatrixBase<Derived>::template CwiseProductDenseReturnType<OtherDerived>::Type
|
318
|
+
SparseMatrixBase<Derived>::cwiseProduct(const MatrixBase<OtherDerived> &other) const
|
319
|
+
{
|
320
|
+
return typename CwiseProductDenseReturnType<OtherDerived>::Type(derived(), other.derived());
|
321
|
+
}
|
322
|
+
|
323
|
+
} // end namespace Eigen
|
324
|
+
|
325
|
+
#endif // EIGEN_SPARSE_CWISE_BINARY_OP_H
|