#define HELPTEXT \ " Remove isomorphs from a file of graphs.\n\
\n\ If outfile is omitted, it is taken to be the same as infile\n\ If both infile and outfile are omitted, input will be taken\n\
from stdin and written to stdout\n\
\n\
The output file has a header ifand only if the input file does.\n\
\n\
-s force output to sparse6 format\n\
-g force output to graph6 format\n\
-z force output to digraph6 format\n\ If none of -s, -z, -g are given, the output format is determined\n\
by the header or, if there is none, by the format of the first\n\
input graph. The output format determines the sorting order too.\n\
As an exception, digraphs are always written in digraph6 format.\n\
-S Use sparse representation internally. Note that this changes the\n\
canonical labelling. \n\
Multiple edges are not supported. One loop per vertex is ok.\n\
-t Use Traces.\n\
Note that this changes the canonical labelling.\n\
Multiple edges,loops, directed edges are not supported,\n\
nor invariants.\n\
\n\
-k output graphs have the same labelling and format as the inputs.\n\
Without -k, output graphs have canonical labelling.\n\
-s, -g, -z are ineffective if -k is given.\n\
\n\
-v write to stderr a list of which input graphs correspond to which\n\
output graphs. The input and output graphs are both numbered\n\
beginning at 1. A line like\n\
23 : 30 154 78\n\
means that inputs 30, 154 and 78 were isomorphic, and produced\n\
output 23.\n\
\n\
-d include in the output only those inputs which are isomorphic\n\
to another input. If -k is specified, all such inputs are\n\
included in their original labelling. Without -k, only one\n\
member of each nontrivial isomorphism class is written,\n\
with canonical labelling.\n\
\n\
-fxxx Specify a partition of the point set. xxx is any\n\
string of ASCII characters except nul. This string is\n\
considered extended to infinity on the right with the\n\
character 'z'. One character is associated with each point,\n\
in the order given. The labelling used obeys these rules:\n\
(1) the new order of the points is such that the associated\n\
characters are in ASCII ascending order\n\
(2) if two graphs are labelled using the same string xxx,\n\
the output graphs are identical iff there is an\n\
associated-character-preserving isomorphism between them.\n\
-i# select an invariant (1 = twopaths, 2 = adjtriang(K), 3 = triples,\n\
4 = quadruples, 5 = celltrips, 6 = cellquads, 7 = cellquins,\n\
8 = distances(K), 9 = indsets(K), 10 = cliques(K), 11 = cellcliq(K),\n\
12 = cellind(K), 13 = adjacencies, 14 = cellfano, 15 = cellfano2,\n\
16 = refinvar(K))\n\
-I#:# select mininvarlevel and maxinvarlevel (default 1:1)\n\
-K# select invararg (default 3)\n\
\n\
-u Write no output, just report how many graphs it would have output.\n\
In thiscase, outfile is not permitted.\n\
-Tdir Specify that directory \"dir\" will be used for temporary disk\n\
space by the sort subprocess. The default is usually /tmp.\n\
-q Suppress auxiliary output\n"
#if (HAVE_PIPE==0) || (HAVE_WAIT==0) || (HAVE_FORK==0) #error Forget it, either pipe(), wait() or fork() are not available #endif
/* Define EXTRA at compile time to add arguments to the sort command. It has to start with a comma and have double quotes around sort arguments. For example, if your sort command has the -S (buffer
size) parameter, you could use -DEXTRA=',"-S10%"' . */ #ifndef EXTRA #define EXTRA #endif
static pid_t
beginsort(FILE **sortin, FILE **sortout, char *tempdir,
boolean vdswitch, boolean keep) /* begin sort process, open streams for i/o to it, and return its pid */
{
pid_t pid; int inpipe[2],outpipe[2];
if (pipe(inpipe) < 0 || pipe(outpipe) < 0)
gt_abort(">E shortg: can't create pipes to sort process\n");
if ((pid = fork()) < 0) gt_abort(">E shortg: can't fork\n");
if (pid > 0) /* parent */
{
close(inpipe[0]);
close(outpipe[1]); if ((*sortin = fdopen(inpipe[1],"w")) == NULL)
gt_abort(">E shortg: can't open stream to sort process\n"); if ((*sortout = fdopen(outpipe[0],"r")) == NULL)
gt_abort(">E shortg: can't open stream from sort process\n");
} else/* child */
{
SET_C_COLLATION;
staticvoid
tosort(FILE *f, char *cdstr, char *dstr, nauty_counter index) /* write one graph to sort process cdstr = canonical string dstr = optional original string
index = optional index number */
{ int i; char buff[30];
for (i = 0; cdstr[i] != '\n'; ++i) {}
cdstr[i] = '\0';
writeline(f,cdstr);
if (dstr != NULL)
{
writeline(f," "); for (i = 0; dstr[i] != '\n'; ++i) {}
dstr[i] = '\0';
writeline(f,dstr);
}
if (strcmp(SORTPROG,"no_sort_found") == 0)
gt_abort(">E shortg: no sort program known\n"); if (uswitch && outfilename != NULL)
gt_abort(">E shortg: -u and outfile are incompatible\n"); if ((sswitch!=0) + (gswitch!=0) + (zswitch!=0) + (kswitch!=0) > 1)
gt_abort(">E shortg: -sgzk are incompatible\n"); if (Tswitch && *tempdir == '\0')
gt_abort(">E shortg: -T needs a non-empty argument\n"); if (tswitch && (format || Sswitch))
gt_abort(">E shortg: -t is incompatible with -S and -f \n"); if (iswitch && (inv > 16))
gt_abort(">E shortg: -i value must be 0..16\n"); if (Sswitch && iswitch && invarproc[inv].entrypoint_sg == NULL)
gt_abort( ">E shortg: that invariant is not available in sparse mode\n");
if (argnum == 1 && !uswitch) outfilename = infilename;
if (iswitch)
{ if (Iswitch)
{
mininvarlevel = minil;
maxinvarlevel = maxil;
} else
mininvarlevel = maxinvarlevel = 1; if (!Kswitch) invararg = 3;
}
if (badargs)
{
fprintf(stderr,">E Usage: %s\n",USAGE);
GETHELP; exit(1);
}
if (!quiet)
{
fprintf(stderr,">A shortg"); if (uswitch || kswitch || vswitch || format || Tswitch || zswitch
|| tswitch || sswitch || gswitch || Sswitch || iswitch)
fprintf(stderr," -"); if (sswitch) fprintf(stderr,"s"); if (gswitch) fprintf(stderr,"g"); if (zswitch) fprintf(stderr,"z"); if (Sswitch) fprintf(stderr,"S"); if (tswitch) fprintf(stderr,"t"); if (kswitch) fprintf(stderr,"k"); if (vswitch) fprintf(stderr,"v"); if (dswitch) fprintf(stderr,"d"); if (uswitch) fprintf(stderr,"u"); if (iswitch)
fprintf(stderr,"i=%s[%d:%d,%d]",invarproc[inv].name,
mininvarlevel,maxinvarlevel,invararg); if (format) fprintf(stderr,"f%s",fmt); if (format && Tswitch) fprintf(stderr," -"); if (Tswitch) fprintf(stderr,"T%s",tempdir); if (argnum > 0) fprintf(stderr," %s",infilename); if (argnum > 1) fprintf(stderr," %s",outfilename);
fprintf(stderr,"\n");
}
/* open input file */
if (infilename && infilename[0] == '-') infilename = NULL;
infile = opengraphfile(infilename,&codetype,FALSE,1); if (!infile) exit(1); if (!infilename) infilename = "stdin";
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.