Skip to content

Commit f37873a

Browse files
committed
-
1 parent ecc8177 commit f37873a

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

source_py3/python_toolbox/combi/perm_space.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,31 @@ class PermSpace(sequence_tools.CuteSequenceMixin, collections.Sequence,
8181
by index number any permutation of the 10**2500 permutations in a fraction
8282
of a second as well.
8383
84+
There are several variations that a perm space could have:
85+
- Rapplied (Range-applied): having an arbitrary sequence as a range. To
86+
make one, pass your sequence as the first argument.
87+
- Dapplied (Domain-applied): having an arbitrary sequence as a domain. To make one, pass a sequence into the `domain` argument.
88+
- Fixed: Having a specified number of indices always pointing at certain
89+
values, making the space smaller. To make one, pass a dict from each key to the value it should be fixed to to argument `fixed_map`
90+
- Sliced: A perm space can be sliced like any Python sequence (except you
91+
can't change the step.) To make one, use slice notation on an existing perm space.
92+
- Degreed: A perm space can be limited to perms of a certain degree. (A
93+
perm's degree is the number of transformations it takes to make it.)
94+
- Partialled: A perm space can be partial, in which case not all elements
95+
are used in perms. E.g. you can have a perm space of a sequence of
96+
length 5 but with `n_elements=3`, so every perm will have only 3
97+
- Combination: If you pass in `is_combination=True` or use the subclass
98+
`CombSpace`, then you'll have a space of combinations (combs) instead of
99+
perms. Combs are like perms except there's no order to the elements.
100+
101+
84102
Instead of a number, you can also pass a sequence as the first argument,
85-
and the `PermSpace` will use that rather than `range`.
103+
and the `PermSpace` will use that rather than a range. Such a `PermSpace`
104+
is called "rapplied", which is short for range-applied. It'll have a
105+
property `.unrapplied` which'll give you a non-rapplied version of that
106+
perm space. You can also take any perm space and use the `.get_rapplied`
107+
method on it to get that space range-applied to a sequence that you
108+
provide.
86109
87110
You may pass a sequence as the `domain` argument, and it'll be used as the
88111
indices for the permutations. (i.e., if the permutations are seen as a

0 commit comments

Comments
 (0)