#include "pq_defs.h"
#include "pga_vars.h"
#include "pq_functions.h"
#include "constants.h"
void compute_degree(struct pga_vars *pga)
{
register int i;
register int maximum = 0;
pga->Degree = 0;
for (i = 0; i < pga->nmr_def_sets; ++i) {
pga->offset[i] = pga->Degree;
if (int_power(pga->p, pga->available[i]) > (INT_MAX - pga->Degree)) {
text(19, 0, 0, 0, 0);
if (!isatty(0))
exit(FAILURE);
else
return;
}
pga->Degree += int_power(pga->p, pga->available[i]);
if (maximum < pga->available[i])
maximum = pga->available[i];
}
pga->powers = allocate_vector(maximum + 1, 0, 0);
for (i = 0; i <= maximum; ++i)
pga->powers[i] = int_power(pga->p, i);
pga->inverse_modp = allocate_vector(pga->p, 0, 0);
for (i = 1; i < pga->p; ++i)
pga->inverse_modp[i] = invert_modp(i, pga->p);
if (pga->print_degree)
printf("Degree of permutation group is %d\n", pga->Degree);
}