tomoto 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +8 -10
- data/ext/tomoto/extconf.rb +6 -2
- data/ext/tomoto/{ext.cpp → tomoto.cpp} +1 -1
- data/lib/tomoto/version.rb +1 -1
- data/lib/tomoto.rb +5 -1
- data/vendor/EigenRand/EigenRand/Core.h +10 -10
- data/vendor/EigenRand/EigenRand/Dists/Basic.h +208 -9
- data/vendor/EigenRand/EigenRand/Dists/Discrete.h +52 -31
- data/vendor/EigenRand/EigenRand/Dists/GammaPoisson.h +9 -8
- data/vendor/EigenRand/EigenRand/Dists/NormalExp.h +28 -21
- data/vendor/EigenRand/EigenRand/EigenRand +11 -6
- data/vendor/EigenRand/EigenRand/Macro.h +13 -7
- data/vendor/EigenRand/EigenRand/MorePacketMath.h +348 -740
- data/vendor/EigenRand/EigenRand/MvDists/Multinomial.h +5 -3
- data/vendor/EigenRand/EigenRand/MvDists/MvNormal.h +9 -3
- data/vendor/EigenRand/EigenRand/PacketFilter.h +11 -253
- data/vendor/EigenRand/EigenRand/PacketRandomEngine.h +21 -47
- data/vendor/EigenRand/EigenRand/RandUtils.h +50 -344
- data/vendor/EigenRand/EigenRand/arch/AVX/MorePacketMath.h +619 -0
- data/vendor/EigenRand/EigenRand/arch/AVX/PacketFilter.h +149 -0
- data/vendor/EigenRand/EigenRand/arch/AVX/RandUtils.h +228 -0
- data/vendor/EigenRand/EigenRand/arch/NEON/MorePacketMath.h +473 -0
- data/vendor/EigenRand/EigenRand/arch/NEON/PacketFilter.h +142 -0
- data/vendor/EigenRand/EigenRand/arch/NEON/RandUtils.h +126 -0
- data/vendor/EigenRand/EigenRand/arch/SSE/MorePacketMath.h +501 -0
- data/vendor/EigenRand/EigenRand/arch/SSE/PacketFilter.h +133 -0
- data/vendor/EigenRand/EigenRand/arch/SSE/RandUtils.h +120 -0
- data/vendor/EigenRand/EigenRand/doc.h +24 -12
- data/vendor/EigenRand/README.md +57 -4
- data/vendor/eigen/COPYING.APACHE +203 -0
- data/vendor/eigen/COPYING.BSD +1 -1
- data/vendor/eigen/COPYING.MINPACK +51 -52
- data/vendor/eigen/Eigen/Cholesky +0 -1
- data/vendor/eigen/Eigen/Core +112 -265
- data/vendor/eigen/Eigen/Eigenvalues +2 -3
- data/vendor/eigen/Eigen/Geometry +5 -8
- data/vendor/eigen/Eigen/Householder +0 -1
- data/vendor/eigen/Eigen/Jacobi +0 -1
- data/vendor/eigen/Eigen/KLUSupport +41 -0
- data/vendor/eigen/Eigen/LU +2 -5
- data/vendor/eigen/Eigen/OrderingMethods +0 -3
- data/vendor/eigen/Eigen/PaStiXSupport +1 -0
- data/vendor/eigen/Eigen/PardisoSupport +0 -0
- data/vendor/eigen/Eigen/QR +2 -3
- data/vendor/eigen/Eigen/QtAlignedMalloc +0 -1
- data/vendor/eigen/Eigen/SVD +0 -1
- data/vendor/eigen/Eigen/Sparse +0 -2
- data/vendor/eigen/Eigen/SparseCholesky +0 -8
- data/vendor/eigen/Eigen/SparseLU +4 -0
- data/vendor/eigen/Eigen/SparseQR +0 -1
- data/vendor/eigen/Eigen/src/Cholesky/LDLT.h +42 -27
- data/vendor/eigen/Eigen/src/Cholesky/LLT.h +39 -23
- data/vendor/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +90 -47
- data/vendor/eigen/Eigen/src/Core/ArithmeticSequence.h +413 -0
- data/vendor/eigen/Eigen/src/Core/Array.h +99 -11
- data/vendor/eigen/Eigen/src/Core/ArrayBase.h +3 -3
- data/vendor/eigen/Eigen/src/Core/ArrayWrapper.h +21 -21
- data/vendor/eigen/Eigen/src/Core/Assign.h +1 -1
- data/vendor/eigen/Eigen/src/Core/AssignEvaluator.h +125 -50
- data/vendor/eigen/Eigen/src/Core/Assign_MKL.h +10 -10
- data/vendor/eigen/Eigen/src/Core/BandMatrix.h +16 -16
- data/vendor/eigen/Eigen/src/Core/Block.h +56 -60
- data/vendor/eigen/Eigen/src/Core/BooleanRedux.h +29 -31
- data/vendor/eigen/Eigen/src/Core/CommaInitializer.h +7 -3
- data/vendor/eigen/Eigen/src/Core/CoreEvaluators.h +325 -272
- data/vendor/eigen/Eigen/src/Core/CoreIterators.h +5 -0
- data/vendor/eigen/Eigen/src/Core/CwiseBinaryOp.h +21 -22
- data/vendor/eigen/Eigen/src/Core/CwiseNullaryOp.h +153 -18
- data/vendor/eigen/Eigen/src/Core/CwiseUnaryOp.h +6 -6
- data/vendor/eigen/Eigen/src/Core/CwiseUnaryView.h +14 -10
- data/vendor/eigen/Eigen/src/Core/DenseBase.h +132 -42
- data/vendor/eigen/Eigen/src/Core/DenseCoeffsBase.h +25 -21
- data/vendor/eigen/Eigen/src/Core/DenseStorage.h +153 -71
- data/vendor/eigen/Eigen/src/Core/Diagonal.h +21 -23
- data/vendor/eigen/Eigen/src/Core/DiagonalMatrix.h +50 -2
- data/vendor/eigen/Eigen/src/Core/DiagonalProduct.h +1 -1
- data/vendor/eigen/Eigen/src/Core/Dot.h +10 -10
- data/vendor/eigen/Eigen/src/Core/EigenBase.h +10 -9
- data/vendor/eigen/Eigen/src/Core/ForceAlignedAccess.h +8 -4
- data/vendor/eigen/Eigen/src/Core/Fuzzy.h +3 -3
- data/vendor/eigen/Eigen/src/Core/GeneralProduct.h +20 -10
- data/vendor/eigen/Eigen/src/Core/GenericPacketMath.h +599 -152
- data/vendor/eigen/Eigen/src/Core/GlobalFunctions.h +40 -33
- data/vendor/eigen/Eigen/src/Core/IO.h +40 -7
- data/vendor/eigen/Eigen/src/Core/IndexedView.h +237 -0
- data/vendor/eigen/Eigen/src/Core/Inverse.h +9 -10
- data/vendor/eigen/Eigen/src/Core/Map.h +7 -7
- data/vendor/eigen/Eigen/src/Core/MapBase.h +10 -3
- data/vendor/eigen/Eigen/src/Core/MathFunctions.h +767 -125
- data/vendor/eigen/Eigen/src/Core/MathFunctionsImpl.h +118 -19
- data/vendor/eigen/Eigen/src/Core/Matrix.h +131 -25
- data/vendor/eigen/Eigen/src/Core/MatrixBase.h +21 -3
- data/vendor/eigen/Eigen/src/Core/NestByValue.h +25 -50
- data/vendor/eigen/Eigen/src/Core/NoAlias.h +4 -3
- data/vendor/eigen/Eigen/src/Core/NumTraits.h +107 -20
- data/vendor/eigen/Eigen/src/Core/PartialReduxEvaluator.h +232 -0
- data/vendor/eigen/Eigen/src/Core/PermutationMatrix.h +3 -31
- data/vendor/eigen/Eigen/src/Core/PlainObjectBase.h +152 -59
- data/vendor/eigen/Eigen/src/Core/Product.h +30 -25
- data/vendor/eigen/Eigen/src/Core/ProductEvaluators.h +192 -125
- data/vendor/eigen/Eigen/src/Core/Random.h +37 -1
- data/vendor/eigen/Eigen/src/Core/Redux.h +180 -170
- data/vendor/eigen/Eigen/src/Core/Ref.h +121 -23
- data/vendor/eigen/Eigen/src/Core/Replicate.h +8 -8
- data/vendor/eigen/Eigen/src/Core/Reshaped.h +454 -0
- data/vendor/eigen/Eigen/src/Core/ReturnByValue.h +7 -5
- data/vendor/eigen/Eigen/src/Core/Reverse.h +18 -12
- data/vendor/eigen/Eigen/src/Core/Select.h +8 -6
- data/vendor/eigen/Eigen/src/Core/SelfAdjointView.h +33 -20
- data/vendor/eigen/Eigen/src/Core/Solve.h +14 -14
- data/vendor/eigen/Eigen/src/Core/SolveTriangular.h +16 -16
- data/vendor/eigen/Eigen/src/Core/SolverBase.h +41 -3
- data/vendor/eigen/Eigen/src/Core/StableNorm.h +100 -70
- data/vendor/eigen/Eigen/src/Core/StlIterators.h +463 -0
- data/vendor/eigen/Eigen/src/Core/Stride.h +9 -4
- data/vendor/eigen/Eigen/src/Core/Swap.h +5 -4
- data/vendor/eigen/Eigen/src/Core/Transpose.h +88 -27
- data/vendor/eigen/Eigen/src/Core/Transpositions.h +26 -47
- data/vendor/eigen/Eigen/src/Core/TriangularMatrix.h +93 -75
- data/vendor/eigen/Eigen/src/Core/VectorBlock.h +5 -5
- data/vendor/eigen/Eigen/src/Core/VectorwiseOp.h +159 -70
- data/vendor/eigen/Eigen/src/Core/Visitor.h +137 -29
- data/vendor/eigen/Eigen/src/Core/arch/AVX/Complex.h +50 -129
- data/vendor/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +126 -337
- data/vendor/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +1092 -155
- data/vendor/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +65 -1
- data/vendor/eigen/Eigen/src/Core/arch/AVX512/Complex.h +422 -0
- data/vendor/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +207 -236
- data/vendor/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +1482 -495
- data/vendor/eigen/Eigen/src/Core/arch/AVX512/TypeCasting.h +89 -0
- data/vendor/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +152 -165
- data/vendor/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +19 -251
- data/vendor/eigen/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +2937 -0
- data/vendor/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +221 -0
- data/vendor/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +629 -0
- data/vendor/eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h +2042 -392
- data/vendor/eigen/Eigen/src/Core/arch/CUDA/Complex.h +235 -80
- data/vendor/eigen/Eigen/src/Core/arch/Default/BFloat16.h +700 -0
- data/vendor/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +102 -14
- data/vendor/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +1649 -0
- data/vendor/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +110 -0
- data/vendor/eigen/Eigen/src/Core/arch/Default/Half.h +942 -0
- data/vendor/eigen/Eigen/src/Core/arch/Default/Settings.h +1 -1
- data/vendor/eigen/Eigen/src/Core/arch/Default/TypeCasting.h +120 -0
- data/vendor/eigen/Eigen/src/Core/arch/{CUDA → GPU}/MathFunctions.h +16 -4
- data/vendor/eigen/Eigen/src/Core/arch/GPU/PacketMath.h +1685 -0
- data/vendor/eigen/Eigen/src/Core/arch/GPU/TypeCasting.h +80 -0
- data/vendor/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h +23 -0
- data/vendor/eigen/Eigen/src/Core/arch/MSA/Complex.h +648 -0
- data/vendor/eigen/Eigen/src/Core/arch/MSA/MathFunctions.h +387 -0
- data/vendor/eigen/Eigen/src/Core/arch/MSA/PacketMath.h +1233 -0
- data/vendor/eigen/Eigen/src/Core/arch/NEON/Complex.h +313 -219
- data/vendor/eigen/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +183 -0
- data/vendor/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +54 -70
- data/vendor/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +4376 -549
- data/vendor/eigen/Eigen/src/Core/arch/NEON/TypeCasting.h +1419 -0
- data/vendor/eigen/Eigen/src/Core/arch/SSE/Complex.h +59 -179
- data/vendor/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +65 -428
- data/vendor/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +893 -283
- data/vendor/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +65 -0
- data/vendor/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h +44 -0
- data/vendor/eigen/Eigen/src/Core/arch/SVE/PacketMath.h +752 -0
- data/vendor/eigen/Eigen/src/Core/arch/SVE/TypeCasting.h +49 -0
- data/vendor/eigen/Eigen/src/Core/arch/SYCL/InteropHeaders.h +232 -0
- data/vendor/eigen/Eigen/src/Core/arch/SYCL/MathFunctions.h +301 -0
- data/vendor/eigen/Eigen/src/Core/arch/SYCL/PacketMath.h +670 -0
- data/vendor/eigen/Eigen/src/Core/arch/SYCL/SyclMemoryModel.h +694 -0
- data/vendor/eigen/Eigen/src/Core/arch/SYCL/TypeCasting.h +85 -0
- data/vendor/eigen/Eigen/src/Core/arch/ZVector/Complex.h +212 -183
- data/vendor/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +101 -5
- data/vendor/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +510 -395
- data/vendor/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +11 -2
- data/vendor/eigen/Eigen/src/Core/functors/BinaryFunctors.h +112 -46
- data/vendor/eigen/Eigen/src/Core/functors/NullaryFunctors.h +31 -30
- data/vendor/eigen/Eigen/src/Core/functors/StlFunctors.h +32 -2
- data/vendor/eigen/Eigen/src/Core/functors/UnaryFunctors.h +355 -16
- data/vendor/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +1075 -586
- data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +49 -24
- data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +41 -35
- data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +6 -6
- data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +4 -2
- data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +382 -483
- data/vendor/eigen/Eigen/src/Core/products/Parallelizer.h +22 -5
- data/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +53 -30
- data/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +16 -8
- data/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +8 -6
- data/vendor/eigen/Eigen/src/Core/products/SelfadjointProduct.h +4 -4
- data/vendor/eigen/Eigen/src/Core/products/SelfadjointRank2Update.h +5 -4
- data/vendor/eigen/Eigen/src/Core/products/TriangularMatrixMatrix.h +33 -27
- data/vendor/eigen/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +14 -12
- data/vendor/eigen/Eigen/src/Core/products/TriangularSolverMatrix.h +36 -34
- data/vendor/eigen/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +8 -4
- data/vendor/eigen/Eigen/src/Core/products/TriangularSolverVector.h +13 -10
- data/vendor/eigen/Eigen/src/Core/util/BlasUtil.h +304 -119
- data/vendor/eigen/Eigen/src/Core/util/ConfigureVectorization.h +512 -0
- data/vendor/eigen/Eigen/src/Core/util/Constants.h +25 -9
- data/vendor/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +26 -3
- data/vendor/eigen/Eigen/src/Core/util/ForwardDeclarations.h +29 -9
- data/vendor/eigen/Eigen/src/Core/util/IndexedViewHelper.h +186 -0
- data/vendor/eigen/Eigen/src/Core/util/IntegralConstant.h +272 -0
- data/vendor/eigen/Eigen/src/Core/util/MKL_support.h +8 -1
- data/vendor/eigen/Eigen/src/Core/util/Macros.h +709 -246
- data/vendor/eigen/Eigen/src/Core/util/Memory.h +222 -52
- data/vendor/eigen/Eigen/src/Core/util/Meta.h +355 -77
- data/vendor/eigen/Eigen/src/Core/util/ReenableStupidWarnings.h +5 -1
- data/vendor/eigen/Eigen/src/Core/util/ReshapedHelper.h +51 -0
- data/vendor/eigen/Eigen/src/Core/util/StaticAssert.h +8 -5
- data/vendor/eigen/Eigen/src/Core/util/SymbolicIndex.h +293 -0
- data/vendor/eigen/Eigen/src/Core/util/XprHelper.h +65 -30
- data/vendor/eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h +1 -1
- data/vendor/eigen/Eigen/src/Eigenvalues/ComplexSchur.h +7 -4
- data/vendor/eigen/Eigen/src/Eigenvalues/EigenSolver.h +2 -2
- data/vendor/eigen/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +1 -1
- data/vendor/eigen/Eigen/src/Eigenvalues/HessenbergDecomposition.h +2 -2
- data/vendor/eigen/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +2 -2
- data/vendor/eigen/Eigen/src/Eigenvalues/RealQZ.h +9 -6
- data/vendor/eigen/Eigen/src/Eigenvalues/RealSchur.h +21 -9
- data/vendor/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +77 -43
- data/vendor/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +20 -15
- data/vendor/eigen/Eigen/src/Geometry/AlignedBox.h +99 -5
- data/vendor/eigen/Eigen/src/Geometry/AngleAxis.h +4 -4
- data/vendor/eigen/Eigen/src/Geometry/EulerAngles.h +3 -3
- data/vendor/eigen/Eigen/src/Geometry/Homogeneous.h +15 -11
- data/vendor/eigen/Eigen/src/Geometry/Hyperplane.h +1 -1
- data/vendor/eigen/Eigen/src/Geometry/OrthoMethods.h +3 -2
- data/vendor/eigen/Eigen/src/Geometry/ParametrizedLine.h +39 -2
- data/vendor/eigen/Eigen/src/Geometry/Quaternion.h +70 -14
- data/vendor/eigen/Eigen/src/Geometry/Rotation2D.h +3 -3
- data/vendor/eigen/Eigen/src/Geometry/Scaling.h +23 -5
- data/vendor/eigen/Eigen/src/Geometry/Transform.h +88 -67
- data/vendor/eigen/Eigen/src/Geometry/Translation.h +6 -12
- data/vendor/eigen/Eigen/src/Geometry/Umeyama.h +1 -1
- data/vendor/eigen/Eigen/src/Geometry/arch/Geometry_SIMD.h +168 -0
- data/vendor/eigen/Eigen/src/Householder/BlockHouseholder.h +9 -2
- data/vendor/eigen/Eigen/src/Householder/Householder.h +8 -4
- data/vendor/eigen/Eigen/src/Householder/HouseholderSequence.h +123 -48
- data/vendor/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +15 -15
- data/vendor/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +7 -23
- data/vendor/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +5 -22
- data/vendor/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +41 -47
- data/vendor/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +51 -60
- data/vendor/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +70 -20
- data/vendor/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +2 -20
- data/vendor/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +11 -9
- data/vendor/eigen/Eigen/src/Jacobi/Jacobi.h +31 -10
- data/vendor/eigen/Eigen/src/KLUSupport/KLUSupport.h +358 -0
- data/vendor/eigen/Eigen/src/LU/Determinant.h +35 -19
- data/vendor/eigen/Eigen/src/LU/FullPivLU.h +29 -43
- data/vendor/eigen/Eigen/src/LU/InverseImpl.h +25 -8
- data/vendor/eigen/Eigen/src/LU/PartialPivLU.h +71 -58
- data/vendor/eigen/Eigen/src/LU/arch/InverseSize4.h +351 -0
- data/vendor/eigen/Eigen/src/OrderingMethods/Amd.h +7 -17
- data/vendor/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +297 -277
- data/vendor/eigen/Eigen/src/OrderingMethods/Ordering.h +6 -10
- data/vendor/eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h +1 -1
- data/vendor/eigen/Eigen/src/PardisoSupport/PardisoSupport.h +9 -7
- data/vendor/eigen/Eigen/src/QR/ColPivHouseholderQR.h +41 -20
- data/vendor/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +100 -27
- data/vendor/eigen/Eigen/src/QR/FullPivHouseholderQR.h +59 -22
- data/vendor/eigen/Eigen/src/QR/HouseholderQR.h +48 -23
- data/vendor/eigen/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +25 -3
- data/vendor/eigen/Eigen/src/SVD/BDCSVD.h +183 -63
- data/vendor/eigen/Eigen/src/SVD/JacobiSVD.h +22 -14
- data/vendor/eigen/Eigen/src/SVD/SVDBase.h +83 -22
- data/vendor/eigen/Eigen/src/SVD/UpperBidiagonalization.h +3 -3
- data/vendor/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +17 -9
- data/vendor/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +12 -37
- data/vendor/eigen/Eigen/src/SparseCore/AmbiVector.h +3 -2
- data/vendor/eigen/Eigen/src/SparseCore/CompressedStorage.h +16 -0
- data/vendor/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +6 -6
- data/vendor/eigen/Eigen/src/SparseCore/SparseAssign.h +81 -27
- data/vendor/eigen/Eigen/src/SparseCore/SparseBlock.h +25 -57
- data/vendor/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +40 -11
- data/vendor/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +11 -15
- data/vendor/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +4 -2
- data/vendor/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +30 -8
- data/vendor/eigen/Eigen/src/SparseCore/SparseMatrix.h +126 -11
- data/vendor/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +5 -12
- data/vendor/eigen/Eigen/src/SparseCore/SparseProduct.h +13 -1
- data/vendor/eigen/Eigen/src/SparseCore/SparseRef.h +7 -7
- data/vendor/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h +5 -2
- data/vendor/eigen/Eigen/src/SparseCore/SparseUtil.h +8 -0
- data/vendor/eigen/Eigen/src/SparseCore/SparseVector.h +1 -1
- data/vendor/eigen/Eigen/src/SparseCore/SparseView.h +1 -0
- data/vendor/eigen/Eigen/src/SparseLU/SparseLU.h +162 -12
- data/vendor/eigen/Eigen/src/SparseLU/SparseLU_Memory.h +1 -1
- data/vendor/eigen/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +76 -2
- data/vendor/eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h +2 -2
- data/vendor/eigen/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +1 -1
- data/vendor/eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h +1 -1
- data/vendor/eigen/Eigen/src/SparseQR/SparseQR.h +19 -6
- data/vendor/eigen/Eigen/src/StlSupport/StdDeque.h +2 -12
- data/vendor/eigen/Eigen/src/StlSupport/StdList.h +2 -2
- data/vendor/eigen/Eigen/src/StlSupport/StdVector.h +2 -2
- data/vendor/eigen/Eigen/src/SuperLUSupport/SuperLUSupport.h +6 -8
- data/vendor/eigen/Eigen/src/UmfPackSupport/UmfPackSupport.h +175 -39
- data/vendor/eigen/Eigen/src/misc/lapacke.h +5 -4
- data/vendor/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.h +28 -2
- data/vendor/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h +155 -11
- data/vendor/eigen/Eigen/src/plugins/BlockMethods.h +626 -242
- data/vendor/eigen/Eigen/src/plugins/CommonCwiseUnaryOps.h +14 -0
- data/vendor/eigen/Eigen/src/plugins/IndexedViewMethods.h +262 -0
- data/vendor/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h +4 -4
- data/vendor/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h +10 -0
- data/vendor/eigen/Eigen/src/plugins/ReshapedMethods.h +149 -0
- data/vendor/eigen/README.md +2 -0
- data/vendor/eigen/bench/btl/README +1 -1
- data/vendor/eigen/bench/tensors/README +6 -7
- data/vendor/eigen/ci/README.md +56 -0
- data/vendor/eigen/demos/mix_eigen_and_c/README +1 -1
- data/vendor/eigen/unsupported/Eigen/CXX11/src/Tensor/README.md +213 -158
- data/vendor/eigen/unsupported/README.txt +1 -1
- data/vendor/tomotopy/README.kr.rst +21 -0
- data/vendor/tomotopy/README.rst +20 -0
- data/vendor/tomotopy/src/Labeling/FoRelevance.cpp +2 -2
- data/vendor/tomotopy/src/Labeling/Phraser.hpp +1 -1
- data/vendor/tomotopy/src/TopicModel/CTModel.hpp +2 -1
- data/vendor/tomotopy/src/TopicModel/DMRModel.hpp +2 -1
- data/vendor/tomotopy/src/TopicModel/DTModel.hpp +1 -1
- data/vendor/tomotopy/src/TopicModel/GDMRModel.hpp +2 -2
- data/vendor/tomotopy/src/TopicModel/HDP.h +1 -0
- data/vendor/tomotopy/src/TopicModel/HDPModel.hpp +53 -2
- data/vendor/tomotopy/src/TopicModel/HLDAModel.hpp +1 -1
- data/vendor/tomotopy/src/TopicModel/HPAModel.hpp +1 -0
- data/vendor/tomotopy/src/TopicModel/LDACVB0Model.hpp +2 -2
- data/vendor/tomotopy/src/TopicModel/LDAModel.hpp +16 -5
- data/vendor/tomotopy/src/TopicModel/LLDAModel.hpp +1 -0
- data/vendor/tomotopy/src/TopicModel/MGLDAModel.hpp +1 -0
- data/vendor/tomotopy/src/TopicModel/PLDAModel.hpp +1 -0
- data/vendor/tomotopy/src/TopicModel/PT.h +3 -1
- data/vendor/tomotopy/src/TopicModel/PTModel.hpp +31 -1
- data/vendor/tomotopy/src/TopicModel/SLDAModel.hpp +2 -2
- data/vendor/tomotopy/src/TopicModel/TopicModel.hpp +7 -5
- data/vendor/tomotopy/src/Utils/EigenAddonOps.hpp +36 -1
- data/vendor/tomotopy/src/Utils/exception.h +6 -0
- data/vendor/tomotopy/src/Utils/sample.hpp +14 -12
- data/vendor/tomotopy/src/Utils/sse_gamma.h +0 -3
- metadata +60 -14
- data/vendor/eigen/Eigen/CMakeLists.txt +0 -19
- data/vendor/eigen/Eigen/src/Core/arch/CUDA/Half.h +0 -674
- data/vendor/eigen/Eigen/src/Core/arch/CUDA/PacketMath.h +0 -333
- data/vendor/eigen/Eigen/src/Core/arch/CUDA/PacketMathHalf.h +0 -1124
- data/vendor/eigen/Eigen/src/Core/arch/CUDA/TypeCasting.h +0 -212
- data/vendor/eigen/Eigen/src/Geometry/arch/Geometry_SSE.h +0 -161
- data/vendor/eigen/Eigen/src/LU/arch/Inverse_SSE.h +0 -338
@@ -13,115 +13,119 @@
|
|
13
13
|
// Davis (davis@cise.ufl.edu), University of Florida. The algorithm was
|
14
14
|
// developed in collaboration with John Gilbert, Xerox PARC, and Esmond
|
15
15
|
// Ng, Oak Ridge National Laboratory.
|
16
|
-
//
|
16
|
+
//
|
17
17
|
// Date:
|
18
|
-
//
|
18
|
+
//
|
19
19
|
// September 8, 2003. Version 2.3.
|
20
|
-
//
|
20
|
+
//
|
21
21
|
// Acknowledgements:
|
22
|
-
//
|
22
|
+
//
|
23
23
|
// This work was supported by the National Science Foundation, under
|
24
24
|
// grants DMS-9504974 and DMS-9803599.
|
25
|
-
//
|
25
|
+
//
|
26
26
|
// Notice:
|
27
|
-
//
|
27
|
+
//
|
28
28
|
// Copyright (c) 1998-2003 by the University of Florida.
|
29
29
|
// All Rights Reserved.
|
30
|
-
//
|
30
|
+
//
|
31
31
|
// THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
|
32
32
|
// EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
|
33
|
-
//
|
33
|
+
//
|
34
34
|
// Permission is hereby granted to use, copy, modify, and/or distribute
|
35
35
|
// this program, provided that the Copyright, this License, and the
|
36
36
|
// Availability of the original version is retained on all copies and made
|
37
37
|
// accessible to the end-user of any code or package that includes COLAMD
|
38
|
-
// or any modified version of COLAMD.
|
39
|
-
//
|
38
|
+
// or any modified version of COLAMD.
|
39
|
+
//
|
40
40
|
// Availability:
|
41
|
-
//
|
41
|
+
//
|
42
42
|
// The colamd/symamd library is available at
|
43
|
-
//
|
43
|
+
//
|
44
44
|
// http://www.suitesparse.com
|
45
45
|
|
46
|
-
|
46
|
+
|
47
47
|
#ifndef EIGEN_COLAMD_H
|
48
48
|
#define EIGEN_COLAMD_H
|
49
49
|
|
50
50
|
namespace internal {
|
51
|
+
|
52
|
+
namespace Colamd {
|
53
|
+
|
51
54
|
/* Ensure that debugging is turned off: */
|
52
55
|
#ifndef COLAMD_NDEBUG
|
53
56
|
#define COLAMD_NDEBUG
|
54
57
|
#endif /* NDEBUG */
|
58
|
+
|
59
|
+
|
55
60
|
/* ========================================================================== */
|
56
61
|
/* === Knob and statistics definitions ====================================== */
|
57
62
|
/* ========================================================================== */
|
58
63
|
|
59
64
|
/* size of the knobs [ ] array. Only knobs [0..1] are currently used. */
|
60
|
-
|
65
|
+
const int NKnobs = 20;
|
61
66
|
|
62
67
|
/* number of output statistics. Only stats [0..6] are currently used. */
|
63
|
-
|
68
|
+
const int NStats = 20;
|
64
69
|
|
65
|
-
/* knobs
|
66
|
-
|
70
|
+
/* Indices into knobs and stats array. */
|
71
|
+
enum KnobsStatsIndex {
|
72
|
+
/* knobs [0] and stats [0]: dense row knob and output statistic. */
|
73
|
+
DenseRow = 0,
|
67
74
|
|
68
|
-
/* knobs [1] and stats [1]: dense column knob and output statistic. */
|
69
|
-
|
75
|
+
/* knobs [1] and stats [1]: dense column knob and output statistic. */
|
76
|
+
DenseCol = 1,
|
70
77
|
|
71
|
-
/* stats [2]: memory defragmentation count output statistic */
|
72
|
-
|
78
|
+
/* stats [2]: memory defragmentation count output statistic */
|
79
|
+
DefragCount = 2,
|
73
80
|
|
74
|
-
/* stats [3]: colamd status: zero OK, > 0 warning or notice, < 0 error */
|
75
|
-
|
81
|
+
/* stats [3]: colamd status: zero OK, > 0 warning or notice, < 0 error */
|
82
|
+
Status = 3,
|
76
83
|
|
77
|
-
/* stats [4..6]: error info, or info on jumbled columns */
|
78
|
-
|
79
|
-
|
80
|
-
|
84
|
+
/* stats [4..6]: error info, or info on jumbled columns */
|
85
|
+
Info1 = 4,
|
86
|
+
Info2 = 5,
|
87
|
+
Info3 = 6
|
88
|
+
};
|
81
89
|
|
82
90
|
/* error codes returned in stats [3]: */
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
91
|
+
enum Status {
|
92
|
+
Ok = 0,
|
93
|
+
OkButJumbled = 1,
|
94
|
+
ErrorANotPresent = -1,
|
95
|
+
ErrorPNotPresent = -2,
|
96
|
+
ErrorNrowNegative = -3,
|
97
|
+
ErrorNcolNegative = -4,
|
98
|
+
ErrorNnzNegative = -5,
|
99
|
+
ErrorP0Nonzero = -6,
|
100
|
+
ErrorATooSmall = -7,
|
101
|
+
ErrorColLengthNegative = -8,
|
102
|
+
ErrorRowIndexOutOfBounds = -9,
|
103
|
+
ErrorOutOfMemory = -10,
|
104
|
+
ErrorInternalError = -999
|
105
|
+
};
|
97
106
|
/* ========================================================================== */
|
98
107
|
/* === Definitions ========================================================== */
|
99
108
|
/* ========================================================================== */
|
100
109
|
|
101
|
-
|
110
|
+
template <typename IndexType>
|
111
|
+
IndexType ones_complement(const IndexType r) {
|
112
|
+
return (-(r)-1);
|
113
|
+
}
|
102
114
|
|
103
115
|
/* -------------------------------------------------------------------------- */
|
104
|
-
|
105
|
-
#define COLAMD_EMPTY (-1)
|
116
|
+
const int Empty = -1;
|
106
117
|
|
107
118
|
/* Row and column status */
|
108
|
-
|
109
|
-
|
119
|
+
enum RowColumnStatus {
|
120
|
+
Alive = 0,
|
121
|
+
Dead = -1
|
122
|
+
};
|
110
123
|
|
111
124
|
/* Column status */
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
#define ROW_IS_DEAD(r) ROW_IS_MARKED_DEAD (Row[r].shared2.mark)
|
117
|
-
#define ROW_IS_MARKED_DEAD(row_mark) (row_mark < ALIVE)
|
118
|
-
#define ROW_IS_ALIVE(r) (Row [r].shared2.mark >= ALIVE)
|
119
|
-
#define COL_IS_DEAD(c) (Col [c].start < ALIVE)
|
120
|
-
#define COL_IS_ALIVE(c) (Col [c].start >= ALIVE)
|
121
|
-
#define COL_IS_DEAD_PRINCIPAL(c) (Col [c].start == DEAD_PRINCIPAL)
|
122
|
-
#define KILL_ROW(r) { Row [r].shared2.mark = DEAD ; }
|
123
|
-
#define KILL_PRINCIPAL_COL(c) { Col [c].start = DEAD_PRINCIPAL ; }
|
124
|
-
#define KILL_NON_PRINCIPAL_COL(c) { Col [c].start = DEAD_NON_PRINCIPAL ; }
|
125
|
+
enum ColumnStatus {
|
126
|
+
DeadPrincipal = -1,
|
127
|
+
DeadNonPrincipal = -2
|
128
|
+
};
|
125
129
|
|
126
130
|
/* ========================================================================== */
|
127
131
|
/* === Colamd reporting mechanism =========================================== */
|
@@ -129,9 +133,9 @@ namespace internal {
|
|
129
133
|
|
130
134
|
// == Row and Column structures ==
|
131
135
|
template <typename IndexType>
|
132
|
-
struct
|
136
|
+
struct ColStructure
|
133
137
|
{
|
134
|
-
IndexType start ; /* index for A of first row in this column, or
|
138
|
+
IndexType start ; /* index for A of first row in this column, or Dead */
|
135
139
|
/* if column is dead */
|
136
140
|
IndexType length ; /* number of rows in this column */
|
137
141
|
union
|
@@ -159,11 +163,21 @@ struct colamd_col
|
|
159
163
|
IndexType degree_next ; /* next column, if col is in a degree list */
|
160
164
|
IndexType hash_next ; /* next column, if col is in a hash list */
|
161
165
|
} shared4 ;
|
162
|
-
|
166
|
+
|
167
|
+
inline bool is_dead() const { return start < Alive; }
|
168
|
+
|
169
|
+
inline bool is_alive() const { return start >= Alive; }
|
170
|
+
|
171
|
+
inline bool is_dead_principal() const { return start == DeadPrincipal; }
|
172
|
+
|
173
|
+
inline void kill_principal() { start = DeadPrincipal; }
|
174
|
+
|
175
|
+
inline void kill_non_principal() { start = DeadNonPrincipal; }
|
176
|
+
|
163
177
|
};
|
164
|
-
|
178
|
+
|
165
179
|
template <typename IndexType>
|
166
|
-
struct
|
180
|
+
struct RowStructure
|
167
181
|
{
|
168
182
|
IndexType start ; /* index for A of first col in this row */
|
169
183
|
IndexType length ; /* number of principal columns in this row */
|
@@ -177,13 +191,19 @@ struct Colamd_Row
|
|
177
191
|
IndexType mark ; /* for computing set differences and marking dead rows*/
|
178
192
|
IndexType first_column ;/* first column in row (used in garbage collection) */
|
179
193
|
} shared2 ;
|
180
|
-
|
194
|
+
|
195
|
+
inline bool is_dead() const { return shared2.mark < Alive; }
|
196
|
+
|
197
|
+
inline bool is_alive() const { return shared2.mark >= Alive; }
|
198
|
+
|
199
|
+
inline void kill() { shared2.mark = Dead; }
|
200
|
+
|
181
201
|
};
|
182
|
-
|
202
|
+
|
183
203
|
/* ========================================================================== */
|
184
204
|
/* === Colamd recommended memory size ======================================= */
|
185
205
|
/* ========================================================================== */
|
186
|
-
|
206
|
+
|
187
207
|
/*
|
188
208
|
The recommended length Alen of the array A passed to colamd is given by
|
189
209
|
the COLAMD_RECOMMENDED (nnz, n_row, n_col) macro. It returns -1 if any
|
@@ -192,41 +212,41 @@ struct Colamd_Row
|
|
192
212
|
required for the Col and Row arrays, respectively, which are internal to
|
193
213
|
colamd. An additional n_col space is the minimal amount of "elbow room",
|
194
214
|
and nnz/5 more space is recommended for run time efficiency.
|
195
|
-
|
215
|
+
|
196
216
|
This macro is not needed when using symamd.
|
197
|
-
|
217
|
+
|
198
218
|
Explicit typecast to IndexType added Sept. 23, 2002, COLAMD version 2.2, to avoid
|
199
219
|
gcc -pedantic warning messages.
|
200
220
|
*/
|
201
221
|
template <typename IndexType>
|
202
|
-
inline IndexType colamd_c(IndexType n_col)
|
203
|
-
{ return IndexType( ((n_col) + 1) * sizeof (
|
222
|
+
inline IndexType colamd_c(IndexType n_col)
|
223
|
+
{ return IndexType( ((n_col) + 1) * sizeof (ColStructure<IndexType>) / sizeof (IndexType) ) ; }
|
204
224
|
|
205
225
|
template <typename IndexType>
|
206
226
|
inline IndexType colamd_r(IndexType n_row)
|
207
|
-
{ return IndexType(((n_row) + 1) * sizeof (
|
227
|
+
{ return IndexType(((n_row) + 1) * sizeof (RowStructure<IndexType>) / sizeof (IndexType)); }
|
208
228
|
|
209
229
|
// Prototypes of non-user callable routines
|
210
230
|
template <typename IndexType>
|
211
|
-
static IndexType init_rows_cols (IndexType n_row, IndexType n_col,
|
231
|
+
static IndexType init_rows_cols (IndexType n_row, IndexType n_col, RowStructure<IndexType> Row [], ColStructure<IndexType> col [], IndexType A [], IndexType p [], IndexType stats[NStats] );
|
212
232
|
|
213
233
|
template <typename IndexType>
|
214
|
-
static void init_scoring (IndexType n_row, IndexType n_col,
|
234
|
+
static void init_scoring (IndexType n_row, IndexType n_col, RowStructure<IndexType> Row [], ColStructure<IndexType> Col [], IndexType A [], IndexType head [], double knobs[NKnobs], IndexType *p_n_row2, IndexType *p_n_col2, IndexType *p_max_deg);
|
215
235
|
|
216
236
|
template <typename IndexType>
|
217
|
-
static IndexType find_ordering (IndexType n_row, IndexType n_col, IndexType Alen,
|
237
|
+
static IndexType find_ordering (IndexType n_row, IndexType n_col, IndexType Alen, RowStructure<IndexType> Row [], ColStructure<IndexType> Col [], IndexType A [], IndexType head [], IndexType n_col2, IndexType max_deg, IndexType pfree);
|
218
238
|
|
219
239
|
template <typename IndexType>
|
220
|
-
static void order_children (IndexType n_col,
|
240
|
+
static void order_children (IndexType n_col, ColStructure<IndexType> Col [], IndexType p []);
|
221
241
|
|
222
242
|
template <typename IndexType>
|
223
|
-
static void detect_super_cols (
|
243
|
+
static void detect_super_cols (ColStructure<IndexType> Col [], IndexType A [], IndexType head [], IndexType row_start, IndexType row_length ) ;
|
224
244
|
|
225
245
|
template <typename IndexType>
|
226
|
-
static IndexType garbage_collection (IndexType n_row, IndexType n_col,
|
246
|
+
static IndexType garbage_collection (IndexType n_row, IndexType n_col, RowStructure<IndexType> Row [], ColStructure<IndexType> Col [], IndexType A [], IndexType *pfree) ;
|
227
247
|
|
228
248
|
template <typename IndexType>
|
229
|
-
static inline IndexType clear_mark (IndexType n_row,
|
249
|
+
static inline IndexType clear_mark (IndexType n_row, RowStructure<IndexType> Row [] ) ;
|
230
250
|
|
231
251
|
/* === No debugging ========================================================= */
|
232
252
|
|
@@ -240,37 +260,37 @@ static inline IndexType clear_mark (IndexType n_row, Colamd_Row<IndexType> Row
|
|
240
260
|
|
241
261
|
|
242
262
|
/**
|
243
|
-
* \brief Returns the recommended value of Alen
|
244
|
-
*
|
245
|
-
* Returns recommended value of Alen for use by colamd.
|
246
|
-
* Returns -1 if any input argument is negative.
|
247
|
-
* The use of this routine or macro is optional.
|
248
|
-
* Note that the macro uses its arguments more than once,
|
249
|
-
* so be careful for side effects, if you pass expressions as arguments to COLAMD_RECOMMENDED.
|
250
|
-
*
|
263
|
+
* \brief Returns the recommended value of Alen
|
264
|
+
*
|
265
|
+
* Returns recommended value of Alen for use by colamd.
|
266
|
+
* Returns -1 if any input argument is negative.
|
267
|
+
* The use of this routine or macro is optional.
|
268
|
+
* Note that the macro uses its arguments more than once,
|
269
|
+
* so be careful for side effects, if you pass expressions as arguments to COLAMD_RECOMMENDED.
|
270
|
+
*
|
251
271
|
* \param nnz nonzeros in A
|
252
272
|
* \param n_row number of rows in A
|
253
273
|
* \param n_col number of columns in A
|
254
274
|
* \return recommended value of Alen for use by colamd
|
255
275
|
*/
|
256
276
|
template <typename IndexType>
|
257
|
-
inline IndexType
|
277
|
+
inline IndexType recommended ( IndexType nnz, IndexType n_row, IndexType n_col)
|
258
278
|
{
|
259
279
|
if ((nnz) < 0 || (n_row) < 0 || (n_col) < 0)
|
260
280
|
return (-1);
|
261
281
|
else
|
262
|
-
return (2 * (nnz) + colamd_c (n_col) + colamd_r (n_row) + (n_col) + ((nnz) / 5));
|
282
|
+
return (2 * (nnz) + colamd_c (n_col) + colamd_r (n_row) + (n_col) + ((nnz) / 5));
|
263
283
|
}
|
264
284
|
|
265
285
|
/**
|
266
286
|
* \brief set default parameters The use of this routine is optional.
|
267
|
-
*
|
268
|
-
* Colamd: rows with more than (knobs [
|
287
|
+
*
|
288
|
+
* Colamd: rows with more than (knobs [DenseRow] * n_col)
|
269
289
|
* entries are removed prior to ordering. Columns with more than
|
270
|
-
* (knobs [
|
271
|
-
* ordering, and placed last in the output column ordering.
|
290
|
+
* (knobs [DenseCol] * n_row) entries are removed prior to
|
291
|
+
* ordering, and placed last in the output column ordering.
|
272
292
|
*
|
273
|
-
*
|
293
|
+
* DenseRow and DenseCol are defined as 0 and 1,
|
274
294
|
* respectively, in colamd.h. Default values of these two knobs
|
275
295
|
* are both 0.5. Currently, only knobs [0] and knobs [1] are
|
276
296
|
* used, but future versions may use more knobs. If so, they will
|
@@ -279,37 +299,37 @@ inline IndexType colamd_recommended ( IndexType nnz, IndexType n_row, IndexType
|
|
279
299
|
* not need to change, assuming that you either use
|
280
300
|
* colamd_set_defaults, or pass a (double *) NULL pointer as the
|
281
301
|
* knobs array to colamd or symamd.
|
282
|
-
*
|
302
|
+
*
|
283
303
|
* \param knobs parameter settings for colamd
|
284
304
|
*/
|
285
305
|
|
286
|
-
static inline void
|
306
|
+
static inline void set_defaults(double knobs[NKnobs])
|
287
307
|
{
|
288
308
|
/* === Local variables ================================================== */
|
289
|
-
|
309
|
+
|
290
310
|
int i ;
|
291
311
|
|
292
312
|
if (!knobs)
|
293
313
|
{
|
294
314
|
return ; /* no knobs to initialize */
|
295
315
|
}
|
296
|
-
for (i = 0 ; i <
|
316
|
+
for (i = 0 ; i < NKnobs ; i++)
|
297
317
|
{
|
298
318
|
knobs [i] = 0 ;
|
299
319
|
}
|
300
|
-
knobs [
|
301
|
-
knobs [
|
320
|
+
knobs [Colamd::DenseRow] = 0.5 ; /* ignore rows over 50% dense */
|
321
|
+
knobs [Colamd::DenseCol] = 0.5 ; /* ignore columns over 50% dense */
|
302
322
|
}
|
303
323
|
|
304
|
-
/**
|
324
|
+
/**
|
305
325
|
* \brief Computes a column ordering using the column approximate minimum degree ordering
|
306
|
-
*
|
326
|
+
*
|
307
327
|
* Computes a column ordering (Q) of A such that P(AQ)=LU or
|
308
328
|
* (AQ)'AQ=LL' have less fill-in and require fewer floating point
|
309
329
|
* operations than factorizing the unpermuted matrix A or A'A,
|
310
330
|
* respectively.
|
311
|
-
*
|
312
|
-
*
|
331
|
+
*
|
332
|
+
*
|
313
333
|
* \param n_row number of rows in A
|
314
334
|
* \param n_col number of columns in A
|
315
335
|
* \param Alen, size of the array A
|
@@ -319,143 +339,143 @@ static inline void colamd_set_defaults(double knobs[COLAMD_KNOBS])
|
|
319
339
|
* \param stats colamd output statistics and error codes
|
320
340
|
*/
|
321
341
|
template <typename IndexType>
|
322
|
-
static bool
|
342
|
+
static bool compute_ordering(IndexType n_row, IndexType n_col, IndexType Alen, IndexType *A, IndexType *p, double knobs[NKnobs], IndexType stats[NStats])
|
323
343
|
{
|
324
344
|
/* === Local variables ================================================== */
|
325
|
-
|
345
|
+
|
326
346
|
IndexType i ; /* loop index */
|
327
347
|
IndexType nnz ; /* nonzeros in A */
|
328
348
|
IndexType Row_size ; /* size of Row [], in integers */
|
329
349
|
IndexType Col_size ; /* size of Col [], in integers */
|
330
350
|
IndexType need ; /* minimum required length of A */
|
331
|
-
|
332
|
-
|
351
|
+
Colamd::RowStructure<IndexType> *Row ; /* pointer into A of Row [0..n_row] array */
|
352
|
+
Colamd::ColStructure<IndexType> *Col ; /* pointer into A of Col [0..n_col] array */
|
333
353
|
IndexType n_col2 ; /* number of non-dense, non-empty columns */
|
334
354
|
IndexType n_row2 ; /* number of non-dense, non-empty rows */
|
335
355
|
IndexType ngarbage ; /* number of garbage collections performed */
|
336
356
|
IndexType max_deg ; /* maximum row degree */
|
337
|
-
double default_knobs [
|
338
|
-
|
339
|
-
|
357
|
+
double default_knobs [NKnobs] ; /* default knobs array */
|
358
|
+
|
359
|
+
|
340
360
|
/* === Check the input arguments ======================================== */
|
341
|
-
|
361
|
+
|
342
362
|
if (!stats)
|
343
363
|
{
|
344
364
|
COLAMD_DEBUG0 (("colamd: stats not present\n")) ;
|
345
365
|
return (false) ;
|
346
366
|
}
|
347
|
-
for (i = 0 ; i <
|
367
|
+
for (i = 0 ; i < NStats ; i++)
|
348
368
|
{
|
349
369
|
stats [i] = 0 ;
|
350
370
|
}
|
351
|
-
stats [
|
352
|
-
stats [
|
353
|
-
stats [
|
354
|
-
|
371
|
+
stats [Colamd::Status] = Colamd::Ok ;
|
372
|
+
stats [Colamd::Info1] = -1 ;
|
373
|
+
stats [Colamd::Info2] = -1 ;
|
374
|
+
|
355
375
|
if (!A) /* A is not present */
|
356
376
|
{
|
357
|
-
stats [
|
377
|
+
stats [Colamd::Status] = Colamd::ErrorANotPresent ;
|
358
378
|
COLAMD_DEBUG0 (("colamd: A not present\n")) ;
|
359
379
|
return (false) ;
|
360
380
|
}
|
361
|
-
|
381
|
+
|
362
382
|
if (!p) /* p is not present */
|
363
383
|
{
|
364
|
-
stats [
|
384
|
+
stats [Colamd::Status] = Colamd::ErrorPNotPresent ;
|
365
385
|
COLAMD_DEBUG0 (("colamd: p not present\n")) ;
|
366
386
|
return (false) ;
|
367
387
|
}
|
368
|
-
|
388
|
+
|
369
389
|
if (n_row < 0) /* n_row must be >= 0 */
|
370
390
|
{
|
371
|
-
stats [
|
372
|
-
stats [
|
391
|
+
stats [Colamd::Status] = Colamd::ErrorNrowNegative ;
|
392
|
+
stats [Colamd::Info1] = n_row ;
|
373
393
|
COLAMD_DEBUG0 (("colamd: nrow negative %d\n", n_row)) ;
|
374
394
|
return (false) ;
|
375
395
|
}
|
376
|
-
|
396
|
+
|
377
397
|
if (n_col < 0) /* n_col must be >= 0 */
|
378
398
|
{
|
379
|
-
stats [
|
380
|
-
stats [
|
399
|
+
stats [Colamd::Status] = Colamd::ErrorNcolNegative ;
|
400
|
+
stats [Colamd::Info1] = n_col ;
|
381
401
|
COLAMD_DEBUG0 (("colamd: ncol negative %d\n", n_col)) ;
|
382
402
|
return (false) ;
|
383
403
|
}
|
384
|
-
|
404
|
+
|
385
405
|
nnz = p [n_col] ;
|
386
406
|
if (nnz < 0) /* nnz must be >= 0 */
|
387
407
|
{
|
388
|
-
stats [
|
389
|
-
stats [
|
408
|
+
stats [Colamd::Status] = Colamd::ErrorNnzNegative ;
|
409
|
+
stats [Colamd::Info1] = nnz ;
|
390
410
|
COLAMD_DEBUG0 (("colamd: number of entries negative %d\n", nnz)) ;
|
391
411
|
return (false) ;
|
392
412
|
}
|
393
|
-
|
413
|
+
|
394
414
|
if (p [0] != 0)
|
395
415
|
{
|
396
|
-
stats [
|
397
|
-
stats [
|
416
|
+
stats [Colamd::Status] = Colamd::ErrorP0Nonzero ;
|
417
|
+
stats [Colamd::Info1] = p [0] ;
|
398
418
|
COLAMD_DEBUG0 (("colamd: p[0] not zero %d\n", p [0])) ;
|
399
419
|
return (false) ;
|
400
420
|
}
|
401
|
-
|
421
|
+
|
402
422
|
/* === If no knobs, set default knobs =================================== */
|
403
|
-
|
423
|
+
|
404
424
|
if (!knobs)
|
405
425
|
{
|
406
|
-
|
426
|
+
set_defaults (default_knobs) ;
|
407
427
|
knobs = default_knobs ;
|
408
428
|
}
|
409
|
-
|
429
|
+
|
410
430
|
/* === Allocate the Row and Col arrays from array A ===================== */
|
411
|
-
|
431
|
+
|
412
432
|
Col_size = colamd_c (n_col) ;
|
413
433
|
Row_size = colamd_r (n_row) ;
|
414
434
|
need = 2*nnz + n_col + Col_size + Row_size ;
|
415
|
-
|
435
|
+
|
416
436
|
if (need > Alen)
|
417
437
|
{
|
418
438
|
/* not enough space in array A to perform the ordering */
|
419
|
-
stats [
|
420
|
-
stats [
|
421
|
-
stats [
|
439
|
+
stats [Colamd::Status] = Colamd::ErrorATooSmall ;
|
440
|
+
stats [Colamd::Info1] = need ;
|
441
|
+
stats [Colamd::Info2] = Alen ;
|
422
442
|
COLAMD_DEBUG0 (("colamd: Need Alen >= %d, given only Alen = %d\n", need,Alen));
|
423
443
|
return (false) ;
|
424
444
|
}
|
425
|
-
|
445
|
+
|
426
446
|
Alen -= Col_size + Row_size ;
|
427
|
-
Col = (
|
428
|
-
Row = (
|
447
|
+
Col = (ColStructure<IndexType> *) &A [Alen] ;
|
448
|
+
Row = (RowStructure<IndexType> *) &A [Alen + Col_size] ;
|
429
449
|
|
430
450
|
/* === Construct the row and column data structures ===================== */
|
431
|
-
|
432
|
-
if (!
|
451
|
+
|
452
|
+
if (!Colamd::init_rows_cols (n_row, n_col, Row, Col, A, p, stats))
|
433
453
|
{
|
434
454
|
/* input matrix is invalid */
|
435
455
|
COLAMD_DEBUG0 (("colamd: Matrix invalid\n")) ;
|
436
456
|
return (false) ;
|
437
457
|
}
|
438
|
-
|
458
|
+
|
439
459
|
/* === Initialize scores, kill dense rows/columns ======================= */
|
440
460
|
|
441
|
-
|
461
|
+
Colamd::init_scoring (n_row, n_col, Row, Col, A, p, knobs,
|
442
462
|
&n_row2, &n_col2, &max_deg) ;
|
443
|
-
|
463
|
+
|
444
464
|
/* === Order the supercolumns =========================================== */
|
445
|
-
|
446
|
-
ngarbage =
|
465
|
+
|
466
|
+
ngarbage = Colamd::find_ordering (n_row, n_col, Alen, Row, Col, A, p,
|
447
467
|
n_col2, max_deg, 2*nnz) ;
|
448
|
-
|
468
|
+
|
449
469
|
/* === Order the non-principal columns ================================== */
|
450
|
-
|
451
|
-
|
452
|
-
|
470
|
+
|
471
|
+
Colamd::order_children (n_col, Col, p) ;
|
472
|
+
|
453
473
|
/* === Return statistics in stats ======================================= */
|
454
|
-
|
455
|
-
stats [
|
456
|
-
stats [
|
457
|
-
stats [
|
458
|
-
COLAMD_DEBUG0 (("colamd: done.\n")) ;
|
474
|
+
|
475
|
+
stats [Colamd::DenseRow] = n_row - n_row2 ;
|
476
|
+
stats [Colamd::DenseCol] = n_col - n_col2 ;
|
477
|
+
stats [Colamd::DefragCount] = ngarbage ;
|
478
|
+
COLAMD_DEBUG0 (("colamd: done.\n")) ;
|
459
479
|
return (true) ;
|
460
480
|
}
|
461
481
|
|
@@ -465,7 +485,6 @@ static bool colamd(IndexType n_row, IndexType n_col, IndexType Alen, IndexType *
|
|
465
485
|
|
466
486
|
/* There are no user-callable routines beyond this point in the file */
|
467
487
|
|
468
|
-
|
469
488
|
/* ========================================================================== */
|
470
489
|
/* === init_rows_cols ======================================================= */
|
471
490
|
/* ========================================================================== */
|
@@ -485,11 +504,11 @@ static IndexType init_rows_cols /* returns true if OK, or false otherwise */
|
|
485
504
|
|
486
505
|
IndexType n_row, /* number of rows of A */
|
487
506
|
IndexType n_col, /* number of columns of A */
|
488
|
-
|
489
|
-
|
507
|
+
RowStructure<IndexType> Row [], /* of size n_row+1 */
|
508
|
+
ColStructure<IndexType> Col [], /* of size n_col+1 */
|
490
509
|
IndexType A [], /* row indices of A, of size Alen */
|
491
510
|
IndexType p [], /* pointers to columns in A, of size n_col+1 */
|
492
|
-
IndexType stats [
|
511
|
+
IndexType stats [NStats] /* colamd statistics */
|
493
512
|
)
|
494
513
|
{
|
495
514
|
/* === Local variables ================================================== */
|
@@ -512,24 +531,24 @@ static IndexType init_rows_cols /* returns true if OK, or false otherwise */
|
|
512
531
|
if ((Col [col].length) < 0) // extra parentheses to work-around gcc bug 10200
|
513
532
|
{
|
514
533
|
/* column pointers must be non-decreasing */
|
515
|
-
stats [
|
516
|
-
stats [
|
517
|
-
stats [
|
534
|
+
stats [Colamd::Status] = Colamd::ErrorColLengthNegative ;
|
535
|
+
stats [Colamd::Info1] = col ;
|
536
|
+
stats [Colamd::Info2] = Col [col].length ;
|
518
537
|
COLAMD_DEBUG0 (("colamd: col %d length %d < 0\n", col, Col [col].length)) ;
|
519
538
|
return (false) ;
|
520
539
|
}
|
521
540
|
|
522
541
|
Col [col].shared1.thickness = 1 ;
|
523
542
|
Col [col].shared2.score = 0 ;
|
524
|
-
Col [col].shared3.prev =
|
525
|
-
Col [col].shared4.degree_next =
|
543
|
+
Col [col].shared3.prev = Empty ;
|
544
|
+
Col [col].shared4.degree_next = Empty ;
|
526
545
|
}
|
527
546
|
|
528
547
|
/* p [0..n_col] no longer needed, used as "head" in subsequent routines */
|
529
548
|
|
530
549
|
/* === Scan columns, compute row degrees, and check row indices ========= */
|
531
550
|
|
532
|
-
stats [
|
551
|
+
stats [Info3] = 0 ; /* number of duplicate or unsorted row indices*/
|
533
552
|
|
534
553
|
for (row = 0 ; row < n_row ; row++)
|
535
554
|
{
|
@@ -551,10 +570,10 @@ static IndexType init_rows_cols /* returns true if OK, or false otherwise */
|
|
551
570
|
/* make sure row indices within range */
|
552
571
|
if (row < 0 || row >= n_row)
|
553
572
|
{
|
554
|
-
stats [
|
555
|
-
stats [
|
556
|
-
stats [
|
557
|
-
stats [
|
573
|
+
stats [Colamd::Status] = Colamd::ErrorRowIndexOutOfBounds ;
|
574
|
+
stats [Colamd::Info1] = col ;
|
575
|
+
stats [Colamd::Info2] = row ;
|
576
|
+
stats [Colamd::Info3] = n_row ;
|
558
577
|
COLAMD_DEBUG0 (("colamd: row %d col %d out of bounds\n", row, col)) ;
|
559
578
|
return (false) ;
|
560
579
|
}
|
@@ -563,10 +582,10 @@ static IndexType init_rows_cols /* returns true if OK, or false otherwise */
|
|
563
582
|
{
|
564
583
|
/* row index are unsorted or repeated (or both), thus col */
|
565
584
|
/* is jumbled. This is a notice, not an error condition. */
|
566
|
-
stats [
|
567
|
-
stats [
|
568
|
-
stats [
|
569
|
-
(stats [
|
585
|
+
stats [Colamd::Status] = Colamd::OkButJumbled ;
|
586
|
+
stats [Colamd::Info1] = col ;
|
587
|
+
stats [Colamd::Info2] = row ;
|
588
|
+
(stats [Colamd::Info3]) ++ ;
|
570
589
|
COLAMD_DEBUG1 (("colamd: row %d col %d unsorted/duplicate\n",row,col));
|
571
590
|
}
|
572
591
|
|
@@ -604,7 +623,7 @@ static IndexType init_rows_cols /* returns true if OK, or false otherwise */
|
|
604
623
|
|
605
624
|
/* === Create row form ================================================== */
|
606
625
|
|
607
|
-
if (stats [
|
626
|
+
if (stats [Status] == OkButJumbled)
|
608
627
|
{
|
609
628
|
/* if cols jumbled, watch for repeated row indices */
|
610
629
|
for (col = 0 ; col < n_col ; col++)
|
@@ -646,7 +665,7 @@ static IndexType init_rows_cols /* returns true if OK, or false otherwise */
|
|
646
665
|
|
647
666
|
/* === See if we need to re-create columns ============================== */
|
648
667
|
|
649
|
-
if (stats [
|
668
|
+
if (stats [Status] == OkButJumbled)
|
650
669
|
{
|
651
670
|
COLAMD_DEBUG0 (("colamd: reconstructing column form, matrix jumbled\n")) ;
|
652
671
|
|
@@ -701,11 +720,11 @@ static void init_scoring
|
|
701
720
|
|
702
721
|
IndexType n_row, /* number of rows of A */
|
703
722
|
IndexType n_col, /* number of columns of A */
|
704
|
-
|
705
|
-
|
723
|
+
RowStructure<IndexType> Row [], /* of size n_row+1 */
|
724
|
+
ColStructure<IndexType> Col [], /* of size n_col+1 */
|
706
725
|
IndexType A [], /* column form and row form of A */
|
707
726
|
IndexType head [], /* of size n_col+1 */
|
708
|
-
double knobs [
|
727
|
+
double knobs [NKnobs],/* parameters */
|
709
728
|
IndexType *p_n_row2, /* number of non-dense, non-empty rows */
|
710
729
|
IndexType *p_n_col2, /* number of non-dense, non-empty columns */
|
711
730
|
IndexType *p_max_deg /* maximum row degree */
|
@@ -732,8 +751,8 @@ static void init_scoring
|
|
732
751
|
|
733
752
|
/* === Extract knobs ==================================================== */
|
734
753
|
|
735
|
-
dense_row_count = numext::maxi(IndexType(0), numext::mini(IndexType(knobs [
|
736
|
-
dense_col_count = numext::maxi(IndexType(0), numext::mini(IndexType(knobs [
|
754
|
+
dense_row_count = numext::maxi(IndexType(0), numext::mini(IndexType(knobs [Colamd::DenseRow] * n_col), n_col)) ;
|
755
|
+
dense_col_count = numext::maxi(IndexType(0), numext::mini(IndexType(knobs [Colamd::DenseCol] * n_row), n_row)) ;
|
737
756
|
COLAMD_DEBUG1 (("colamd: densecount: %d %d\n", dense_row_count, dense_col_count)) ;
|
738
757
|
max_deg = 0 ;
|
739
758
|
n_col2 = n_col ;
|
@@ -750,7 +769,7 @@ static void init_scoring
|
|
750
769
|
{
|
751
770
|
/* this is a empty column, kill and order it last */
|
752
771
|
Col [c].shared2.order = --n_col2 ;
|
753
|
-
|
772
|
+
Col[c].kill_principal() ;
|
754
773
|
}
|
755
774
|
}
|
756
775
|
COLAMD_DEBUG1 (("colamd: null columns killed: %d\n", n_col - n_col2)) ;
|
@@ -761,7 +780,7 @@ static void init_scoring
|
|
761
780
|
for (c = n_col-1 ; c >= 0 ; c--)
|
762
781
|
{
|
763
782
|
/* skip any dead columns */
|
764
|
-
if (
|
783
|
+
if (Col[c].is_dead())
|
765
784
|
{
|
766
785
|
continue ;
|
767
786
|
}
|
@@ -777,7 +796,7 @@ static void init_scoring
|
|
777
796
|
{
|
778
797
|
Row [*cp++].shared1.degree-- ;
|
779
798
|
}
|
780
|
-
|
799
|
+
Col[c].kill_principal() ;
|
781
800
|
}
|
782
801
|
}
|
783
802
|
COLAMD_DEBUG1 (("colamd: Dense and null columns killed: %d\n", n_col - n_col2)) ;
|
@@ -791,7 +810,7 @@ static void init_scoring
|
|
791
810
|
if (deg > dense_row_count || deg == 0)
|
792
811
|
{
|
793
812
|
/* kill a dense or empty row */
|
794
|
-
|
813
|
+
Row[r].kill() ;
|
795
814
|
--n_row2 ;
|
796
815
|
}
|
797
816
|
else
|
@@ -813,7 +832,7 @@ static void init_scoring
|
|
813
832
|
for (c = n_col-1 ; c >= 0 ; c--)
|
814
833
|
{
|
815
834
|
/* skip dead column */
|
816
|
-
if (
|
835
|
+
if (Col[c].is_dead())
|
817
836
|
{
|
818
837
|
continue ;
|
819
838
|
}
|
@@ -826,7 +845,7 @@ static void init_scoring
|
|
826
845
|
/* get a row */
|
827
846
|
row = *cp++ ;
|
828
847
|
/* skip if dead */
|
829
|
-
if (
|
848
|
+
if (Row[row].is_dead())
|
830
849
|
{
|
831
850
|
continue ;
|
832
851
|
}
|
@@ -845,7 +864,7 @@ static void init_scoring
|
|
845
864
|
/* and have already been killed) */
|
846
865
|
COLAMD_DEBUG2 (("Newly null killed: %d\n", c)) ;
|
847
866
|
Col [c].shared2.order = --n_col2 ;
|
848
|
-
|
867
|
+
Col[c].kill_principal() ;
|
849
868
|
}
|
850
869
|
else
|
851
870
|
{
|
@@ -870,7 +889,7 @@ static void init_scoring
|
|
870
889
|
/* clear the hash buckets */
|
871
890
|
for (c = 0 ; c <= n_col ; c++)
|
872
891
|
{
|
873
|
-
head [c] =
|
892
|
+
head [c] = Empty ;
|
874
893
|
}
|
875
894
|
min_score = n_col ;
|
876
895
|
/* place in reverse order, so low column indices are at the front */
|
@@ -878,7 +897,7 @@ static void init_scoring
|
|
878
897
|
for (c = n_col-1 ; c >= 0 ; c--)
|
879
898
|
{
|
880
899
|
/* only add principal columns to degree lists */
|
881
|
-
if (
|
900
|
+
if (Col[c].is_alive())
|
882
901
|
{
|
883
902
|
COLAMD_DEBUG4 (("place %d score %d minscore %d ncol %d\n",
|
884
903
|
c, Col [c].shared2.score, min_score, n_col)) ;
|
@@ -891,16 +910,16 @@ static void init_scoring
|
|
891
910
|
COLAMD_ASSERT (min_score <= n_col) ;
|
892
911
|
COLAMD_ASSERT (score >= 0) ;
|
893
912
|
COLAMD_ASSERT (score <= n_col) ;
|
894
|
-
COLAMD_ASSERT (head [score] >=
|
913
|
+
COLAMD_ASSERT (head [score] >= Empty) ;
|
895
914
|
|
896
915
|
/* now add this column to dList at proper score location */
|
897
916
|
next_col = head [score] ;
|
898
|
-
Col [c].shared3.prev =
|
917
|
+
Col [c].shared3.prev = Empty ;
|
899
918
|
Col [c].shared4.degree_next = next_col ;
|
900
919
|
|
901
920
|
/* if there already was a column with the same score, set its */
|
902
921
|
/* previous pointer to this new column */
|
903
|
-
if (next_col !=
|
922
|
+
if (next_col != Empty)
|
904
923
|
{
|
905
924
|
Col [next_col].shared3.prev = c ;
|
906
925
|
}
|
@@ -939,8 +958,8 @@ static IndexType find_ordering /* return the number of garbage collections */
|
|
939
958
|
IndexType n_row, /* number of rows of A */
|
940
959
|
IndexType n_col, /* number of columns of A */
|
941
960
|
IndexType Alen, /* size of A, 2*nnz + n_col or larger */
|
942
|
-
|
943
|
-
|
961
|
+
RowStructure<IndexType> Row [], /* of size n_row+1 */
|
962
|
+
ColStructure<IndexType> Col [], /* of size n_col+1 */
|
944
963
|
IndexType A [], /* column form and row form of A */
|
945
964
|
IndexType head [], /* of size n_col+1 */
|
946
965
|
IndexType n_col2, /* Remaining columns to order */
|
@@ -986,7 +1005,7 @@ static IndexType find_ordering /* return the number of garbage collections */
|
|
986
1005
|
/* === Initialization and clear mark ==================================== */
|
987
1006
|
|
988
1007
|
max_mark = INT_MAX - n_col ; /* INT_MAX defined in <limits.h> */
|
989
|
-
tag_mark =
|
1008
|
+
tag_mark = Colamd::clear_mark (n_row, Row) ;
|
990
1009
|
min_score = 0 ;
|
991
1010
|
ngarbage = 0 ;
|
992
1011
|
COLAMD_DEBUG1 (("colamd: Ordering, n_col2=%d\n", n_col2)) ;
|
@@ -1001,10 +1020,10 @@ static IndexType find_ordering /* return the number of garbage collections */
|
|
1001
1020
|
/* make sure degree list isn't empty */
|
1002
1021
|
COLAMD_ASSERT (min_score >= 0) ;
|
1003
1022
|
COLAMD_ASSERT (min_score <= n_col) ;
|
1004
|
-
COLAMD_ASSERT (head [min_score] >=
|
1023
|
+
COLAMD_ASSERT (head [min_score] >= Empty) ;
|
1005
1024
|
|
1006
1025
|
/* get pivot column from head of minimum degree list */
|
1007
|
-
while (min_score < n_col && head [min_score] ==
|
1026
|
+
while (min_score < n_col && head [min_score] == Empty)
|
1008
1027
|
{
|
1009
1028
|
min_score++ ;
|
1010
1029
|
}
|
@@ -1012,12 +1031,12 @@ static IndexType find_ordering /* return the number of garbage collections */
|
|
1012
1031
|
COLAMD_ASSERT (pivot_col >= 0 && pivot_col <= n_col) ;
|
1013
1032
|
next_col = Col [pivot_col].shared4.degree_next ;
|
1014
1033
|
head [min_score] = next_col ;
|
1015
|
-
if (next_col !=
|
1034
|
+
if (next_col != Empty)
|
1016
1035
|
{
|
1017
|
-
Col [next_col].shared3.prev =
|
1036
|
+
Col [next_col].shared3.prev = Empty ;
|
1018
1037
|
}
|
1019
1038
|
|
1020
|
-
COLAMD_ASSERT (
|
1039
|
+
COLAMD_ASSERT (Col[pivot_col].is_alive()) ;
|
1021
1040
|
COLAMD_DEBUG3 (("Pivot col: %d\n", pivot_col)) ;
|
1022
1041
|
|
1023
1042
|
/* remember score for defrag check */
|
@@ -1036,12 +1055,12 @@ static IndexType find_ordering /* return the number of garbage collections */
|
|
1036
1055
|
needed_memory = numext::mini(pivot_col_score, n_col - k) ;
|
1037
1056
|
if (pfree + needed_memory >= Alen)
|
1038
1057
|
{
|
1039
|
-
pfree =
|
1058
|
+
pfree = Colamd::garbage_collection (n_row, n_col, Row, Col, A, &A [pfree]) ;
|
1040
1059
|
ngarbage++ ;
|
1041
1060
|
/* after garbage collection we will have enough */
|
1042
1061
|
COLAMD_ASSERT (pfree + needed_memory < Alen) ;
|
1043
1062
|
/* garbage collection has wiped out the Row[].shared2.mark array */
|
1044
|
-
tag_mark =
|
1063
|
+
tag_mark = Colamd::clear_mark (n_row, Row) ;
|
1045
1064
|
|
1046
1065
|
}
|
1047
1066
|
|
@@ -1064,9 +1083,9 @@ static IndexType find_ordering /* return the number of garbage collections */
|
|
1064
1083
|
{
|
1065
1084
|
/* get a row */
|
1066
1085
|
row = *cp++ ;
|
1067
|
-
COLAMD_DEBUG4 (("Pivot col pattern %d %d\n",
|
1086
|
+
COLAMD_DEBUG4 (("Pivot col pattern %d %d\n", Row[row].is_alive(), row)) ;
|
1068
1087
|
/* skip if row is dead */
|
1069
|
-
if (
|
1088
|
+
if (Row[row].is_dead())
|
1070
1089
|
{
|
1071
1090
|
continue ;
|
1072
1091
|
}
|
@@ -1078,7 +1097,7 @@ static IndexType find_ordering /* return the number of garbage collections */
|
|
1078
1097
|
col = *rp++ ;
|
1079
1098
|
/* add the column, if alive and untagged */
|
1080
1099
|
col_thickness = Col [col].shared1.thickness ;
|
1081
|
-
if (col_thickness > 0 &&
|
1100
|
+
if (col_thickness > 0 && Col[col].is_alive())
|
1082
1101
|
{
|
1083
1102
|
/* tag column in pivot row */
|
1084
1103
|
Col [col].shared1.thickness = -col_thickness ;
|
@@ -1105,7 +1124,7 @@ static IndexType find_ordering /* return the number of garbage collections */
|
|
1105
1124
|
/* may be killing an already dead row */
|
1106
1125
|
row = *cp++ ;
|
1107
1126
|
COLAMD_DEBUG3 (("Kill row in pivot col: %d\n", row)) ;
|
1108
|
-
|
1127
|
+
Row[row].kill() ;
|
1109
1128
|
}
|
1110
1129
|
|
1111
1130
|
/* === Select a row index to use as the new pivot row =============== */
|
@@ -1120,7 +1139,7 @@ static IndexType find_ordering /* return the number of garbage collections */
|
|
1120
1139
|
else
|
1121
1140
|
{
|
1122
1141
|
/* there is no pivot row, since it is of zero length */
|
1123
|
-
pivot_row =
|
1142
|
+
pivot_row = Empty ;
|
1124
1143
|
COLAMD_ASSERT (pivot_row_length == 0) ;
|
1125
1144
|
}
|
1126
1145
|
COLAMD_ASSERT (Col [pivot_col].length > 0 || pivot_row_length == 0) ;
|
@@ -1157,7 +1176,7 @@ static IndexType find_ordering /* return the number of garbage collections */
|
|
1157
1176
|
while (rp < rp_end)
|
1158
1177
|
{
|
1159
1178
|
col = *rp++ ;
|
1160
|
-
COLAMD_ASSERT (
|
1179
|
+
COLAMD_ASSERT (Col[col].is_alive() && col != pivot_col) ;
|
1161
1180
|
COLAMD_DEBUG3 (("Col: %d\n", col)) ;
|
1162
1181
|
|
1163
1182
|
/* clear tags used to construct pivot row pattern */
|
@@ -1172,8 +1191,8 @@ static IndexType find_ordering /* return the number of garbage collections */
|
|
1172
1191
|
next_col = Col [col].shared4.degree_next ;
|
1173
1192
|
COLAMD_ASSERT (cur_score >= 0) ;
|
1174
1193
|
COLAMD_ASSERT (cur_score <= n_col) ;
|
1175
|
-
COLAMD_ASSERT (cur_score >=
|
1176
|
-
if (prev_col ==
|
1194
|
+
COLAMD_ASSERT (cur_score >= Empty) ;
|
1195
|
+
if (prev_col == Empty)
|
1177
1196
|
{
|
1178
1197
|
head [cur_score] = next_col ;
|
1179
1198
|
}
|
@@ -1181,7 +1200,7 @@ static IndexType find_ordering /* return the number of garbage collections */
|
|
1181
1200
|
{
|
1182
1201
|
Col [prev_col].shared4.degree_next = next_col ;
|
1183
1202
|
}
|
1184
|
-
if (next_col !=
|
1203
|
+
if (next_col != Empty)
|
1185
1204
|
{
|
1186
1205
|
Col [next_col].shared3.prev = prev_col ;
|
1187
1206
|
}
|
@@ -1194,12 +1213,12 @@ static IndexType find_ordering /* return the number of garbage collections */
|
|
1194
1213
|
{
|
1195
1214
|
/* get a row */
|
1196
1215
|
row = *cp++ ;
|
1197
|
-
row_mark = Row [row].shared2.mark ;
|
1198
1216
|
/* skip if dead */
|
1199
|
-
if (
|
1217
|
+
if (Row[row].is_dead())
|
1200
1218
|
{
|
1201
1219
|
continue ;
|
1202
1220
|
}
|
1221
|
+
row_mark = Row [row].shared2.mark ;
|
1203
1222
|
COLAMD_ASSERT (row != pivot_row) ;
|
1204
1223
|
set_difference = row_mark - tag_mark ;
|
1205
1224
|
/* check if the row has been seen yet */
|
@@ -1215,7 +1234,7 @@ static IndexType find_ordering /* return the number of garbage collections */
|
|
1215
1234
|
if (set_difference == 0)
|
1216
1235
|
{
|
1217
1236
|
COLAMD_DEBUG3 (("aggressive absorption. Row: %d\n", row)) ;
|
1218
|
-
|
1237
|
+
Row[row].kill() ;
|
1219
1238
|
}
|
1220
1239
|
else
|
1221
1240
|
{
|
@@ -1237,7 +1256,7 @@ static IndexType find_ordering /* return the number of garbage collections */
|
|
1237
1256
|
{
|
1238
1257
|
/* get a column */
|
1239
1258
|
col = *rp++ ;
|
1240
|
-
COLAMD_ASSERT (
|
1259
|
+
COLAMD_ASSERT (Col[col].is_alive() && col != pivot_col) ;
|
1241
1260
|
hash = 0 ;
|
1242
1261
|
cur_score = 0 ;
|
1243
1262
|
cp = &A [Col [col].start] ;
|
@@ -1252,12 +1271,12 @@ static IndexType find_ordering /* return the number of garbage collections */
|
|
1252
1271
|
/* get a row */
|
1253
1272
|
row = *cp++ ;
|
1254
1273
|
COLAMD_ASSERT(row >= 0 && row < n_row) ;
|
1255
|
-
row_mark = Row [row].shared2.mark ;
|
1256
1274
|
/* skip if dead */
|
1257
|
-
if (
|
1275
|
+
if (Row [row].is_dead())
|
1258
1276
|
{
|
1259
1277
|
continue ;
|
1260
1278
|
}
|
1279
|
+
row_mark = Row [row].shared2.mark ;
|
1261
1280
|
COLAMD_ASSERT (row_mark > tag_mark) ;
|
1262
1281
|
/* compact the column */
|
1263
1282
|
*new_cp++ = row ;
|
@@ -1278,7 +1297,7 @@ static IndexType find_ordering /* return the number of garbage collections */
|
|
1278
1297
|
{
|
1279
1298
|
COLAMD_DEBUG4 (("further mass elimination. Col: %d\n", col)) ;
|
1280
1299
|
/* nothing left but the pivot row in this column */
|
1281
|
-
|
1300
|
+
Col[col].kill_principal() ;
|
1282
1301
|
pivot_row_degree -= Col [col].shared1.thickness ;
|
1283
1302
|
COLAMD_ASSERT (pivot_row_degree >= 0) ;
|
1284
1303
|
/* order it */
|
@@ -1302,7 +1321,7 @@ static IndexType find_ordering /* return the number of garbage collections */
|
|
1302
1321
|
COLAMD_ASSERT (hash <= n_col) ;
|
1303
1322
|
|
1304
1323
|
head_column = head [hash] ;
|
1305
|
-
if (head_column >
|
1324
|
+
if (head_column > Empty)
|
1306
1325
|
{
|
1307
1326
|
/* degree list "hash" is non-empty, use prev (shared3) of */
|
1308
1327
|
/* first column in degree list as head of hash bucket */
|
@@ -1319,7 +1338,7 @@ static IndexType find_ordering /* return the number of garbage collections */
|
|
1319
1338
|
|
1320
1339
|
/* save hash function in Col [col].shared3.hash */
|
1321
1340
|
Col [col].shared3.hash = (IndexType) hash ;
|
1322
|
-
COLAMD_ASSERT (
|
1341
|
+
COLAMD_ASSERT (Col[col].is_alive()) ;
|
1323
1342
|
}
|
1324
1343
|
}
|
1325
1344
|
|
@@ -1329,11 +1348,11 @@ static IndexType find_ordering /* return the number of garbage collections */
|
|
1329
1348
|
|
1330
1349
|
COLAMD_DEBUG3 (("** Supercolumn detection phase. **\n")) ;
|
1331
1350
|
|
1332
|
-
|
1351
|
+
Colamd::detect_super_cols (Col, A, head, pivot_row_start, pivot_row_length) ;
|
1333
1352
|
|
1334
1353
|
/* === Kill the pivotal column ====================================== */
|
1335
1354
|
|
1336
|
-
|
1355
|
+
Col[pivot_col].kill_principal() ;
|
1337
1356
|
|
1338
1357
|
/* === Clear mark =================================================== */
|
1339
1358
|
|
@@ -1341,7 +1360,7 @@ static IndexType find_ordering /* return the number of garbage collections */
|
|
1341
1360
|
if (tag_mark >= max_mark)
|
1342
1361
|
{
|
1343
1362
|
COLAMD_DEBUG2 (("clearing tag_mark\n")) ;
|
1344
|
-
tag_mark =
|
1363
|
+
tag_mark = Colamd::clear_mark (n_row, Row) ;
|
1345
1364
|
}
|
1346
1365
|
|
1347
1366
|
/* === Finalize the new pivot row, and column scores ================ */
|
@@ -1357,7 +1376,7 @@ static IndexType find_ordering /* return the number of garbage collections */
|
|
1357
1376
|
{
|
1358
1377
|
col = *rp++ ;
|
1359
1378
|
/* skip dead columns */
|
1360
|
-
if (
|
1379
|
+
if (Col[col].is_dead())
|
1361
1380
|
{
|
1362
1381
|
continue ;
|
1363
1382
|
}
|
@@ -1391,11 +1410,11 @@ static IndexType find_ordering /* return the number of garbage collections */
|
|
1391
1410
|
COLAMD_ASSERT (min_score <= n_col) ;
|
1392
1411
|
COLAMD_ASSERT (cur_score >= 0) ;
|
1393
1412
|
COLAMD_ASSERT (cur_score <= n_col) ;
|
1394
|
-
COLAMD_ASSERT (head [cur_score] >=
|
1413
|
+
COLAMD_ASSERT (head [cur_score] >= Empty) ;
|
1395
1414
|
next_col = head [cur_score] ;
|
1396
1415
|
Col [col].shared4.degree_next = next_col ;
|
1397
|
-
Col [col].shared3.prev =
|
1398
|
-
if (next_col !=
|
1416
|
+
Col [col].shared3.prev = Empty ;
|
1417
|
+
if (next_col != Empty)
|
1399
1418
|
{
|
1400
1419
|
Col [next_col].shared3.prev = col ;
|
1401
1420
|
}
|
@@ -1448,7 +1467,7 @@ static inline void order_children
|
|
1448
1467
|
/* === Parameters ======================================================= */
|
1449
1468
|
|
1450
1469
|
IndexType n_col, /* number of columns of A */
|
1451
|
-
|
1470
|
+
ColStructure<IndexType> Col [], /* of size n_col+1 */
|
1452
1471
|
IndexType p [] /* p [0 ... n_col-1] is the column permutation*/
|
1453
1472
|
)
|
1454
1473
|
{
|
@@ -1464,15 +1483,15 @@ static inline void order_children
|
|
1464
1483
|
for (i = 0 ; i < n_col ; i++)
|
1465
1484
|
{
|
1466
1485
|
/* find an un-ordered non-principal column */
|
1467
|
-
COLAMD_ASSERT (
|
1468
|
-
if (!
|
1486
|
+
COLAMD_ASSERT (col_is_dead(Col, i)) ;
|
1487
|
+
if (!Col[i].is_dead_principal() && Col [i].shared2.order == Empty)
|
1469
1488
|
{
|
1470
1489
|
parent = i ;
|
1471
1490
|
/* once found, find its principal parent */
|
1472
1491
|
do
|
1473
1492
|
{
|
1474
1493
|
parent = Col [parent].shared1.parent ;
|
1475
|
-
} while (!
|
1494
|
+
} while (!Col[parent].is_dead_principal()) ;
|
1476
1495
|
|
1477
1496
|
/* now, order all un-ordered non-principal columns along path */
|
1478
1497
|
/* to this parent. collapse tree at the same time */
|
@@ -1482,7 +1501,7 @@ static inline void order_children
|
|
1482
1501
|
|
1483
1502
|
do
|
1484
1503
|
{
|
1485
|
-
COLAMD_ASSERT (Col [c].shared2.order ==
|
1504
|
+
COLAMD_ASSERT (Col [c].shared2.order == Empty) ;
|
1486
1505
|
|
1487
1506
|
/* order this column */
|
1488
1507
|
Col [c].shared2.order = order++ ;
|
@@ -1493,9 +1512,9 @@ static inline void order_children
|
|
1493
1512
|
c = Col [c].shared1.parent ;
|
1494
1513
|
|
1495
1514
|
/* continue until we hit an ordered column. There are */
|
1496
|
-
/*
|
1515
|
+
/* guaranteed not to be anymore unordered columns */
|
1497
1516
|
/* above an ordered column */
|
1498
|
-
} while (Col [c].shared2.order ==
|
1517
|
+
} while (Col [c].shared2.order == Empty) ;
|
1499
1518
|
|
1500
1519
|
/* re-order the super_col parent to largest order for this group */
|
1501
1520
|
Col [parent].shared2.order = order ;
|
@@ -1547,8 +1566,8 @@ template <typename IndexType>
|
|
1547
1566
|
static void detect_super_cols
|
1548
1567
|
(
|
1549
1568
|
/* === Parameters ======================================================= */
|
1550
|
-
|
1551
|
-
|
1569
|
+
|
1570
|
+
ColStructure<IndexType> Col [], /* of size n_col+1 */
|
1552
1571
|
IndexType A [], /* row indices of A */
|
1553
1572
|
IndexType head [], /* head of degree lists and hash buckets */
|
1554
1573
|
IndexType row_start, /* pointer to set of columns to check */
|
@@ -1578,7 +1597,7 @@ static void detect_super_cols
|
|
1578
1597
|
while (rp < rp_end)
|
1579
1598
|
{
|
1580
1599
|
col = *rp++ ;
|
1581
|
-
if (
|
1600
|
+
if (Col[col].is_dead())
|
1582
1601
|
{
|
1583
1602
|
continue ;
|
1584
1603
|
}
|
@@ -1590,7 +1609,7 @@ static void detect_super_cols
|
|
1590
1609
|
/* === Get the first column in this hash bucket ===================== */
|
1591
1610
|
|
1592
1611
|
head_column = head [hash] ;
|
1593
|
-
if (head_column >
|
1612
|
+
if (head_column > Empty)
|
1594
1613
|
{
|
1595
1614
|
first_col = Col [head_column].shared3.headhash ;
|
1596
1615
|
}
|
@@ -1601,10 +1620,10 @@ static void detect_super_cols
|
|
1601
1620
|
|
1602
1621
|
/* === Consider each column in the hash bucket ====================== */
|
1603
1622
|
|
1604
|
-
for (super_c = first_col ; super_c !=
|
1623
|
+
for (super_c = first_col ; super_c != Empty ;
|
1605
1624
|
super_c = Col [super_c].shared4.hash_next)
|
1606
1625
|
{
|
1607
|
-
COLAMD_ASSERT (
|
1626
|
+
COLAMD_ASSERT (Col [super_c].is_alive()) ;
|
1608
1627
|
COLAMD_ASSERT (Col [super_c].shared3.hash == hash) ;
|
1609
1628
|
length = Col [super_c].length ;
|
1610
1629
|
|
@@ -1614,10 +1633,10 @@ static void detect_super_cols
|
|
1614
1633
|
/* === Compare super_c with all columns after it ================ */
|
1615
1634
|
|
1616
1635
|
for (c = Col [super_c].shared4.hash_next ;
|
1617
|
-
c !=
|
1636
|
+
c != Empty ; c = Col [c].shared4.hash_next)
|
1618
1637
|
{
|
1619
1638
|
COLAMD_ASSERT (c != super_c) ;
|
1620
|
-
COLAMD_ASSERT (
|
1639
|
+
COLAMD_ASSERT (Col[c].is_alive()) ;
|
1621
1640
|
COLAMD_ASSERT (Col [c].shared3.hash == hash) ;
|
1622
1641
|
|
1623
1642
|
/* not identical if lengths or scores are different */
|
@@ -1635,10 +1654,10 @@ static void detect_super_cols
|
|
1635
1654
|
for (i = 0 ; i < length ; i++)
|
1636
1655
|
{
|
1637
1656
|
/* the columns are "clean" (no dead rows) */
|
1638
|
-
COLAMD_ASSERT (
|
1639
|
-
COLAMD_ASSERT (
|
1657
|
+
COLAMD_ASSERT ( cp1->is_alive() );
|
1658
|
+
COLAMD_ASSERT ( cp2->is_alive() );
|
1640
1659
|
/* row indices will same order for both supercols, */
|
1641
|
-
/* no gather scatter
|
1660
|
+
/* no gather scatter necessary */
|
1642
1661
|
if (*cp1++ != *cp2++)
|
1643
1662
|
{
|
1644
1663
|
break ;
|
@@ -1658,9 +1677,9 @@ static void detect_super_cols
|
|
1658
1677
|
|
1659
1678
|
Col [super_c].shared1.thickness += Col [c].shared1.thickness ;
|
1660
1679
|
Col [c].shared1.parent = super_c ;
|
1661
|
-
|
1680
|
+
Col[c].kill_non_principal() ;
|
1662
1681
|
/* order c later, in order_children() */
|
1663
|
-
Col [c].shared2.order =
|
1682
|
+
Col [c].shared2.order = Empty ;
|
1664
1683
|
/* remove c from hash bucket */
|
1665
1684
|
Col [prev_c].shared4.hash_next = Col [c].shared4.hash_next ;
|
1666
1685
|
}
|
@@ -1668,15 +1687,15 @@ static void detect_super_cols
|
|
1668
1687
|
|
1669
1688
|
/* === Empty this hash bucket ======================================= */
|
1670
1689
|
|
1671
|
-
if (head_column >
|
1690
|
+
if (head_column > Empty)
|
1672
1691
|
{
|
1673
1692
|
/* corresponding degree list "hash" is not empty */
|
1674
|
-
Col [head_column].shared3.headhash =
|
1693
|
+
Col [head_column].shared3.headhash = Empty ;
|
1675
1694
|
}
|
1676
1695
|
else
|
1677
1696
|
{
|
1678
1697
|
/* corresponding degree list "hash" is empty */
|
1679
|
-
head [hash] =
|
1698
|
+
head [hash] = Empty ;
|
1680
1699
|
}
|
1681
1700
|
}
|
1682
1701
|
}
|
@@ -1688,7 +1707,7 @@ static void detect_super_cols
|
|
1688
1707
|
|
1689
1708
|
/*
|
1690
1709
|
Defragments and compacts columns and rows in the workspace A. Used when
|
1691
|
-
all
|
1710
|
+
all available memory has been used while performing row merging. Returns
|
1692
1711
|
the index of the first free position in A, after garbage collection. The
|
1693
1712
|
time taken by this routine is linear is the size of the array A, which is
|
1694
1713
|
itself linear in the number of nonzeros in the input matrix.
|
@@ -1698,11 +1717,11 @@ template <typename IndexType>
|
|
1698
1717
|
static IndexType garbage_collection /* returns the new value of pfree */
|
1699
1718
|
(
|
1700
1719
|
/* === Parameters ======================================================= */
|
1701
|
-
|
1720
|
+
|
1702
1721
|
IndexType n_row, /* number of rows */
|
1703
1722
|
IndexType n_col, /* number of columns */
|
1704
|
-
|
1705
|
-
|
1723
|
+
RowStructure<IndexType> Row [], /* row info */
|
1724
|
+
ColStructure<IndexType> Col [], /* column info */
|
1706
1725
|
IndexType A [], /* A [0 ... Alen-1] holds the matrix */
|
1707
1726
|
IndexType *pfree /* &A [0] ... pfree is in use */
|
1708
1727
|
)
|
@@ -1721,7 +1740,7 @@ static IndexType garbage_collection /* returns the new value of pfree */
|
|
1721
1740
|
pdest = &A[0] ;
|
1722
1741
|
for (c = 0 ; c < n_col ; c++)
|
1723
1742
|
{
|
1724
|
-
if (
|
1743
|
+
if (Col[c].is_alive())
|
1725
1744
|
{
|
1726
1745
|
psrc = &A [Col [c].start] ;
|
1727
1746
|
|
@@ -1732,7 +1751,7 @@ static IndexType garbage_collection /* returns the new value of pfree */
|
|
1732
1751
|
for (j = 0 ; j < length ; j++)
|
1733
1752
|
{
|
1734
1753
|
r = *psrc++ ;
|
1735
|
-
if (
|
1754
|
+
if (Row[r].is_alive())
|
1736
1755
|
{
|
1737
1756
|
*pdest++ = r ;
|
1738
1757
|
}
|
@@ -1745,22 +1764,22 @@ static IndexType garbage_collection /* returns the new value of pfree */
|
|
1745
1764
|
|
1746
1765
|
for (r = 0 ; r < n_row ; r++)
|
1747
1766
|
{
|
1748
|
-
if (
|
1767
|
+
if (Row[r].is_alive())
|
1749
1768
|
{
|
1750
1769
|
if (Row [r].length == 0)
|
1751
1770
|
{
|
1752
|
-
|
1753
|
-
|
1754
|
-
|
1771
|
+
/* this row is of zero length. cannot compact it, so kill it */
|
1772
|
+
COLAMD_DEBUG3 (("Defrag row kill\n")) ;
|
1773
|
+
Row[r].kill() ;
|
1755
1774
|
}
|
1756
1775
|
else
|
1757
1776
|
{
|
1758
|
-
|
1759
|
-
|
1760
|
-
|
1761
|
-
|
1762
|
-
|
1763
|
-
|
1777
|
+
/* save first column index in Row [r].shared2.first_column */
|
1778
|
+
psrc = &A [Row [r].start] ;
|
1779
|
+
Row [r].shared2.first_column = *psrc ;
|
1780
|
+
COLAMD_ASSERT (Row[r].is_alive()) ;
|
1781
|
+
/* flag the start of the row with the one's complement of row */
|
1782
|
+
*psrc = ones_complement(r) ;
|
1764
1783
|
|
1765
1784
|
}
|
1766
1785
|
}
|
@@ -1776,11 +1795,11 @@ static IndexType garbage_collection /* returns the new value of pfree */
|
|
1776
1795
|
{
|
1777
1796
|
psrc-- ;
|
1778
1797
|
/* get the row index */
|
1779
|
-
r =
|
1798
|
+
r = ones_complement(*psrc) ;
|
1780
1799
|
COLAMD_ASSERT (r >= 0 && r < n_row) ;
|
1781
1800
|
/* restore first column index */
|
1782
1801
|
*psrc = Row [r].shared2.first_column ;
|
1783
|
-
COLAMD_ASSERT (
|
1802
|
+
COLAMD_ASSERT (Row[r].is_alive()) ;
|
1784
1803
|
|
1785
1804
|
/* move and compact the row */
|
1786
1805
|
COLAMD_ASSERT (pdest <= psrc) ;
|
@@ -1789,7 +1808,7 @@ static IndexType garbage_collection /* returns the new value of pfree */
|
|
1789
1808
|
for (j = 0 ; j < length ; j++)
|
1790
1809
|
{
|
1791
1810
|
c = *psrc++ ;
|
1792
|
-
if (
|
1811
|
+
if (Col[c].is_alive())
|
1793
1812
|
{
|
1794
1813
|
*pdest++ = c ;
|
1795
1814
|
}
|
@@ -1821,7 +1840,7 @@ static inline IndexType clear_mark /* return the new value for tag_mark */
|
|
1821
1840
|
/* === Parameters ======================================================= */
|
1822
1841
|
|
1823
1842
|
IndexType n_row, /* number of rows in A */
|
1824
|
-
|
1843
|
+
RowStructure<IndexType> Row [] /* Row [0 ... n_row-1].shared2.mark is set to zero */
|
1825
1844
|
)
|
1826
1845
|
{
|
1827
1846
|
/* === Local variables ================================================== */
|
@@ -1830,7 +1849,7 @@ static inline IndexType clear_mark /* return the new value for tag_mark */
|
|
1830
1849
|
|
1831
1850
|
for (r = 0 ; r < n_row ; r++)
|
1832
1851
|
{
|
1833
|
-
if (
|
1852
|
+
if (Row[r].is_alive())
|
1834
1853
|
{
|
1835
1854
|
Row [r].shared2.mark = 0 ;
|
1836
1855
|
}
|
@@ -1838,6 +1857,7 @@ static inline IndexType clear_mark /* return the new value for tag_mark */
|
|
1838
1857
|
return (1) ;
|
1839
1858
|
}
|
1840
1859
|
|
1860
|
+
} // namespace Colamd
|
1841
1861
|
|
1842
|
-
} // namespace internal
|
1862
|
+
} // namespace internal
|
1843
1863
|
#endif
|