function p = colmmd(S)
%COLMMD Column minimum degree permutation.
%   P = COLMMD(S) returns the column minimum degree permutation vector
%   for the sparse matrix S. For a non-symmetric matrix S, S(:,P)
%   tends to have sparser LU factors than S.
%
%   See also SYMMMD, SYMRCM, COLPERM.

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

p = sparsfun('colmmd',S);
[ignore,q] = sparsfun('coletree',S(:,p));
p = p(q);
