/* This function creates a (forward) linked list of the generators of a permutationgrouphavinglevelequaltoorgreaterthanagivenvalue. ThexNextfieldofeachpermutationisusedforthelinks.Thefunction returnsapointertothefirstpermutationinthelist.Thelevelfields ofthegeneratingpermutationsmustbefilledatbeforethefunctionis
invoked. */
Permutation *linkGensAtLevel(
PermGroup *G, /* The permutation group. */ Unsigned level) /* Permutations at or above this level
will be included. */
{
Permutation *gen, *listHeader = NULL, *currentListEntry;
for ( gen = G->generator ; gen ; gen = gen->next ) if ( gen->level >= level ) { if ( !listHeader )
listHeader = gen; else
currentListEntry->xNext = gen;
currentListEntry = gen;
} if ( listHeader )
currentListEntry->xNext = NULL; return listHeader;
}
/* This function creates a (forward) linked list of the generators of a permutationgrouphavinglevelequaltoorgreaterthanagivenvalueand whichareflaggedasessentialatthatvalue.ThexNextfieldofeach permutationisusedforthelinks.Thefunctionreturnsapointertothe firstpermutationinthelist.Thelevelfieldsofthegenerating
permutations must be filled at before the function is invoked. */
Permutation *linkEssentialGensAtLevel(
PermGroup *G, /* The permutation group. */ Unsigned level) /* Permutations at or above this level willbeincludediftheyareessential
at this level. */
{
Permutation *gen, *listHeader = NULL, *currentListEntry;
for ( gen = G->generator ; gen ; gen = gen->next ) if ( gen->level >= level && ESSENTIAL_AT_LEVEL(gen,level) ) { if ( !listHeader )
listHeader = gen; else
currentListEntry->xNext = gen;
currentListEntry = gen;
} if ( listHeader )
currentListEntry->xNext = NULL; return listHeader;
}
/* This function returns the first generator on the list *firstGen (xNext linked)thatfailstofixorbit[1..orbitLen]setwise,orNULLifnosuch permutationexists.NotesvecistheSchreiervectorfortheorbit.The functionalsodelinksthepermutationreturnedfromthe(xNext-linked)
list *firstGen. */
/* This function constructs the basic orbit vector and Schreier vector at a specifiedlevelinapermutationgroup.Storageforthebasicorbit andSchreiervectormusthavebeenallocatedpriortoinvocationofthis function,andthelevelfieldineachgeneratingpermutationforthe groupmustbefilledin.Inversesofgeneratorswillbeusedonlyif thereisaseparatestructure(typePermutation)fortheinverse.
Therearethreeoptions,whichdeterminewhichgeneratorsareusedin constructingtheSchreiervectors: "AllGensAtLevel":Allgeneratorsatorabovethespecifiedlevelareused inconstructingtheSchreiervector,andallare flaggedasessentialatthislevel. "KnownEssential":Onlygeneratorspreviouslyflaggedasessentialatthis levelareused,andtheessentialflagsarenot modified.(CAUTION:TheessentialflagsMUSTbe correct.) "FindEssential":Anattemptismadetouseasfewgeneratorsaspossible intheSchreiervectorconstruction,andallgenerators atorabovethelevelaremarkedasessentialornot essentialatthislevel,dependingonwhetherornot
they are used in the Schreier vector. */
void constructBasicOrbit(
PermGroup *const G, /* The permutation group. */ constUnsigned level, /* The level of the basic orbit to build. */ char *option) /* One of the three options above. */
{ typedefenum{ all, known, find} Option;
Option svecOption;
FactoredInt factoredOrbLen;
Permutation **svec = G->schreierVec[level]; Unsigned i;
UnsignedS *orbit = G->basicOrbit[level]; Unsigned found = 1, processed = 0, pt, img;
Permutation *gen, *firstGen, *gensUsed, *newEssentialGen;
/* Using xNext, form linked list of generators (or essential generators at level,ifKnownEssentialoptionisspecified)atorabovespecified
level. */ switch( svecOption) { case all:
firstGen = linkGensAtLevel( G, level); for ( gen = firstGen ; gen ; gen = gen->xNext )
MAKE_ESSENTIAL_AT_LEVEL(gen,level); break; case known:
firstGen = linkEssentialGensAtLevel( G, level); break; case find:
firstGen = linkGensAtLevel( G, level); break;
}
case all: case known: while ( processed < found ) {
pt = orbit[++processed]; for ( gen = firstGen ; gen ; gen = gen->xNext ) {
img = gen->image[pt]; if ( !svec[img] ) {
svec[img] = gen;
orbit[++found] = img;
}
}
} break;
for ( i = 1 ; i <= found ; ++i ) {
img = newEssentialGen->image[orbit[i]]; if ( !svec[img] ) {
orbit[++found] = img;
svec[img] = newEssentialGen;
}
}
while ( processed < found ) {
pt = orbit[++processed]; for ( gen = gensUsed ; gen ; gen = gen->xNext ) {
img = gen->image[pt]; if ( !svec[img] ) {
svec[img] = gen;
orbit[++found] = img;
}
}
}
}
for ( gen = gensUsed ; gen ; gen = gen->xNext )
MAKE_ESSENTIAL_AT_LEVEL(gen,level); for ( gen = firstGen ; gen ; gen = gen->xNext )
MAKE_NOT_ESSENTIAL_AT_LEVEL(gen,level); break;
}
/* This function may be used to extend a basic orbit and Schreier vector atagivenlevel,correspondingtoinclusionofanewgenerator(assumed tobe)atagivenlevel.Itreturnsthenumberofadditionalpointsin thebasicorbit.Firstthenewgeneratorisappliedtoallpointsin thebasicorbit.Then,ifanynewpointsarefound,theconstructionof
the Schreier vector continues in the usual manner. */
Unsigned extendBasicOrbit(
PermGroup *G, /* The permutation group. */ Unsigned level, /* The level of the basic orbit to extend. */
Permutation *newGen) /* The new generator not previously included
the Schreier vector. */
{
Permutation **svec = G->schreierVec[level];
UnsignedS *orbit = G->basicOrbit[level]; Unsigned found = G->basicOrbLen[level], processed = found, pt, img,
oldLength, i;
Permutation *gen, *firstGen;
for ( i = 1 ; i <= G->basicOrbLen[level] ; ++i ) {
img = newGen->image[orbit[i]]; if ( !svec[img] ) {
svec[img] = newGen;
orbit[++found] = img;
}
}
if ( found > G->basicOrbLen[level] ) {
firstGen = linkGensAtLevel( G, level); while ( processed < found ) {
pt = orbit[++processed]; for ( gen = firstGen ; gen ; gen = gen->xNext ) {
img = gen->image[pt]; if ( !svec[img] ) {
svec[img] = gen;
orbit[++found] = img;
}
}
}
}
oldLength = G->basicOrbLen[level];
G->basicOrbLen[level] = found; return found - oldLength;
/* This function constructs complete orbit information for a group at a given level.Specifically,itfillsinthecompleteOrbit,orbNumberOfPt,and startOfOrbitNofields.(NotefieldsschreierVecandbasicOrbitarenot modified;inparticular,thisroutinewillnormallybeusedinadditionto, ratherthatasanalternativeto,routinecstborb.Note startOfOrbitNo[orbitCount+1]issettodegree+1,inordertofacilitate
computation of orbit lengths. */
/* The trivial case level>baseSize is handled here. */ if ( level > G->baseSize ) { for ( pt = i = 1 ; pt <= G->degree ; ++pt , ++i ) {
orbNumberOfPt[pt] = i;
startOfOrbitNo[i] = i;
completeOrbit[i] = pt;
}
startOfOrbitNo[G->degree+1] = G->degree+1; return;
}
/* Initially all points are flagged as not found. */ for ( pt = 1 ; pt <= G->degree ; ++pt)
orbNumberOfPt[pt] = 0;
/* Construct a linked list of the generators at the appropriate level.
Should only essential generators be used? */
firstGen = linkGensAtLevel( G, level);
/* Construct the orbits, one by one in order. */ for ( orbRep = 1 ; orbRep <= G->degree ; ++orbRep ) if ( !orbNumberOfPt[orbRep] ) {
completeOrbit[++found] = orbRep;
startOfOrbitNo[++orbitCount] = found;
orbNumberOfPt[orbRep] = orbitCount; while ( processed < found ) {
pt = completeOrbit[++processed]; for ( gen = firstGen ; gen ; gen = gen->xNext ) {
img = gen->image[pt]; if ( !orbNumberOfPt[img] ) {
completeOrbit[++found] = img;
orbNumberOfPt[img] = orbitCount;
}
}
}
}
startOfOrbitNo[orbitCount+1] = G->degree+1;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet am 2026-06-26)
¤
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.