#define HELPTEXT \ " Assemble input graphs as components of output graphs.\n\
\n\
The output file has no header.\n\ If the input has any directed graphs, all outputs are directed.\n\
Otherwise, the output format is determined by the header\n\ or first input.\n\
The input graphs had better all fit into memory at once,\n\
unless -L is given, in which case only the graphs of at\n\
most half the output size are stored at once.\n\
The output graphs will be non-isomorphic if the input\n\
graphs are connected and non-isomorphic.\n\
\n\
-n# -n#:# Give range of output sizes (compulsory)\n\
-i# -i#:# Give range of input sizes to use\n\
-L Assume all input graphs strictly larger than maxn/2\n\
vertices follow any smaller graphs in the input,\n\
where maxn is the largest size specified by -n.\n\ This can greatly reduce memory consumption.\n\
-c Also write graphs consisting of a single input\n\
-q Suppress auxiliary information.\n"
staticvoid
insertg(graph *g, int ng, graph *h, int nh, int n) /* Insert nh-vertex graph starting at vertex ng in graph g. n is the total size available.
It is assumed that g is empty apart from 0..ng-1. */
{ int i,j,m,mh;
set *gi,*hi;
m = SETWORDSNEEDED(n);
mh = SETWORDSNEEDED(nh);
for (i = 0, hi = h, gi = g + ng*m; i < nh;
++i, hi += mh, gi += m)
{ for (j = -1; (j = nextelement(hi,mh,j)) >= 0; )
ADDELEMENT(gi,ng+j);
}
}
staticvoid
removeg(graph *g, int ng, int nh, int n) /* Remove a subgraph that was in position ng..ng+nh-1. */
{
set *gi; int i,j,m;
m = SETWORDSNEEDED(n);
for (i = ng, gi = g + ng*m; i < ng+nh; ++i, gi += m)
{ for (j = ng; j < ng+nh; ++j)
DELELEMENT(gi,j);
}
}
staticvoid
readinputs(FILE *f, int imin, int imax) /* Read inputs and sort by size */
{
size_t tablesize;
graph *g; int m,n;
boolean digraph;
if ((gin = malloc(sizeof(graphptr)*10000)) == NULL ||
(size = malloc(sizeof(int)*10000)) == NULL)
gt_abort(">E malloc failed in readinputs()\n");
tablesize = 10000;
ninputs = 0;
while (TRUE)
{ if ((g = readgg(f,NULL,0,&m,&n,&digraph)) == NULL) break; if (digraph) outcode = DIGRAPH6; if (n < imin || n > imax) continue;
if (ninputs == tablesize)
{
tablesize = 3*tablesize/2 + 10000; if ((gin = realloc(gin,sizeof(graphptr)*tablesize)) == NULL ||
(size = realloc(size,sizeof(int)*tablesize)) == NULL)
gt_abort(">E realloc failed in readinputs()\n");
}
gin[ninputs] = g;
size[ninputs] = n;
++ninputs;
}
if (ninputs < 0 || ninputs > tablesize)
gt_abort(">E Some overflow problem in readinputs()\n");
sortbysize(size,gin,ninputs);
}
staticvoid
readsomeinputs(FILE *f, int imin, int imax, int maxsize,
graph **g, int *n) /* Read inputs and sort by size. Stop when either EOF or a
graph bigger than maxsize is read. */
{
size_t tablesize; int m;
boolean digraph;
if ((gin = malloc(sizeof(graphptr)*10000)) == NULL ||
(size = malloc(sizeof(int)*10000)) == NULL)
gt_abort(">E malloc failed in readsomeinputs()\n");
tablesize = 10000;
ninputs = 0;
while (TRUE)
{ if ((*g = readgg(f,NULL,0,&m,n,&digraph)) == NULL) break; if (digraph) outcode = DIGRAPH6; if (*n > maxsize) break;
if (*n < imin || *n > imax) continue;
if (ninputs == tablesize)
{
tablesize += 10000; if ((gin = realloc(gin,sizeof(graphptr)*tablesize)) == NULL ||
(size = realloc(size,sizeof(int)*tablesize)) == NULL)
gt_abort(">E realloc failed in readsomeinputs()\n");
}
staticvoid
assemble(graph *g, int nmin, int nmax, int sofar, int lastpos,
boolean writeconn, FILE *outfile) /* Recursively add one more graph.
sofar = how many vertices so far. */
{ int pos,newsize;
for (pos = lastpos; pos < ninputs; ++pos)
{
newsize = sofar + size[pos]; if (newsize > nmax) break;
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.