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 find_allowable_subgroup.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 "constants.h"13#include "pq_functions.h"14#include "standard.h"1516#if defined(STANDARD_PCP)1718/* given a presentation for the p-covering group of a19class c p-quotient; find the allowable subgroup which20determines the presentation for the class c + 1 quotient;21set up its definition set both as a bit_string and as a subset */2223int **find_allowable_subgroup(int option,24FILE *cover_tmp_file,25FILE *group_tmp_file,26int *bit_string,27int **subset,28struct pga_vars *pga,29struct pcp_vars *pcp)30{31register int *y = y_address;3233register int generator, exp, r, i;34register int structure, lastg;35register int start = pcp->ccbeg;36register int q = pga->q;37register int end = start + q - 1;38register int pointer;39register int length;40register int u, v;41int **definition;42int *relation;43int **subgroup;44int index, x;45int nmr_defs;46#include "access.h"4748/* restore the presentation for the p-covering group */49restore_pcp(cover_tmp_file, pcp);50RESET(cover_tmp_file);5152definition = allocate_matrix(q, 2, 0, FALSE);5354structure = pcp->structure;5556/* store the definitions of the generators of the relevant57initial segment subgroup of the p-multiplicator */58for (generator = start; generator <= end; ++generator) {59pointer = y[structure + generator];60u = PART2(pointer);61v = PART3(pointer);62definition[generator - start][0] = u;63definition[generator - start][1] = v;64}6566#if defined(DEBUG)67printf("The definition matrix is\n");68print_matrix(definition, q, 2);69#endif7071/* now restore the presentation for the class c + 1 quotient */72restore_pcp(group_tmp_file, pcp);73RESET(group_tmp_file);7475#if defined(DEBUG)76pcp->diagn = TRUE;77print_presentation(TRUE, pcp);78pcp->diagn = FALSE;79#endif8081structure = pcp->structure;82lastg = pcp->lastg;8384subgroup = allocate_matrix(pga->s, q, 0, TRUE);85relation = allocate_vector(q, 0, TRUE);8687*bit_string = 0;88*subset = allocate_vector(lastg - start + 1, 0, FALSE);8990/* check the values of the definitions in this quotient91and set up its definition set */92index = 0;93for (generator = start; generator <= lastg; ++generator) {94pointer = y[structure + generator];95u = PART2(pointer);96v = PART3(pointer);97if ((x = find_index(u, v, definition, q)) != -1) {98*bit_string |= 1 << x;99(*subset)[index] = x;100subgroup[index++][x] = 1;101relation[x] = TRUE;102} else {103(*subset)[index++] = -1;104}105}106107#if defined(DEBUG)108printf("Bit string and matrix are %d and ", *bit_string);109print_array(*subset, 0, lastg - start);110#endif111112if (option == RELATIVE) {113nmr_defs = 0;114for (i = 0; i < lastg - start + 1; ++i)115if ((*subset)[i] >= 0)116++nmr_defs;117pga->s = nmr_defs;118119/* memory leakage September 1996 */120free_matrix(definition, q, 0);121free_vector(relation, 0);122free_matrix(subgroup, pga->s, 0);123free_vector(*subset, 0);124*subset = (int *)0;125126return (int **)0;127}128129/* look up necessary relations in the class c + 1 quotient130and store the appropriate exponents in subgroup matrix */131for (r = 0; r < q; ++r) {132if (relation[r] == TRUE)133continue;134135u = definition[r][0];136v = definition[r][1];137138/* look up u^p or [u, v] */139pointer = (v == 0) ? y[pcp->ppower + u] : y[y[pcp->ppcomm + u] + v];140141/* set up the exponents of these relations in the subgroup matrix */142if (pointer > 0)143subgroup[pointer - start][r] = 1;144else if (pointer < 0) {145pointer = -pointer + 1;146length = y[pointer];147for (i = 1; i <= length; i++) {148exp = FIELD1(y[pointer + i]);149generator = FIELD2(y[pointer + i]);150if (generator >= start)151subgroup[generator - start][r] = exp;152}153}154}155156#if defined(DEBUG)157printf("The subgroup matrix is\n");158print_matrix(subgroup, pga->s, q);159#endif160161free_matrix(definition, q, 0);162free_vector(relation, 0);163164return subgroup;165}166167/* which generator of the p-covering group did u and v define? */168169int find_index(int u, int v, int **definition, int q)170{171register int i;172173for (i = 0; i < q; ++i)174if (u == definition[i][0] && v == definition[i][1])175return i;176177return -1;178}179#endif180181182