Ejemplo n.º 1
0
int
main(int argc, char *argv[])
{
	graph *g;
	sparsegraph sg,sh;
	int m,n,codetype;
	int argnum,j,outcode;
	char *arg,sw,*fmt;
	boolean badargs;
	boolean sswitch,gswitch,qswitch,fswitch,Oswitch;
	boolean iswitch,Iswitch,Kswitch,Mswitch,Sswitch;
	boolean uswitch,tswitch;
	int inv,mininvarlevel,maxinvarlevel,invararg;
	long minil,maxil;
	double t;
	char *infilename,*outfilename;
	char autominfo[800];
	FILE *infile,*outfile;
	nauty_counter nin;
	int ii,secret,loops;
	DEFAULTOPTIONS_TRACES(traces_opts);
	TracesStats traces_stats;
#if MAXN
	graph h[MAXN*MAXM];
	int lab[MAXN],ptn[MAXN],orbits[MAXN];
#else
	DYNALLSTAT(graph,h,h_sz);
	DYNALLSTAT(int,lab,lab_sz);
	DYNALLSTAT(int,ptn,ptn_sz);
	DYNALLSTAT(int,orbits,orbits_sz);
#endif

	HELP;

	nauty_check(WORDSIZE,1,1,NAUTYVERSIONID);

	sswitch = gswitch = qswitch = FALSE;
	fswitch = Oswitch = Mswitch = FALSE;
	iswitch = Iswitch = Kswitch = FALSE;
	uswitch = Sswitch = tswitch = FALSE;
	infilename = outfilename = NULL;
	inv = 0;

	argnum = 0;
	badargs = FALSE;
	for (j = 1; !badargs && j < argc; ++j)
	{
	    arg = argv[j];
	    if (arg[0] == '-' && arg[1] != '\0')
	    {
		++arg;
		while (*arg != '\0')
		{
		    sw = *arg++;
		         SWBOOLEAN('s',sswitch)
		    else SWBOOLEAN('g',gswitch)
		    else SWBOOLEAN('u',uswitch)
		    else SWBOOLEAN('q',qswitch)
		    else SWBOOLEAN('O',Oswitch)
		    else SWBOOLEAN('S',Sswitch)
		    else SWBOOLEAN('t',tswitch)
		    else SWINT('i',iswitch,inv,"labelg -i")
		    else SWINT('K',Kswitch,invararg,"labelg -K")
		    else SWRANGE('k',":-",Iswitch,minil,maxil,"labelg -k")
		    else SWRANGE('I',":-",Iswitch,minil,maxil,"labelg -I")
		    else if (sw == 'f')
		    {
			fswitch = TRUE;
			fmt = arg;
			break;
		    }
		    else SWINT('M',Mswitch,secret,"labelg -M")
		    else badargs = TRUE;
		}
	    }
	    else
	    {
		++argnum;
Ejemplo n.º 2
0
int
main(int argc, char *argv[])
{
    char *infilename,*outfilename;
    FILE *infile,*outfile;
    FILE *sortin,*sortout;
    int status,loops;
    char *dstr,*cdstr,*prevdstr,*prevcdstr;
    char sw,*fmt;
    boolean badargs,quiet,vswitch,dswitch,kswitch,format,uswitch;
    boolean iswitch,Iswitch,Kswitch,Tswitch;
    boolean zswitch,sswitch,gswitch,Sswitch,tswitch;
    boolean digraph;
    nauty_counter numread,prevnumread,numwritten,classsize;
    int m,n,i,ii,argnum,line;
    int outcode,codetype;
    int inv,mininvarlevel,maxinvarlevel,invararg;
    long minil,maxil;
    pid_t sortpid;
    graph *g;
    char *arg,*tempdir;
    sparsegraph sg,sh;
    DEFAULTOPTIONS_TRACES(traces_opts);
    TracesStats traces_stats;
#if MAXN
    graph h[MAXN*MAXM];
    int lab[MAXN],ptn[MAXN],orbits[MAXN];
#else
    DYNALLSTAT(graph,h,h_sz);
    DYNALLSTAT(int,lab,lab_sz);
    DYNALLSTAT(int,ptn,ptn_sz);
    DYNALLSTAT(int,orbits,orbits_sz);
#endif

    HELP;

    nauty_check(WORDSIZE,1,1,NAUTYVERSIONID);

    infilename = outfilename = NULL;
    dswitch = format = quiet = vswitch = kswitch = uswitch = FALSE;
    zswitch = sswitch = gswitch = Sswitch = Tswitch = FALSE;
    tswitch = iswitch = Iswitch = Kswitch = FALSE;
    tempdir = NULL;
    inv = 0;

     /* parse argument list */

    argnum = 0;
    badargs = FALSE;

    for (i = 1; !badargs && i < argc; ++i)
    {
        arg = argv[i];
        if (arg[0] == '-' && arg[1] != '\0')
        {
            ++arg;
            while (*arg != '\0')
            {
                sw = *arg++;
                     SWBOOLEAN('q',quiet)
                else SWBOOLEAN('v',vswitch)
                else SWBOOLEAN('k',kswitch)
                else SWBOOLEAN('d',dswitch)
                else SWBOOLEAN('u',uswitch)
                else SWBOOLEAN('s',sswitch)
                else SWBOOLEAN('g',gswitch)
                else SWBOOLEAN('z',zswitch)
                else SWBOOLEAN('S',Sswitch)
                else SWBOOLEAN('t',tswitch)
                else SWINT('i',iswitch,inv,"shortg -i")
                else SWINT('K',Kswitch,invararg,"shortg -K")
                else SWRANGE('I',":-",Iswitch,minil,maxil,"shortg -I")
                else if (sw == 'f')
                {
                    format = TRUE;
                    fmt = arg;
                    break;
                }
                else if (sw == 'T')
                {
                    Tswitch = TRUE;
                    tempdir = arg;
                    break;
                }
                else badargs = TRUE;
            }
        }
        else
        {
            ++argnum;