GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
/****************************************************************************1**2*A consistency.c ANUPQ source Eamonn O'Brien3**4*Y Copyright 1995-2001, Lehrstuhl D fuer Mathematik, RWTH Aachen, Germany5*Y Copyright 1995-2001, School of Mathematical Sciences, ANU, Australia6**7*/89#include "pq_defs.h"10#include "pcp_vars.h"1112#if !defined(CONSISTENCY_FILTER)1314/* process those consistency relations of weight wc not already used;15the value of type determines the consistency relations processed;16if type = 0 then all relations are processed;17for Lie Algebra calculations, the type is always 3 */1819void consistency(20int type, int *queue, int *queue_length, int wc, struct pcp_vars *pcp)21{22register int *y = y_address;2324register int a;25register int b;26register int c;2728register int wta; /* weight of a */2930register int a_start; /* start of range for a */31register int a_end; /* end of range for a */32register int b_start;33register int b_end;34register int c_start;35register int c_end;3637register int jacobi_wt = wc;38register int bound = jacobi_wt >> 1;39register int constant;40register int offset;41register int entry;42register int p1;4344register int class_end = pcp->clend;45register int p_pcomm = pcp->ppcomm;46register int p_power = pcp->ppower;47register int structure = pcp->structure;4849register Logical metabelian = pcp->metabelian;50register Logical compute; /* is it necessary to compute jacobi? */5152#include "access.h"5354/* process the consistency equations (a^p) a = a (a^p)55where 2 * WT(a) + 1 = jacobi_wt */5657if (type == 0 || type == 1) {58if (MOD(jacobi_wt, 2) != 0) {5960/* find range of a */61offset = class_end + bound - 1;62a_start = y[offset] + 1;63a_end = y[++offset];6465for (a = a_start; a <= a_end; a++) {66compute =67(!metabelian || (metabelian && (PART2(y[structure + a]) == 0 ||68PART3(y[structure + a]) == 0)));69if (compute) {70jacobi(a, a, a, 0, pcp);71if (pcp->redgen != 0 && pcp->m != 0)72queue[++*queue_length] = pcp->redgen;73}74if (pcp->overflow || (pcp->complete != 0 && !pcp->multiplicator))75return;76}77}78}7980/* process the consistency equations81(b^p) a = b^(p - 1) (ba) and b (a^p) = (ba) a^(p - 1)82where b > a and WT(b) + WT(a) + 1 = jacobi_wt */8384if (type == 0 || type == 2) {85for (wta = 1; wta <= bound; ++wta) {8687/* find range of a */88offset = class_end + wta - 1;89a_start = y[offset] + 1;90a_end = y[++offset];9192/* find maximum value of b */93offset = class_end + jacobi_wt - wta - 2;94b_end = y[offset + 1];9596for (a = a_start; a <= a_end; ++a) {9798/* ensure b > a */99b_start = MAX(y[offset] + 1, a + 1);100for (b = b_start; b <= b_end; ++b) {101102/* introduce Vaughan-Lee consistency check restriction */103if (wta == 1) {104/* check if this jacobi relation has already been used105in filling in the tail on (b, a)^p */106p1 = y[p_pcomm + b];107if (y[p1 + a] <= 0 || y[p1 + a] >= pcp->first_pseudo) {108compute = (!metabelian ||109(metabelian && (PART2(y[structure + b]) == 0 ||110PART3(y[structure + b]) == 0)));111if (compute) {112jacobi(b, b, a, 0, pcp);113if (pcp->redgen != 0 && pcp->m != 0)114queue[++*queue_length] = pcp->redgen;115}116if (pcp->overflow ||117(pcp->complete != 0 && !pcp->multiplicator))118return;119}120}121122/* check if this jacobi relation has already been123used in filling in the tail on (b, a^p) */124entry = y[p_power + a];125if (entry <= 0 || entry >= b) {126compute = (!metabelian ||127(metabelian && (PART2(y[structure + a]) == 0 ||128PART3(y[structure + a]) == 0 ||129PART2(y[structure + b]) == 0 ||130PART3(y[structure + b]) == 0)));131if (compute) {132jacobi(b, a, a, 0, pcp);133if (pcp->redgen != 0 && pcp->m != 0)134queue[++*queue_length] = pcp->redgen;135}136if (pcp->overflow ||137(pcp->complete != 0 && !pcp->multiplicator))138return;139}140}141}142}143}144145/* process the consistency equations (cb) a = c (ba), where146c > b > a, WT(a) + WT(b) + WT(c) = jacobi_wt, and WT(a) = 1 */147148if (type == 0 || type == 3) {149150/* first, find maximum values of a and b */151a_end = y[class_end + 1];152b_end = y[class_end + ((jacobi_wt - 1) >> 1)];153constant = class_end + jacobi_wt - 2;154155for (a = 1; a <= a_end; ++a) {156for (b = a + 1; b <= b_end; ++b) {157158/* find range of c and ensure c > b */159offset = constant - WT(y[structure + b]);160c_start = MAX(y[offset] + 1, b + 1);161c_end = y[++offset];162163/* where possible, avoid redoing those jacobis used to164fill in tails on (c, (b, a)) */165if (!metabelian) {166p1 = y[p_pcomm + b];167if (y[p1 + a] > 0)168c_end = MIN(c_end, y[p1 + a]);169}170171for (c = c_start; c <= c_end; ++c) {172compute = (!metabelian ||173(metabelian && (PART2(y[structure + b]) == 0 ||174PART3(y[structure + b]) == 0 ||175PART2(y[structure + c]) == 0 ||176PART3(y[structure + c]) == 0)));177if (compute) {178jacobi(c, b, a, 0, pcp);179if (pcp->redgen != 0 && pcp->m != 0)180queue[++*queue_length] = pcp->redgen;181}182if (pcp->overflow || (pcp->complete != 0 && !pcp->multiplicator))183return;184}185}186}187}188}189190#endif191192193