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 close_relations.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 "pga_vars.h"12#include "pq_functions.h"13#define SORT_FACTOR 251415/* close a queue of relations under the action of the automorphisms;1617each of length entries in the queue is a pointer to18a relation of the sort1920x = y1^a1 ... yq^aq2122where each of x and y<i> are among the new generators introduced;23apply automorphism alpha to this relation and rewrite to obtain2425(y1^a1 ... yq^aq)<alpha> * x<alpha>^-1 = identity2627this new relation is now echelonised */2829void close_relations(Logical report,30int limit,31int queue_type,32int *head,33int *list,34int *queue,35int length,36int *long_queue,37int *long_queue_length,38struct pcp_vars *pcp)39{40register int *y = y_address;4142char *s;43char *t;44int nmr_reds = 0;4546int current = 1;47int gen;4849int relation_length;50int generator, exponent;5152register int offset;5354int *copy;5556int alpha, i;57int cp, p1;58int start = y[pcp->clend + pcp->cc - 1] + 1;59int prime = pcp->p;60int pm1 = pcp->pm1;61#include "access.h"6263while (current <= length) {6465gen = queue[current];66++current;6768if (gen == 0)69continue;7071if (current % SORT_FACTOR == 1) {72copy = queue + current - 1;73bubble_sort(copy, length - current + 1, pcp);74}7576/* apply automorphism alpha to the relation */77for (alpha = 1; alpha <= pcp->m; ++alpha) {7879if (is_space_exhausted(2 * pcp->lastg, pcp)) {80pcp->overflow = TRUE;81return;82}8384cp = pcp->lused;85for (i = 1; i <= 2 * pcp->lastg; ++i)86y[cp + i] = 0;8788offset = (alpha - 1) * pcp->lastg;8990/* is the relation trivial? */91if (y[pcp->structure + gen] == 0)92traverse_list(1, head[offset + gen], list, cp, pcp);93else {94/* the relation was non-trivial; first, set up (gen<alpha>)^-1 */95traverse_list(pm1, head[offset + gen], list, cp, pcp);9697/* now apply the automorphism to each entry of98the string pointed to by y[pcp->structure + gen] */99100p1 = -y[pcp->structure + gen];101relation_length = y[p1 + 1];102103if (queue_type == 1 && relation_length > limit) {104long_queue[++*long_queue_length] = gen;105break;106}107108for (i = 1; i <= relation_length; ++i) {109generator = FIELD2(y[p1 + 1 + i]);110exponent = FIELD1(y[p1 + 1 + i]);111traverse_list(exponent, head[offset + generator], list, cp, pcp);112}113114/* now reduce the entries mod p */115for (i = start; i <= pcp->lastg; ++i)116y[cp + i] %= prime;117}118119relation_length = echelon(pcp);120if (pcp->complete)121return;122123/* if appropriate, add a new relation to the queue */124if (pcp->eliminate_flag) {125++nmr_reds;126if (relation_length <= limit || queue_type == 2)127queue[++length] = pcp->redgen;128if (relation_length > limit || queue_type == 2)129long_queue[++*long_queue_length] = pcp->redgen;130}131}132}133134if (report || pcp->fullop || pcp->diagn) {135if (queue_type == 1)136s = "Short";137else138s = "Long";139if (nmr_reds == 1)140t = "y";141else142t = "ies";143printf("%s queue gave %d redundanc%s\n", s, nmr_reds, t);144}145}146147/* add exponent times the action of automorphism with pointer head148to the contents of the exponent-vector with base address cp */149150void151traverse_list(int exponent, int head, int *list, int cp, struct pcp_vars *pcp)152{153register int *y = y_address;154155register int value;156register int length = list[++head];157#include "access.h"158159while (length != 0) {160value = list[head + length];161y[cp + FIELD2(value)] += FIELD1(value) * exponent;162--length;163}164}165166167