1
function [p, stats] = csymamd (S, knobs, cmember)
2
%CSYMAMD Constrained symmetric approximate minimum degree permutation.
3
% P = CSYMAMD(S) for a symmetric positive definite matrix S, returns the
4
% permutation vector p such that S(p,p) tends to have a sparser Cholesky
5
% factor than S. Sometimes CSYMAMD works well for symmetric indefinite
6
% matrices too. The matrix S is assumed to be symmetric; only the
7
% strictly lower triangular part is referenced. S must be square. Note
8
% that p=amd(S) is faster, but does not allow for a constrained ordering.
9
% The ordering is followed by an elimination tree post-ordering.
11
% See also AMD, CCOLAMD, COLAMD, SYMAMD.
13
% Usage: p = csymamd(S)
14
% [p stats] = csymamd(S,knobs,cmember)
16
% knobs is an optional one- to three-element input vector, with a default
17
% value of [10 1 0] if present or empty ([ ]). Entries not present are set
20
% knobs(1): If S is n-by-n, then rows and columns with more than
21
% max(16,knobs(1)*sqrt(n)) entries are ignored, and ordered last in the
22
% output permutation (subject to the cmember constraints).
23
% knobs(2): if nonzero, aggressive absorption is performed.
24
% knobs(3): if nonzero, statistics and knobs are printed.
26
% Type the command "type csymamd" for a description of the optional stats
29
% cmember is an optional vector of length n. It defines the constraints on
30
% the ordering. If cmember(j)=s, then row/column j is in constraint set s
31
% (s must be in the range 1 to n). In the output permutation p,
32
% rows/columns in set 1 appear first, followed by all rows/columns in set 2,
33
% and so on. cmember=ones(1,n) if not present or empty. csymamd(S,[],1:n)
36
% p = csymamd(S) is about the same as p = symamd(S). knobs and its default
39
% Authors: S. Larimore, T. Davis (Univ of Florida), and S. Rajamanickam, in
40
% collaboration with J. Gilbert and E. Ng. Supported by the National
41
% Science Foundation (DMS-9504974, DMS-9803599, CCR-0203270), and a grant
42
% from Sandia National Lab. See http://www.cise.ufl.edu/research/sparse
43
% for ccolamd, csymamd, amd, colamd, symamd, and other related orderings.
45
% See also AMD, CCOLAMD, COLAMD, SYMAMD, SYMRCM.
47
% ----------------------------------------------------------------------------
48
% CCOLAMD version 2.5.
49
% Copyright (C) 2005, Univ. of Florida. Authors: Timothy A. Davis,
50
% Sivasankaran Rajamanickam, and Stefan Larimore
51
% See License.txt for the Version 2.1 of the GNU Lesser General Public License
52
% http://www.cise.ufl.edu/research/sparse
53
% ----------------------------------------------------------------------------
55
% stats(1): number of dense or empty rows removed prior to ordering
56
% stats(2): number of dense or empty columns removed prior to ordering.
57
% These rows and columns are placed last in their constraint set.
58
% stats(3): number of garbage collections performed.
59
% stats (4:7) provide information if COLAMD was able to continue. The
60
% matrix is OK if stats (4) is zero, or 1 if invalid. stats (5) is the
61
% rightmost column index that is unsorted or contains duplicate entries,
62
% or zero if no such column exists. stats (6) is the last seen duplicate
63
% or out-of-order row index in the column index given by stats (5), or zero
64
% if no such row index exists. stats (7) is the number of duplicate or
65
% out-of-order row indices.
67
% stats (8:20) is always zero in the current version of COLAMD (reserved
70
error ('csymamd: mexFunction not found') ;