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

563690 views
1
#include"typedef.h"
2
#include"getput.h"
3
#include"bravais.h"
4
#include"matrix.h"
5
6
main (int argc, char *argv[])
7
{
8
int anz,
9
i,
10
j,
11
k,
12
prime;
13
14
matrix_TYP **F,
15
*tmp;
16
17
read_header(argc, argv);
18
if((FILEANZ != 1) || (!is_option('p')))
19
{
20
printf("usage: Modp file -p=prime\n");
21
printf(" where file contains a matrix_TYP.\n");
22
printf("\n");
23
printf(" Writes the given matrices in file modulo the given prime.\n");
24
printf("\n");
25
printf("\n");
26
if (is_option('h')){
27
exit(0);
28
}
29
else{
30
exit(31);
31
}
32
}
33
34
F = mget_mat(FILENAMES[0],&anz);
35
36
prime = optionnumber('p');
37
38
printf("#%d\n",anz);
39
40
for (i=0;i<anz;i++){
41
Check_mat(F[i]);
42
if (!F[i]->flags.Integral){
43
printf("Modp uses only integral matrices \n");
44
exit(3);
45
}
46
for (j=0;j<F[i]->rows;j++){
47
for (k=0;k<F[i]->cols;k++){
48
F[i]->array.SZ[j][k] = F[i]->array.SZ[j][k] % prime;
49
}
50
}
51
Check_mat(F[i]);
52
put_mat(F[i],NULL,NULL,2);
53
}
54
55
exit(0);
56
}
57
58
59