function p = symmmd(S)
%SYMMMD Symmetric minimum degree permutation.
%   p = SYMMMD(S), for a symmetric positive definite matrix S,
%   returns the permutation vector p such that S(p,p) tends to have a
%   sparser Cholesky factor than S.  Sometimes SYMMMD works well
%   for symmetric indefinite matrices too.
%
%   See also COLMMD, COLPERM, SYMRCM.

%   Copyright 1984-2000 The MathWorks, Inc. 
%   $Revision: 5.6 $  $Date: 2000/06/02 17:59:32 $

p = sparsfun('symmmd',S);
[ignore,q] = sparsfun('symetree',S(p,p));
p = p(q);
