8
8
#include "termorder.h"
10
10
class SymmetryGroup{
11
unsigned char *byteTable;
12
15
typedef set<IntegerVector,LexicographicTermOrder> ElementContainer;
13
16
ElementContainer elements;
17
int sizeOfBaseSet()const;
19
Applies the permutation v to each vector in the list l.
15
21
static IntegerVectorList permuteIntegerVectorList(IntegerVectorList const &l, IntegerVector const &v);
16
22
static Polynomial permutePolynomial(const Polynomial &p, IntegerVector const &v);
17
23
static PolynomialSet permutePolynomialSet(PolynomialSet const &s, IntegerVector const &v);
18
24
Polynomial computeUniqueRepresentative(Polynomial p);
19
static IntegerVector compose(IntegerVector const &a, IntegerVector const &b);
25
static IntegerVector compose(IntegerVector const &perm, IntegerVector const &b);
20
26
static IntegerVector composeInverse(IntegerVector const &a, IntegerVector const &b);
21
27
static IntegerVector identity(int numberOfElements);
22
28
static IntegerVector inverse(IntegerVector const &a);
29
static bool isPermutation(IntegerVector const &a);
31
* Takes a permutation of variables and sign changes of variables and combines them in to a single permutation of the variables and their inverses. That is, the permutation is a permutation on 2n elements.
33
static IntegerVector combinePermutationAndSignChanges(IntegerVector const &permutation, IntegerVector const &signChanges);
35
* Does the opposite transformation as combinePermutationAndSignChanges.
37
static void extractPermuationAndSignChanges(IntegerVector const &v, IntegerVector &permutation, IntegerVector &signChanges);
39
The set of vectors which are not improved lexicographically when
40
perm is applied to them is convex. Its closure is a
41
halfspace. This routine returns the inner normal of this
42
halfspace. The only exception is if perm is the identity then the
43
zero vector is returned.
45
static IntegerVector fundamentalDomainInequality(IntegerVector const &perm);
47
The set of vectors which cannot be improved lexicographically by
48
applying an element from the group is a convex set. Its closure
49
is a polyhedral cone. This routine returns a set of inequalities
50
The returned list does not contain the zero vector.
52
IntegerVectorList fundamentalDomainInequalities()const;
23
53
SymmetryGroup(int n);
24
54
void computeClosure(IntegerVector const &v);
25
55
void computeClosure(IntegerVectorList const &l);
56
IntegerVectorList getUniqueGenerators()const;
57
int orbitSize(IntegerVector const &stable)const;
58
bool isTrivial()const;
26
59
void print(FILE *f);
61
The symmetry group acts on vectors by permuting the entries. The
62
following routine returns a unique representative for the orbit
63
containing v. This makes it easy to check if two elements are in
64
the same orbit. The permutation used to get this representative
65
is stored in *usedPermutation (if pointer not 0).
67
IntegerVector orbitRepresentative(IntegerVector const &v, IntegerVector *usedPermutation=0)const;
69
This routine works as orbitRepresentative() except that the
70
symmetry group considered is only the subgroup keeping the vector
73
IntegerVector orbitRepresentativeFixing(IntegerVector const &v, IntegerVector const &fixed)const;
75
// Methods for highly optimized symmetry group computations:
76
void createByteTable();//Can only be called once. SymmetryGroup is not allowed to be changed afterwards or to be copied. Leaks memory at destruction.
78
unsigned char *getByteTable()const;
79
int getByteTableHeight()const;
83
* Sorts v and returns the number of swaps performed.
85
int mergeSort(IntegerVector &v);