int i; int j; int k; int l; int p1; int p2; int weight; int comma; int ndgen = pcp->ndgen; int dgen = pcp->dgen;
#include"access.h"
/* construct a free group with enough generators */
fprintf(file, "F := FreeGroup( %d );\n", pcp->lastg);
if (aspcgroup) {
fprintf(file, "F := PcGroupFpGroupNC( F / [\n");
} else
fprintf(file, "F := F / [\n");
/* write power-relators with possible non-trivial rhs */
comma = 0;
k = y[pcp->clend + pcp->cc - 1]; for (i = 1; i <= k; i++) { if (comma)
fprintf(file, ",\n"); else
comma = 1;
p2 = y[pcp->ppower + i]; if (p2 == 0)
fprintf(file, " F.%d^%d", i, pcp->p); else {
fprintf(file, " F.%d^%d /", i, pcp->p);
print_GAP_word(file, p2);
}
}
/* write power-relators with trivial rhs */ for (i = k + 1; i <= pcp->lastg; ++i) { if (comma)
fprintf(file, ",\n"); else
comma = 1;
fprintf(file, " F.%d^%d", i, pcp->p);
}
/* write commutator-relators */ for (i = 2; i <= k; i++) {
weight = WT(y[pcp->structure + i]);
p1 = y[pcp->ppcomm + i];
l = MIN(i - 1, y[pcp->clend + pcp->cc - weight]); for (j = 1; j <= l; j++) {
p2 = y[p1 + j]; if (p2 != 0) {
fprintf(file, ",\n");
fprintf(file, " Comm( F.%d, F.%d ) /", i, j);
print_GAP_word(file, p2);
}
}
}
if (aspcgroup)
fprintf(file, "] );\n"); else
fprintf(file, "];\n");
/* store the relation between pc gens and fp gens */
fprintf(file, "MapImages := [];\n"); for (i = 1; i <= ndgen; i++) {
p2 = y[dgen + i];
fprintf(file, "MapImages[%d] := ", i);
print_GAP_word(file, p2);
fprintf(file, ";\n");
}
}
void MakeNameList(FILE *file, char *ident)
{ int first = 1;
fprintf(file, "SetANUPQIdentity( F, [ "); while (*(ident = nextnumber(ident)) != '\0') { if (!first)
fprintf(file, ",");
first = 0;
fprintf(file, "["); do
fprintf(file, "%c", *ident); while (*++ident != ';');
ident++;
fprintf(file, ","); do {
fprintf(file, "%c", *ident);
ident++;
} while ('0' <= *ident && *ident <= '9');
fprintf(file, "]");
}
fprintf(file, " ] );\n");
}
/**************************************************************************** ** *Fwrite_GAP_library **writeGAPlibraryfileinformsuitableforreadingintoGAP
*/ int countcall = 0;
void write_GAP_library(FILE *file, struct pcp_vars *pcp)
{ /* if this is the first call initialise 'ANUgroups' */ if (countcall == 0) {
fprintf(file, "ANUPQgroups := [];\n");
fprintf(file, "ANUPQautos := [];\n\n");
}
countcall++;
/* write function call to <countcall>.th position of <ANUPQgroups> */
fprintf(file, "## group number: %d\n", countcall);
fprintf(file, "ANUPQgroups[%d] := function( L )\n", countcall);
fprintf(file, "local MapImages, F;\n\n");
/* write the GAP presentation to file */
GAP_presentation(file, pcp, 0);
/* convert <F> to a pc group in descendants case
... has to be done here; otherwise, we lose the property/attributes */
fprintf(file, "if IsList(L) then\n F := PcGroupFpGroupNC(F);\nfi;\n");
/* add info. whether group is capable, and its nuclear and mult'r ranks*/
fprintf(file, "SetIsCapable(F, %s);\n", (pcp->newgen) ? "true" : "false");
fprintf(file, "SetNuclearRank(F, %d);\n", pcp->newgen);
fprintf(file, "SetMultiplicatorRank (F, %d);\n", pcp->multiplicator_rank);
/* add the pq identitfier */
MakeNameList(file, pcp->ident);
/* add the group <F> to <L> */
fprintf(file, "if IsList(L) then\n Add( L, F );\n");
fprintf(file, "else\n L.group := F;\n L.map := MapImages;\nfi;");
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 und die Messung sind noch experimentell.