Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

563665 views
1
#ifdef TEST_PRIVATE
2
#include "ZZ_P.h"
3
#include "ZZ_irr_const_P.h"
4
#include "ZZ_cen_fun_P.h"
5
#else
6
#include "ZZ.h"
7
#endif
8
9
/*{{{}}} */
10
/*{{{ ZZ_usage */
11
void
12
ZZ_usage (progname)
13
char *progname;
14
{
15
fprintf (stderr, "Usage: %s -bghl <#level> n <#number> pqrstu <file>\n\n", progname);
16
fprintf (stderr, "-b : Print only the matrices of change of base and their inverse.\n");
17
fprintf (stderr, "-g : Do not compute elementary divisors of the gram matrix.\n");
18
fprintf (stderr, "-h : Print this help\n");
19
fprintf (stderr, "-l #: Stop after reaching level #level (default #=%d).\n", LEVEL);
20
fprintf (stderr, "-n #: Stop after computation of #number \"Zentrierungen\" (default #=%d).\n", NUMBER);
21
fprintf (stderr, "-p<d0>/<d1>/<d2> ... : treat the lattice as a direct sum of <d0> sublattices\n");
22
fprintf (stderr, " of dimensions <d1>, <d2> etc. (0 <= d0 <= 6) and compute only those\n");
23
fprintf (stderr, " centerings that have surjective projections on them.\n");
24
fprintf (stderr, "-q : Quiet mode. Suppress any messages to stdin/stdout.\n");
25
fprintf (stderr, "-r : With ZZ_lll-reduction.\n");
26
fprintf (stderr, "-s : Print less information.\n");
27
fprintf (stderr, "-t : Create the data-file \"ZZ.tmp\".\n");
28
fprintf (stderr, "-u : Do not compute elementary divisors of the change of base\n\n");
29
}
30
31
/*}}} */
32
33
34
void
35
foo ()
36
{
37
/* printf("Hello world!\n"); */
38
}
39
40
#ifndef TEST_PRIVATE
41
/*{{{ main */
42
void
43
main (argc, argv)
44
int argc;
45
char *argv[];
46
{
47
bravais_TYP *group;
48
matrix_TYP *gram;
49
char *file_name = NULL;
50
char *prog_name;
51
int retval;
52
char options[256];
53
int is_option;
54
int projections[7];
55
char *help;
56
int num_proj;
57
58
/* skipped the function atexit because some compiler won't have it
59
tilman 28/07/97:
60
atexit (foo); */
61
prog_name = argv[0];
62
options[0] = '\0';
63
is_option = 0;
64
argv++;
65
argc--;
66
while (argc >= 2)
67
{
68
if (**argv == '-')
69
{
70
(*argv)++;
71
is_option = 1;
72
}
73
if (is_option)
74
{
75
strcat (options, *argv);
76
if ((help = strchr (*argv, 'p')) != NULL)
77
{
78
projections[0] = atoi (help + 1);
79
if (projections[0] == 0)
80
{ /* is in next argv */
81
argv++;
82
argc--;
83
projections[0] = atoi (argv[0]);
84
}
85
if (projections[0] == 0)
86
{
87
fprintf (stderr, "\"p\" option requires number of sublattices and their dimensions to be given.\n");
88
ZZ_usage (prog_name);
89
exit (31);
90
}
91
else if (projections[0] > 6)
92
{
93
fprintf (stderr, "Maximal dimensionis 6\n");
94
}
95
else
96
{
97
printf ("%d\n", projections[0]);
98
help = argv[0];
99
for (num_proj = 1; num_proj <= projections[0]; num_proj++)
100
{
101
if ((help = strchr (help, '/')) != NULL)
102
{
103
help++;
104
projections[num_proj] = atoi (help);
105
if (projections[num_proj] == 0)
106
{
107
fprintf (stderr, "\"p\" option requires number of sublattices and their dimensions to be given.\n");
108
ZZ_usage (prog_name);
109
exit (31);
110
}
111
}
112
else
113
{
114
fprintf (stderr, "\"p\" option requires number of sublattices and their dimensions to be given.\n");
115
ZZ_usage (prog_name);
116
exit (31);
117
}
118
}
119
}
120
}
121
}
122
argv++;
123
argc--;
124
}
125
file_name = *argv;
126
if (file_name == NULL)
127
{
128
fprintf (stderr, "No filename specified.\n");
129
ZZ_usage (prog_name);
130
exit (31);
131
}
132
133
group = get_bravais (file_name);
134
135
gram = group->form[0];
136
137
ZZ (group, gram, group->divisors, options, projections[0],
138
projections[1],
139
projections[2],
140
projections[3],
141
projections[4],
142
projections[5],
143
projections[6]);
144
145
fprintf (stderr, "num_zentr: %d\n", group->zentr_no);
146
cleanup_prime ();
147
free_bravais (group);
148
149
#ifdef MEM_DEBUG
150
debug_meminfo ();
151
#endif
152
153
exit (retval);
154
155
}
156
/*}}} */
157
#else
158
/*{{{ main */
159
void
160
main (argc, argv)
161
162
int argc;
163
char *argv[];
164
{
165
matrix_TYP *Gram, **help2;
166
ZZ_data_t data;
167
ZZ_tree_t tree;
168
169
int i, j, k;
170
171
char *file_name;
172
173
scan_arg (argc, argv, &file_name);
174
Gram = ZZ_fget_data (&data, &tree, file_name);
175
if (constituents == 1)
176
{
177
for (i = 0; i < data.p_consts.k; i++)
178
{
179
help2 = ZZ_irr_const (data.DELTA, data.r,
180
data.p_consts.p[i],
181
&data.p_consts.s[i]);
182
data.n[i] = (int *) malloc (data.p_consts.s[i] * sizeof (int), "main:data.n[i]");
183
data.p_consts.Delta[i] = (matrix_TYP ***) malloc (data.p_consts.s[i] * sizeof (matrix_TYP **), "main:data.p_consts.Delta[i]");
184
for (j = 0; j < data.p_consts.s[i]; j++)
185
{
186
data.p_consts.Delta[i][j] = (matrix_TYP **) malloc (data.r * sizeof (matrix_TYP *), "main:data.p_consts.Delta[i][j]");
187
for (k = 0; k < data.r; k++)
188
{
189
data.p_consts.Delta[i][j][k] = help2[j * data.r + k];
190
data.p_consts.Delta[i][j][k]->prime = data.p_consts.p[i];
191
}
192
data.n[i][j] = data.p_consts.Delta[i][j][0]->rows;
193
}
194
free (help2);
195
}
196
ZZ_test_konst (&data);
197
/*{{{ */
198
/*{{{ */
199
for (i = 0; i < data.p_consts.k; i++)
200
{
201
/*{{{ */
202
/*------------------------------------------------------------*\
203
| initialize Endomorphisms |
204
\*------------------------------------------------------------*/
205
data.EnCo[i] = (ZZ_prod_t *) malloc (data.p_consts.s[i] * sizeof (ZZ_prod_t), "main:data.EnCo[i]");
206
data.Endo[i] = (matrix_TYP ***) malloc (data.p_consts.s[i] * sizeof (matrix_TYP **), "main:data.Endo[i]");
207
}
208
209
data.epi_base = NULL;
210
data.epi = init_mat (data.N, data.N, "ik");
211
tree.root->k_vec = (int **) malloc (data.p_consts.k * sizeof (int *), "main:tree.root->k_vec");
212
data.VK = (int **) malloc (data.p_consts.k * sizeof (int *), "main:data.VK");
213
for (i = 0; i < data.p_consts.k; i++)
214
{
215
tree.root->k_vec[i] = (int *) calloc (data.p_consts.s[i], sizeof (int), "main:tree.root->k_vec[i]");
216
data.VK[i] = (int *) calloc (data.p_consts.s[i] + 1, sizeof (int), "main:data.VK[i]");
217
data.VK[i]++;
218
}
219
ZZ_make_endo (&data);
220
/*}}} */
221
/*}}} */
222
/*}}} */
223
}
224
if (verbose == TRUE)
225
{
226
/*{{{ */
227
for (i = 0; i < data.p_consts.k; i++)
228
{
229
fprintf (stderr, "Primzahl: %d\n", data.p_consts.p[i]);
230
for (j = 0; j < data.p_consts.s[i]; j++)
231
{
232
fprintf (stderr, "Konstituent %d:\n", j);
233
for (k = 0; k < data.r; k++)
234
{
235
fprintf (stderr, "Erzeuger %d:\n", k);
236
fput_mat (stderr, data.p_consts.Delta[i][j][k], "Konstituent", 0);
237
}
238
}
239
}
240
/*}}} */
241
}
242
ZZ_intern (Gram, &data, &tree);
243
ZZ_fput_data (&data, &tree);
244
ZZ_free_data (&data);
245
free (Gram);
246
}
247
/*}}} */
248
#endif
249
250