#define HELPTEXT \ " Copy a file of graphs with possible format conversion.\n\
\n\
-g Use graph6 format for output\n\
-s Use sparse6 format for output\n\
-z Use digraph6 format for output\n\
-i Use incremental sparse6 format for output\n\
In the absence of -g, -s, -z or -i, the format\n\
depends on the header or, if none, the first input line.\n\
As an exception, digraphs are always written in digraph6.\n\
\n\
-p# -p#:# \n\
Specify range of input lines (first is 1)\n\ This can fail if the input has incremental lines.\n\
-f With -p, assume input lines of fixed length\n\
(ignored if header or first line has sparse6 format).\n\
-I# Have at most this number of incremental steps\n\
in a row. Implies -i. \n\
\n\
-h Write a header.\n\
-x Don't write a header.\n\
In the absence of -h and -x, a header is written if\n\
there is one in the input.\n\
\n\
-q Suppress auxiliary output.\n"
#ifdef FILTER #define HELPTEXT1 HELPTEXT #define HELPTEXT2 \ "\n\
-Q# -Q#:# a number or range to pass to the filter.\n\
\n\
Only inputs satisfying the filter, ornot satisfying the\n\
filter if -v is given, are passed through.\n" #endif
/* How to use this as a skeleton to construct a filter.
Suppose we want to make a filter "numleaves" that filters graphs according to their number of leaves.
(1) In a separate file numleaves.c (present in the package), write a procedure with prototype matching boolean numleaves(graph *g, boolean digraph, long Qlo, long Qhi, int m, int n); It should return a nonzero value if g has between Qlo and Qhi leaves, and return 0 otherwise. The values of Qlo and Qhi are obtained from the -Q switch, with missing lower bound -NOLIMIT and missing upper bound NOLIMIT.
(2) Compile numleaves.c together with this program with the preprocessor variable FILTER defined as "numleaves" (without the quotes). Link with nauty.a. For the gcc, icc, and some other compilers, you can do it like this: gcc -o numleaves -O3 -DFILTER=numleaves copyg.c numleaves.c nauty.a
(3) That's it. Now "numleaves -Q2:7" will copy through graphs with 2-7 leaves, while "numleaves -v -Q7" will copy through graphs whose number of leaves is not 7.
Within the procedure numleaves(), the index number of the current graph is available in the external nauty_counter variable nin. The first graph has index 1.
If you also define SUMMARY to be a procedure with prototype void name(void), it is called before the final summary (unless -q is given). You can't use SUMMARY without FILTER.
*/
#ifdef FILTER extern boolean
FILTER(graph *g, boolean digraph, long Qlo, long Qhi, int m, int n); #ifdef SUMMARY externvoid SUMMARY(void); #endif #endif
nauty_counter nin;
int
main(int argc, char *argv[])
{
graph *g,*gprev,*gbase; int m,n,codetype; char *infilename,*outfilename;
FILE *infile,*outfile; int outcode;
nauty_counter nout; int argnum,j,nprev,mprev; char *arg,sw;
boolean sswitch,fswitch,pswitch,qswitch,gswitch;
boolean hswitch,xswitch,iswitch,Iswitch,zswitch;
boolean badargs,digraph,vswitch,Qswitch,kept; long Qlo,Qhi; long pval1,pval2,maxin,refresh,inclines; double t0,t1;
if (Iswitch) iswitch = TRUE; if ((sswitch!=0) + (gswitch!=0) + (iswitch!=0) + (zswitch!=0) > 1)
gt_abort(">E copyg: -s, -g, -z and -i/-I are incompatible\n"); if (hswitch && xswitch)
gt_abort(">E copyg: -h and -x are incompatible\n");
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.