#define HELPTEXT \ " Check a file of graphs, optionally write corrected version\n\
\n\
-p# -p#:# \n\
Specify range of input lines (first is 1)\n\
\n\
-w Write corrected graphs (default is not to write)\n\
A header is written if there is one in the input.\n"
static boolean
seemsbad(char *s) /* Check graph string for apparent problem, if so, correct it */
{ int i,j,k,m,n; char *p,x,pq;
set *gj; long ii; int r,rr,topbit,nb,lastj;
graph g[16];
if (s[0] != ':') returnFALSE; /* not sparse6 */
n = graphsize(s); if (n != 2 && n != 4 && n != 8 && n != 16) returnFALSE;
m = 1;
stringtograph(s,g,m); if (g[n-1] != bit[n-1]) returnFALSE; if (g[n-2] == 0) returnFALSE;
g[n-1] = 0;
p = s+2;
for (i = n-1, nb = 0; i != 0 ; i >>= 1, ++nb) {}
topbit = 1 << (nb-1);
k = 6;
x = 0;
lastj = 0; for (j = 0; j < n; ++j)
{
gj = GRAPHROW(g,j,m); for (i = 0; i <= j; ++i)
{ if (ISELEMENT(gj,i))
{ if (j == lastj)
{
x <<= 1; if (--k == 0)
{
p++;
k = 6;
x = 0;
}
} else
{
x = (x << 1) | 1; if (--k == 0)
{
p++;
k = 6;
x = 0;
} if (j > lastj+1)
{ for (r = 0, rr = j; r < nb; ++r, rr <<= 1)
{ if (rr & topbit) x = (x << 1) | 1; else x <<= 1; if (--k == 0)
{
p++;
k = 6;
x = 0;
}
}
x <<= 1; if (--k == 0)
{
p++;
k = 6;
x = 0;
}
}
lastj = j;
} for (r = 0, rr = i; r < nb; ++r, rr <<= 1)
{ if (rr & topbit) x = (x << 1) | 1; else x <<= 1; if (--k == 0)
{
p++;
k = 6;
x = 0;
}
}
}
}
}
int
main(int argc, char *argv[])
{ int m,n,codetype; char *infilename,*outfilename;
FILE *infile,*outfile; int outcode; long nin,nerr; int argnum,j; char *arg,sw,*s;
boolean pswitch;
boolean wswitch;
boolean badargs; long pval1,pval2,maxin;
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 ist noch experimentell.