in = fopen(from, "r"); if (in == NULL) {
perror(from); exit(FAILURE);
}
out = fopen(to, "w"); if (out == NULL) {
perror(to); exit(FAILURE);
} do {
n = fread(FileBuffer, 1, 1024, in); if (0 < n)
fwrite(FileBuffer, 1, n, out); if (ferror(in)) {
perror(from); exit(FAILURE);
} if (ferror(out)) {
perror(to); exit(FAILURE);
}
} while (!feof(in));
fclose(in);
fclose(out);
}
in = fopen(from, "r"); if (in == NULL) {
perror(from); exit(FAILURE);
}
out = fopen(to, "a"); if (out == NULL) {
perror(to); exit(FAILURE);
} do {
n = fread(FileBuffer, 1, 1024, in); if (0 < n)
fwrite(FileBuffer, 1, n, out); if (ferror(in)) {
perror(from); exit(FAILURE);
} if (ferror(out)) {
perror(to); exit(FAILURE);
}
} while (!feof(in));
fclose(in);
fclose(out);
}
#define ISOM_OPTION 8 #define MAXOPTION 9 /* maximum number of menu options */
void list_isom_menu(void);
/* control routine for computing standard presentation */
int output = DEFAULT_STANDARD_PRINT; int start_class, final_class; int option; int t; int status; int complete; int iteration; int *seq1; int *seq2; int len1, len2; int nmr_items; int ***auts; int x_dim, y_dim;
FILE *GAP_library = 0; char *name = 0; int nmr_of_exponents;
StandardPresentation = TRUE;
pga.nmr_soluble = 0;
list_isom_menu();
do {
option = read_option(MAXOPTION); switch (option) {
case -1:
list_isom_menu(); break;
case START_INFO:
t = runTime();
group_present = setup_start_info(FALSE, 0, stdin, format, &pga, pcp);
handle_error(group_present);
user_supplied = TRUE;
t = runTime() - t; /* it is possible that the p-quotient is trivial */ if (pcp->cc == 0) {
group_present = FALSE; break;
}
printf("Class %d %d-quotient and its %d-covering group computed in " "%.2f seconds\n",
pcp->cc - 1,
pcp->p,
pcp->p,
t * CLK_SCALE); break;
case CONSTRUCT: if (!user_supplied) {
name = GetString("Enter input file name for group information: ");
FileName = OpenFile(name, "r"); if (FileName == NULL) break;
}
name = GetString("Enter output file name for group information: ");
read_value( TRUE, "Standardise presentation to what class? ", &final_class, 0); if (user_supplied && final_class < pcp->cc) {
printf("Value supplied for end class must be at least %d\n",
pcp->cc);
}
/* read in data from file and set up group to end of start_class
and compute its p-covering group */
if (!user_supplied) {
group_present =
setup_start_info(FALSE, 0, FileName, FILE_INPUT, &pga, pcp);
handle_error(group_present); if (final_class < pcp->cc) {
CloseFile(FileName);
printf("Value supplied for end class must be at least %d\n",
pcp->cc);
}
}
if (pcp->cc == 0) {
printf("%d-quotient is trivial\n", pcp->p); break;
}
/* if necessary, set up new presentation + other information */
FileName = OpenFile("ISOM_PP", "r");
group_present = setup_start_info(
identity_map, status, FileName, FILE_INPUT, &pga, pcp);
handle_error(group_present);
/* if appropriate, factor subgroup from p-multiplicator */ if (status != END_OF_CLASS)
factor_subgroup(pcp);
} while (status != END_OF_CLASS && complete != TERMINAL);
CloseFile(Subgroup);
/* the group may have completed only when relations are enforced;
this is an attempt to determine this case */ if (pga.nuclear_rank != 0 && pcp->complete) break;
t = runTime() - t;
printf("Computing standard presentation for class %d took %.2f " "seconds\n",
start_class,
t * CLK_SCALE);
}
/* we currently may have presentation for p-covering group; or is the starting group terminal? if so, we may want to
use last_class to revert to group presentation */
if (!user_supplied && iteration == 0 && !pcp->complete)
last_class(pcp);
/* is the group terminal? */ if (complete == TERMINAL)
printf("The largest %d-quotient of the group has class %d\n",
pcp->p,
pcp->cc);
if (iteration == 0) break;
/* rename file ISOM_PP containing iteration info to nominated file */
rename("ISOM_PP", name);
break;
case PRINT_PCP: if (group_present)
print_presentation(TRUE, pcp); break;
case SAVE_PRES:
name = GetString("Enter output file name: ");
FileName = OpenFileOutput(name); if (group_present && FileName != NULL) {
save_pcp(FileName, pcp);
CloseFile(FileName);
printf("Presentation written to file\n");
} break;
case COMPARE:
valid = get_description( "Enter file name storing first presentation: ", &len1, &seq1, pcp); if (!valid) break;
valid =
get_description("Enter file name storing second presentation: ",
&len2,
&seq2,
pcp);
case STANDARD_PRINT_LEVEL:
read_value( TRUE, "Input print level for construction (0-2): ", &output, 0); /* allow user to supply same max print level as for
p-quotient calculations */ if (output == MAX_STANDARD_PRINT + 1)
--output; if (output > MAX_STANDARD_PRINT) {
printf("Print level must lie between %d and %d\n",
MIN_STANDARD_PRINT,
MAX_STANDARD_PRINT);
output = DEFAULT_STANDARD_PRINT;
} break;
case PQ_MENU:
options(ISOM_MENU, format, pcp); break;
void list_isom_menu(void)
{
printf("\nStandard Presentation Menu\n");
printf("-----------------------------\n");
printf("%d. Supply start information\n", START_INFO);
printf("%d. Compute standard presentation to supplied class\n", CONSTRUCT);
printf("%d. Save presentation to file\n", SAVE_PRES);
printf("%d. Display presentation\n", PRINT_PCP);
printf("%d. Set print level for construction\n", STANDARD_PRINT_LEVEL);
printf("%d. Compare two presentations stored in files\n", COMPARE);
printf("%d. Call basic menu for p-Quotient program\n", PQ_MENU);
printf("%d. Compute the isomorphism\n", ISOM_OPTION);
printf("%d. Exit from program\n", MAXOPTION);
}
/* set up the group to the desired class and its p-covering group; identity_map indicates whether standard automorphism applied was the identity; status indicates whether we are end of class;
the presentation is read from file using indicated format */
FILE *FileName;
FILE *presentation_file;
Logical group_present = FALSE; int exit_value; int *list, *head; int i;
#ifdefined(TIME) int t;
t = runTime(); #endif
if (!identity_map) {
/* we must recompute the presentation since generators and
relations have been altered by applying the standard map */
/* memory leak September 1996 */ if (user_gen_name != NULL) {
num_gens = user_gen_name[0].first;
for (i = 1; i <= num_gens; ++i) {
free_vector(user_gen_name[i].g, 0);
}
free(user_gen_name);
user_gen_name = NULL;
free_vector(inv_of, 0);
free_vector(pairnumber, 0);
}
exit_value = pquotient(0, 0, file, format, pcp); if (exit_value == SUCCESS)
group_present = TRUE;
#ifdefined(TIME)
printf("Time to recompute pcp is %.2f\n", (runTime() - t) * CLK_SCALE); #endif
} else { /* generators and relations of presentation have not changed -- we can restore presentation for either full p-covering group
or class c + 1 quotient */ if (status == END_OF_CLASS)
presentation_file = OpenFile("ISOM_group_file", "r"); else
presentation_file = OpenFile("ISOM_cover_file", "r");
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.