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

563604 views
1
#include <typedef.h>
2
#include <getput.h>
3
#include <matrix.h>
4
#include <base.h>
5
#include <longtools.h>
6
#include <presentation.h>
7
#include <sort.h>
8
9
/*************************************************************************
10
@
11
@-------------------------------------------------------------------------
12
@
13
@ void check_base(bahn **s,
14
@ bravais_TYP *G)
15
@
16
@ checks the integrity of the structure s for the finite
17
@ group G, ie. checks all words in s[i]->words (0<=i<G->dim)
18
@ wheter they produce the right matrix if one insert G->gen
19
@ into them.
20
@ Neither s nor G are changed, and if an error occurs
21
@ the function gives a message to stderr.
22
@
23
@-------------------------------------------------------------------------
24
@
25
**************************************************************************/
26
void check_base(bahn **s,
27
bravais_TYP *G){
28
29
int i,
30
j;
31
32
33
matrix_TYP *M,
34
**GENINV;
35
36
GENINV = (matrix_TYP **) calloc(G->gen_no , sizeof(matrix_TYP *));
37
38
for (i=0;i<G->dim;i++){
39
for (j=0;j<s[i]->length;j++){
40
if (s[i]->words[j] == NULL){
41
fprintf(stderr,"error: no word\n");
42
}
43
}
44
}
45
46
47
for (i=0;i<G->dim;i++){
48
for (j=0;j<s[i]->length;j++){
49
M = mapped_word(s[i]->words[j],G->gen,GENINV);
50
if (mat_comp(M,s[i]->representatives[j])){
51
fprintf(stderr,"error: word is wrong i=%d j=%d\n",i,j);
52
put_word(s[i]->words[j],"G");
53
}
54
else if (FALSE){
55
fprintf(stderr,"word is good i=%d j=%d\n",i,j);
56
put_word(s[i]->words[j],"G");
57
}
58
free_mat(M);
59
}
60
}
61
62
for (i=0;i<G->gen_no;i++)
63
if (GENINV[i]) free_mat(GENINV[i]);
64
65
if (GENINV) free(GENINV);
66
67
return;
68
69
} /* check_base(.....) */
70
71
72