colamd
Column approximate minimum degree permutation
Syntax
p = colamd(S)
Description
p = colamd(S)
returns the column approximate minimum degree permutation vector for the sparse matrixS
. For a non-symmetric matrixS
,S(:,p)
tends to have sparser LU factors thanS
. The Cholesky factorization ofS(:,p)' * S(:,p)
also tends to be sparser than that ofS'*S
.
knobs
我s a two-element vector. If S ism
-by-n
, then rows with more than(knobs(1))*n
entries are ignored. Columns with more than(knobs(2))*m
entries are removed prior to ordering, and ordered last in the output permutationp
. If theknobs
parameter is not present, thenknobs(1)
=knobs(2) = spparms('wh_frac')
.
stats
我s an optional vector that provides data about the ordering and the validity of the matrixS
.
|
Number of dense or empty rows ignored by |
|
Number of dense or empty columns ignored by |
|
Number of garbage collections performed on the internal data structure used by |
|
|
|
Rightmost column index that is unsorted or contains duplicate entries, or |
|
最后一次看到重复或外-order row index in the column index given by |
|
Number of duplicate and out-of-order row indices |
Although MATLAB®built-in functions generate valid sparse matrices, a user may construct an invalid sparse matrix using the MATLAB C or Fortran APIs and pass it tocolamd
. For this reason,colamd
verifies thatS
我s valid:
If a row index appears two or more times in the same column,
colamd
我gnores the duplicate entries, continues processing, and provides information about the duplicate entries instats(4:7)
.If row indices in a column are out of order,
colamd
sorts each column of its internal copy of the matrixS
(but does not repair the input matrixS
), continues processing, and provides information about the out-of-order entries instats(4:7)
.If
S
我s invalid in any other way,colamd
cannot continue. It prints an error message, and returns no output arguments (p
orstats
) .
The ordering is followed by a column elimination tree post-ordering.
Examples
References
[1] The authors of the code forcolamd
are Stefan I. Larimore and Timothy A. Davis. The algorithm was developed in collaboration with John Gilbert, Xerox PARC, and Esmond Ng, Oak Ridge National Laboratory. Sparse Matrix Algorithms Research:http://faculty.cse.tamu.edu/davis/research.html