Home > matgraph > @permutation > mtimes.m

mtimes

PURPOSE ^

p*q is the composition of p and q

SYNOPSIS ^

function r = mtimes(p,q)

DESCRIPTION ^

 p*q is the composition of p and q

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function r = mtimes(p,q)
0002 % p*q is the composition of p and q
0003 np = length(p);
0004 nq = length(q);
0005 
0006 if np < nq
0007     p.array = [p.array, np+1:nq];
0008     np = nq;
0009 end
0010 
0011 if np > nq
0012     q.array = [q.array, nq+1:np];
0013     nq = np;
0014 end
0015 
0016 n = np;
0017 
0018 a = zeros(1,n);
0019 
0020 for k=1:n
0021     a(k) = p.array(q.array(k));
0022 end
0023 
0024 r = permutation(a);

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