1 Robert Dodier, February 2006:
2 -----------------------------
3 There were two files here which implemented two versions of a
4 permutation function, both of which are superseded by the permutation
5 function in maxima/src/nset.lisp.
7 Jaime Villate, November 2017:
8 -----------------------------
9 I have added a package that implements some of the permutations
10 functions of Macsyma (with different names) and will implement many
13 Since Maxima's nset package already includes functions permutations
14 and random_permutation which return permuted arrangements of a set or
15 list, I have used the name "perm" for permutations written as a list
16 of the first n positive integers without repetitions. Thus, perms(int)
17 will give the list of permutations of degree n, in contrast to
18 permutations(set) which gives that list of permutations applied to the
21 Some differences with Macsyma: permutation_decomp has been named here
22 perm_cycles and perm_decomp is used for decomposition into the
23 generators of the permutation group (adjacent transpositions).
24 perm_cycles returns only cycles and no fixed points; i.e,
25 [[1,4,5],[3,6]] instead of [[1,4,5],[2],[3,6]].
27 perm_undecomp does not require a complete set of cycles and fixed
28 points, such as [[1,4,5],[2],[3,6],[7]]; it accepts just
29 [[1,4,5],[3,6]], but it needs an extra parameter, namely, the degree
30 of the group. For example: perm_undecomp([[1,4,5],[3,6]],7)
32 perms_lex returns the list of permutations of degree n in
33 lexicographic order, but unlike Macsyma's permutations_lex, the
34 argument should be just an integer (n) and not a permutation.
35 perms(n) gives tht complete list of permutations using a
36 minimum-change ordering, in which is permutation differs from the
37 previous one by just one adjacent transposition.