Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 28 lines (22 sloc) 705 Bytes
#!/usr/bin/python -Wall
# ================================================================
# Please see LICENSE.txt in the same directory as this file.
# John Kerl
# 2007-05-31
# ================================================================
# Group module for permutation group S_n, with image-map I/O.
import pmti_tm
import sackint
def get_elements(n, sort_them=True):
group_size = sackint.factorial(n)
elts = []
for k in range(0, group_size):
elt = pmti_tm.kth_pmti(k, n, group_size)
if sort_them:
return elts
def get_elements_str(params_string):
n = pmti_tm.params_from_string(params_string)
return get_elements(n)