Code covered by the BSD License  

Highlights from
Matgraph

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

Description of length
Home > matgraph > @permutation > length.m

length

PURPOSE ^

length(p) gives the size of the permutation

SYNOPSIS ^

function s = length(p)

DESCRIPTION ^

 length(p) gives the size of the permutation

CROSS-REFERENCE INFORMATION ^

This function calls:
  • length length(p) gives the size of the permutation
This function is called by:
  • cycles cycles(p) returns a cell array containing the cycle structure of p
  • display display(p) --- display a permutation in disjoint cycle form.
  • eq test if p == q
  • length length(p) gives the size of the permutation
  • longest_cycle longest_cycle(p) -- return the length of the longest cycle in p
  • matrix matrix(p) gives a permutation matrix version of p
  • mpower p^t is p multiplied by itself t times. May have t <= 0.
  • mtimes p*q is the composition of p and q
  • permutation constructor for the permutation class
  • random random(p) --- return a random reordering of the elements of p
  • sign sign of a permutation (1 for even, -1 for odd)
  • size size(p) returns the number of elements permuted and the number of cycles.
  • subsref p(k) returns the result of p applied to k.

SOURCE CODE ^

0001 function s = length(p)
0002 % length(p) gives the size of the permutation
0003 s = length(p.array);

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

Contact us at files@mathworks.com