Shape of a permutation

Description

Returns the shape of a permutation. If given a word, it coerces to cycle form.

Usage

1
2
3
4

Arguments

x

Object of class cycle (if not, coerced)

cyc

A cyclist

n

Integer governing the size of the partition assumed, with default NULL meaning to use the largest element

drop

Boolean, with default TRUE meaning to unlist if possible

id1

Boolean, with default TRUE in function shape_cyclist() meaning that the shape of the identity is “1” and FALSE meaning that the shape is NULL

Value

Function shape() returns a list with elements representing the lengths of the component cycles.

Function shapepart() returns an object of class partition showing the permutation as a set partition of disjoint cycles.

Note

Function shape() returns the lengths of the cycles in the order returned by nicify_cyclist(), so not necessarily in increasing or decreasing order.

Author(s)

Robin K. S. Hankin

See Also

size

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
shape(rperm(10,9)) # coerced to cycle

m <- megaminx

shape(m)
shape(m*m[1])

jj <- m*m[1]
stopifnot(identical(shape(jj),shape(tidy(jj))))  #tidy() does not change shape

shapepart(rperm(10,5))

shape_cyclist(list(1:4,8:9))
shapepart_cyclist(list(1:4,8:9))