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 (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 5.7 $  $Date: 1997/11/21 23:44:17 $

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