Functions to create permutation objects.
permutation is a
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Further arguments passed to
cycle() are rather formal functions
which make no attempt to coerce their arguments into sensible forms.
The user should use
permutation(), which detects the form of the
input and dispatches to
are much more user-friendly.
cycle() are the only functions in the
package which assign class
cycle to an
A word is a matrix whose rows correspond to permutations in word format.
A cycle is a list whose elements correspond to permutations in
cycle form. A
cycle object comprises elements which are
informally dubbed ‘cyclists’. A cyclist is a list of integer
vectors corresponding to the cycles of the permutation.
cycle2word() converts cycle objects to word objects.
shift_cycle() is a convenience wrapper for
cyc_len() is a synonym.
It is a very common error (at least, it is for me) to use
when you meant
The print method is sensitive to the value of option
print_word_as_cycle’, documented at
as.matrix.word() coerces a vector of permutations in word form to
a matrix, each row of which is a word. To get a permutation matrix (that is, a
square matrix of ones and zeros with exactly one entry of 1 in each row and each column),
cycle object or a
Robin K. S. Hankin
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
word(matrix(1:8,7,8)) # default print method displays cycle form cycle(list(list(c(1,8,2),c(3,6)),list(1:2, 4:8))) char2cycle(c("(1,4)(6,7)","(3,4,2)(8,19)", "(56)","(12345)(78)","(78)")) jj <- c(4,2,3,1) as.word(jj) as.cycle(jj) as.cycle(1:2)*as.cycle(1:8) == as.cycle(1:8)*as.cycle(1:2) # FALSE! x <- rperm(10,7) y <- rperm(10,7) as.cycle(commutator(x,y)) cycle(sapply(seq_len(9),cyc_len))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.