PermClass¶
-
class
permuta.demo.
PermClass
(basis=())¶ Bases:
object
A perm(utation) class object.
Pass the constructor an iterable of Perms or objects that can be interpreted as such; each non-Perm element is passed to the Perm constructor. If the constructor is passed a single int or Perm, the principal class for that Perm is constructed.
Examples
>>> PermClass() <All perms> >>> PermClass(123) <Perms avoiding: (1, 2, 3)> >>> PermClass(["1423", "1234"]) <Perms avoiding: (1, 2, 3, 4) and (1, 4, 2, 3)> >>> PermClass([123, "321", Perm(3, 1, 2)]) <Perms avoiding: (1, 2, 3), (3, 1, 2), and (3, 2, 1)> >>> PermClass([62, 123]) <Perms avoiding: (2, 1) and (1, 2, 3)>
-
of_length
(length: int) → permuta.demo._PermClass._PermClassOfLength¶ Return the subset of perms of a certain length.
-