-
Notifications
You must be signed in to change notification settings - Fork 6
/
orbit_representatives.c
69 lines (64 loc) · 2.76 KB
/
orbit_representatives.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#error THIS FILE IS NOT USED
#include"typedef.h"
#include"orbit.h"
#include"getput.h"
#include"sort.h"
main (int argc, char *argv[])
{
matrix_TYP **Mat, *erg;
bravais_TYP *G;
int i, Manz, length;
int *option;
read_header(argc, argv);
if(FILEANZ != 2)
{
printf("Usage: %s 'file1' 'file2' [-i] [-r] [-l] [-k] [-t] [-L=n] [-S=n] [-p] [-u]\n",argv[0]);
printf("\n");
printf("file1: matrix_TYP, contains matrices X_i forming a G-set (union of G-orbits)\n");
printf("file2: bravais_TYP, contains generators of a group G\n");
printf("\n");
printf("Calulates the orbit representatives of the G-orbits on {X_1,...},\n");
printf("where the action is specified by the options. Default option is action by\n");
printf("left multiplication.\n");
printf("\n");
printf("Options:\n");
printf("-i : Use the generators given in file2 and their\n");
printf(" inverses to calculate the orbit.\n");
printf("-r : Operate from the right.\n");
printf("-l : Operate from the left (default).\n");
printf("-k : Operate via conjugation, ie. x -> g x g^-1 \n");
printf("-L=n : Calculate at most n elements of the Orbit.\n");
printf(" 0 means infinity.\n");
printf("-S=n : If given as -S or -S=0 a generating set for\n");
printf(" the stabilizer is calculated. If given as\n");
printf(" -S=n at most n matrices of the stabilizer\n");
printf(" are calculated.\n");
printf("-p : Operate on pairs of the form {M,-M}.\n");
printf("-u : Operate on the set of rows of the matrix given\n");
printf(" in file1.\n");
printf("-g : Operate on sublattices of Z^n spanned by the columns of the \n");
printf(" matrices gX with g in G.\n");
printf("-f : Operates on quadratic forms via x -> g^-tr x g^-1\n");
printf("\n");
printf("Cf. Orbit.\n");
if (is_option('h')){
exit(0);
}
else{
exit(31);
}
}
Mat = mget_mat (FILENAMES[0], &Manz);
G = get_bravais(FILENAMES[1]);
option = make_orbit_options();
mat_quicksort(Mat, 0, Manz-1, mat_comp);
erg = orbit_representatives(Mat, Manz, G, option, &length, 1);
printf("#%d\n", length);
for(i=0;i<length;i++)
put_mat(Mat[erg->array.SZ[0][i]], NULL, "", 2);
printf(" length of i-th orbit is\n");
for(i=0;i<length;i++)
printf("%d, ", erg->array.SZ[1][i]);
printf("\n");
exit(0);
}