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 collect_comm.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 "constants.h"12#include "pq_functions.h"13#include "pretty_filterfns.h"14#include "word_types.h"1516/* collect a commutator relation in the defining generators of the group */1718void collect_def_comm(int ptr, int cp, struct pcp_vars *pcp)19{20register int *y = y_address;2122register int cp1, cp2, cp3, cp4, result;23register int lastg = pcp->lastg;24register int total;25int disp = 0;26int depth;27int exp;2829cp1 = pcp->submlg - lastg - 2;30cp2 = cp1 - lastg;31cp3 = cp2 - lastg;32cp4 = cp3 - lastg;33result = cp4 - lastg;3435/* fudge the value of submlg because of possible call to power */36total = 6 * lastg + 6;37pcp->submlg -= total;3839depth = -y[ptr] - 1;40exp = y[ptr + 1];4142collect_defining_generator(ptr + 2, cp2, pcp);43copy(cp2, lastg, cp3, pcp);4445disp = 0;46while (--depth > 0) {4748++disp;49collect_defining_generator(ptr + 2 + disp, cp1, pcp);50copy(cp1, lastg, cp4, pcp);5152/* solve the equation (ba) * x = ab to obtain [a, b] */53find_commutator(cp1, cp2, cp3, cp4, result, pcp);5455copy(result, lastg, cp2, pcp);56copy(result, lastg, cp3, pcp);57}5859power(exp, result, pcp);6061#ifdef DEBUG62/* print the commutator */63setup_word_to_print("commutator", result, pcp->lused, pcp);64#endif6566/* copy result to cp */67copy(result, lastg, cp, pcp);6869/* reset the value of submlg */70pcp->submlg += total;71}7273/* collect value of defining generator stored at y[ptr] to74storage location cp */7576void collect_defining_generator(int ptr, int cp, struct pcp_vars *pcp)77{78register int *y = y_address;7980register int lastg = pcp->lastg;81int i, generator, genval;8283#ifdef DEBUG84int j, word_len;85#endif8687/* zero out lastg entries in array in order to store result */88for (i = 1; i <= lastg; ++i)89y[cp + i] = 0;9091generator = y[ptr];92genval = y[pcp->dgen + generator];9394/* check for illegal defining generators */95if (abs(generator) > pcp->ndgen || generator == 0)96report_error(0, generator, 0);9798#ifdef DEBUG99if (genval > 0)100printf("%d %d\n", generator, genval);101else if (genval < 0) {102printf("%d %d ", generator, y[-genval]);103word_len = y[-genval + 1];104for (j = 1; j <= word_len; ++j)105printf(" %d", y[-genval + 1 + j]);106} else107printf("generator %d is trivial\n", generator);108#endif109110collect(genval, cp, pcp);111112#ifdef DEBUG113print_array(y, cp, cp + pcp->lastg + 1);114#endif115}116117118