#define MAXOPTION 10 /* maximum number of menu options */
/* control routine for p-quotient program */
void options(int call, int format, struct pcp_vars *pcp)
{ int option; int t; char *name;
FILE *FileName;
int output_level = DEFAULT_PRINT;
Logical group_present = FALSE;
Logical print_flag; int exit_value;
Logical report;
int *list, *head;
if (isatty(0))
list_pqa_menu();
if (call != DEFAULT_MENU)
group_present = TRUE;
do {
option = read_option(MAXOPTION); switch (option) {
case -1:
list_pqa_menu(); break;
case COMPUTE_PCP:
t = runTime();
exit_value = pquotient(0, 0, stdin, format, pcp); if (exit_value == SUCCESS)
group_present = TRUE;
t = runTime() - t;
printf("Computation of presentation took %.2f seconds\n",
t * CLK_SCALE); break;
case SAVE_PCP:
name = GetString("Enter output file name: ");
FileName = OpenFileOutput(name); if (group_present && FileName != NULL) {
save_pcp(FileName, pcp); if (pcp->m != 0)
save_auts(FileName, head, list, pcp);
CloseFile(FileName);
printf("Presentation written to file\n");
} break;
case RESTORE_GROUP:
name = GetString("Enter input file name: ");
FileName = OpenFileInput(name); if (FileName != NULL) {
restore_pcp(FileName, pcp); #ifdef DEBUG
pcp->m = 0; #endif if (pcp->m != 0)
restore_automorphisms(FileName, &head, &list, pcp);
group_present = TRUE;
RESET(FileName);
printf("Presentation read from file\n");
} break;
case DISPLAY_PRESENTATION:
print_flag = (output_level >= MAX_PRINT - 1) ? TRUE : FALSE; if (group_present)
print_presentation(print_flag, pcp); break;
case PRINT_LEVEL:
print_level(&output_level, pcp); break;
case NEXT_CLASS: if (pcp->cc >= MAXCLASS || pcp->lastg >= MAXPC) {
printf("You have reached the specified limits on class or number " "of defining generators\n"); break;
} if (!pcp->overflow && group_present) {
t = runTime();
report = pcp->complete;
next_class(FALSE, &head, &list, pcp); if (report || (output_level == 1 && pcp->complete) ||
pcp->lastg < 1)
text(5, pcp->cc, pcp->p, pcp->lastg, 0);
t = runTime() - t; if (!pcp->overflow) {
print_flag = (output_level >= MAX_PRINT - 1) ? TRUE : FALSE;
print_presentation(print_flag, pcp);
}
printf("Computation of next class took %.2f seconds\n",
t * CLK_SCALE);
} break;
case PCOVER: if (group_present) {
t = runTime();
pcp->multiplicator = TRUE;
next_class(FALSE, &head, &list, pcp);
pcp->multiplicator = FALSE;
pcp->update = FALSE;
pcp->middle_of_tails = FALSE;
t = runTime() - t;
print_flag = (output_level >= MAX_PRINT - 1) ? TRUE : FALSE;
print_presentation(print_flag, pcp);
printf("Computation of %d-covering group took %.2f seconds\n",
pcp->p,
t * CLK_SCALE);
} break;
case INTERACTIVE_PQ:
interactive_pq(group_present, format, output_level, &head, &list, pcp); break;
case PGP:
pgroup_generation(&group_present, pcp); break;
caseEXIT: case MAXOPTION:
printf("Exiting from ANU p-Quotient Program\n"); break;
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.