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) elts.append(elt) if sort_them: pmti_tm.sort_pmtis(elts) return elts
def get_elements(n): sn_size = sackint.factorial(n) elts = [] for k in range(0, sn_size): elt = pmtc_tm.kth_pmtc(k, n, sn_size) if (elt.parity() == 0): elts.append(elt) pmtc_tm.sort_pmtcs(elts) return elts
def get_elements(n, sort_them=True): group_size = sackint.factorial(n) elts = [] for k in range(0, group_size): elt = pmtc_tm.kth_pmtc(k, n, group_size) elts.append(elt) if sort_them: pmtc_tm.sort_pmtcs(elts) return elts
def get_elements(n): sn_size = sackint.factorial(n) elts = [] for k in range(0, sn_size): elt = pmti_tm.kth_pmti(k, n, sn_size) if (elt.parity() == 0): elts.append(elt) pmti_tm.sort_pmtis(elts) return elts
def num_ct_reps(ct): # Find n n = 0 for e in ct: n += e # Find n! rv = sackint.factorial(n) # Account for cyclic shifts within cycles. for e in ct: rv /= e # Account for permutations of same-length cycles. pairs = type_to_counts(ct) for pair in pairs: rv /= sackint.factorial(pair[1]) return rv