Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
Project: cocalc-sagemath-dev-slelievre
Views: 418346/****************************************************************************1**2*A consistency_filter.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"11#include "pq_functions.h"1213#if defined(CONSISTENCY_FILTER)1415int *add_weights();161718/* process those consistency relations of weight wc not already used;19the value of type determines the consistency relations processed;20if type = 0 then all relations are processed */2122void consistency(23int type, int *queue, int *queue_length, int wc, struct pcp_vars *pcp)24{25register int *y = y_address;2627register int a;28register int b;29register int c;30int **definition;31int *copy_vector;32int processed, filtered;3334register int wta; /* weight of a */3536register int a_start; /* start of range for a */37register int a_end; /* end of range for a */38register int b_start;39register int b_end;40register int c_start;41register int c_end;4243register int jacobi_wt = wc;44register int bound = jacobi_wt >> 1;45register int constant;46register int offset;47register int entry;48register int p1;4950register int class_end = pcp->clend;51register int p_pcomm = pcp->ppcomm;52register int p_power = pcp->ppower;53register int structure = pcp->structure;5455register Logical metabelian = pcp->metabelian;56register Logical compute; /* is it necessary to compute jacobi? */57register filter = (pcp->nocset);58Logical can_filter;5960int moccur = pcp->ndgen + pcp->dgen;61int frattini_rank = y[pcp->clend + 1];62int l;63int *weight_vector;6465#include "access.h"6667processed = 0;68filtered = 0;6970if (filter) {71definition = allocate_matrix(pcp->lastg, frattini_rank + 1, 0, TRUE);72}7374/* process the consistency equations (a^p) a = a (a^p)75where 2 * WT(a) + 1 = jacobi_wt */7677if (type == 0 || type == 1) {78if (MOD(jacobi_wt, 2) != 0) {7980/* find range of a */81offset = class_end + bound - 1;82a_start = y[offset] + 1;83a_end = y[++offset];8485for (a = a_start; a <= a_end; a++) {86compute =87(!metabelian || (metabelian && (PART2(y[structure + a]) == 0 ||88PART3(y[structure + a]) == 0)));89if (compute) {90jacobi(a, a, a, 0, pcp);91if (pcp->redgen != 0 && pcp->m != 0)92queue[++*queue_length] = pcp->redgen;93}94if (pcp->overflow || (pcp->complete != 0 && !pcp->multiplicator))95return;96}97}98}99100/* process the consistency equations101(b^p) a = b^(p - 1) (ba) and b (a^p) = (ba) a^(p - 1)102where b > a and WT(b) + WT(a) + 1 = jacobi_wt */103104if (type == 0 || type == 2) {105for (wta = 1; wta <= bound; ++wta) {106107/* find range of a */108offset = class_end + wta - 1;109a_start = y[offset] + 1;110a_end = y[++offset];111112/* find maximum value of b */113offset = class_end + jacobi_wt - wta - 2;114b_end = y[offset + 1];115116for (a = a_start; a <= a_end; ++a) {117118/* ensure b > a */119b_start = MAX(y[offset] + 1, a + 1);120for (b = b_start; b <= b_end; ++b) {121122/* introduce Vaughan-Lee consistency check restriction */123if (wta == 1) {124/* check if this jacobi relation has already been used125in filling in the tail on (b, a)^p */126p1 = y[p_pcomm + b];127if (y[p1 + a] <= 0 || y[p1 + a] >= pcp->first_pseudo) {128compute = (!metabelian ||129(metabelian && (PART2(y[structure + b]) == 0 ||130PART3(y[structure + b]) == 0)));131if (compute) {132jacobi(b, b, a, 0, pcp);133if (pcp->redgen != 0 && pcp->m != 0)134queue[++*queue_length] = pcp->redgen;135}136if (pcp->overflow || pcp->complete && !pcp->multiplicator)137return;138}139}140141/* check if this jacobi relation has already been142used in filling in the tail on (b, a^p) */143entry = y[p_power + a];144if (entry <= 0 || entry >= b) {145compute = (!metabelian ||146(metabelian && (PART2(y[structure + a]) == 0 ||147PART3(y[structure + a]) == 0 ||148PART2(y[structure + b]) == 0 ||149PART3(y[structure + b]) == 0)));150if (compute) {151jacobi(b, a, a, 0, pcp);152if (pcp->redgen != 0 && pcp->m != 0)153queue[++*queue_length] = pcp->redgen;154}155if (pcp->overflow ||156(pcp->complete != 0 && !pcp->multiplicator))157return;158}159}160}161}162}163164/* process the consistency equations (cb) a = c (ba), where165c > b > a, WT(a) + WT(b) + WT(c) = jacobi_wt, and WT(a) = 1 */166167if (type == 0 || type == 3) {168169/* first, find maximum values of a and b */170a_end = y[class_end + 1];171b_end = y[class_end + ((jacobi_wt - 1) >> 1)];172constant = class_end + jacobi_wt - 2;173174for (a = 1; a <= a_end; ++a) {175if (filter) {176if (definition[a][0] == FALSE) {177lookup_structure(a, definition[a], pcp);178definition[a][0] = TRUE;179}180}181182for (b = a + 1; b <= b_end; ++b) {183184if (filter) {185if (definition[b][0] == FALSE) {186lookup_structure(b, definition[b], pcp);187definition[b][0] = TRUE;188}189}190191/* find range of c and ensure c > b */192offset = constant - WT(y[structure + b]);193c_start = MAX(y[offset] + 1, b + 1);194c_end = y[++offset];195196/* where possible, avoid redoing those jacobis used to197fill in tails on (c, (b, a)) */198if (!metabelian) {199p1 = y[p_pcomm + b];200if (y[p1 + a] > 0)201c_end = MIN(c_end, y[p1 + a]);202}203204for (c = c_start; c <= c_end; ++c) {205can_filter = FALSE;206if (filter) {207if (definition[c][0] == FALSE) {208lookup_structure(c, definition[c], pcp);209definition[c][0] = TRUE;210}211weight_vector = add_weights(212definition[a], definition[b], y[pcp->clend + 1]);213weight_vector = add_weights(214weight_vector, definition[c], y[pcp->clend + 1]);215for (l = 1; l <= frattini_rank && !can_filter; ++l)216can_filter = (weight_vector[l] > y[moccur + l]);217}218if (can_filter)219++filtered;220221compute = (!metabelian ||222(metabelian && (PART2(y[structure + b]) == 0 ||223PART3(y[structure + b]) == 0 ||224PART2(y[structure + c]) == 0 ||225PART3(y[structure + c]) == 0)));226227/* only evaluate if we must */228if (compute && can_filter == FALSE) {229++processed;230jacobi(c, b, a, 0, pcp);231if (pcp->redgen != 0 && pcp->m != 0)232queue[++*queue_length] = pcp->redgen;233}234if (pcp->overflow || (pcp->complete != 0 && !pcp->multiplicator))235return;236}237}238}239}240241if (filter) {242printf(243"Number evaluated = %d, Number filtered = %d\n", processed, filtered);244free_matrix(definition, pcp->lastg, 0);245}246}247248#endif249250251