void interactive_pq(Logical group_present, int format, int output_level, int **head, int **list, struct pcp_vars *pcp)
{ registerint *y = y_address;
int option, t, class; registerint cp;
Logical print_flag; int type; int i; int factor, limit; int ***auts; char *s; char *name;
FILE *FileName;
int *queue, *long_queue; int start_length = 0; int prev_qlength = 0, current_qlength; int long_queue_length = 0, queue_length = 0; int consistency_type; int nmr_of_auts; int nmr_of_exponents; int tail_type; int start_gen, final_gen;
Logical queue_setup = FALSE; /* redundancy queue set up? */
Logical echelon_ready = FALSE; /* ready to echelonise? */
Logical output; /* temporarily store value of pcp->fullop */ struct exp_vars exp_flag;
case PRINT_LEVEL:
print_level(&output_level, pcp); break;
case SETUP: if (pcp->complete) {
printf("Group is complete\n"); break;
}
setup(pcp);
pcp->update = FALSE;
pcp->middle_of_tails = FALSE;
printf("Setup performed for class %d\n", pcp->cc); break;
case TAILS:
t = runTime(); if (pcp->complete) {
printf("Group is complete\n"); break;
}
pcp->middle_of_tails = FALSE;
read_value(TRUE, "Input class for tails computation (0 for all): ",
&class,
-9999); /* by negative class we mean that we want to extend the lower central
series up to -class, by adding p-powers. Variable i is hijacked. */ if (class < 0) { i = class; class = 0; } else { i = 1; }
tail_info(&tail_type); if (class == 0 || (class > 1 && class <= pcp->cc)) { if (class > 0) {
tails(tail_type, class, pcp->cc, i, pcp); if (class != 2)
pcp->middle_of_tails = TRUE;
} else { /* variable end_weight is never used. We hijack it to pass the
l.c.s. desired depth. */ for (class = pcp->cc; class > 1; --class)
tails(tail_type, class, pcp->cc, i, pcp);
} if (pcp->overflow && !isatty(0)) exit(FAILURE);
t = runTime() - t;
printf("Tails computation took %.2f seconds \n", t * CLK_SCALE);
} else
printf("Class %d is invalid for tails calculations\n", class); break;
case CONSISTENCY:
t = runTime(); if (pcp->complete) {
printf("Group is complete\n"); break;
}
read_value(TRUE, "Input class for consistency check (0 for all): ",
&class,
0);
consistency_info(&consistency_type); if (class == 0 || (class > 2 && class <= pcp->cc)) { if (pcp->m != 0) {
queue_setup = TRUE;
start_length = queue_length;
queue_space(
&queue, &long_queue, ¤t_qlength, &prev_qlength, pcp);
}
if (class > 0)
consistency(consistency_type, queue, &queue_length, class, pcp); else for (class = pcp->cc; class > 2; --class)
consistency(
consistency_type, queue, &queue_length, class, pcp); if (pcp->overflow && !isatty(0)) exit(FAILURE);
if (pcp->m != 0) {
s = (queue_length - start_length == 1) ? "y" : "ies";
printf("Consistency checks gave %d redundanc%s\n",
queue_length - start_length,
s);
} if (pcp->complete && output_level <= 1)
text(5, pcp->cc, pcp->p, pcp->lastg, 0);
t = runTime() - t;
printf("Consistency checks took %.2f seconds\n", t * CLK_SCALE);
} else
printf("Class %d is invalid for consistency checks\n", class); break;
case RELATIONS:
t = runTime(); if (pcp->complete) {
printf("Group is complete\n"); break;
}
/* if no tails have been added, do not perform update */ if (y[pcp->clend + pcp->cc - 1] < pcp->lastg) { if (!pcp->complete && pcp->cc > 1 && !pcp->middle_of_tails &&
!pcp->update) {
update_generators(pcp);
pcp->update = TRUE;
} if (!pcp->complete)
collect_relations(pcp);
}
if (!pcp->complete && !pcp->overflow) { if (pcp->fullop || pcp->diagn)
printf("Length of long queue after short queue closed is %d\n",
long_queue_length);
close_relations(TRUE,
limit,
2,
*head,
*list,
long_queue,
long_queue_length,
long_queue,
&long_queue_length,
pcp); if (pcp->fullop || pcp->diagn) {
printf("Final long queue length was %d\n", long_queue_length);
}
}
case FORMULA:
t = runTime(); if (pcp->m != 0) {
queue_setup = TRUE;
start_length = queue_length;
queue_space(
&queue, &long_queue, ¤t_qlength, &prev_qlength, pcp);
}
evaluate_formula(queue, &queue_length, pcp);
if (pcp->m != 0) {
s = (queue_length - start_length == 1) ? "y" : "ies";
printf("Formula checks gave %d redundanc%s\n",
queue_length - start_length,
s); if (queue_length != 0)
print_array(queue, 1, queue_length + 1);
}
t = runTime() - t;
printf("Formula evaluation took %.2f seconds\n", t * CLK_SCALE); break;
case OUTPUT_PRESENTATION: /* TODO: We used to support more output formats, but now only GAP output is supported. As such, the following query is no redundant.
We keep it for backward compatibility only. */
name = GetString("Enter output file name: ");
read_value(TRUE, "Output file in GAP (2) format? ",
&file_format,
GAP_PRES_FORMAT);
FileName = OpenFile(name, "a+"); if (FileName != NULL) { if (file_format == GAP_PRES_FORMAT) {
GAP_presentation(FileName, pcp, 1);
printf("Group presentation written in GAP format to file\n");
} else
printf("Format must be %d\n", GAP_PRES_FORMAT);
}
CloseFile(FileName); break;
case COMPACT_PRESENTATION:
compact_description(TRUE, pcp);
printf("Group description written to gps%d^%d\n", pcp->p, pcp->lastg); break;
caseEXIT: case MAXOPTION:
printf("Exiting from interactive p-Quotient menu\n"); break;
if (queue_setup) {
free_vector(queue, 1);
free_vector(long_queue, 1);
}
}
/* interactive p-quotient menu */
void list_interactive_pq_menu(void)
{
printf("\nAdvanced p-Quotient Menu\n");
printf("-------------------------\n");
printf("%d. Do individual collection\n", COLLECT);
printf("%d. Solve the equation ax = b for x\n", SOLVE);
printf("%d. Calculate commutator\n", COMMUTATOR);
printf("%d. Display group presentation\n", DISPLAY_PRESENTATION);
printf("%d. Set print level\n", PRINT_LEVEL);
printf("%d. Set up tables for next class\n", SETUP);
printf("%d. Insert tails for some or all classes\n", TAILS);
printf("%d. Check consistency for some or all classes\n", CONSISTENCY);
printf("%d. Collect defining relations\n", RELATIONS);
printf("%d. Carry out exponent checks\n", EXTRA_RELATIONS);
printf("%d. Eliminate redundant generators\n", ELIMINATE);
printf("%d. Revert to presentation for previous class\n", LAST_CLASS);
printf("%d. Set maximal occurrences for pcp generators\n", MAXOCCUR);
printf("%d. Set metabelian flag\n", METABELIAN);
printf("%d. Carry out an individual consistency calculation\n", JACOBI);
printf("%d. Carry out compaction\n", COMPACT);
printf("%d. Carry out echelonisation\n", ECHELON);
printf("%d. Supply and/or extend automorphisms\n", AUTS);
printf("%d. Close relations under automorphism actions\n", CLOSE_RELATIONS);
printf("%d. Print structure of a range of pcp generators\n", STRUCTURE);
printf("%d. Display automorphism actions on generators\n",
LIST_AUTOMORPHISMS);
printf("%d. Collect word in defining generators\n", DGEN_WORD);
printf("%d. Compute commutator of defining generators\n", DGEN_COMM);
printf("%d. Write presentation to file in GAP format\n",
OUTPUT_PRESENTATION);
printf("%d. Write compact description of group to file\n",
COMPACT_PRESENTATION);
printf("%d. Evaluate certain formulae\n", FORMULA);
printf("%d. Evaluate action specified on defining generators\n", DGEN_AUT);
printf("%d. Evaluate Engel (p - 1)-identity\n", ENGEL);
printf("%d. Process contents of relation file\n", RELATIONS_FILE);
printf("%d. Exit to basic menu\n", MAXOPTION);
}
#endif
/* set up space for the queues used in exponent checking */
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.