Represents a permutation encoded as a map from preimages to images, including only pairs that are moved by the permutation (so the identity is Map.empty).
Note that although the preimage and image contain only moved points, the domain and range of a Perm is all integers. This acts as the identity for integers not in the image.
- Companion
- object
Value members
Concrete methods
Compose this with another Perm
with this permutation applied first.
Compose this with another Perm
with this permutation applied first.
Apply this permutation to an Int
.
Apply this permutation to an Int
.
- Definition Classes
- Function1
A Perm
constructed by cycling args so each n,,i,, maps to n,,i+1,,.
A Perm
constructed by cycling args so each n,,i,, maps to n,,i+1,,.
This new cycle is composed with the current permutation to yield a new Perm
. Cycles provided to this constructor
must be disjoint. See Perm$.apply.
Compose this with another Perm
with this permutation applied last.
Compose this with another Perm
with this permutation applied last.
The set of points moved by this permutation (equivalent to preimage).
The set of points moved by this permutation (equivalent to preimage).
The inverse permutation, which composes with this to yield the identity. Note that this uses a lazy inverse map, so the first call may be O(n) rather than O(1).
The inverse permutation, which composes with this to yield the identity. Note that this uses a lazy inverse map, so the first call may be O(n) rather than O(1).
The preimage of k
(so that apply(invert(k)) == k
).
The preimage of k
(so that apply(invert(k)) == k
).