Skip to content

Commit ea6a757

Browse files
committed
-
1 parent d974942 commit ea6a757

File tree

1 file changed

+15
-2
lines changed
  • source_py3/python_toolbox/combi/perming

1 file changed

+15
-2
lines changed

source_py3/python_toolbox/combi/perming/perm.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,21 @@ def inverse(self):
194194
'''
195195
The inverse of this permutation.
196196
197-
This means, the permutation such that `perm * ~perm` would be the identity
198-
permutation.
197+
i.e. the permutation that we need to multiply this permutation by to
198+
get the identity permutation.
199+
200+
This is also accessible as `~perm`.
201+
202+
Example:
203+
204+
>>> perm = PermSpace(5)[10]
205+
>>> perm
206+
<Perm: (0, 2, 4, 1, 3)>
207+
>>> ~perm
208+
<Perm: (0, 3, 1, 4, 2)>
209+
>>> perm * ~perm
210+
<Perm: (0, 1, 2, 3, 4)>
211+
199212
'''
200213
if self.is_partial:
201214
raise TypeError("Partial perms don't have an inverse.")

0 commit comments

Comments
 (0)