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

563642 views
1
#include "typedef.h"
2
#include "gmp.h"
3
#include "getput.h"
4
#include "zass.h"
5
6
void put_cocycle(matrix_TYP *COZ,
7
int dim,
8
int number,
9
char *file,
10
char *comment)
11
{
12
int i,
13
j;
14
15
FILE *F;
16
17
if (file == NULL){
18
F = stdout;
19
}
20
else{
21
F = fopen(file,"rw");
22
}
23
24
if (F == NULL){
25
fprintf(stderr,"problems opening %s\n",file);
26
exit(4);
27
}
28
29
if (dim * number != COZ->rows ){
30
exit (3);
31
}
32
33
if (COZ->cols != 1){
34
fprintf(stderr,"cozycle with more than 1 columns?\n");
35
exit(3);
36
}
37
38
rat2kgv(COZ);
39
Check_mat(COZ);
40
41
if (COZ->kgv == 1 ||
42
COZ->kgv == 0){
43
fprintf(F,"%dx%d\t%s\n",dim,number,comment);
44
}
45
else{
46
fprintf(F,"%dx%d/%d\t%s\n",dim,number,COZ->kgv,comment);
47
}
48
49
for (i=0;i<dim;i++){
50
for (j=0;j<number;j++){
51
fprintf(F,"%d ",COZ->array.SZ[j*dim+i][0]);
52
}
53
printf("\n");
54
}
55
56
return;
57
}
58
59
60