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 construct.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 "exp_vars.h"13#include "constants.h"14#include "pq_functions.h"151617#define ITERATION 618#define SINGLE_STAGE 51920static Logical select_group(int *min_step,21int *max_step,22int order_bound,23struct pga_vars *pga,24struct pcp_vars *pcp);252627/* prepare to construct, partially or completely, some or all of the28immediate descendants of group group_nmr stored on start_file */2930int construct(int call_depth,31struct pga_vars *flag,32int option,33FILE *output_file,34FILE *start_file,35int k,36int order_bound,37int group_nmr,38struct pga_vars *pga,39struct pcp_vars *pcp)40{41int ***auts;42char *name;43register int step;44int min_step, max_step;45int nmr_of_descendants = 0;46int nmr_of_capables = 0;47int nmr_of_covers;48int x_dim, y_dim;49FILE *tmp_file;50Logical change;5152if (option == ITERATION) {53restore_pcp(start_file, pcp);54auts = restore_pga(start_file, pga, pcp);55/* enforce any law on the p-covering group of starting group */56if (call_depth == 1)57enforce_laws(flag, pga, pcp);58start_group(&tmp_file, auts, pga, pcp);59} else {60auts = restore_group(TRUE, start_file, group_nmr, pga, pcp);61RESET(start_file);62}636465/* save dimension of autormorphism array for later call to free */66x_dim = pga->m;67y_dim = pcp->lastg;6869pga->nmr_of_descendants = 0;70pga->nmr_of_capables = 0;7172switch (option) {7374case SINGLE_STAGE:75defaults_pga(option, &k, flag, pga, pcp);76copy_flags(flag, pga);77name = GetString("Input output file name: ");78output_file = OpenFileOutput(name);79enforce_laws(flag, pga, pcp);80print_group_details(pga, pcp);81nmr_of_covers =82reduced_covers(output_file, output_file, k, auts, pga, pcp);83if (pcp->overflow)84exit(FAILURE);85nmr_of_descendants = pga->nmr_of_descendants;86nmr_of_capables = pga->nmr_of_capables;87report(nmr_of_capables, nmr_of_descendants, nmr_of_covers, pga, pcp);88auts = restore_group(TRUE, start_file, group_nmr, pga, pcp);89RESET(start_file);90RESET(output_file);91break;9293case ITERATION:94print_group_details(pga, pcp);95/* check if automorphism group is now soluble */96change = (pga->soluble == LINK_SOLUBLE_FLAG);97copy_flags(flag, pga);98if (change)99pga->soluble = LINK_SOLUBLE_FLAG;100if (!select_group(&min_step, &max_step, order_bound, pga, pcp)) {101free_array(auts, x_dim, y_dim, 1);102CloseFile(tmp_file);103break;104}105106for (step = min_step; step <= max_step; ++step) {107pga->step_size = step;108start_stage(output_file, k, auts, pga, pcp);109report(pga->nmr_of_capables - nmr_of_capables,110pga->nmr_of_descendants - nmr_of_descendants,1110,112pga,113pcp);114nmr_of_descendants = pga->nmr_of_descendants;115nmr_of_capables = pga->nmr_of_capables;116free_array(auts, x_dim, y_dim, 1);117if (step != max_step) {118auts = restore_group(TRUE, tmp_file, 1, pga, pcp);119RESET(tmp_file);120}121pga->nmr_of_descendants = nmr_of_descendants;122pga->nmr_of_capables = nmr_of_capables;123change = (pga->soluble == LINK_SOLUBLE_FLAG);124copy_flags(flag, pga);125if (change)126pga->soluble = LINK_SOLUBLE_FLAG;127}128CloseFile(tmp_file);129break;130} /* switch */131132/* were terminal groups processed? */133if (pga->terminal)134return nmr_of_descendants;135else136return nmr_of_capables;137}138139/* report on the number immediate descendants and on those capable */140141void report(int nmr_of_capables,142int nmr_of_descendants,143int nmr_of_covers,144struct pga_vars *pga,145struct pcp_vars *pcp)146{147register int *y = y_address;148149/*150FILE * COUNT;151COUNT = OpenFile ("COUNT", "a+");152fprintf (COUNT, "%d,\n", nmr_of_descendants);153*/154155if (nmr_of_descendants != 0) {156printf("# of immediate descendants of order %d^%d is %d\n",157pcp->p,158y[pcp->clend + pcp->cc - 1] + pga->step_size,159nmr_of_descendants);160if (nmr_of_capables != 0)161printf("# of capable immediate descendants is %d\n", nmr_of_capables);162} else if (nmr_of_covers != 0)163printf("# of reduced %d-covering groups is %d\n", pcp->p, nmr_of_covers);164}165166/* print out basic information about the starting group */167168void print_group_details(struct pga_vars *pga, struct pcp_vars *pcp)169{170register int *y = y_address;171int order;172173printf("\n**************************************************\n");174printf("Starting group: %s\n", pcp->ident);175order = pcp->newgen ? y[pcp->clend + pcp->cc - 1] : y[pcp->clend + pcp->cc];176printf("Order: %d^%d\n", pcp->p, order);177printf("Nuclear rank: %d\n", pga->nuclear_rank);178printf("%d-multiplicator rank: %d\n", pga->p, pga->multiplicator_rank);179}180181/* check if the group is a valid starting group */182183static Logical select_group(int *min_step,184int *max_step,185int order_bound,186struct pga_vars *pga,187struct pcp_vars *pcp)188{189register int *y = y_address;190191int max_extension = order_bound - y[pcp->clend + pcp->cc - 1];192Logical select = TRUE;193194if (pga->step_size == ALL) {195*max_step = MIN(pcp->newgen, max_extension);196if (*max_step <= 0) {197invalid_group(pcp);198return FALSE;199} else200*min_step = 1;201} else {202if (pga->step_size > pcp->newgen || pga->step_size > max_extension) {203invalid_group(pcp);204return FALSE;205} else206*min_step = *max_step = pga->step_size;207}208209return select;210}211212/* print a message that the group is not a valid starting group */213214void invalid_group(struct pcp_vars *pcp)215{216printf("Group %s is an invalid starting group\n", pcp->ident);217}218219/* enforce laws on p-covering group of starting group --220these include exponent and metabelian laws */221222void223enforce_laws(struct pga_vars *flag, struct pga_vars *pga, struct pcp_vars *pcp)224{225struct exp_vars exp_flag;226227if (flag->exponent_law != 0) {228initialise_exponent(&exp_flag, pcp);229pcp->extra_relations = flag->exponent_law;230extra_relations(&exp_flag, pcp);231eliminate(FALSE, pcp);232set_values(pga, pcp);233}234}235236237