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 "matrix.h"
3
#include "gmp.h"
4
#include "zass.h"
5
6
/**************************************************************************
7
@
8
@ -------------------------------------------------------------------------
9
@
10
***************************************************************************/
11
matrix_TYP *convert_to_cozycle(matrix_TYP *x,matrix_TYP *cozycle,
12
matrix_TYP *D)
13
{
14
15
int i,
16
j,
17
first,
18
last,
19
factor;
20
21
matrix_TYP *erg;
22
23
erg = init_mat(cozycle->rows,1,"");
24
25
/* set first and last */
26
for (first = 0;first<D->cols && D->array.SZ[first][first] == 1;first++);
27
for (last = 0;last<D->cols && D->array.SZ[last][last] != 0;last++);
28
29
for (i=first;i<last;i++){
30
factor = x->array.SZ[i-first][0] *
31
D->array.SZ[last-1][last-1] / D->array.SZ[i][i];
32
for (j=0;j<erg->rows;j++){
33
erg->array.SZ[j][0] += (cozycle->array.SZ[j][i-first] * factor);
34
}
35
}
36
37
erg->kgv = D->array.SZ[last-1][last-1];
38
erg->flags.Integral = FALSE;
39
40
Check_mat(erg);
41
42
return erg;
43
}
44
45
46