COLPERM

 

 Order columns based on nonzero count.

  p = COLPERM(S) generate a permutation that reorders the

  columns of the sparse (or full) matrix S in nondecreasing

  order of nonzero count.  Useful as a preordering for LUM9XTU2 

  factorization: lu(S(:,p)).

  Not the best ordering in the world, but it's fast to 

  compute, it does a pretty good job, and it shows that 

  we, too, can write tricky one-liners.

 

 

  See also COLMMD27BOBX, SYMMMD3MKDHXL, SYMRCMYV5SQ7.