|
| PermClass () |
| Creates the conjugacy class for the identity permutation. More...
|
|
| PermClass (const PermClass &src) |
| Creates a copy of the given conjugacy class. More...
|
|
PermClass & | operator= (const PermClass &src) |
| Sets this to be a copy of the given conjugacy class. More...
|
|
bool | operator== (const PermClass &other) const |
| Determines whether this and the given object describe the same conjugacy class. More...
|
|
bool | operator!= (const PermClass &other) const |
| Determines whether this and the given object describe different conjugacy classes. More...
|
|
bool | isIdentity () const |
| Determines whether this is the conjugacy class for the identity permutation. More...
|
|
int | cycle (int which) const |
| Returns the length of the given cycle in this conjugacy class. More...
|
|
int | countCycles () const |
| Returns the number of cycles in this conjugacy class. More...
|
|
Perm< n > | rep () const |
| Returns the minimal representative of this conjugacy class. More...
|
|
std::string | str () const |
| Returns a string representation of this conjugacy class. More...
|
|
PermClass & | operator++ () |
| A preincrement operator that changes this to become the next conjugacy class in a lexicographical enumeration. More...
|
|
PermClass | operator++ (int) |
| A postincrement operator that changes this to become the next conjugacy class in a lexicographical enumeration. More...
|
|
| operator bool () const |
| Determines whether this represents a genuine conjugacy class, or whether it represents the special past-the-end value. More...
|
|
template<int n>
class regina::PermClass< n >
Represents a conjugacy class of permutations on n elements.
Each such conjugacy class correpsonds to an unordered partition of n, describing the cycle structure of the permutations in the conjugacy class.
There is a special "past-the-end" conjugacy class, which effectively holds no value; the only way you can obtain such a class is to iterate through all classes using the increment operators. You can test for a past-the-end value by casting to bool
.
PermClass objects are, in their current implementation, entirely stack-based. This means they cannot support fast move or swap operations. However, their size is linear in n, so while copy operations are not enormously expensive, they are not as cheap as copying a Perm object (which just holds a single machine-native integer). This decision is a deliberate trade-off between speed versus space; the implication for end users is that you should be economical about copying PermClass objects, and work with them in-place where possible.
- Python
- Python does not support templates. For each n = 2,...,16, this class is available in Python under the corresponding name PermClass2, PermClass3, ..., PermClass16.
- Template Parameters
-
n | the number of objects being permuted. This must be between 2 and 16 inclusive. |
Returns the length of the given cycle in this conjugacy class.
Recall from the class notes that a conjugacy class identifies the cycle structure of a permutation. If the cycle lengths are listed in order from shortest to longest, then this routine returns the whichth cycle length in this sequence. Fixed points are included in this sequence (they are considered to be cycles of length 1, and will appear at the beginning of the sequence).
For example, for a conjugacy class in PermClass<9>
with cycle lengths (1,1,3,4)
, calling cycle(2)
will return 3.
- Parameters
-
which | indicates which cycle length to return; this must be between 0 and countCycles()-1 inclusive. |
- Returns
- the requested cycle length.
A preincrement operator that changes this to become the next conjugacy class in a lexicographical enumeration.
Specifically, the increment operators work through conjugacy classes in lexicographical order, where each class is represented by its sequence of cycle lengths (given in increasing order). Thus the conjugacy class 11...1
(representing the identity permutation) will come first, and the conjugacy class n
(representing a single long cycle) will come last.
If there are no more conjugacy classes (i.e., this represents a single cycle of length n), then this object will be set to the special past-the-end value (which can be tested by casting to a bool
).
- Python
- Not present. The postincrement operator is present in Python as the member function inc().
- Returns
- a reference to this conjugacy class after the increment.
A postincrement operator that changes this to become the next conjugacy class in a lexicographical enumeration.
Specifically, the increment operators work through conjugacy classes in lexicographical order, where each class is represented by its sequence of cycle lengths (given in increasing order). Thus the conjugacy class 11...1
(representing the identity permutation) will come first, and the conjugacy class n
(representing a single long cycle) will come last.
If there are no more conjugacy classes (i.e., this represents a single cycle of length n), then this object will be set to the special past-the-end value (which can be tested by casting to a bool
).
- Python
- This routine is named inc() since python does not support the increment operator.
- Returns
- a copy of this conjugacy class before the increment took place.
Returns a string representation of this conjugacy class.
At present, the string representation consists of a sequence of digits indicating the cycle lengths (where cycle lengths 10,11,...,16 use a,b,...,g
for their respective digits).
If this is the past-the-end conjugacy class, a suitable string will be returned.
- Returns
- a string representation of this conjugacy class.