> < ^ Date: Sat, 27 Sep 1997 16:27:44 +0100 (BST)
> < ^ From: Goetz Pfeiffer <Goetz.Pfeiffer@NUIGalway.ie >
< ^ Subject: Re: List to Cycle

Dear Gap Forum,

Bruce W. Colletti asked
> 
> What GAP 3.4.4 command, if any, converts a list into a cycle, e.g.,
> Command([1,2,3]) = (1,2,3), Command([6,4,9,2]) = (6,4,9,2)?

There is no such command in GAP 3.4.4 as far as I know. But the
following GAP function should do the trick:

CycleList:= function(c)

local cycle, shift;

shift:= [2..Length(c)];  Add(shift, 1);
cycle:= [1..Maximum(c)];  cycle{c}:= c{shift};

return PermList(cycle);

end;

Goetz.

-------------------------------------------------------------------------
Goetz.Pfeiffer@ucg.ie                       http://schmidt.ucg.ie/~goetz/
University College Galway, Ireland.                  phone +353-91-750353

> < [top]