tomoto 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +3 -0
- data/LICENSE.txt +22 -0
- data/README.md +123 -0
- data/ext/tomoto/ext.cpp +245 -0
- data/ext/tomoto/extconf.rb +28 -0
- data/lib/tomoto.rb +12 -0
- data/lib/tomoto/ct.rb +11 -0
- data/lib/tomoto/hdp.rb +11 -0
- data/lib/tomoto/lda.rb +67 -0
- data/lib/tomoto/version.rb +3 -0
- data/vendor/EigenRand/EigenRand/Core.h +1139 -0
- data/vendor/EigenRand/EigenRand/Dists/Basic.h +111 -0
- data/vendor/EigenRand/EigenRand/Dists/Discrete.h +877 -0
- data/vendor/EigenRand/EigenRand/Dists/GammaPoisson.h +108 -0
- data/vendor/EigenRand/EigenRand/Dists/NormalExp.h +626 -0
- data/vendor/EigenRand/EigenRand/EigenRand +19 -0
- data/vendor/EigenRand/EigenRand/Macro.h +24 -0
- data/vendor/EigenRand/EigenRand/MorePacketMath.h +978 -0
- data/vendor/EigenRand/EigenRand/PacketFilter.h +286 -0
- data/vendor/EigenRand/EigenRand/PacketRandomEngine.h +624 -0
- data/vendor/EigenRand/EigenRand/RandUtils.h +413 -0
- data/vendor/EigenRand/EigenRand/doc.h +220 -0
- data/vendor/EigenRand/LICENSE +21 -0
- data/vendor/EigenRand/README.md +288 -0
- data/vendor/eigen/COPYING.BSD +26 -0
- data/vendor/eigen/COPYING.GPL +674 -0
- data/vendor/eigen/COPYING.LGPL +502 -0
- data/vendor/eigen/COPYING.MINPACK +52 -0
- data/vendor/eigen/COPYING.MPL2 +373 -0
- data/vendor/eigen/COPYING.README +18 -0
- data/vendor/eigen/Eigen/CMakeLists.txt +19 -0
- data/vendor/eigen/Eigen/Cholesky +46 -0
- data/vendor/eigen/Eigen/CholmodSupport +48 -0
- data/vendor/eigen/Eigen/Core +537 -0
- data/vendor/eigen/Eigen/Dense +7 -0
- data/vendor/eigen/Eigen/Eigen +2 -0
- data/vendor/eigen/Eigen/Eigenvalues +61 -0
- data/vendor/eigen/Eigen/Geometry +62 -0
- data/vendor/eigen/Eigen/Householder +30 -0
- data/vendor/eigen/Eigen/IterativeLinearSolvers +48 -0
- data/vendor/eigen/Eigen/Jacobi +33 -0
- data/vendor/eigen/Eigen/LU +50 -0
- data/vendor/eigen/Eigen/MetisSupport +35 -0
- data/vendor/eigen/Eigen/OrderingMethods +73 -0
- data/vendor/eigen/Eigen/PaStiXSupport +48 -0
- data/vendor/eigen/Eigen/PardisoSupport +35 -0
- data/vendor/eigen/Eigen/QR +51 -0
- data/vendor/eigen/Eigen/QtAlignedMalloc +40 -0
- data/vendor/eigen/Eigen/SPQRSupport +34 -0
- data/vendor/eigen/Eigen/SVD +51 -0
- data/vendor/eigen/Eigen/Sparse +36 -0
- data/vendor/eigen/Eigen/SparseCholesky +45 -0
- data/vendor/eigen/Eigen/SparseCore +69 -0
- data/vendor/eigen/Eigen/SparseLU +46 -0
- data/vendor/eigen/Eigen/SparseQR +37 -0
- data/vendor/eigen/Eigen/StdDeque +27 -0
- data/vendor/eigen/Eigen/StdList +26 -0
- data/vendor/eigen/Eigen/StdVector +27 -0
- data/vendor/eigen/Eigen/SuperLUSupport +64 -0
- data/vendor/eigen/Eigen/UmfPackSupport +40 -0
- data/vendor/eigen/Eigen/src/Cholesky/LDLT.h +673 -0
- data/vendor/eigen/Eigen/src/Cholesky/LLT.h +542 -0
- data/vendor/eigen/Eigen/src/Cholesky/LLT_LAPACKE.h +99 -0
- data/vendor/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +639 -0
- data/vendor/eigen/Eigen/src/Core/Array.h +329 -0
- data/vendor/eigen/Eigen/src/Core/ArrayBase.h +226 -0
- data/vendor/eigen/Eigen/src/Core/ArrayWrapper.h +209 -0
- data/vendor/eigen/Eigen/src/Core/Assign.h +90 -0
- data/vendor/eigen/Eigen/src/Core/AssignEvaluator.h +935 -0
- data/vendor/eigen/Eigen/src/Core/Assign_MKL.h +178 -0
- data/vendor/eigen/Eigen/src/Core/BandMatrix.h +353 -0
- data/vendor/eigen/Eigen/src/Core/Block.h +452 -0
- data/vendor/eigen/Eigen/src/Core/BooleanRedux.h +164 -0
- data/vendor/eigen/Eigen/src/Core/CommaInitializer.h +160 -0
- data/vendor/eigen/Eigen/src/Core/ConditionEstimator.h +175 -0
- data/vendor/eigen/Eigen/src/Core/CoreEvaluators.h +1688 -0
- data/vendor/eigen/Eigen/src/Core/CoreIterators.h +127 -0
- data/vendor/eigen/Eigen/src/Core/CwiseBinaryOp.h +184 -0
- data/vendor/eigen/Eigen/src/Core/CwiseNullaryOp.h +866 -0
- data/vendor/eigen/Eigen/src/Core/CwiseTernaryOp.h +197 -0
- data/vendor/eigen/Eigen/src/Core/CwiseUnaryOp.h +103 -0
- data/vendor/eigen/Eigen/src/Core/CwiseUnaryView.h +128 -0
- data/vendor/eigen/Eigen/src/Core/DenseBase.h +611 -0
- data/vendor/eigen/Eigen/src/Core/DenseCoeffsBase.h +681 -0
- data/vendor/eigen/Eigen/src/Core/DenseStorage.h +570 -0
- data/vendor/eigen/Eigen/src/Core/Diagonal.h +260 -0
- data/vendor/eigen/Eigen/src/Core/DiagonalMatrix.h +343 -0
- data/vendor/eigen/Eigen/src/Core/DiagonalProduct.h +28 -0
- data/vendor/eigen/Eigen/src/Core/Dot.h +318 -0
- data/vendor/eigen/Eigen/src/Core/EigenBase.h +159 -0
- data/vendor/eigen/Eigen/src/Core/ForceAlignedAccess.h +146 -0
- data/vendor/eigen/Eigen/src/Core/Fuzzy.h +155 -0
- data/vendor/eigen/Eigen/src/Core/GeneralProduct.h +455 -0
- data/vendor/eigen/Eigen/src/Core/GenericPacketMath.h +593 -0
- data/vendor/eigen/Eigen/src/Core/GlobalFunctions.h +187 -0
- data/vendor/eigen/Eigen/src/Core/IO.h +225 -0
- data/vendor/eigen/Eigen/src/Core/Inverse.h +118 -0
- data/vendor/eigen/Eigen/src/Core/Map.h +171 -0
- data/vendor/eigen/Eigen/src/Core/MapBase.h +303 -0
- data/vendor/eigen/Eigen/src/Core/MathFunctions.h +1415 -0
- data/vendor/eigen/Eigen/src/Core/MathFunctionsImpl.h +101 -0
- data/vendor/eigen/Eigen/src/Core/Matrix.h +459 -0
- data/vendor/eigen/Eigen/src/Core/MatrixBase.h +529 -0
- data/vendor/eigen/Eigen/src/Core/NestByValue.h +110 -0
- data/vendor/eigen/Eigen/src/Core/NoAlias.h +108 -0
- data/vendor/eigen/Eigen/src/Core/NumTraits.h +248 -0
- data/vendor/eigen/Eigen/src/Core/PermutationMatrix.h +633 -0
- data/vendor/eigen/Eigen/src/Core/PlainObjectBase.h +1035 -0
- data/vendor/eigen/Eigen/src/Core/Product.h +186 -0
- data/vendor/eigen/Eigen/src/Core/ProductEvaluators.h +1112 -0
- data/vendor/eigen/Eigen/src/Core/Random.h +182 -0
- data/vendor/eigen/Eigen/src/Core/Redux.h +505 -0
- data/vendor/eigen/Eigen/src/Core/Ref.h +283 -0
- data/vendor/eigen/Eigen/src/Core/Replicate.h +142 -0
- data/vendor/eigen/Eigen/src/Core/ReturnByValue.h +117 -0
- data/vendor/eigen/Eigen/src/Core/Reverse.h +211 -0
- data/vendor/eigen/Eigen/src/Core/Select.h +162 -0
- data/vendor/eigen/Eigen/src/Core/SelfAdjointView.h +352 -0
- data/vendor/eigen/Eigen/src/Core/SelfCwiseBinaryOp.h +47 -0
- data/vendor/eigen/Eigen/src/Core/Solve.h +188 -0
- data/vendor/eigen/Eigen/src/Core/SolveTriangular.h +235 -0
- data/vendor/eigen/Eigen/src/Core/SolverBase.h +130 -0
- data/vendor/eigen/Eigen/src/Core/StableNorm.h +221 -0
- data/vendor/eigen/Eigen/src/Core/Stride.h +111 -0
- data/vendor/eigen/Eigen/src/Core/Swap.h +67 -0
- data/vendor/eigen/Eigen/src/Core/Transpose.h +403 -0
- data/vendor/eigen/Eigen/src/Core/Transpositions.h +407 -0
- data/vendor/eigen/Eigen/src/Core/TriangularMatrix.h +983 -0
- data/vendor/eigen/Eigen/src/Core/VectorBlock.h +96 -0
- data/vendor/eigen/Eigen/src/Core/VectorwiseOp.h +695 -0
- data/vendor/eigen/Eigen/src/Core/Visitor.h +273 -0
- data/vendor/eigen/Eigen/src/Core/arch/AVX/Complex.h +451 -0
- data/vendor/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +439 -0
- data/vendor/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +637 -0
- data/vendor/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +51 -0
- data/vendor/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +391 -0
- data/vendor/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +1316 -0
- data/vendor/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +430 -0
- data/vendor/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +322 -0
- data/vendor/eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h +1061 -0
- data/vendor/eigen/Eigen/src/Core/arch/CUDA/Complex.h +103 -0
- data/vendor/eigen/Eigen/src/Core/arch/CUDA/Half.h +674 -0
- data/vendor/eigen/Eigen/src/Core/arch/CUDA/MathFunctions.h +91 -0
- data/vendor/eigen/Eigen/src/Core/arch/CUDA/PacketMath.h +333 -0
- data/vendor/eigen/Eigen/src/Core/arch/CUDA/PacketMathHalf.h +1124 -0
- data/vendor/eigen/Eigen/src/Core/arch/CUDA/TypeCasting.h +212 -0
- data/vendor/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +29 -0
- data/vendor/eigen/Eigen/src/Core/arch/Default/Settings.h +49 -0
- data/vendor/eigen/Eigen/src/Core/arch/NEON/Complex.h +490 -0
- data/vendor/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +91 -0
- data/vendor/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +760 -0
- data/vendor/eigen/Eigen/src/Core/arch/SSE/Complex.h +471 -0
- data/vendor/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +562 -0
- data/vendor/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +895 -0
- data/vendor/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +77 -0
- data/vendor/eigen/Eigen/src/Core/arch/ZVector/Complex.h +397 -0
- data/vendor/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +137 -0
- data/vendor/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +945 -0
- data/vendor/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +168 -0
- data/vendor/eigen/Eigen/src/Core/functors/BinaryFunctors.h +475 -0
- data/vendor/eigen/Eigen/src/Core/functors/NullaryFunctors.h +188 -0
- data/vendor/eigen/Eigen/src/Core/functors/StlFunctors.h +136 -0
- data/vendor/eigen/Eigen/src/Core/functors/TernaryFunctors.h +25 -0
- data/vendor/eigen/Eigen/src/Core/functors/UnaryFunctors.h +792 -0
- data/vendor/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +2156 -0
- data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +492 -0
- data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +311 -0
- data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +145 -0
- data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +122 -0
- data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +619 -0
- data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +136 -0
- data/vendor/eigen/Eigen/src/Core/products/Parallelizer.h +163 -0
- data/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +521 -0
- data/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +287 -0
- data/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +260 -0
- data/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h +118 -0
- data/vendor/eigen/Eigen/src/Core/products/SelfadjointProduct.h +133 -0
- data/vendor/eigen/Eigen/src/Core/products/SelfadjointRank2Update.h +93 -0
- data/vendor/eigen/Eigen/src/Core/products/TriangularMatrixMatrix.h +466 -0
- data/vendor/eigen/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +315 -0
- data/vendor/eigen/Eigen/src/Core/products/TriangularMatrixVector.h +350 -0
- data/vendor/eigen/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h +255 -0
- data/vendor/eigen/Eigen/src/Core/products/TriangularSolverMatrix.h +335 -0
- data/vendor/eigen/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +163 -0
- data/vendor/eigen/Eigen/src/Core/products/TriangularSolverVector.h +145 -0
- data/vendor/eigen/Eigen/src/Core/util/BlasUtil.h +398 -0
- data/vendor/eigen/Eigen/src/Core/util/Constants.h +547 -0
- data/vendor/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +83 -0
- data/vendor/eigen/Eigen/src/Core/util/ForwardDeclarations.h +302 -0
- data/vendor/eigen/Eigen/src/Core/util/MKL_support.h +130 -0
- data/vendor/eigen/Eigen/src/Core/util/Macros.h +1001 -0
- data/vendor/eigen/Eigen/src/Core/util/Memory.h +993 -0
- data/vendor/eigen/Eigen/src/Core/util/Meta.h +534 -0
- data/vendor/eigen/Eigen/src/Core/util/NonMPL2.h +3 -0
- data/vendor/eigen/Eigen/src/Core/util/ReenableStupidWarnings.h +27 -0
- data/vendor/eigen/Eigen/src/Core/util/StaticAssert.h +218 -0
- data/vendor/eigen/Eigen/src/Core/util/XprHelper.h +821 -0
- data/vendor/eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h +346 -0
- data/vendor/eigen/Eigen/src/Eigenvalues/ComplexSchur.h +459 -0
- data/vendor/eigen/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h +91 -0
- data/vendor/eigen/Eigen/src/Eigenvalues/EigenSolver.h +622 -0
- data/vendor/eigen/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +418 -0
- data/vendor/eigen/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +226 -0
- data/vendor/eigen/Eigen/src/Eigenvalues/HessenbergDecomposition.h +374 -0
- data/vendor/eigen/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +158 -0
- data/vendor/eigen/Eigen/src/Eigenvalues/RealQZ.h +654 -0
- data/vendor/eigen/Eigen/src/Eigenvalues/RealSchur.h +546 -0
- data/vendor/eigen/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +77 -0
- data/vendor/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +870 -0
- data/vendor/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +87 -0
- data/vendor/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +556 -0
- data/vendor/eigen/Eigen/src/Geometry/AlignedBox.h +392 -0
- data/vendor/eigen/Eigen/src/Geometry/AngleAxis.h +247 -0
- data/vendor/eigen/Eigen/src/Geometry/EulerAngles.h +114 -0
- data/vendor/eigen/Eigen/src/Geometry/Homogeneous.h +497 -0
- data/vendor/eigen/Eigen/src/Geometry/Hyperplane.h +282 -0
- data/vendor/eigen/Eigen/src/Geometry/OrthoMethods.h +234 -0
- data/vendor/eigen/Eigen/src/Geometry/ParametrizedLine.h +195 -0
- data/vendor/eigen/Eigen/src/Geometry/Quaternion.h +814 -0
- data/vendor/eigen/Eigen/src/Geometry/Rotation2D.h +199 -0
- data/vendor/eigen/Eigen/src/Geometry/RotationBase.h +206 -0
- data/vendor/eigen/Eigen/src/Geometry/Scaling.h +170 -0
- data/vendor/eigen/Eigen/src/Geometry/Transform.h +1542 -0
- data/vendor/eigen/Eigen/src/Geometry/Translation.h +208 -0
- data/vendor/eigen/Eigen/src/Geometry/Umeyama.h +166 -0
- data/vendor/eigen/Eigen/src/Geometry/arch/Geometry_SSE.h +161 -0
- data/vendor/eigen/Eigen/src/Householder/BlockHouseholder.h +103 -0
- data/vendor/eigen/Eigen/src/Householder/Householder.h +172 -0
- data/vendor/eigen/Eigen/src/Householder/HouseholderSequence.h +470 -0
- data/vendor/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +226 -0
- data/vendor/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +228 -0
- data/vendor/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +246 -0
- data/vendor/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +400 -0
- data/vendor/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +462 -0
- data/vendor/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +394 -0
- data/vendor/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +216 -0
- data/vendor/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +115 -0
- data/vendor/eigen/Eigen/src/Jacobi/Jacobi.h +462 -0
- data/vendor/eigen/Eigen/src/LU/Determinant.h +101 -0
- data/vendor/eigen/Eigen/src/LU/FullPivLU.h +891 -0
- data/vendor/eigen/Eigen/src/LU/InverseImpl.h +415 -0
- data/vendor/eigen/Eigen/src/LU/PartialPivLU.h +611 -0
- data/vendor/eigen/Eigen/src/LU/PartialPivLU_LAPACKE.h +83 -0
- data/vendor/eigen/Eigen/src/LU/arch/Inverse_SSE.h +338 -0
- data/vendor/eigen/Eigen/src/MetisSupport/MetisSupport.h +137 -0
- data/vendor/eigen/Eigen/src/OrderingMethods/Amd.h +445 -0
- data/vendor/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +1843 -0
- data/vendor/eigen/Eigen/src/OrderingMethods/Ordering.h +157 -0
- data/vendor/eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h +678 -0
- data/vendor/eigen/Eigen/src/PardisoSupport/PardisoSupport.h +543 -0
- data/vendor/eigen/Eigen/src/QR/ColPivHouseholderQR.h +653 -0
- data/vendor/eigen/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +97 -0
- data/vendor/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +562 -0
- data/vendor/eigen/Eigen/src/QR/FullPivHouseholderQR.h +676 -0
- data/vendor/eigen/Eigen/src/QR/HouseholderQR.h +409 -0
- data/vendor/eigen/Eigen/src/QR/HouseholderQR_LAPACKE.h +68 -0
- data/vendor/eigen/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +313 -0
- data/vendor/eigen/Eigen/src/SVD/BDCSVD.h +1246 -0
- data/vendor/eigen/Eigen/src/SVD/JacobiSVD.h +804 -0
- data/vendor/eigen/Eigen/src/SVD/JacobiSVD_LAPACKE.h +91 -0
- data/vendor/eigen/Eigen/src/SVD/SVDBase.h +315 -0
- data/vendor/eigen/Eigen/src/SVD/UpperBidiagonalization.h +414 -0
- data/vendor/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +689 -0
- data/vendor/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +199 -0
- data/vendor/eigen/Eigen/src/SparseCore/AmbiVector.h +377 -0
- data/vendor/eigen/Eigen/src/SparseCore/CompressedStorage.h +258 -0
- data/vendor/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +352 -0
- data/vendor/eigen/Eigen/src/SparseCore/MappedSparseMatrix.h +67 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseAssign.h +216 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseBlock.h +603 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseColEtree.h +206 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +341 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +726 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +148 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +320 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseDiagonalProduct.h +138 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseDot.h +98 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseFuzzy.h +29 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseMap.h +305 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseMatrix.h +1403 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +405 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparsePermutation.h +178 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseProduct.h +169 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseRedux.h +49 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseRef.h +397 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h +656 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseSolverBase.h +124 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +198 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseTranspose.h +92 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseTriangularView.h +189 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseUtil.h +178 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseVector.h +478 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseView.h +253 -0
- data/vendor/eigen/Eigen/src/SparseCore/TriangularSolver.h +315 -0
- data/vendor/eigen/Eigen/src/SparseLU/SparseLU.h +773 -0
- data/vendor/eigen/Eigen/src/SparseLU/SparseLUImpl.h +66 -0
- data/vendor/eigen/Eigen/src/SparseLU/SparseLU_Memory.h +226 -0
- data/vendor/eigen/Eigen/src/SparseLU/SparseLU_Structs.h +110 -0
- data/vendor/eigen/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +301 -0
- data/vendor/eigen/Eigen/src/SparseLU/SparseLU_Utils.h +80 -0
- data/vendor/eigen/Eigen/src/SparseLU/SparseLU_column_bmod.h +181 -0
- data/vendor/eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h +179 -0
- data/vendor/eigen/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +107 -0
- data/vendor/eigen/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +280 -0
- data/vendor/eigen/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +126 -0
- data/vendor/eigen/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +130 -0
- data/vendor/eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h +223 -0
- data/vendor/eigen/Eigen/src/SparseLU/SparseLU_panel_dfs.h +258 -0
- data/vendor/eigen/Eigen/src/SparseLU/SparseLU_pivotL.h +137 -0
- data/vendor/eigen/Eigen/src/SparseLU/SparseLU_pruneL.h +136 -0
- data/vendor/eigen/Eigen/src/SparseLU/SparseLU_relax_snode.h +83 -0
- data/vendor/eigen/Eigen/src/SparseQR/SparseQR.h +745 -0
- data/vendor/eigen/Eigen/src/StlSupport/StdDeque.h +126 -0
- data/vendor/eigen/Eigen/src/StlSupport/StdList.h +106 -0
- data/vendor/eigen/Eigen/src/StlSupport/StdVector.h +131 -0
- data/vendor/eigen/Eigen/src/StlSupport/details.h +84 -0
- data/vendor/eigen/Eigen/src/SuperLUSupport/SuperLUSupport.h +1027 -0
- data/vendor/eigen/Eigen/src/UmfPackSupport/UmfPackSupport.h +506 -0
- data/vendor/eigen/Eigen/src/misc/Image.h +82 -0
- data/vendor/eigen/Eigen/src/misc/Kernel.h +79 -0
- data/vendor/eigen/Eigen/src/misc/RealSvd2x2.h +55 -0
- data/vendor/eigen/Eigen/src/misc/blas.h +440 -0
- data/vendor/eigen/Eigen/src/misc/lapack.h +152 -0
- data/vendor/eigen/Eigen/src/misc/lapacke.h +16291 -0
- data/vendor/eigen/Eigen/src/misc/lapacke_mangling.h +17 -0
- data/vendor/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.h +332 -0
- data/vendor/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h +552 -0
- data/vendor/eigen/Eigen/src/plugins/BlockMethods.h +1058 -0
- data/vendor/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.h +115 -0
- data/vendor/eigen/Eigen/src/plugins/CommonCwiseUnaryOps.h +163 -0
- data/vendor/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h +152 -0
- data/vendor/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h +85 -0
- data/vendor/eigen/README.md +3 -0
- data/vendor/eigen/bench/README.txt +55 -0
- data/vendor/eigen/bench/btl/COPYING +340 -0
- data/vendor/eigen/bench/btl/README +154 -0
- data/vendor/eigen/bench/tensors/README +21 -0
- data/vendor/eigen/blas/README.txt +6 -0
- data/vendor/eigen/demos/mandelbrot/README +10 -0
- data/vendor/eigen/demos/mix_eigen_and_c/README +9 -0
- data/vendor/eigen/demos/opengl/README +13 -0
- data/vendor/eigen/unsupported/Eigen/CXX11/src/Tensor/README.md +1760 -0
- data/vendor/eigen/unsupported/README.txt +50 -0
- data/vendor/tomotopy/LICENSE +21 -0
- data/vendor/tomotopy/README.kr.rst +375 -0
- data/vendor/tomotopy/README.rst +382 -0
- data/vendor/tomotopy/src/Labeling/FoRelevance.cpp +362 -0
- data/vendor/tomotopy/src/Labeling/FoRelevance.h +88 -0
- data/vendor/tomotopy/src/Labeling/Labeler.h +50 -0
- data/vendor/tomotopy/src/TopicModel/CT.h +37 -0
- data/vendor/tomotopy/src/TopicModel/CTModel.cpp +13 -0
- data/vendor/tomotopy/src/TopicModel/CTModel.hpp +293 -0
- data/vendor/tomotopy/src/TopicModel/DMR.h +51 -0
- data/vendor/tomotopy/src/TopicModel/DMRModel.cpp +13 -0
- data/vendor/tomotopy/src/TopicModel/DMRModel.hpp +374 -0
- data/vendor/tomotopy/src/TopicModel/DT.h +65 -0
- data/vendor/tomotopy/src/TopicModel/DTM.h +22 -0
- data/vendor/tomotopy/src/TopicModel/DTModel.cpp +15 -0
- data/vendor/tomotopy/src/TopicModel/DTModel.hpp +572 -0
- data/vendor/tomotopy/src/TopicModel/GDMR.h +37 -0
- data/vendor/tomotopy/src/TopicModel/GDMRModel.cpp +14 -0
- data/vendor/tomotopy/src/TopicModel/GDMRModel.hpp +485 -0
- data/vendor/tomotopy/src/TopicModel/HDP.h +74 -0
- data/vendor/tomotopy/src/TopicModel/HDPModel.cpp +13 -0
- data/vendor/tomotopy/src/TopicModel/HDPModel.hpp +592 -0
- data/vendor/tomotopy/src/TopicModel/HLDA.h +40 -0
- data/vendor/tomotopy/src/TopicModel/HLDAModel.cpp +13 -0
- data/vendor/tomotopy/src/TopicModel/HLDAModel.hpp +681 -0
- data/vendor/tomotopy/src/TopicModel/HPA.h +27 -0
- data/vendor/tomotopy/src/TopicModel/HPAModel.cpp +21 -0
- data/vendor/tomotopy/src/TopicModel/HPAModel.hpp +588 -0
- data/vendor/tomotopy/src/TopicModel/LDA.h +144 -0
- data/vendor/tomotopy/src/TopicModel/LDACVB0Model.hpp +442 -0
- data/vendor/tomotopy/src/TopicModel/LDAModel.cpp +13 -0
- data/vendor/tomotopy/src/TopicModel/LDAModel.hpp +1058 -0
- data/vendor/tomotopy/src/TopicModel/LLDA.h +45 -0
- data/vendor/tomotopy/src/TopicModel/LLDAModel.cpp +13 -0
- data/vendor/tomotopy/src/TopicModel/LLDAModel.hpp +203 -0
- data/vendor/tomotopy/src/TopicModel/MGLDA.h +63 -0
- data/vendor/tomotopy/src/TopicModel/MGLDAModel.cpp +17 -0
- data/vendor/tomotopy/src/TopicModel/MGLDAModel.hpp +558 -0
- data/vendor/tomotopy/src/TopicModel/PA.h +43 -0
- data/vendor/tomotopy/src/TopicModel/PAModel.cpp +13 -0
- data/vendor/tomotopy/src/TopicModel/PAModel.hpp +467 -0
- data/vendor/tomotopy/src/TopicModel/PLDA.h +17 -0
- data/vendor/tomotopy/src/TopicModel/PLDAModel.cpp +13 -0
- data/vendor/tomotopy/src/TopicModel/PLDAModel.hpp +214 -0
- data/vendor/tomotopy/src/TopicModel/SLDA.h +54 -0
- data/vendor/tomotopy/src/TopicModel/SLDAModel.cpp +17 -0
- data/vendor/tomotopy/src/TopicModel/SLDAModel.hpp +456 -0
- data/vendor/tomotopy/src/TopicModel/TopicModel.hpp +692 -0
- data/vendor/tomotopy/src/Utils/AliasMethod.hpp +169 -0
- data/vendor/tomotopy/src/Utils/Dictionary.h +80 -0
- data/vendor/tomotopy/src/Utils/EigenAddonOps.hpp +181 -0
- data/vendor/tomotopy/src/Utils/LBFGS.h +202 -0
- data/vendor/tomotopy/src/Utils/LBFGS/LineSearchBacktracking.h +120 -0
- data/vendor/tomotopy/src/Utils/LBFGS/LineSearchBracketing.h +122 -0
- data/vendor/tomotopy/src/Utils/LBFGS/Param.h +213 -0
- data/vendor/tomotopy/src/Utils/LUT.hpp +82 -0
- data/vendor/tomotopy/src/Utils/MultiNormalDistribution.hpp +69 -0
- data/vendor/tomotopy/src/Utils/PolyaGamma.hpp +200 -0
- data/vendor/tomotopy/src/Utils/PolyaGammaHybrid.hpp +672 -0
- data/vendor/tomotopy/src/Utils/ThreadPool.hpp +150 -0
- data/vendor/tomotopy/src/Utils/Trie.hpp +220 -0
- data/vendor/tomotopy/src/Utils/TruncMultiNormal.hpp +94 -0
- data/vendor/tomotopy/src/Utils/Utils.hpp +337 -0
- data/vendor/tomotopy/src/Utils/avx_gamma.h +46 -0
- data/vendor/tomotopy/src/Utils/avx_mathfun.h +736 -0
- data/vendor/tomotopy/src/Utils/exception.h +28 -0
- data/vendor/tomotopy/src/Utils/math.h +281 -0
- data/vendor/tomotopy/src/Utils/rtnorm.hpp +2690 -0
- data/vendor/tomotopy/src/Utils/sample.hpp +192 -0
- data/vendor/tomotopy/src/Utils/serializer.hpp +695 -0
- data/vendor/tomotopy/src/Utils/slp.hpp +131 -0
- data/vendor/tomotopy/src/Utils/sse_gamma.h +48 -0
- data/vendor/tomotopy/src/Utils/sse_mathfun.h +710 -0
- data/vendor/tomotopy/src/Utils/text.hpp +49 -0
- data/vendor/tomotopy/src/Utils/tvector.hpp +543 -0
- metadata +531 -0
@@ -0,0 +1,223 @@
|
|
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
|
+
// Copyright (C) 2012 Gael Guennebaud <gael.guennebaud@inria.fr>
|
6
|
+
//
|
7
|
+
// This Source Code Form is subject to the terms of the Mozilla
|
8
|
+
// Public License v. 2.0. If a copy of the MPL was not distributed
|
9
|
+
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
10
|
+
|
11
|
+
/*
|
12
|
+
|
13
|
+
* NOTE: This file is the modified version of [s,d,c,z]panel_bmod.c file in SuperLU
|
14
|
+
|
15
|
+
* -- SuperLU routine (version 3.0) --
|
16
|
+
* Univ. of California Berkeley, Xerox Palo Alto Research Center,
|
17
|
+
* and Lawrence Berkeley National Lab.
|
18
|
+
* October 15, 2003
|
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 SPARSELU_PANEL_BMOD_H
|
32
|
+
#define SPARSELU_PANEL_BMOD_H
|
33
|
+
|
34
|
+
namespace Eigen {
|
35
|
+
namespace internal {
|
36
|
+
|
37
|
+
/**
|
38
|
+
* \brief Performs numeric block updates (sup-panel) in topological order.
|
39
|
+
*
|
40
|
+
* Before entering this routine, the original nonzeros in the panel
|
41
|
+
* were already copied i nto the spa[m,w]
|
42
|
+
*
|
43
|
+
* \param m number of rows in the matrix
|
44
|
+
* \param w Panel size
|
45
|
+
* \param jcol Starting column of the panel
|
46
|
+
* \param nseg Number of segments in the U part
|
47
|
+
* \param dense Store the full representation of the panel
|
48
|
+
* \param tempv working array
|
49
|
+
* \param segrep segment representative... first row in the segment
|
50
|
+
* \param repfnz First nonzero rows
|
51
|
+
* \param glu Global LU data.
|
52
|
+
*
|
53
|
+
*
|
54
|
+
*/
|
55
|
+
template <typename Scalar, typename StorageIndex>
|
56
|
+
void SparseLUImpl<Scalar,StorageIndex>::panel_bmod(const Index m, const Index w, const Index jcol,
|
57
|
+
const Index nseg, ScalarVector& dense, ScalarVector& tempv,
|
58
|
+
IndexVector& segrep, IndexVector& repfnz, GlobalLU_t& glu)
|
59
|
+
{
|
60
|
+
|
61
|
+
Index ksub,jj,nextl_col;
|
62
|
+
Index fsupc, nsupc, nsupr, nrow;
|
63
|
+
Index krep, kfnz;
|
64
|
+
Index lptr; // points to the row subscripts of a supernode
|
65
|
+
Index luptr; // ...
|
66
|
+
Index segsize,no_zeros ;
|
67
|
+
// For each nonz supernode segment of U[*,j] in topological order
|
68
|
+
Index k = nseg - 1;
|
69
|
+
const Index PacketSize = internal::packet_traits<Scalar>::size;
|
70
|
+
|
71
|
+
for (ksub = 0; ksub < nseg; ksub++)
|
72
|
+
{ // For each updating supernode
|
73
|
+
/* krep = representative of current k-th supernode
|
74
|
+
* fsupc = first supernodal column
|
75
|
+
* nsupc = number of columns in a supernode
|
76
|
+
* nsupr = number of rows in a supernode
|
77
|
+
*/
|
78
|
+
krep = segrep(k); k--;
|
79
|
+
fsupc = glu.xsup(glu.supno(krep));
|
80
|
+
nsupc = krep - fsupc + 1;
|
81
|
+
nsupr = glu.xlsub(fsupc+1) - glu.xlsub(fsupc);
|
82
|
+
nrow = nsupr - nsupc;
|
83
|
+
lptr = glu.xlsub(fsupc);
|
84
|
+
|
85
|
+
// loop over the panel columns to detect the actual number of columns and rows
|
86
|
+
Index u_rows = 0;
|
87
|
+
Index u_cols = 0;
|
88
|
+
for (jj = jcol; jj < jcol + w; jj++)
|
89
|
+
{
|
90
|
+
nextl_col = (jj-jcol) * m;
|
91
|
+
VectorBlock<IndexVector> repfnz_col(repfnz, nextl_col, m); // First nonzero column index for each row
|
92
|
+
|
93
|
+
kfnz = repfnz_col(krep);
|
94
|
+
if ( kfnz == emptyIdxLU )
|
95
|
+
continue; // skip any zero segment
|
96
|
+
|
97
|
+
segsize = krep - kfnz + 1;
|
98
|
+
u_cols++;
|
99
|
+
u_rows = (std::max)(segsize,u_rows);
|
100
|
+
}
|
101
|
+
|
102
|
+
if(nsupc >= 2)
|
103
|
+
{
|
104
|
+
Index ldu = internal::first_multiple<Index>(u_rows, PacketSize);
|
105
|
+
Map<ScalarMatrix, Aligned, OuterStride<> > U(tempv.data(), u_rows, u_cols, OuterStride<>(ldu));
|
106
|
+
|
107
|
+
// gather U
|
108
|
+
Index u_col = 0;
|
109
|
+
for (jj = jcol; jj < jcol + w; jj++)
|
110
|
+
{
|
111
|
+
nextl_col = (jj-jcol) * m;
|
112
|
+
VectorBlock<IndexVector> repfnz_col(repfnz, nextl_col, m); // First nonzero column index for each row
|
113
|
+
VectorBlock<ScalarVector> dense_col(dense, nextl_col, m); // Scatter/gather entire matrix column from/to here
|
114
|
+
|
115
|
+
kfnz = repfnz_col(krep);
|
116
|
+
if ( kfnz == emptyIdxLU )
|
117
|
+
continue; // skip any zero segment
|
118
|
+
|
119
|
+
segsize = krep - kfnz + 1;
|
120
|
+
luptr = glu.xlusup(fsupc);
|
121
|
+
no_zeros = kfnz - fsupc;
|
122
|
+
|
123
|
+
Index isub = lptr + no_zeros;
|
124
|
+
Index off = u_rows-segsize;
|
125
|
+
for (Index i = 0; i < off; i++) U(i,u_col) = 0;
|
126
|
+
for (Index i = 0; i < segsize; i++)
|
127
|
+
{
|
128
|
+
Index irow = glu.lsub(isub);
|
129
|
+
U(i+off,u_col) = dense_col(irow);
|
130
|
+
++isub;
|
131
|
+
}
|
132
|
+
u_col++;
|
133
|
+
}
|
134
|
+
// solve U = A^-1 U
|
135
|
+
luptr = glu.xlusup(fsupc);
|
136
|
+
Index lda = glu.xlusup(fsupc+1) - glu.xlusup(fsupc);
|
137
|
+
no_zeros = (krep - u_rows + 1) - fsupc;
|
138
|
+
luptr += lda * no_zeros + no_zeros;
|
139
|
+
MappedMatrixBlock A(glu.lusup.data()+luptr, u_rows, u_rows, OuterStride<>(lda) );
|
140
|
+
U = A.template triangularView<UnitLower>().solve(U);
|
141
|
+
|
142
|
+
// update
|
143
|
+
luptr += u_rows;
|
144
|
+
MappedMatrixBlock B(glu.lusup.data()+luptr, nrow, u_rows, OuterStride<>(lda) );
|
145
|
+
eigen_assert(tempv.size()>w*ldu + nrow*w + 1);
|
146
|
+
|
147
|
+
Index ldl = internal::first_multiple<Index>(nrow, PacketSize);
|
148
|
+
Index offset = (PacketSize-internal::first_default_aligned(B.data(), PacketSize)) % PacketSize;
|
149
|
+
MappedMatrixBlock L(tempv.data()+w*ldu+offset, nrow, u_cols, OuterStride<>(ldl));
|
150
|
+
|
151
|
+
L.setZero();
|
152
|
+
internal::sparselu_gemm<Scalar>(L.rows(), L.cols(), B.cols(), B.data(), B.outerStride(), U.data(), U.outerStride(), L.data(), L.outerStride());
|
153
|
+
|
154
|
+
// scatter U and L
|
155
|
+
u_col = 0;
|
156
|
+
for (jj = jcol; jj < jcol + w; jj++)
|
157
|
+
{
|
158
|
+
nextl_col = (jj-jcol) * m;
|
159
|
+
VectorBlock<IndexVector> repfnz_col(repfnz, nextl_col, m); // First nonzero column index for each row
|
160
|
+
VectorBlock<ScalarVector> dense_col(dense, nextl_col, m); // Scatter/gather entire matrix column from/to here
|
161
|
+
|
162
|
+
kfnz = repfnz_col(krep);
|
163
|
+
if ( kfnz == emptyIdxLU )
|
164
|
+
continue; // skip any zero segment
|
165
|
+
|
166
|
+
segsize = krep - kfnz + 1;
|
167
|
+
no_zeros = kfnz - fsupc;
|
168
|
+
Index isub = lptr + no_zeros;
|
169
|
+
|
170
|
+
Index off = u_rows-segsize;
|
171
|
+
for (Index i = 0; i < segsize; i++)
|
172
|
+
{
|
173
|
+
Index irow = glu.lsub(isub++);
|
174
|
+
dense_col(irow) = U.coeff(i+off,u_col);
|
175
|
+
U.coeffRef(i+off,u_col) = 0;
|
176
|
+
}
|
177
|
+
|
178
|
+
// Scatter l into SPA dense[]
|
179
|
+
for (Index i = 0; i < nrow; i++)
|
180
|
+
{
|
181
|
+
Index irow = glu.lsub(isub++);
|
182
|
+
dense_col(irow) -= L.coeff(i,u_col);
|
183
|
+
L.coeffRef(i,u_col) = 0;
|
184
|
+
}
|
185
|
+
u_col++;
|
186
|
+
}
|
187
|
+
}
|
188
|
+
else // level 2 only
|
189
|
+
{
|
190
|
+
// Sequence through each column in the panel
|
191
|
+
for (jj = jcol; jj < jcol + w; jj++)
|
192
|
+
{
|
193
|
+
nextl_col = (jj-jcol) * m;
|
194
|
+
VectorBlock<IndexVector> repfnz_col(repfnz, nextl_col, m); // First nonzero column index for each row
|
195
|
+
VectorBlock<ScalarVector> dense_col(dense, nextl_col, m); // Scatter/gather entire matrix column from/to here
|
196
|
+
|
197
|
+
kfnz = repfnz_col(krep);
|
198
|
+
if ( kfnz == emptyIdxLU )
|
199
|
+
continue; // skip any zero segment
|
200
|
+
|
201
|
+
segsize = krep - kfnz + 1;
|
202
|
+
luptr = glu.xlusup(fsupc);
|
203
|
+
|
204
|
+
Index lda = glu.xlusup(fsupc+1)-glu.xlusup(fsupc);// nsupr
|
205
|
+
|
206
|
+
// Perform a trianglar solve and block update,
|
207
|
+
// then scatter the result of sup-col update to dense[]
|
208
|
+
no_zeros = kfnz - fsupc;
|
209
|
+
if(segsize==1) LU_kernel_bmod<1>::run(segsize, dense_col, tempv, glu.lusup, luptr, lda, nrow, glu.lsub, lptr, no_zeros);
|
210
|
+
else if(segsize==2) LU_kernel_bmod<2>::run(segsize, dense_col, tempv, glu.lusup, luptr, lda, nrow, glu.lsub, lptr, no_zeros);
|
211
|
+
else if(segsize==3) LU_kernel_bmod<3>::run(segsize, dense_col, tempv, glu.lusup, luptr, lda, nrow, glu.lsub, lptr, no_zeros);
|
212
|
+
else LU_kernel_bmod<Dynamic>::run(segsize, dense_col, tempv, glu.lusup, luptr, lda, nrow, glu.lsub, lptr, no_zeros);
|
213
|
+
} // End for each column in the panel
|
214
|
+
}
|
215
|
+
|
216
|
+
} // End for each updating supernode
|
217
|
+
} // end panel bmod
|
218
|
+
|
219
|
+
} // end namespace internal
|
220
|
+
|
221
|
+
} // end namespace Eigen
|
222
|
+
|
223
|
+
#endif // SPARSELU_PANEL_BMOD_H
|
@@ -0,0 +1,258 @@
|
|
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
|
+
* NOTE: This file is the modified version of [s,d,c,z]panel_dfs.c file in SuperLU
|
13
|
+
|
14
|
+
* -- SuperLU routine (version 2.0) --
|
15
|
+
* Univ. of California Berkeley, Xerox Palo Alto Research Center,
|
16
|
+
* and Lawrence Berkeley National Lab.
|
17
|
+
* November 15, 1997
|
18
|
+
*
|
19
|
+
* Copyright (c) 1994 by Xerox Corporation. All rights reserved.
|
20
|
+
*
|
21
|
+
* THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
|
22
|
+
* EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
|
23
|
+
*
|
24
|
+
* Permission is hereby granted to use or copy this program for any
|
25
|
+
* purpose, provided the above notices are retained on all copies.
|
26
|
+
* Permission to modify the code and to distribute modified code is
|
27
|
+
* granted, provided the above notices are retained, and a notice that
|
28
|
+
* the code was modified is included with the above copyright notice.
|
29
|
+
*/
|
30
|
+
#ifndef SPARSELU_PANEL_DFS_H
|
31
|
+
#define SPARSELU_PANEL_DFS_H
|
32
|
+
|
33
|
+
namespace Eigen {
|
34
|
+
|
35
|
+
namespace internal {
|
36
|
+
|
37
|
+
template<typename IndexVector>
|
38
|
+
struct panel_dfs_traits
|
39
|
+
{
|
40
|
+
typedef typename IndexVector::Scalar StorageIndex;
|
41
|
+
panel_dfs_traits(Index jcol, StorageIndex* marker)
|
42
|
+
: m_jcol(jcol), m_marker(marker)
|
43
|
+
{}
|
44
|
+
bool update_segrep(Index krep, StorageIndex jj)
|
45
|
+
{
|
46
|
+
if(m_marker[krep]<m_jcol)
|
47
|
+
{
|
48
|
+
m_marker[krep] = jj;
|
49
|
+
return true;
|
50
|
+
}
|
51
|
+
return false;
|
52
|
+
}
|
53
|
+
void mem_expand(IndexVector& /*glu.lsub*/, Index /*nextl*/, Index /*chmark*/) {}
|
54
|
+
enum { ExpandMem = false };
|
55
|
+
Index m_jcol;
|
56
|
+
StorageIndex* m_marker;
|
57
|
+
};
|
58
|
+
|
59
|
+
|
60
|
+
template <typename Scalar, typename StorageIndex>
|
61
|
+
template <typename Traits>
|
62
|
+
void SparseLUImpl<Scalar,StorageIndex>::dfs_kernel(const StorageIndex jj, IndexVector& perm_r,
|
63
|
+
Index& nseg, IndexVector& panel_lsub, IndexVector& segrep,
|
64
|
+
Ref<IndexVector> repfnz_col, IndexVector& xprune, Ref<IndexVector> marker, IndexVector& parent,
|
65
|
+
IndexVector& xplore, GlobalLU_t& glu,
|
66
|
+
Index& nextl_col, Index krow, Traits& traits
|
67
|
+
)
|
68
|
+
{
|
69
|
+
|
70
|
+
StorageIndex kmark = marker(krow);
|
71
|
+
|
72
|
+
// For each unmarked krow of jj
|
73
|
+
marker(krow) = jj;
|
74
|
+
StorageIndex kperm = perm_r(krow);
|
75
|
+
if (kperm == emptyIdxLU ) {
|
76
|
+
// krow is in L : place it in structure of L(*, jj)
|
77
|
+
panel_lsub(nextl_col++) = StorageIndex(krow); // krow is indexed into A
|
78
|
+
|
79
|
+
traits.mem_expand(panel_lsub, nextl_col, kmark);
|
80
|
+
}
|
81
|
+
else
|
82
|
+
{
|
83
|
+
// krow is in U : if its supernode-representative krep
|
84
|
+
// has been explored, update repfnz(*)
|
85
|
+
// krep = supernode representative of the current row
|
86
|
+
StorageIndex krep = glu.xsup(glu.supno(kperm)+1) - 1;
|
87
|
+
// First nonzero element in the current column:
|
88
|
+
StorageIndex myfnz = repfnz_col(krep);
|
89
|
+
|
90
|
+
if (myfnz != emptyIdxLU )
|
91
|
+
{
|
92
|
+
// Representative visited before
|
93
|
+
if (myfnz > kperm ) repfnz_col(krep) = kperm;
|
94
|
+
|
95
|
+
}
|
96
|
+
else
|
97
|
+
{
|
98
|
+
// Otherwise, perform dfs starting at krep
|
99
|
+
StorageIndex oldrep = emptyIdxLU;
|
100
|
+
parent(krep) = oldrep;
|
101
|
+
repfnz_col(krep) = kperm;
|
102
|
+
StorageIndex xdfs = glu.xlsub(krep);
|
103
|
+
Index maxdfs = xprune(krep);
|
104
|
+
|
105
|
+
StorageIndex kpar;
|
106
|
+
do
|
107
|
+
{
|
108
|
+
// For each unmarked kchild of krep
|
109
|
+
while (xdfs < maxdfs)
|
110
|
+
{
|
111
|
+
StorageIndex kchild = glu.lsub(xdfs);
|
112
|
+
xdfs++;
|
113
|
+
StorageIndex chmark = marker(kchild);
|
114
|
+
|
115
|
+
if (chmark != jj )
|
116
|
+
{
|
117
|
+
marker(kchild) = jj;
|
118
|
+
StorageIndex chperm = perm_r(kchild);
|
119
|
+
|
120
|
+
if (chperm == emptyIdxLU)
|
121
|
+
{
|
122
|
+
// case kchild is in L: place it in L(*, j)
|
123
|
+
panel_lsub(nextl_col++) = kchild;
|
124
|
+
traits.mem_expand(panel_lsub, nextl_col, chmark);
|
125
|
+
}
|
126
|
+
else
|
127
|
+
{
|
128
|
+
// case kchild is in U :
|
129
|
+
// chrep = its supernode-rep. If its rep has been explored,
|
130
|
+
// update its repfnz(*)
|
131
|
+
StorageIndex chrep = glu.xsup(glu.supno(chperm)+1) - 1;
|
132
|
+
myfnz = repfnz_col(chrep);
|
133
|
+
|
134
|
+
if (myfnz != emptyIdxLU)
|
135
|
+
{ // Visited before
|
136
|
+
if (myfnz > chperm)
|
137
|
+
repfnz_col(chrep) = chperm;
|
138
|
+
}
|
139
|
+
else
|
140
|
+
{ // Cont. dfs at snode-rep of kchild
|
141
|
+
xplore(krep) = xdfs;
|
142
|
+
oldrep = krep;
|
143
|
+
krep = chrep; // Go deeper down G(L)
|
144
|
+
parent(krep) = oldrep;
|
145
|
+
repfnz_col(krep) = chperm;
|
146
|
+
xdfs = glu.xlsub(krep);
|
147
|
+
maxdfs = xprune(krep);
|
148
|
+
|
149
|
+
} // end if myfnz != -1
|
150
|
+
} // end if chperm == -1
|
151
|
+
|
152
|
+
} // end if chmark !=jj
|
153
|
+
} // end while xdfs < maxdfs
|
154
|
+
|
155
|
+
// krow has no more unexplored nbrs :
|
156
|
+
// Place snode-rep krep in postorder DFS, if this
|
157
|
+
// segment is seen for the first time. (Note that
|
158
|
+
// "repfnz(krep)" may change later.)
|
159
|
+
// Baktrack dfs to its parent
|
160
|
+
if(traits.update_segrep(krep,jj))
|
161
|
+
//if (marker1(krep) < jcol )
|
162
|
+
{
|
163
|
+
segrep(nseg) = krep;
|
164
|
+
++nseg;
|
165
|
+
//marker1(krep) = jj;
|
166
|
+
}
|
167
|
+
|
168
|
+
kpar = parent(krep); // Pop recursion, mimic recursion
|
169
|
+
if (kpar == emptyIdxLU)
|
170
|
+
break; // dfs done
|
171
|
+
krep = kpar;
|
172
|
+
xdfs = xplore(krep);
|
173
|
+
maxdfs = xprune(krep);
|
174
|
+
|
175
|
+
} while (kpar != emptyIdxLU); // Do until empty stack
|
176
|
+
|
177
|
+
} // end if (myfnz = -1)
|
178
|
+
|
179
|
+
} // end if (kperm == -1)
|
180
|
+
}
|
181
|
+
|
182
|
+
/**
|
183
|
+
* \brief Performs a symbolic factorization on a panel of columns [jcol, jcol+w)
|
184
|
+
*
|
185
|
+
* A supernode representative is the last column of a supernode.
|
186
|
+
* The nonzeros in U[*,j] are segments that end at supernodes representatives
|
187
|
+
*
|
188
|
+
* The routine returns a list of the supernodal representatives
|
189
|
+
* in topological order of the dfs that generates them. This list is
|
190
|
+
* a superset of the topological order of each individual column within
|
191
|
+
* the panel.
|
192
|
+
* The location of the first nonzero in each supernodal segment
|
193
|
+
* (supernodal entry location) is also returned. Each column has
|
194
|
+
* a separate list for this purpose.
|
195
|
+
*
|
196
|
+
* Two markers arrays are used for dfs :
|
197
|
+
* marker[i] == jj, if i was visited during dfs of current column jj;
|
198
|
+
* marker1[i] >= jcol, if i was visited by earlier columns in this panel;
|
199
|
+
*
|
200
|
+
* \param[in] m number of rows in the matrix
|
201
|
+
* \param[in] w Panel size
|
202
|
+
* \param[in] jcol Starting column of the panel
|
203
|
+
* \param[in] A Input matrix in column-major storage
|
204
|
+
* \param[in] perm_r Row permutation
|
205
|
+
* \param[out] nseg Number of U segments
|
206
|
+
* \param[out] dense Accumulate the column vectors of the panel
|
207
|
+
* \param[out] panel_lsub Subscripts of the row in the panel
|
208
|
+
* \param[out] segrep Segment representative i.e first nonzero row of each segment
|
209
|
+
* \param[out] repfnz First nonzero location in each row
|
210
|
+
* \param[out] xprune The pruned elimination tree
|
211
|
+
* \param[out] marker work vector
|
212
|
+
* \param parent The elimination tree
|
213
|
+
* \param xplore work vector
|
214
|
+
* \param glu The global data structure
|
215
|
+
*
|
216
|
+
*/
|
217
|
+
|
218
|
+
template <typename Scalar, typename StorageIndex>
|
219
|
+
void SparseLUImpl<Scalar,StorageIndex>::panel_dfs(const Index m, const Index w, const Index jcol, MatrixType& A, IndexVector& perm_r, Index& nseg, ScalarVector& dense, IndexVector& panel_lsub, IndexVector& segrep, IndexVector& repfnz, IndexVector& xprune, IndexVector& marker, IndexVector& parent, IndexVector& xplore, GlobalLU_t& glu)
|
220
|
+
{
|
221
|
+
Index nextl_col; // Next available position in panel_lsub[*,jj]
|
222
|
+
|
223
|
+
// Initialize pointers
|
224
|
+
VectorBlock<IndexVector> marker1(marker, m, m);
|
225
|
+
nseg = 0;
|
226
|
+
|
227
|
+
panel_dfs_traits<IndexVector> traits(jcol, marker1.data());
|
228
|
+
|
229
|
+
// For each column in the panel
|
230
|
+
for (StorageIndex jj = StorageIndex(jcol); jj < jcol + w; jj++)
|
231
|
+
{
|
232
|
+
nextl_col = (jj - jcol) * m;
|
233
|
+
|
234
|
+
VectorBlock<IndexVector> repfnz_col(repfnz, nextl_col, m); // First nonzero location in each row
|
235
|
+
VectorBlock<ScalarVector> dense_col(dense,nextl_col, m); // Accumulate a column vector here
|
236
|
+
|
237
|
+
|
238
|
+
// For each nnz in A[*, jj] do depth first search
|
239
|
+
for (typename MatrixType::InnerIterator it(A, jj); it; ++it)
|
240
|
+
{
|
241
|
+
Index krow = it.row();
|
242
|
+
dense_col(krow) = it.value();
|
243
|
+
|
244
|
+
StorageIndex kmark = marker(krow);
|
245
|
+
if (kmark == jj)
|
246
|
+
continue; // krow visited before, go to the next nonzero
|
247
|
+
|
248
|
+
dfs_kernel(jj, perm_r, nseg, panel_lsub, segrep, repfnz_col, xprune, marker, parent,
|
249
|
+
xplore, glu, nextl_col, krow, traits);
|
250
|
+
}// end for nonzeros in column jj
|
251
|
+
|
252
|
+
} // end for column jj
|
253
|
+
}
|
254
|
+
|
255
|
+
} // end namespace internal
|
256
|
+
} // end namespace Eigen
|
257
|
+
|
258
|
+
#endif // SPARSELU_PANEL_DFS_H
|