/* Check for limits option. If present in position 1, give limits and
return. */ if ( strcmp( argv[1], "-l") == 0 || strcmp( argv[1], "-L") == 0 ) {
showLimits(); return0;
} /* Check for verify option. If present in position i (i as above) perform
verify (Note verifyOptions terminates program). */ if ( strcmp( argv[1], "-v") == 0 || strcmp( argv[1], "-V") == 0 )
verifyOptions();
/* Check for at most 2 parameters following options. */ if ( argc - optionCountPlus1 > 2 )
ERROR( "Compgrp", "Exactly 2 non-option parameters are required.")
/* If second group is omitted, check if first group is the identity. */ if ( !group2 ) { if ( group1->order->noOfFactors == 0 ) { if ( options.inform )
printf( "\n %s is the identity.\n", group1->name); return0;
} else { if ( options.inform )
printf( "\n %s is not the identity.\n", group1->name); return1;
}
}
/* Check containment. */ if ( isSubgroupOf(group1,group2) ) { if ( isSubgroupOf(group2,group1) ) { if ( options.inform )
printf( "\n %s and %s are equal.\n", group1->name, group2->name); if ( centralizeFlag ) { if ( isCentralizedBy(group1,group2) ) {
printf( " %s and %s centralize each other.\n",
group1->name, group2->name);
skipNormalize = TRUE;
} else
printf( " %s and %s do not centralize each other.\n",
group1->name, group2->name);
}
returnCode = 0;
} else { if ( options.inform )
printf( "\n %s is properly contained in %s.\n", group1->name,
group2->name); if ( centralizeFlag ) { if ( isCentralizedBy(group1,group2) ) {
printf( " %s and %s centralize each other.\n",
group1->name, group2->name);
skipNormalize = TRUE;
} else
printf( " %s and %s do not centralize each other.\n",
group1->name, group2->name);
} if ( normalizeFlag && !skipNormalize ) { if ( isNormalizedBy(group1,group2) )
printf( " %s is normal in %s.\n", group1->name,
group2->name); else
printf( " %s is not normal in %s.\n", group1->name,
group2->name);
}
returnCode = 1;
}
} else { if ( isSubgroupOf(group2,group1) ) { if ( options.inform )
printf( "\n %s is properly contained in %s.\n", group2->name,
group1->name); if ( centralizeFlag ) { if ( isCentralizedBy(group1,group2) ) {
printf( " %s and %s centralize each other.\n",
group1->name, group2->name);
skipNormalize = TRUE;
} else
printf( " %s and %s do not centralize each other.\n",
group1->name, group2->name);
} if ( normalizeFlag && !skipNormalize ) { if ( isNormalizedBy( group2, group1) )
printf( " %s is normal in %s.\n", group2->name,
group1->name); else
printf( " %s is not normal in %s.\n", group2->name,
group1->name);
}
returnCode = 2;
} else { if ( options.inform )
printf( "\n Neither of %s or %s is contained in the other.\n",
group1->name, group2->name); if ( centralizeFlag ) { if ( isCentralizedBy(group1,group2) ) {
printf( " %s and %s centralize each other.\n",
group1->name, group2->name);
skipNormalize = TRUE;
} else
printf( " %s and %s do not centralize each other.\n",
group1->name, group2->name);
} if ( normalizeFlag && !skipNormalize ) { if ( isNormalizedBy( group1, group2) )
printf( " %s is normalized by %s.\n", group1->name,
group2->name); else
printf( " %s is not normalized by %s.\n", group1->name,
group2->name); if ( isNormalizedBy( group2, group1) )
printf( " %s is normalized by %s.\n", group2->name,
group1->name); else
printf( " %s is not normalized by %s.\n", group2->name,
group1->name);
}
returnCode = 3;
}
}
if ( set2 ) { for ( i = 1 ; i <= set1->size ; ++i ) if ( !set2->inSet[set1->pointList[i]] ) {
set1InSet2 = FALSE; break;
} for ( i = 1 ; i <= set2->size ; ++i ) if ( !set1->inSet[set2->pointList[i]] ) {
set2InSet1 = FALSE; break;
} if ( set1InSet2 && set2InSet1 ) { if ( options.inform )
printf( "\n Sets %s and %s are equal.\n", set1->name, set2->name); return0;
} elseif ( set1InSet2 ) { if ( options.inform )
printf( "\n Set %s is properly contained in set %s.\n", set1->name,
set2->name); return1;
} elseif ( set2InSet1 ) { if ( options.inform )
printf( "\n Set %s is properly contained in set %s.\n", set2->name,
set1->name); return2;
} else { if ( options.inform )
printf( "\n Neither set %s or set %s is contained in the other.\n",
set1->name, set2->name); return3;
}
} else { if ( set1->size == 0 ) { if ( options.inform )
printf( "\n %s is empty.\n", set1->name); return0;
} else { if ( options.inform )
printf( "\n %s is not empty.\n", set1->name); 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.