[GAP Forum] CyclePermInt

Alexander Konovalov alexander.konovalov at gmail.com
Mon Nov 1 14:38:07 GMT 2010


Dear Adam, dear GAP Forum,

On 1 Nov 2010, at 11:26, Adam James wrote:

> Dear Forum,
> 
> Sorry If I have missed this somewhere in the reference manual or online, but
> I came across some GAP code recently using the CyclePermInt function and
> can't figure out what this function does?
> 
> Regards,
> Adam

CyclePermInt is currently undocumented:

gap> ?CyclePermInt
Help: no matching entry found
Help: 'CyclePermInt' is currently undocumented.
      For details, try ?Undocumented Variables

To find out what it is doing, first let's see if this
is a function on an operation:

gap> CyclePermInt;
function( perm, point ) ... end

and now print this function:

gap> Print(last,"\n");
function ( perm, point )
    <<compiled code>>
end

This output suggests that it is implemented in the kernel. Search in the 
source ( gap4r4/src/ ) reveals that it is contained in permutat.c and has 
a comment explaining what it does:

**  'CyclePermInt( <perm>, <point> )'
**
**  'CyclePermInt' returns the cycle of <point>, which  must  be  a  positive
**  integer, under the permutation <perm> as a list.

Note, however, that one should not rely on the behaviour of internal undocumented
functions, since their semantics/names/arguments may be changed across releases 
and it is not guaranteed that they will be preserved in the next release at all.

To the contrary, if the function is documented, then there is a very strict set of 
rules specifying how such changes should be done.

Best regards,
Alexander


More information about the Forum mailing list