1
function [x,stats] = cholmod (A, b, ordering) %#ok
2
%CHOLMOD: Supernodal sparse Cholesky backslash, x = A\b
6
% Computes the LL' factorization of A(p,p), where p is a fill-reducing
7
% ordering, then solves a sparse linear system Ax=b. A must be sparse,
8
% symmetric, and positive definite). Uses only the upper triangular part
9
% of A. A second output, [x,stats]=cholmod(A,b), returns statistics:
11
% stats(1) estimate of the reciprocal of the condition number
12
% stats(2) ordering used:
13
% 0: natural, 1: given, 2:amd, 3:metis, 4:nesdis,
14
% 5:colamd, 6: natural but postordered.
16
% stats(4) flop count in Cholesky factorization. Excludes solution
17
% of upper/lower triangular systems, which can be easily
18
% computed from stats(3) (roughly 4*nnz(L)*size(b,2)).
19
% stats(5) memory usage in MB.
21
% The 3rd argument select the ordering method to use. If not present or -1,
22
% the default ordering strategy is used (AMD, and then try METIS if AMD finds
23
% an ordering with high fill-in, and use the best method tried).
25
% Other options for the ordering parameter:
27
% 0 natural (no etree postordering)
28
% -1 use CHOLMOD's default ordering strategy (AMD, then try METIS)
29
% -2 AMD, and then try NESDIS (not METIS) if AMD has high fill-in
33
% -6 natural, but with etree postordering
34
% p user permutation (vector of size n, with a permutation of 1:n)
36
% See also CHOL, MLDIVIDE.
38
% Copyright 2006, Timothy A. Davis
39
% http://www.cise.ufl.edu/research/sparse
41
error ('cholmod mexFunction not found\n') ;