Code covered by the BSD License  

Highlights from
Matgraph

from Matgraph by Ed Scheinerman
Toolbox for working with simple, undirected graphs

Description of display
Home > matgraph > @partition > display.m

display

PURPOSE ^

display(p) --- used to display paritions to the console

SYNOPSIS ^

function display(p)

DESCRIPTION ^

 display(p) --- used to display paritions to the console

CROSS-REFERENCE INFORMATION ^

This function calls:
  • size size(p) --- returns [nv,np]: number of vertices, parts.
This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function display(p)
0002 % display(p) --- used to display paritions to the console
0003 
0004 [m,n] = size(p.array);
0005 
0006 outstr = '{ ';
0007 
0008 for k=m:-1:1
0009     part = find(p.array(k,:));
0010     outstr = [outstr,disp_part(part),' '];
0011 end
0012 outstr = [outstr,'}'];
0013 disp(outstr);
0014 
0015 end
0016 
0017 
0018 
0019 function s = disp_part(part)
0020 s = '{';
0021 for k=1:length(part)
0022     s = [s,int2str(part(k))];
0023     if (k<length(part))
0024         s = [s,','];
0025     end
0026 end
0027 s = [s,'}'];
0028 end

Generated on Thu 13-Mar-2008 14:23:52 by m2html © 2003

Contact us at files@mathworks.com