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

563580 views
1
#include <typedef.h>
2
#include <getput.h>
3
#include <matrix.h>
4
#include <base.h>
5
#include <longtools.h>
6
7
8
9
/************************************************************************
10
@ Calculate the order of the cohomology group!
11
@
12
@ matrix_TYP *D: 2nd matrix returned by cohomolgy for G.
13
*************************************************************************/
14
MP_INT cohomology_size(matrix_TYP *D)
15
{
16
int first, i;
17
18
MP_INT coho_size;
19
20
21
for (first = 0; first < D->cols && D->array.SZ[first][first] == 1; first++);
22
23
mpz_init_set_si(&coho_size, 1);
24
/* the order of the cohomology group in the product of those elementary
25
divisors which are not equal 0 */
26
for (i = first; i < D->cols && D->array.SZ[i][i] != 0; i++)
27
mpz_mul_ui(&coho_size, &coho_size, (unsigned long) D->array.SZ[i][i]);
28
29
return(coho_size);
30
}
31
32