Various functionality to deal with cyclists
1 2 3 4 5
Integer vector, interpreted as a word
A cyclist is an object corresponding to a permutation P. It is a list with elements that are integer vectors corresponding to the cycles of P. This object is informally known as a cyclist, but there is no S3 class corresponding to it.
An object of S3 class cycle is a (possibly named) list of cyclists. NB: there is an unavoidable notational clash here. When considering a single permutation, “cycle” means group-theoretic cycle; when considering R objects, “cycle” means “an R object of class cycle whose elements are permutations written in cycle form”.
The elements of a cyclist are the disjoint group-theoretic cycles. Note the redundancies inherent: firstly, because the cycles commute, their order is immaterial (and a list is ordered); and secondly, the cycles themselves are invariant under cyclic permutation. Heigh ho.
A cyclist may be poorly formed in a number of ways: the cycles may
include repeats, or contain elements which are common to more than one
cycle. Such problems are detected by
cycle.valid(). Also, there
are less serious problems: the cycles may include length-one cycles; the
cycles may start with an element that is not the smallest. These issues
are dealt with by
nicify_cyclist() takes a cyclist and puts it in
a nice form but does not alter the permutation. It takes a cyclist
and removes length-one cycles; then orders each cycle so that the
smallest element appears first (that is, it changes
(235)). It then orders the cycles by the smallest element.
remove_length_one() takes a cyclist and removes
length-one cycles from it.
vec2cyclist_single() takes a vector of integers,
interpreted as a word, and converts it into a cyclist. Length-one
cycles are discarded.
vec2cyclist_single_cpp() is a placeholder for a
function that is not yet written.
cyclist2word_single() takes a cyclist and
returns a vector corresponding to a single word. This function is not
intended for everyday use; function
cycle2word() is much more
char2cyclist_single() takes a character string
(342)(19)” and turns it into a cyclist, in this
list(c(3,4,2),c(1,9)). This function returns a cyclist
which is not necessarily canonicalized: it might have length-one
cycles, and the cycles themselves might start with the wrong number or
be incorrectly ordered. It attempts to deal with absence of commas in
a sensible way, so “
(18,19)(2,5)” is dealt with
appropriately too. The function is insensitive to spaces. Also, one
can give it an argument which does not correspond to a cycle object,
char2cyclist_single("(94)(32)(19)(1)") (in which “9”
is repeated). The function does not return an error, but to catch
this kind of problem use
char2cycle() which calls the validity
The user should use
char2cycle() which executes validity checks
and coerces to a cycle object.
Robin K. S. Hankin
1 2 3 4 5 6 7 8 9
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.