Code covered by the BSD License  

Highlights from
Matgraph

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

Description of size

size

PURPOSE ^

size(p) returns the number of elements permuted and the number of cycles.

SYNOPSIS ^

function s = size(p)

DESCRIPTION ^

 size(p) returns the number of elements permuted and the number of cycles.

CROSS-REFERENCE INFORMATION ^

This function calls:
  • cycles cycles(p) returns a cell array containing the cycle structure of p
  • length length(p) gives the size of the permutation
This function is called by:

SOURCE CODE ^

0001 function s = size(p)
0002 % size(p) returns the number of elements permuted and the number of cycles.
0003 s1 = length(p.array);
0004 c = cycles(p);
0005 s2 = length(c);
0006 s = [s1,s2];

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

Contact us at files@mathworks.com