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 defaults_pga.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#define SINGLE_STAGE 51516/* set up algorithm and print defaults for p-group generation calculation */1718void defaults_pga(int option,19int *k,20struct pga_vars *flag,21struct pga_vars *pga,22struct pcp_vars *pcp)23{24int default_algorithm;25int default_output;26int default_perm_info;27int default_group_info;28int default_orbit_info;29int default_automorphism_info;3031set_defaults(flag);3233if (option == SINGLE_STAGE)34read_step_size(pga, pcp);35flag->step_size = pga->step_size;3637query_solubility(flag);3839read_value(40TRUE, "Do you want default algorithm? ", &default_algorithm, INT_MIN);41if (!default_algorithm) {42read_subgroup_rank(k);43if (flag->soluble)44query_space_efficiency(flag);45query_terminal(flag);46query_exponent_law(flag);47query_metabelian_law(flag);48} else {49*k = 0;50}5152read_value(TRUE, "Do you want default output? ", &default_output, INT_MIN);53if (default_output)54return;5556read_value(TRUE,57"Do you want default permutation group output? ",58&default_perm_info,59INT_MIN);60if (!default_perm_info) {61query_degree_aut_information(flag);62query_perm_information(flag);63}6465read_value(TRUE,66"Do you want default orbit information? ",67&default_orbit_info,68INT_MIN);69if (!default_orbit_info)70query_orbit_information(flag);7172read_value(TRUE,73"Do you want default group information? ",74&default_group_info,75INT_MIN);76if (!default_group_info)77query_group_information(pcp->p, flag);7879read_value(TRUE,80"Do you want default automorphism group information? ",81&default_automorphism_info,82INT_MIN);83if (!default_automorphism_info)84query_aut_group_information(flag);8586read_value(TRUE,87"Do you want algorithm trace information? ",88&flag->trace,89INT_MIN);90}9192/* set printing and algorithm defaults up in flag structure for storage */9394void set_defaults(struct pga_vars *flag)95{96flag->print_extensions = FALSE;97flag->print_automorphism_matrix = FALSE;9899flag->print_degree = FALSE;100flag->print_permutation = FALSE;101102flag->print_subgroup = FALSE;103flag->print_reduced_cover = FALSE;104flag->print_group = FALSE;105flag->print_nuclear_rank = FALSE;106flag->print_multiplicator_rank = FALSE;107108flag->print_orbit_summary = FALSE;109flag->print_orbits = FALSE;110flag->print_orbit_arrays = FALSE;111112flag->print_commutator_matrix = FALSE;113flag->print_automorphisms = FALSE;114flag->print_automorphism_order = FALSE;115flag->print_stabiliser_array = FALSE;116117flag->trace = FALSE;118119flag->space_efficient = FALSE;120flag->soluble = TRUE;121flag->terminal = FALSE;122flag->metabelian = FALSE;123flag->exponent_law = 0;124}125126/* copy printing and algorithm defaults from flag structure to pga */127128void copy_flags(struct pga_vars *flag, struct pga_vars *pga)129{130pga->print_extensions = flag->print_extensions;131pga->print_automorphism_matrix = flag->print_automorphism_matrix;132133pga->print_degree = flag->print_degree;134pga->print_permutation = flag->print_permutation;135136pga->print_subgroup = flag->print_subgroup;137pga->print_reduced_cover = flag->print_reduced_cover;138pga->print_group = flag->print_group;139pga->print_nuclear_rank = flag->print_nuclear_rank;140pga->print_multiplicator_rank = flag->print_multiplicator_rank;141142pga->print_orbits = flag->print_orbits;143pga->print_orbit_summary = flag->print_orbit_summary;144pga->print_orbit_arrays = flag->print_orbit_arrays;145146pga->print_commutator_matrix = flag->print_commutator_matrix;147pga->print_automorphisms = flag->print_automorphisms;148pga->print_automorphism_order = flag->print_automorphism_order;149pga->print_stabiliser_array = flag->print_stabiliser_array;150151pga->trace = flag->trace;152153pga->space_efficient = flag->space_efficient;154pga->soluble = flag->soluble;155pga->terminal = flag->terminal;156pga->exponent_law = flag->exponent_law;157pga->metabelian = flag->metabelian;158159pga->step_size = flag->step_size;160}161162/* use space efficient option? */163164void query_space_efficiency(struct pga_vars *pga)165{166read_value(167TRUE, "Space efficient computation? ", &pga->space_efficient, INT_MIN);168}169170/* orbit information to be printed */171172void query_orbit_information(struct pga_vars *pga)173{174read_value(TRUE,175"Summary of orbit information? ",176&pga->print_orbit_summary,177INT_MIN);178179read_value(180TRUE, "Complete listing of orbits? ", &pga->print_orbits, INT_MIN);181182pga->print_orbit_arrays = FALSE;183}184185/* group information to be printed */186187void query_group_information(int p, struct pga_vars *pga)188{189read_value(TRUE,190"Print standard matrix of allowable subgroup? ",191&pga->print_subgroup,192INT_MIN);193194read_value(TRUE,195"Presentation of reduced p-covering groups? ",196&pga->print_reduced_cover,197INT_MIN);198199read_value(TRUE,200"Presentation of immediate descendants? ",201&pga->print_group,202INT_MIN);203204read_value(TRUE,205"Print nuclear rank of descendants? ",206&pga->print_nuclear_rank,207INT_MIN);208209read_value(TRUE,210"Print p-multiplicator rank of descendants? ",211&pga->print_multiplicator_rank,212INT_MIN);213}214215/* automorphism group information to be printed */216217void query_aut_group_information(struct pga_vars *pga)218{219read_value(TRUE,220"Print commutator matrix? ",221&pga->print_commutator_matrix,222INT_MIN);223224read_value(TRUE,225"Automorphism group description of descendants? ",226&pga->print_automorphisms,227INT_MIN);228229#ifdef HAVE_GMP230read_value(TRUE,231"Automorphism group order of descendants? ",232&pga->print_automorphism_order,233INT_MIN);234#else235/* HACK: still ask the question, to prevent the GAP interface from236getting "confused" (it blindly fires input at us, without checking237what the prompt is). */238int fake;239read_value(TRUE,240"PLACEHOLDER QUESTION (GMP disabled), input any integer? ",241&fake,242INT_MIN);243#endif244245pga->print_stabiliser_array = FALSE;246}247248/* degree and extended automorphism information to be printed */249250void query_degree_aut_information(struct pga_vars *pga)251{252read_value(TRUE,253"Print degree of permutation group? ",254&pga->print_degree,255INT_MIN);256257read_value(258TRUE, "Print extended automorphisms? ", &pga->print_extensions, INT_MIN);259}260261/* other permutation group information to be printed */262263void query_perm_information(struct pga_vars *pga)264{265read_value(TRUE,266"Print automorphism matrices? ",267&pga->print_automorphism_matrix,268INT_MIN);269270read_value(TRUE, "Print permutations? ", &pga->print_permutation, INT_MIN);271}272273/* read step size */274275void read_step_size(struct pga_vars *pga, struct pcp_vars *pcp)276{277Logical reading = TRUE;278279while (reading) {280read_value(TRUE, "Input step size: ", &pga->step_size, 1);281reading = (pga->step_size <= 0);282if (isatty(0))283reading = (reading || (pga->step_size > pcp->newgen));284if (reading)285printf("Error: step sizes range from 1 to %d only\n", pcp->newgen);286/*287if (reading = (pga->step_size <= 0 || pga->step_size > pcp->newgen))288printf ("Error: step sizes range from 1 to %d only\n", pcp->newgen);289*/290}291}292293/* read class bound */294295void read_class_bound(int *class_bound, struct pcp_vars *pcp)296{297read_value(TRUE, "Input class bound on descendants: ", class_bound, pcp->cc);298}299300/* read order bound */301302void read_order_bound(int *order_bound, struct pcp_vars *pcp)303{304register int *y = y_address;305306int least_order = y[pcp->clend + pcp->cc - 1] + 1;307read_value(308TRUE, "Input order bound on descendants: ", order_bound, least_order);309}310311/* read rank of initial-segment subgroup */312313void read_subgroup_rank(int *k)314{315read_value(TRUE, "Rank of the initial segment subgroup? ", k, 0);316*k = MAX(0, *k - 1);317}318319/* supply a PAG-generating sequence for automorphism group? */320321void query_solubility(struct pga_vars *pga)322{323read_value(TRUE,324"PAG-generating sequence for automorphism group? ",325&pga->soluble,326INT_MIN);327}328329/* completely process all (capable and terminal) descendants? */330331void query_terminal(struct pga_vars *pga)332{333read_value(TRUE,334"Completely process terminal descendants? ",335&pga->terminal,336INT_MIN);337}338339/* set exponent law for all descendants to satisfy */340341void query_exponent_law(struct pga_vars *pga)342{343read_value(344TRUE, "Input exponent law (0 if none): ", &pga->exponent_law, INT_MIN);345}346347/* enforce metabelian law on all descendants */348349void query_metabelian_law(struct pga_vars *pga)350{351read_value(TRUE, "Enforce metabelian law? ", &pga->metabelian, INT_MIN);352}353354355