colamdR returns the column approximate minimum degree permutation of a sparse matrix S. The permutation of S, S[,p], will result in LU factors sparser than S.

colamdR(M)

Arguments

M

A matrix to be permuted.

Value

A vector containing the column minimum degree permutation of the matrix M.

Details

This is an implementation of the colamd function available in SuiteSparse, and also implemented in Matlab.

References

The authors of the code for "colamd" are Stefan I. Larimore and Timothy A. Davis (davis@cise.ufl.edu), University of Florida.

Examples

M <- matrix(c(1,1,0,0,1,0,0,1,0,1,1,1,1,1,0,0,1,0,1,0), ncol=4) p <- colamdR(M) M[,p]
#> [,1] [,2] [,3] [,4] #> [1,] 0 1 1 0 #> [2,] 0 1 1 1 #> [3,] 1 0 1 0 #> [4,] 0 0 1 1 #> [5,] 1 1 0 0