/* Copyright (C) 1992 by Jeffrey S. Leon. This software may be used freely foreducationalandresearchpurposes.Anyotheruserequirespermission
from the author. */
/* Main program for set stabilizer command, which may be used computethestabilizerG_LambdainapermutationgroupGofapointset Lmabda.Theformatofthecommandis:
/* Check whether the first parameter is Image or (U)Partn, and if so whether thesecondparameterisImageor(U)Partn.Ifso,asetimage,partition stabilizer,orpartitionimagecomputationwillbeperformedinsteadof asetstabilizerone,andthevalidremainingparameterswillbe
different. */
/* Provide help if no arguments are specified. Note i and j must be as
described above. */ if ( i == argc ) { switch( j ) { case0: printf( "\nUsage: setstab [options] permGroup pointSet stabilizerSubgroup\n"); break; case1: printf( "\nUsage: parstab [options] permGroup ordPartition stabilizerSubgroup\n"); break; case2: printf( "\nUsage: uprstab [options] permGroup unOrdPartition stabilizerSubgroup\n"); break; case4: printf( "\nUsage: setimage [options] permGroup pointSet1 pointSet2 groupElement\n"); break; case5: printf( "\nUsage: parimage [options] permGroup ordPartition1 ordPartition2 groupElement\n"); break; case6: printf( "\nUsage: uprimage [options] permGroup unOrdPartition1 unOrdPartition2 groupElement\n"); break;
} return0;
}
/* Check for limits option. If present in position i (i as above) give
limits and return. */ if ( i < argc && (strcmp(argv[i], "-l") == 0 || strcmp(argv[i], "-L") == 0) ) {
showLimits(); return0;
} /* Check for verify option. If present in position i (i as above) perform
verify (Note verifyOptions terminates program). */ if ( i < argc && (strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "-V") == 0) )
verifyOptions(); if ( argc < 4 )
ERROR( "main (setstab)", "Too few parameters.")
/* Check for exactly 3 (set or partn stabilizer) or 4 (set or partn image) parameters
following options. Note i must be as above. */ for ( optionCountPlus1 = i ; optionCountPlus1 < argc &&
argv[optionCountPlus1][0] == '-' ; ++optionCountPlus1 )
;
/* Compute maximum degree and word length. */
options.maxWordLength = 200 + 5 * options.maxBaseSize;
options.maxDegree = MAX_INT - 2 - options.maxBaseSize;
/* Compute names for files and name for set stabilizer or coset rep. */
parseLibraryName( argv[optionCountPlus1], prefix, suffix, permGroupFileName,
permGroupLibraryName); switch( computationType) { case SET_STAB: case PARTN_STAB: case UPARTN_STAB:
parseLibraryName( argv[optionCountPlus1+1], prefix, suffix,
pointSetFileName, pointSetLibraryName);
parseLibraryName( argv[optionCountPlus1+2], "", "",
outputFileName, outputLibraryName); if ( outputObjectName[0] == '\0' )
strncpy( outputObjectName, outputLibraryName, MAX_NAME_LENGTH+1); if ( knownSubgroupSpecifier[0] != '\0' )
parseLibraryName( knownSubgroupSpecifier, prefix, suffix,
knownSubgroupFileName, knownSubgroupLibraryName); break; case SET_IMAGE: case PARTN_IMAGE: case UPARTN_IMAGE:
parseLibraryName( argv[optionCountPlus1+1], prefix, suffix,
pointSet_L_FileName, pointSet_L_LibraryName);
parseLibraryName( argv[optionCountPlus1+2], prefix, suffix,
pointSet_R_FileName, pointSet_R_LibraryName);
parseLibraryName( argv[optionCountPlus1+3], "", "",
outputFileName, outputLibraryName); if ( outputObjectName[0] == '\0' )
strncpy( outputObjectName, outputLibraryName, MAX_NAME_LENGTH+1); if ( knownSubgroup_L_Specifier[0] )
parseLibraryName( knownSubgroup_L_Specifier, prefix, suffix,
knownSubgroup_L_FileName, knownSubgroup_L_LibraryName); if ( knownSubgroup_R_Specifier[0] )
parseLibraryName( knownSubgroup_R_Specifier, prefix, suffix,
knownSubgroup_R_FileName, knownSubgroup_R_LibraryName);
}
/* Read in the containing group G. */
G = readPermGroup( permGroupFileName, permGroupLibraryName, 0, "Generate");
/* Read in the known subgroups, if present. */ switch ( computationType ) { case SET_STAB: case PARTN_STAB: case UPARTN_STAB: if ( knownSubgroupSpecifier[0] )
L = readPermGroup( knownSubgroupFileName, knownSubgroupLibraryName,
G->degree, "Generate"); break; case SET_IMAGE: case PARTN_IMAGE: case UPARTN_IMAGE: if ( knownSubgroup_L_Specifier[0] )
L_L = readPermGroup( knownSubgroup_L_FileName,
knownSubgroup_L_LibraryName, G->degree, "Generate"); if ( knownSubgroup_R_Specifier[0] )
L_R = readPermGroup( knownSubgroup_R_FileName,
knownSubgroup_R_LibraryName, G->degree, "Generate"); break;
}
/* Read in the point set(s) or partition(s). */ switch ( computationType ) { case SET_STAB:
Lambda = readPointSet( pointSetFileName, pointSetLibraryName,
G->degree); break; case SET_IMAGE:
Lambda = readPointSet( pointSet_L_FileName, pointSet_L_LibraryName,
G->degree);
Xi = readPointSet( pointSet_R_FileName, pointSet_R_LibraryName,
G->degree); break; case PARTN_STAB: case UPARTN_STAB:
PLambda = readPartition( partitionFileName, partitionLibraryName,
G->degree); break; case PARTN_IMAGE: case UPARTN_IMAGE:
PLambda = readPartition( partition_L_FileName, partition_L_LibraryName,
G->degree);
PXi = readPartition( partition_R_FileName, partition_R_LibraryName,
G->degree); break;
}
/* Compute maximum base change level if not specified as option. */ if ( options.maxBaseChangeLevel == UNKNOWN )
options.maxBaseChangeLevel =
isDoublyTransitive(G) ?
( 1 + options.maxBaseSize * depthGreaterThan(G,4) ) :
( depthGreaterThan(G,5) + options.maxBaseSize * depthGreaterThan(G,6));
/* Compute the set or partition stabilizer or coset rep and write it out. */ switch ( computationType ) { case SET_STAB: if ( options.inform ) {
printf( "\n\n Set Stabilizer Program: " "Group %s, Point Set %s\n\n", G->name, Lambda->name); if ( L )
printf( "\nKnown Subgroup: %s\n", L->name);
}
options.groupOrderMessage = "Set stabilizer";
G_pP = setStabilizer( G, Lambda, L);
strcpy( G_pP->name, outputObjectName);
G_pP->printFormat = (imageFormatFlag ? imageFormat : cycleFormat);
sprintf( comment, "The stabilizer in permutation group %s of point set %s.",
G->name, Lambda->name);
writePermGroup( outputFileName, outputLibraryName, G_pP, comment); break; case PARTN_STAB: case UPARTN_STAB: if ( options.inform ) {
printf( "\n\n %s Partition Stabilizer Program: " "Group %s, Partition %s\n\n", ordUnord, G->name,
PLambda->name); if ( L )
printf( "\nKnown Subgroup: %s\n", L->name);
} switch( computationType ) { case PARTN_STAB:
options.groupOrderMessage = "Ordered partition stabilizer";
G_pP = partnStabilizer( G, PLambda, L);
sprintf( comment, "The stabilizer in permutation group %s of ordered partition %s.",
G->name, PLambda->name); break; case UPARTN_STAB:
options.groupOrderMessage = "Unordered partition stabilizer";
G_pP = uPartnStabilizer( G, PLambda, L);
sprintf( comment, "The stabilizer in permutation group %s of unordered partition %s.",
G->name, PLambda->name); break; default: /* can not actually reach here, silence a compiler warning */ break;
}
strcpy( G_pP->name, outputObjectName);
G_pP->printFormat = (imageFormatFlag ? imageFormat : cycleFormat);
writePermGroup( outputFileName, outputLibraryName, G_pP, comment); break; case SET_IMAGE: if ( options.inform ) {
printf( "\n\n\n Set Image Program: " "Group %s, Point Sets %s And %s\n\n", G->name,
Lambda->name, Xi->name); if ( L_L )
printf( "\nKnown Subgroup (left): %s", L_L->name); if ( L_R )
printf( "\nKnown Subgroup (right): %s", L_R->name); if ( L_L || L_R )
printf( "\n");
}
options.cosetRepMessage = "The first set is mapped to the second by group element:";
options.noCosetRepMessage = "The sets are not equivalent under the group.";
y = setImage( G, Lambda, Xi, L_L, L_R); if ( y ) {
strcpy( y->name, outputObjectName);
sprintf( comment, "A permutation in group %s mapping point set %s to point set %s.",
G->name, Lambda->name, Xi->name); if ( imageFormatFlag )
writePermutation( outputFileName, outputLibraryName, y, "image", comment); else
writePermutation( outputFileName, outputLibraryName, y, "", comment);
} break; case PARTN_IMAGE: case UPARTN_IMAGE: if ( options.inform ) {
printf( "\n\n\n %s Partition Image Program: " "Group %s, Partitions %s And %s\n\n", ordUnord, G->name,
PLambda->name, PXi->name); if ( L_L )
printf( "\nKnown Subgroup (left): %s", L_L->name); if ( L_R )
printf( "\nKnown Subgroup (right): %s", L_R->name); if ( L_L || L_R )
printf( "\n");
} switch( computationType ) { case PARTN_IMAGE:
options.cosetRepMessage = "The first ordered partition is mapped to the second by group element:";
options.noCosetRepMessage = "The ordered partitions are not equivalent under the group.";
y = partnImage( G, PLambda, PXi, L_L, L_R);
sprintf( comment, "A permutation in group %s mapping ordered partition %s to ordered partition %s.",
G->name, PLambda->name, PXi->name); break; case UPARTN_IMAGE:
options.cosetRepMessage = "The first unordered partition is mapped to the second by group element:";
options.noCosetRepMessage = "The unordered partitions are not equivalent under the group.";
y = uPartnImage( G, PLambda, PXi, L_L, L_R);
sprintf( comment, "A permutation in group %s mapping unordered partition %s to unordered partition %s.",
G->name, PLambda->name, PXi->name); break; default: /* can not actually reach here, silence a compiler warning */ break;
} if ( y ) {
strcpy( y->name, outputObjectName); if ( imageFormatFlag )
writePermutation( outputFileName, outputLibraryName, y, "image", comment); else
writePermutation( outputFileName, outputLibraryName, y, "", comment);
} break;
}
/* Return to caller. */ if ( !imageFlag || y ) return0; else return1;
}
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.