nauty.h
1 /*
2  @copyright Russell Standish 2000-2013
3  @author Russell Standish
4  This file is part of EcoLab
5 
6  Open source licensed under the MIT license. See LICENSE for details.
7 */
8 
9 /**************************************************************************
10 * This is the header file for Version 2.2 of nauty(). *
11 * Generated automatically from nauty-h.in by configure.
12 **************************************************************************/
13 
14 #ifndef _NAUTY_H_ /* only process this file once */
15 #define _NAUTY_H_
16 
17 /* The parts between the ==== lines are modified by configure when
18 creating nauty.h out of nauty-h.in. If configure is not being used,
19 it is necessary to check they are correct.
20 ====================================================================*/
21 
22 /* Check whether various headers are available */
23 #define HAVE_UNISTD_H 1 /* <unistd.h> */
24 #define HAVE_SYSTYPES_H 1 /* <sys/types.h> */
25 #define HAVE_STDDEF_H 1 /* <stddef.h> */
26 #define HAVE_STDLIB_H 1 /* <stdlib.h> */
27 #define HAVE_STRING_H 1 /* <string.h> */
28 #define MALLOC_DEC 1 /* 1 = malloc() is declared in stdlib.h,
29  2 = in malloc.h, 0 = in neither place */
30 #define HAS_MATH_INF 0 /* INFINITY is defined in math.h or
31  some system header likely to be used */
32 
33 #if 0
34 #define SIZEOF_INT 4
35 #define SIZEOF_LONG 4
36 #define SIZEOF_LONG_LONG 8 /* 0 if nonexistent */
37 #endif
38 #include <nauty_sizes.h> /* auto generate these macros */
39 
40 #define HAVE_CONST 1 /* compiler properly supports const */
41 
42 /*==================================================================*/
43 
44 /* The following line must be uncommented for compiling into Magma. */
45 /* #define NAUTY_IN_MAGMA */
46 
47 #ifdef NAUTY_IN_MAGMA
48 #include "defs.h"
49 #include "system.h"
50 #include "bs.h"
51 #undef BIGNAUTY
52 #define BIGNAUTY
53 #undef OLDEXTDEFS
54 #define OLDEXTDEFS
55 #else
56 #include <stdio.h>
57 #define P_(x) x
58 #endif
59 
60 #if defined(__cray) || defined(__cray__) || defined(cray)
61 #define SYS_CRAY /* Cray UNIX, portable or standard C */
62 #endif
63 
64 #if defined(__unix) || defined(__unix__) || defined(unix)
65 #define SYS_UNIX
66 #endif
67 
68 #if !HAVE_CONST
69 #define const
70 #endif
71 
72 /*****************************************************************************
73 * *
74 * AUTHOR: Brendan D. McKay *
75 * Computer Science Department *
76 * Australian National University *
77 * Canberra, ACT 0200, Australia *
78 * phone: +61 2 6125 3845 fax: +61 2 6125 0010 *
79 * email: bdm@cs.anu.edu.au *
80 * *
81 * Copyright (1984-2004) Brendan McKay. All rights reserved. Permission *
82 * is hereby given for use and/or distribution with the exception of *
83 * sale for profit or application with nontrivial military significance. *
84 * You must not remove this copyright notice, and you must document any *
85 * changes that you make to this program. *
86 * This software is subject to this copyright only, irrespective of *
87 * any copyright attached to any package of which this is a part. *
88 * *
89 * This program is only provided "as is". No responsibility will be taken *
90 * by the author, his employer or his pet rabbit* for any misfortune which *
91 * befalls you because of its use. I don't think it will delete all your *
92 * files, burn down your computer room or turn your children against you, *
93 * but if it does: stiff cheddar. On the other hand, I very much welcome *
94 * bug reports, or at least I would if there were any bugs. *
95 * * RIP, 1989 *
96 * *
97 * If you wish to acknowledge use of this program in published articles, *
98 * please do so by citing the User's Guide: *
99 * *
100 * B. D. McKay, nauty User's Guide (Version 1.5), Technical Report *
101 * TR-CS-90-02, Australian National University, Department of *
102 * Computer Science, 1990. *
103 * *
104 * CHANGE HISTORY *
105 * 10-Nov-87 : final changes for version 1.2 *
106 * 5-Dec-87 : renamed to version 1.3 (no changes to this file) *
107 * 28-Sep-88 : added PC Turbo C support, making version 1.4 *
108 * 23-Mar-89 : changes for version 1.5 : *
109 * - reworked M==1 code *
110 * - defined NAUTYVERSION string *
111 * - made NAUTYH_READ to allow this file to be read twice *
112 * - added optional ANSI function prototypes *
113 * - added validity check for WORDSIZE *
114 * - added new fields to optionblk structure *
115 * - updated DEFAULTOPTIONS to add invariants fields *
116 * - added (set*) cast to definition of GRAPHROW *
117 * - added definition of ALLOCS and FREES *
118 * 25-Mar-89 : - added declaration of new function doref() *
119 * - added UNION macro *
120 * 29-Mar-89 : - reduced the default MAXN for small machines *
121 * - removed OUTOFSPACE (no longer used) *
122 * - added SETDIFF and XOR macros *
123 * 2-Apr-89 : - extended statsblk structure *
124 * 4-Apr-89 : - added IS_* macros *
125 * - added ERRFILE definition *
126 * - replaced statsblk.outofspace by statsblk.errstatus *
127 * 5-Apr-89 : - deleted definition of np2vector (no longer used) *
128 * - introduced EMPTYSET macro *
129 * 12-Apr-89 : - eliminated MARK, UNMARK and ISMARKED (no longer used) *
130 * 18-Apr-89 : - added MTOOBIG and CANONGNIL *
131 * 12-May-89 : - made ISELEM1 and ISELEMENT return 0 or 1 *
132 * 2-Mar-90 : - added EXTPROC macro and used it *
133 * 12-Mar-90 : - added SYS_CRAY, with help from N. Sloane and A. Grosky *
134 * - added dummy groupopts field to optionblk *
135 * - select some ANSI things if __STDC__ exists *
136 * 20-Mar-90 : - changed default MAXN for Macintosh versions *
137 * - created SYS_MACTHINK for Macintosh THINK compiler *
138 * 27-Mar-90 : - split SYS_MSDOS into SYS_PCMS4 and SYS_PCMS5 *
139 * 13-Oct-90 : changes for version 1.6: *
140 * - fix definition of setword for WORDSIZE==64 *
141 * 14-Oct-90 : - added SYS_APOLLO version to avoid compiler bug *
142 * 15-Oct-90 : - improve detection of ANSI conformance *
143 * 17-Oct-90 : - changed temp name in EMPTYSET to avoid A/UX bug *
144 * 16-Apr-91 : changes for version 1.7: *
145 * - made version SYS_PCTURBO use free(), not cfree() *
146 * 2-Sep-91 : - noted that SYS_PCMS5 also works for Quick C *
147 * - moved MULTIPLY to here from nauty.c *
148 * 12-Jun-92 : - changed the top part of this comment *
149 * 27-Aug-92 : - added version SYS_IBMC, thanks to Ivo Duentsch *
150 * 5-Jun-93 : - renamed to version 1.7+, only change in naututil.h *
151 * 29-Jul-93 : changes for version 1.8: *
152 * - fixed error in default 64-bit version of FIRSTBIT *
153 * (not used in any version before ALPHA) *
154 * - installed ALPHA version (thanks to Gordon Royle) *
155 * - defined ALLOCS,FREES for SYS_IBMC *
156 * 3-Sep-93 : - make calloc void* in ALPHA version *
157 * 17-Sep-93 : - renamed to version 1.9, *
158 * changed only dreadnaut.c and nautinv.c *
159 * 24-Feb-94 : changes for version 1.10: *
160 * - added version SYS_AMIGAAZT, thanks to Carsten Saager *
161 * (making 1.9+) *
162 * 19-Apr-95 : - added prototype wrapper for C++, *
163 * thanks to Daniel Huson *
164 * 5-Mar-96 : - added SYS_ALPHA32 version (32-bit setwords on Alpha) *
165 * 13-Jul-96 : changes for version 2.0: *
166 * - added dynamic allocation *
167 * - ERRFILE must be defined *
168 * - added FLIPELEM1 and FLIPELEMENT macros *
169 * 13-Aug-96 : - added SWCHUNK? macros *
170 * - added TAKEBIT macro *
171 * 28-Nov-96 : - include sys/types.h if not ANSI (tentative!) *
172 * 24-Jan-97 : - and stdlib.h if ANSI *
173 * - removed use of cfree() from UNIX variants *
174 * 25-Jan-97 : - changed options.getcanon from boolean to int *
175 * Backwards compatibility is ok, as boolean and int *
176 * are the same. Now getcanon=2 means to get the label *
177 * and not care about the group. Sometimes faster. *
178 * 6-Feb-97 : - Put in #undef for FALSE and TRUE to cope with *
179 * compilers that illegally predefine them. *
180 * - declared nauty_null and nautil_null *
181 * 2-Jul-98 : - declared ALLBITS *
182 * 21-Oct-98 : - allow WORDSIZE==64 using unsigned long long *
183 * - added BIGNAUTY option for really big graphs *
184 * 11-Dec-99 : - made bit, leftbit and bytecount static in each file *
185 * 9-Jan-00 : - declared nauty_check() and nautil_check() *
186 * 12-Feb-00 : - Used #error for compile-time checks *
187 * - Added DYNREALLOC *
188 * 4-Mar-00 : - declared ALLMASK(n) *
189 * 27-May-00 : - declared CONDYNFREE *
190 * 28-May-00 : - declared nautil_freedyn() *
191 * 16-Aug-00 : - added OLDNAUTY and changed canonical labelling *
192 * 16-Nov-00 : - function prototypes are now default and unavoidable *
193 * - removed UPROC, now assume all compilers know void *
194 * - removed nvector, now just int (as it always was) *
195 * - added extra parameter to targetcell() *
196 * - removed old versions which were only to skip around *
197 * bugs that should have been long fixed: *
198 * SYS_APOLLO and SYS_VAXBSD. *
199 * - DEFAULTOPIONS now specifies no output *
200 * - Removed obsolete SYS_MACLSC version *
201 * 21-Apr-01 : - Added code to satisfy compilation into Magma. This *
202 * is activated by defining NAUTY_IN_MAGMA above. *
203 * - The *_null routines no longer exist *
204 * - Default maxinvarlevel is now 1. (This has no effect *
205 * unless an invariant is specified.) *
206 * - Now labelorg has a concrete declaration in nautil.c *
207 * and EXTDEFS is not needed *
208 * 5-May-01 : - NILFUNCTION, NILSET, NILGRAPH now obsolete. Use NULL. *
209 * 11-Sep-01 : - setword is unsigned int in the event that UINT_MAX *
210 * is defined and indicates it is big enough *
211 * 17-Oct-01 : - major rewrite for 2.1. SYS_* variables gone! *
212 * Some modernity assumed, eg size_t *
213 * 8-Aug-02 : - removed MAKEEMPTY (use EMPTYSET instead) *
214 * - deleted OLDNAUTY everywhere *
215 * 27-Aug-02 : - converted to use autoconf. Now the original of this *
216 * file is nauty-h.in. Run configure to make nauty.h. *
217 * 20-Dec-02 : - increased INFINITY *
218 * some reorganization to please Magma *
219 * - declared nauty_freedyn() *
220 * 17-Nov-03 : - renamed INFINITY to NAUTY_INFINITY *
221 * 29-May-04 : - added definition of SETWORD_FORMAT *
222 * 14-Sep-04 : - extended prototypes even to recursive functions *
223 * 16-Oct-04 : - added DEFAULTOPTIONS_GRAPH *
224 * 24-Oct-04 : Starting 2.3 *
225 * - remove register declarations as modern compilers *
226 * tend to find them a nuisance *
227 * - Don't define the obsolete symbol INFINITY if it is *
228 * defined already *
229 * *
230 *****************************************************************************/
231 
232 /*****************************************************************************
233 * *
234 * 16-bit, 32-bit and 64-bit versions can be selected by defining WORDSIZE. *
235 * The largest graph that can be handled has MAXN vertices. *
236 * Both WORDSIZE and MAXN can be defined on the command line. *
237 * WORDSIZE must be 16, 32 or 64; MAXN must be <= NAUTY_INFINITY - 2; *
238 * *
239 * With a very slight loss of efficiency (depending on platform), nauty *
240 * can be compiled to dynamically allocate arrays. Predefine MAXN=0 to *
241 * achieve this effect, which is default behaviour from version 2.0. *
242 * In that case, graphs of size up to NAUTY_INFINITY-2 can be handled *
243 * if the the memory is available. *
244 * *
245 * If only very small graphs need to be processed, use MAXN<=WORDSIZE *
246 * since this causes substantial code optimizations. *
247 * *
248 * Conventions and Assumptions: *
249 * *
250 * A 'setword' is the chunk of memory that is occupied by one part of *
251 * a set. This is assumed to be >= WORDSIZE bits in size. *
252 * *
253 * The rightmost (loworder) WORDSIZE bits of setwords are numbered *
254 * 0..WORDSIZE-1, left to right. It is necessary that the 2^WORDSIZE *
255 * setwords with the other bits zero are totally ordered under <,=,>. *
256 * This needs care on a 1's-complement machine. *
257 * *
258 * The int variables m and n have consistent meanings throughout. *
259 * Graphs have n vertices always, and sets have m setwords always. *
260 * *
261 * A 'set' consists of m contiguous setwords, whose bits are numbered *
262 * 0,1,2,... from left (high-order) to right (low-order), using only *
263 * the rightmost WORDSIZE bits of each setword. It is used to *
264 * represent a subset of {0,1,...,n-1} in the usual way - bit number x *
265 * is 1 iff x is in the subset. Bits numbered n or greater, and *
266 * unnumbered bits, are assumed permanently zero. *
267 * *
268 * A 'graph' consists of n contiguous sets. The i-th set represents *
269 * the vertices adjacent to vertex i, for i = 0,1,...,n-1. *
270 * *
271 * A 'permutation' is an array of n short ints (ints in the case that *
272 * BIGNAUTY is defined) , repesenting a permutation of the set *
273 * {0,1,...,n-1}. The value of the i-th entry is the number to which *
274 * i is mapped. *
275 * *
276 * If g is a graph and p is a permutation, then g^p is the graph in *
277 * which vertex i is adjacent to vertex j iff vertex p[i] is adjacent *
278 * to vertex p[j] in g. *
279 * *
280 * A partition nest is represented by a pair (lab,ptn), where lab and ptn *
281 * are int arrays. The "partition at level x" is the partition whose *
282 * cells are {lab[i],lab[i+1],...,lab[j]}, where [i,j] is a maximal *
283 * subinterval of [0,n-1] such that ptn[k] > x for i <= k < j and *
284 * ptn[j] <= x. The partition at level 0 is given to nauty by the user. *
285 * This is refined for the root of the tree, which has level 1. *
286 * *
287 *****************************************************************************/
288 
289 #ifdef BIGNAUTY
290 #define NAUTYVERSIONID 2201 /* 1000 times the version number */
291 #define NAUTYREQUIRED 2201 /* Minimum compatible version */
292 #else
293 #define NAUTYVERSIONID 2200
294 #define NAUTYREQUIRED 2200
295 #endif
296 
297 #ifndef NAUTY_IN_MAGMA
298 #if HAVE_SYSTYPES_H
299 #include <sys/types.h>
300 #endif
301 #if HAVE_UNISTD_H
302 #include <unistd.h>
303 #endif
304 #if HAVE_STDDEF_H
305 #include <stddef.h>
306 #endif
307 #if HAVE_STDLIB_H
308 #include <stdlib.h>
309 #endif
310 #if HAVE_STRING_H
311 #include <string.h>
312 #else
313 #include <strings.h>
314 #endif
315 #endif
316 
317 /* WORDSIZE is the number of set elements per setword (16, 32 or 64).
318  Starting at version 2.2, WORDSIZE and setword are defined as follows:
319  If WORDSIZE is so far undefined, use 32 unless longs have more
320  than 32 bits, in which case use 64.
321  Define setword thus:
322  WORDSIZE==16 : unsigned short
323  WORDSIZE==32 : unsigned int unless it is too small,
324  in which case unsigned long
325  WORDSIZE==64 : the first of unsigned int, unsigned long,
326  unsigned long long, which is large enough.
327 */
328 
329 #ifdef NAUTY_IN_MAGMA
330 #undef WORDSIZE
331 #define WORDSIZE WORDBITS
332 #endif
333 
334 #ifdef WORDSIZE
335 
336 #if (WORDSIZE != 16) && (WORDSIZE != 32) && (WORDSIZE != 64)
337  #error "WORDSIZE must be 16, 32 or 64"
338 #endif
339 
340 #else /* WORDSIZE undefined */
341 
342 #if SIZEOF_LONG>4
343 #define WORDSIZE 64
344 #else
345 #define WORDSIZE 32
346 #endif
347 
348 #endif /* WORDSIZE */
349 
350 #if defined(BIGNAUTY) && (WORDSIZE==16)
351  #error "BIGNAUTY requires WORDSIZE 32 or 64"
352 #endif
353 
354 #ifdef NAUTY_IN_MAGMA
355 typedef t_uint setword;
356 #define SETWORD_INT /* Don't assume this is correct in Magma. */
357 
358 #else /* NAUTY_IN_MAGMA */
359 
360 #if WORDSIZE==16
361 typedef unsigned short setword;
362 #define SETWORD_SHORT
363 #endif
364 
365 #if WORDSIZE==32
366 #if SIZEOF_INT>=4
367 typedef unsigned int setword;
368 #define SETWORD_INT
369 #else
370 typedef unsigned long setword;
371 #define SETWORD_LONG
372 #endif
373 #endif
374 
375 #if WORDSIZE==64
376 #if SIZEOF_INT>=8
377 typedef unsigned int setword;
378 #define SETWORD_INT
379 #else
380 #if SIZEOF_LONG>=8
381 typedef unsigned long setword;
382 #define SETWORD_LONG
383 #else
384 typedef unsigned long long setword;
385 #define SETWORD_LONGLONG
386 #endif
387 #endif
388 #endif
389 
390 #endif /* NAUTY_IN_MAGMA else */
391 
392 #if WORDSIZE==16
393 #define NAUTYVERSION "2.2 (16 bits)"
394 #endif
395 #if WORDSIZE==32
396 #define NAUTYVERSION "2.2 (32 bits)"
397 #endif
398 #if WORDSIZE==64
399 #define NAUTYVERSION "2.2 (64 bits)"
400 #endif
401 
402 #ifndef MAXN /* maximum allowed n value; use 0 for dynamic sizing. */
403 #define MAXN 0
404 #define MAXM 0
405 #else
406 #define MAXM ((MAXN+WORDSIZE-1)/WORDSIZE) /* max setwords in a set */
407 #endif /* MAXN */
408 
409 /* Starting at version 2.2, set operations work for all set sizes unless
410  ONE_WORD_SETS is defined. In the latter case, if MAXM=1, set ops
411  work only for single-setword sets. In any case, macro versions
412  ending with 1 work for single-setword sets and versions ending with
413  0 work for all set sizes.
414 */
415 
416 #if WORDSIZE==16
417 #define SETWD(pos) ((pos)>>4) /* number of setword containing bit pos */
418 #define SETBT(pos) ((pos)&0xF) /* position within setword of bit pos */
419 #define TIMESWORDSIZE(w) ((w)<<4)
420 #endif
421 
422 #if WORDSIZE==32
423 #define SETWD(pos) ((pos)>>5)
424 #define SETBT(pos) ((pos)&0x1F)
425 #define TIMESWORDSIZE(w) ((w)<<5)
426 #endif
427 
428 #if WORDSIZE==64
429 #define SETWD(pos) ((pos)>>6)
430 #define SETBT(pos) ((pos)&0x3F)
431 #define TIMESWORDSIZE(w) ((w)<<6) /* w*WORDSIZE */
432 #endif
433 
434 #ifdef NAUTY_IN_MAGMA
435 #define BITT bs_bit
436 #else
437 #define BITT bit
438 #endif
439 
440 #define ADDELEMENT1(setadd,pos) (*(setadd) |= BITT[pos])
441 #define DELELEMENT1(setadd,pos) (*(setadd) &= ~BITT[pos])
442 #define FLIPELEMENT1(setadd,pos) (*(setadd) ^= BITT[pos])
443 #define ISELEMENT1(setadd,pos) ((*(setadd) & BITT[pos]) != 0)
444 #define EMPTYSET1(setadd,m) *(setadd) = 0;
445 #define GRAPHROW1(g,v,m) ((set*)(g) + (v))
446 
447 #define ADDELEMENT0(setadd,pos) ((setadd)[SETWD(pos)] |= BITT[SETBT(pos)])
448 #define DELELEMENT0(setadd,pos) ((setadd)[SETWD(pos)] &= ~BITT[SETBT(pos)])
449 #define FLIPELEMENT0(setadd,pos) ((setadd)[SETWD(pos)] ^= BITT[SETBT(pos)])
450 #define ISELEMENT0(setadd,pos) (((setadd)[SETWD(pos)] & BITT[SETBT(pos)]) != 0)
451 #define EMPTYSET0(setadd,m) \
452  {setword *es; \
453  for (es = (setword*)(setadd)+(m); --es >= (setword*)(setadd);) *es=0;}
454 #define GRAPHROW0(g,v,m) ((set*)(g) + (long)(v)*(long)(m))
455 
456 #if (MAXM==1) && defined(ONE_WORD_SETS)
457 #define ADDELEMENT ADDELEMENT1
458 #define DELELEMENT DELELEMENT1
459 #define FLIPELEMENT FLIPELEMENT1
460 #define ISELEMENT ISELEMENT1
461 #define EMPTYSET EMPTYSET1
462 #define GRAPHROW GRAPHROW1
463 #else
464 #define ADDELEMENT ADDELEMENT0
465 #define DELELEMENT DELELEMENT0
466 #define FLIPELEMENT FLIPELEMENT0
467 #define ISELEMENT ISELEMENT0
468 #define EMPTYSET EMPTYSET0
469 #define GRAPHROW GRAPHROW0
470 #endif
471 
472 #ifdef NAUTY_IN_MAGMA
473 #undef EMPTYSET
474 #define EMPTYSET(setadd,m) {t_int _i; bsp_makeempty(setadd,m,_i);}
475 #endif
476 
477 #define NOTSUBSET(word1,word2) ((word1) & ~(word2)) /* test if the 1-bits
478  in setword word1 do not form a subset of those in word2 */
479 #define INTERSECT(word1,word2) ((word1) &= (word2)) /* AND word2 into word1 */
480 #define UNION(word1,word2) ((word1) |= (word2)) /* OR word2 into word1 */
481 #define SETDIFF(word1,word2) ((word1) &= ~(word2)) /* - word2 into word1 */
482 #define XOR(word1,word2) ((word1) ^= (word2)) /* XOR word2 into word1 */
483 #define ZAPBIT(word,x) ((word) &= ~BITT[x]) /* delete bit x in setword */
484 #define TAKEBIT(iw,w) {iw = FIRSTBIT(w); w ^= BITT[iw];}
485 
486 #ifdef SETWORD_LONGLONG
487 #define MSK3232 0xFFFFFFFF00000000ULL
488 #define MSK1648 0xFFFF000000000000ULL
489 #define MSK0856 0xFF00000000000000ULL
490 #define MSK1632 0x0000FFFF00000000ULL
491 #define MSK0840 0xFF0000000000ULL
492 #define MSK1616 0xFFFF0000ULL
493 #define MSK0824 0xFF000000ULL
494 #define MSK0808 0xFF00ULL
495 #define MSK63C 0x7FFFFFFFFFFFFFFFULL
496 #define MSK31C 0x7FFFFFFFULL
497 #define MSK15C 0x7FFFULL
498 #define MSK64 0xFFFFFFFFFFFFFFFFULL
499 #define MSK32 0xFFFFFFFFULL
500 #define MSK16 0xFFFFULL
501 #endif
502 
503 #ifdef SETWORD_LONG
504 #define MSK3232 0xFFFFFFFF00000000UL
505 #define MSK1648 0xFFFF000000000000UL
506 #define MSK0856 0xFF00000000000000UL
507 #define MSK1632 0x0000FFFF00000000UL
508 #define MSK0840 0xFF0000000000UL
509 #define MSK1616 0xFFFF0000UL
510 #define MSK0824 0xFF000000UL
511 #define MSK0808 0xFF00UL
512 #define MSK63C 0x7FFFFFFFFFFFFFFFUL
513 #define MSK31C 0x7FFFFFFFUL
514 #define MSK15C 0x7FFFUL
515 #define MSK64 0xFFFFFFFFFFFFFFFFUL
516 #define MSK32 0xFFFFFFFFUL
517 #define MSK16 0xFFFFUL
518 #endif
519 
520 #if defined(SETWORD_INT) || defined(SETWORD_SHORT)
521 #define MSK3232 0xFFFFFFFF00000000U
522 #define MSK1648 0xFFFF000000000000U
523 #define MSK0856 0xFF00000000000000U
524 #define MSK1632 0x0000FFFF00000000U
525 #define MSK0840 0xFF0000000000U
526 #define MSK1616 0xFFFF0000U
527 #define MSK0824 0xFF000000U
528 #define MSK0808 0xFF00U
529 #define MSK63C 0x7FFFFFFFFFFFFFFFU
530 #define MSK31C 0x7FFFFFFFU
531 #define MSK15C 0x7FFFU
532 #define MSK64 0xFFFFFFFFFFFFFFFFU
533 #define MSK32 0xFFFFFFFFU
534 #define MSK16 0xFFFFU
535 #endif
536 
537 #if defined(SETWORD_LONGLONG)
538 #if WORDSIZE==16
539 #define SETWORD_FORMAT "%04llx"
540 #endif
541 #if WORDSIZE==32
542 #define SETWORD_FORMAT "%08llx"
543 #endif
544 #if WORDSIZE==64
545 #define SETWORD_FORMAT "%16llx"
546 #endif
547 #endif
548 
549 #if defined(SETWORD_LONG)
550 #if WORDSIZE==16
551 #define SETWORD_FORMAT "%04lx"
552 #endif
553 #if WORDSIZE==32
554 #define SETWORD_FORMAT "%08lx"
555 #endif
556 #if WORDSIZE==64
557 #define SETWORD_FORMAT "%16lx"
558 #endif
559 #endif
560 
561 #if defined(SETWORD_INT)
562 #if WORDSIZE==16
563 #define SETWORD_FORMAT "%04x"
564 #endif
565 #if WORDSIZE==32
566 #define SETWORD_FORMAT "%08x"
567 #endif
568 #if WORDSIZE==64
569 #define SETWORD_FORMAT "%16x"
570 #endif
571 #endif
572 
573 #if defined(SETWORD_SHORT)
574 #if WORDSIZE==16
575 #define SETWORD_FORMAT "%04hx"
576 #endif
577 #if WORDSIZE==32
578 #define SETWORD_FORMAT "%08hx"
579 #endif
580 #if WORDSIZE==64
581 #define SETWORD_FORMAT "%16hx"
582 #endif
583 #endif
584 
585 /* POPCOUNT(x) = number of 1-bits in a setword x
586  POPCOUNT(x) = number of first 1-bit in non-zero setword (0..WORDSIZE-1)
587  BITMASK(x) = setword whose rightmost WORDSIZE-x-1 (numbered) bits
588  are 1 and the rest 0 (0 <= x < WORDSIZE)
589  ALLBITS = all (numbered) bits in a setword */
590 
591 #if WORDSIZE==64
592 #define POPCOUNT(x) (bytecount[(x)>>56 & 0xFF] + bytecount[(x)>>48 & 0xFF] \
593  + bytecount[(x)>>40 & 0xFF] + bytecount[(x)>>32 & 0xFF] \
594  + bytecount[(x)>>24 & 0xFF] + bytecount[(x)>>16 & 0xFF] \
595  + bytecount[(x)>>8 & 0xFF] + bytecount[(x) & 0xFF])
596 #define FIRSTBIT(x) ((x) & MSK3232 ? \
597  (x) & MSK1648 ? \
598  (x) & MSK0856 ? \
599  0+leftbit[((x)>>56) & 0xFF] : \
600  8+leftbit[(x)>>48] \
601  : (x) & MSK0840 ? \
602  16+leftbit[(x)>>40] : \
603  24+leftbit[(x)>>32] \
604  : (x) & MSK1616 ? \
605  (x) & MSK0824 ? \
606  32+leftbit[(x)>>24] : \
607  40+leftbit[(x)>>16] \
608  : (x) & MSK0808 ? \
609  48+leftbit[(x)>>8] : \
610  56+leftbit[x])
611 #define BITMASK(x) (MSK63C >> (x))
612 #define ALLBITS MSK64
613 #define SWCHUNK0(w) ((long)((w)>>48)&0xFFFFL)
614 #define SWCHUNK1(w) ((long)((w)>>32)&0xFFFFL)
615 #define SWCHUNK2(w) ((long)((w)>>16)&0xFFFFL)
616 #define SWCHUNK3(w) ((long)(w)&0xFFFFL)
617 #endif
618 
619 #if WORDSIZE==32
620 #define POPCOUNT(x) (bytecount[(x)>>24 & 0xFF] + bytecount[(x)>>16 & 0xFF] \
621  + bytecount[(x)>>8 & 0xFF] + bytecount[(x) & 0xFF])
622 #define FIRSTBIT(x) ((x) & MSK1616 ? ((x) & MSK0824 ? \
623  leftbit[((x)>>24) & 0xFF] : 8+leftbit[(x)>>16]) \
624  : ((x) & MSK0808 ? 16+leftbit[(x)>>8] : 24+leftbit[x]))
625 #define BITMASK(x) (MSK31C >> (x))
626 #define ALLBITS MSK32
627 #define SWCHUNK0(w) ((long)((w)>>16)&0xFFFFL)
628 #define SWCHUNK1(w) ((long)(w)&0xFFFFL)
629 #endif
630 
631 #if WORDSIZE==16
632 #define POPCOUNT(x) (bytecount[(x)>>8 & 0xFF] + bytecount[(x) & 0xFF])
633 #define FIRSTBIT(x) ((x) & MSK0808 ? leftbit[((x)>>8) & 0xFF] : 8+leftbit[x])
634 #define BITMASK(x) (MSK15C >> (x))
635 #define ALLBITS MSK16
636 #define SWCHUNK0(w) ((long)(w)&0xFFFFL)
637 #endif
638 
639 #ifdef SYS_CRAY
640 #undef POPCOUNT
641 #undef FIRSTBIT
642 #undef BITMASK
643 #define POPCOUNT(x) _popcnt(x)
644 #define FIRSTBIT(x) _leadz(x)
645 #define BITMASK(x) _mask(65+(x))
646 #endif
647 
648 #ifdef NAUTY_IN_MAGMA
649 #undef POPCOUNT
650 #undef FIRSTBIT
651 #undef BITMASK
652 #define POPCOUNT(x) bs_popcount(x)
653 #define FIRSTBIT(x) bs_firstbit(x)
654 #define BITMASK(x) bs_bitmask(x)
655 #endif
656 
657 #define ALLMASK(n) ((n)?~BITMASK((n)-1):(setword)0) /* First n bits */
658 
659  /* various constants: */
660 #undef FALSE
661 #undef TRUE
662 #define FALSE 0
663 #define TRUE 1
664 
665 #ifdef BIGNAUTY
666 #define NAUTY_INFINITY 0xFFFFFFF /* positive int greater than MAXN+2 */
667 typedef int shortish;
668 #else
669 #define NAUTY_INFINITY 0x7FFF /* positive short int greater than MAXN+2 */
670 typedef short shortish;
671 #endif
672 
673 /* For backward compatibility: */
674 #if !HAS_MATH_INF && !defined(INFINITY)
675 #define INFINITY NAUTY_INFINITY
676 #endif
677 
678 #if MAXN > NAUTY_INFINITY-3
679  #error MAXN must be at most NAUTY_INFINITY-3
680 #endif
681 
682  /* typedefs for sets, graphs, permutations, etc.: */
683 
684 typedef int boolean; /* boolean MUST be the same as int */
685 
686 #define UPROC void /* obsolete */
687 
688 typedef setword set,graph;
689 typedef int nvector,np2vector; /* obsolete */
690 typedef shortish permutation;
691 #ifdef NAUTY_IN_MAGMA
692 typedef graph nauty_graph;
693 typedef set nauty_set;
694 #endif
695 
696 typedef struct
697 {
698  double grpsize1; /* size of group is */
699  int grpsize2; /* grpsize1 * 10^grpsize2 */
700 #define groupsize1 grpsize1 /* for backwards compatibility */
701 #define groupsize2 grpsize2
702  int numorbits; /* number of orbits in group */
703  int numgenerators; /* number of generators found */
704  int errstatus; /* if non-zero : an error code */
705 #define outofspace errstatus; /* for backwards compatibility */
706  long numnodes; /* total number of nodes */
707  long numbadleaves; /* number of leaves of no use */
708  int maxlevel; /* maximum depth of search */
709  long tctotal; /* total size of all target cells */
710  long canupdates; /* number of updates of best label */
711  long invapplics; /* number of applications of invarproc */
712  long invsuccesses; /* number of successful applics of invarproc() */
713  int invarsuclevel; /* least level where invarproc worked */
714 } statsblk;
715 
716 /* codes for errstatus field (see nauty.c for more accurate descriptions): */
717 #define NTOOBIG 1 /* n > MAXN or n > WORDSIZE*m */
718 #define MTOOBIG 2 /* m > MAXM */
719 #define CANONGNIL 3 /* canong = NULL, but getcanon = TRUE */
720 
721 /* manipulation of real approximation to group size */
722 #define MULTIPLY(s1,s2,i) if ((s1 *= i) >= 1e10) {s1 /= 1e10; s2 += 10;}
723 
724 typedef struct
725 {
726  boolean (*isautom) /* test for automorphism */
727  (graph*,permutation*,boolean,int,int);
728  int (*testcanlab) /* test for better labelling */
729  (graph*,graph*,int*,int*,int,int);
730  void (*updatecan) /* update canonical object */
731  (graph*,graph*,permutation*,int,int,int);
732  void (*refine) /* refine partition */
733  (graph*,int*,int*,int,int*,permutation*,set*,int*,int,int);
734  void (*refine1) /* refine partition, MAXM==1 */
735  (graph*,int*,int*,int,int*,permutation*,set*,int*,int,int);
736  boolean (*cheapautom) /* test for easy automorphism */
737  (int*,int,boolean,int);
738  int (*bestcell) /* find best cell to split */
739  (graph*,int*,int*,int,int,int,int);
740  void (*freedyn)(void); /* free dynamic memory */
741  void (*check) /* check compilation parameters */
742  (int,int,int,int);
743  void (*dv_spare1)();
744  void (*dv_spare2)();
745 } dispatchvec;
746 
747 typedef struct
748 {
749  int getcanon; /* make canong and canonlab? */
750 #define LABELONLY 2 /* new value UNIMPLEMENTED */
751  boolean digraph; /* multiple edges or loops? */
752  boolean writeautoms; /* write automorphisms? */
753  boolean writemarkers; /* write stats on pts fixed, etc.? */
754  boolean defaultptn; /* set lab,ptn,active for single cell? */
755  boolean cartesian; /* use cartesian rep for writing automs? */
756  int linelength; /* max chars/line (excl. '\n') for output */
757  FILE *outfile; /* file for output, if any */
758  void (*userrefproc) /* replacement for usual refine procedure */
759  (graph*,int*,int*,int,int*,permutation*,set*,int*,int,int);
760  void (*userautomproc) /* procedure called for each automorphism */
761  (int,permutation*,int*,int,int,int);
762  void (*userlevelproc) /* procedure called for each level */
763  (int*,int*,int,int*,statsblk*,int,int,int,int,int,int);
764  void (*usernodeproc) /* procedure called for each node */
765  (graph*,int*,int*,int,int,int,int,int,int);
766  void (*usertcellproc) /* replacement for targetcell procedure */
767  (graph*,int*,int*,int,int,set*,int*,int*,int,int,
768  int(*)(graph*,int*,int*,int,int,int,int),int,int);
769  void (*invarproc) /* procedure to compute vertex-invariant */
770  (graph*,int*,int*,int,int,int,permutation*,int,boolean,int,int);
771  int tc_level; /* max level for smart target cell choosing */
772  int mininvarlevel; /* min level for invariant computation */
773  int maxinvarlevel; /* max level for invariant computation */
774  int invararg; /* value passed to (*invarproc)() */
775  dispatchvec *dispatch; /* vector of object-specific routines */
776 #ifdef NAUTY_IN_MAGMA
777  boolean print_stats; /* CAYLEY specfic - GYM Sep 1990 */
778  char *invarprocname; /* Magma - no longer global sjc 1994 */
779  int lab_h; /* Magma - no longer global sjc 1994 */
780  int ptn_h; /* Magma - no longer global sjc 1994 */
781  int orbitset_h; /* Magma - no longer global sjc 1994 */
782 #endif
783 } optionblk;
784 
785 #ifndef CONSOLWIDTH
786 #define CONSOLWIDTH 78
787 #endif
788 
789 /* The following are obsolete. Just use NULL. */
790 #define NILFUNCTION ((void(*)())NULL) /* nil pointer to user-function */
791 #define NILSET ((set*)NULL) /* nil pointer to set */
792 #define NILGRAPH ((graph*)NULL) /* nil pointer to graph */
793 
794 #define DEFAULTOPTIONS_GRAPH(options) optionblk options = \
795  {0,FALSE,FALSE,FALSE,TRUE,FALSE,CONSOLWIDTH, \
796  NULL,NULL,NULL,NULL,NULL,NULL,NULL,100,0,1,0,&dispatch_graph}
797 
798 #ifndef DEFAULTOPTIONS
799 #define DEFAULTOPTIONS DEFAULTOPTIONS_GRAPH
800 #endif
801 
802 #ifdef NAUTY_IN_MAGMA
803 #define PUTC(c,f) io_putchar(c)
804 #else
805 #ifdef IS_JAVA
806 extern void javastream(FILE* f,char c);
807 #define PUTC(c,f) javastream(f,c)
808 #else
809 #define PUTC(c,f) putc(c,f)
810 #endif
811 #endif
812 
813 /* We hope that malloc, free, realloc are declared either in <stdlib.h>
814  or <malloc.h>. Otherwise we will define them. We also assume that
815  size_t has been defined by the time we get to define malloc(). */
816 #ifndef NAUTY_IN_MAGMA
817 #if MALLOC_DEC==2
818 #include <malloc.h>
819 #endif
820 #if MALLOC_DEC==0
821 extern void *malloc(size_t);
822 extern void *realloc(void*,size_t);
823 extern void free(void*);
824 #endif
825 #endif
826 
827 /* ALLOCS(x,y) should return a pointer (any pointer type) to x*y units of new
828  storage, not necessarily initialised. A "unit" of storage is defined by
829  the sizeof operator. x and y are integer values of type int or larger,
830  but x*y may well be too large for an int. The macro should cast to the
831  correct type for the call. On failure, ALLOCS(x,y) should return a NULL
832  pointer. FREES(p) should free storage previously allocated by ALLOCS,
833  where p is the value that ALLOCS returned. */
834 
835 #ifdef NAUTY_IN_MAGMA
836 #define ALLOCS(x,y) mem_malloc((size_t)(x)*(size_t)(y))
837 #define REALLOCS(p,x) mem_realloc(p,(size_t)(x))
838 #define FREES(p) mem_free(p)
839 #else
840 #define ALLOCS(x,y) malloc((size_t)(x)*(size_t)(y))
841 #define REALLOCS(p,x) realloc(p,(size_t)(x))
842 #define FREES(p) free(p)
843 #endif
844 
845 /* The following macros are used by nauty if MAXN=0. They dynamically
846  allocate arrays of size dependent on m or n. For each array there
847  should be two static variables:
848  type *name;
849  size_t name_sz;
850  "name" will hold a pointer to an allocated array. "name_sz" will hold
851  the size of the allocated array in units of sizeof(type). DYNALLSTAT
852  declares both variables and initialises name_sz=0. DYNALLOC1 and
853  DYNALLOC2 test if there is enough space allocated, and if not free
854  the existing space and allocate a bigger space. The allocated space
855  is not initialised.
856 
857  In the case of DYNALLOC1, the space is allocated using
858  ALLOCS(sz,sizeof(type)).
859  In the case of DYNALLOC2, the space is allocated using
860  ALLOCS(sz1,sz2*sizeof(type)).
861 
862  DYNREALLOC is like DYNALLOC1 except that the old contents are copied
863  into the new space. realloc() is assumed. This is not currently
864  used by nauty or dreadnaut.
865 
866  DYNFREE frees any allocated array and sets name_sz back to 0.
867  CONDYNFREE does the same, but only if name_sz exceeds some limit.
868 */
869 
870 #define DYNALLSTAT(type,name,name_sz) \
871  static type *name; static size_t name_sz=0
872 #define DYNALLOC1(type,name,name_sz,sz,msg) \
873  if ((size_t)(sz) > name_sz) \
874  { if (name_sz) FREES(name); name_sz = (sz); \
875  if ((name=(type*)ALLOCS(sz,sizeof(type))) == NULL) {alloc_error(msg);}}
876 #define DYNALLOC2(type,name,name_sz,sz1,sz2,msg) \
877  if ((size_t)(sz1)*(size_t)(sz2) > name_sz) \
878  { if (name_sz) FREES(name); name_sz = (size_t)(sz1)*(size_t)(sz2); \
879  if ((name=(type*)ALLOCS((sz1),(sz2)*sizeof(type))) == NULL) \
880  {alloc_error(msg);}}
881 #define DYNREALLOC(type,name,name_sz,sz,msg) \
882  {if ((size_t)(sz) > name_sz) \
883  { if ((name = (type*)REALLOCS(name,(sz)*sizeof(type))) == NULL) \
884  {alloc_error(msg);} else name_sz = (sz);}}
885 #define DYNFREE(name,name_sz) if (name_sz) {FREES(name); name_sz = 0;}
886 #define CONDYNFREE(name,name_sz,minsz) \
887  if (name_sz > (size_t)(minsz)) {FREES(name); name_sz = 0;}
888 
889 /* File to write error messages to (used as first argument to fprintf()). */
890 #define ERRFILE stderr
891 
892 #ifdef OLDEXTDEFS
893 #define EXTDEF_CLASS
894 #ifdef EXTDEFS
895 #define EXTDEF_TYPE 1
896 #else
897 #define EXTDEF_TYPE 2
898 #endif
899 #else
900 #define EXTDEF_CLASS static
901 #define EXTDEF_TYPE 2
902 #endif
903 
904 extern int labelorg; /* Declared in nautil.c */
905 
906 #ifndef NAUTY_IN_MAGMA
907  /* Things equivalent to bit, bytecount, leftbit are defined
908  in bs.h for Magma. */
909 #if EXTDEF_TYPE==1
910 extern setword bit[];
911 extern int bytecount[];
912 extern int leftbit[];
913 
914 #else
915  /* array giving setwords with single 1-bit */
916 #if WORDSIZE==64
917 #ifdef SETWORD_LONGLONG
918 EXTDEF_CLASS
919 setword bit[] = {01000000000000000000000LL,0400000000000000000000LL,
920  0200000000000000000000LL,0100000000000000000000LL,
921  040000000000000000000LL,020000000000000000000LL,
922  010000000000000000000LL,04000000000000000000LL,
923  02000000000000000000LL,01000000000000000000LL,
924  0400000000000000000LL,0200000000000000000LL,
925  0100000000000000000LL,040000000000000000LL,
926  020000000000000000LL,010000000000000000LL,
927  04000000000000000LL,02000000000000000LL,
928  01000000000000000LL,0400000000000000LL,0200000000000000LL,
929  0100000000000000LL,040000000000000LL,020000000000000LL,
930  010000000000000LL,04000000000000LL,02000000000000LL,
931  01000000000000LL,0400000000000LL,0200000000000LL,
932  0100000000000LL,040000000000LL,020000000000LL,010000000000LL,
933  04000000000LL,02000000000LL,01000000000LL,0400000000LL,
934  0200000000LL,0100000000LL,040000000LL,020000000LL,
935  010000000LL,04000000LL,02000000LL,01000000LL,0400000LL,
936  0200000LL,0100000LL,040000LL,020000LL,010000LL,04000LL,
937  02000LL,01000LL,0400LL,0200LL,0100LL,040LL,020LL,010LL,
938  04LL,02LL,01LL};
939 #else
940 
941 EXTDEF_CLASS
942 setword bit[] = {01000000000000000000000,0400000000000000000000,
943  0200000000000000000000,0100000000000000000000,
944  040000000000000000000,020000000000000000000,
945  010000000000000000000,04000000000000000000,
946  02000000000000000000,01000000000000000000,
947  0400000000000000000,0200000000000000000,
948  0100000000000000000,040000000000000000,020000000000000000,
949  010000000000000000,04000000000000000,02000000000000000,
950  01000000000000000,0400000000000000,0200000000000000,
951  0100000000000000,040000000000000,020000000000000,
952  010000000000000,04000000000000,02000000000000,
953  01000000000000,0400000000000,0200000000000,0100000000000,
954  040000000000,020000000000,010000000000,04000000000,
955  02000000000,01000000000,0400000000,0200000000,0100000000,
956  040000000,020000000,010000000,04000000,02000000,01000000,
957  0400000,0200000,0100000,040000,020000,010000,04000,
958  02000,01000,0400,0200,0100,040,020,010,04,02,01};
959 
960 #endif
961 #endif
962 
963 #if WORDSIZE==32
964 EXTDEF_CLASS
965 setword bit[] = {020000000000,010000000000,04000000000,02000000000,
966  01000000000,0400000000,0200000000,0100000000,040000000,
967  020000000,010000000,04000000,02000000,01000000,0400000,
968  0200000,0100000,040000,020000,010000,04000,02000,01000,
969  0400,0200,0100,040,020,010,04,02,01};
970 #endif
971 
972 #if WORDSIZE==16
973 EXTDEF_CLASS
974 setword bit[] = {0100000,040000,020000,010000,04000,02000,01000,0400,0200,
975  0100,040,020,010,04,02,01};
976 #endif
977 
978  /* array giving number of 1-bits in bytes valued 0..255: */
979 EXTDEF_CLASS
980 int bytecount[] = {0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,
981  1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
982  1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
983  2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
984  1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
985  2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
986  2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
987  3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
988  1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
989  2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
990  2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
991  3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
992  2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
993  3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
994  3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
995  4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8};
996 
997  /* array giving position (1..7) of high-order 1-bit in byte: */
998 EXTDEF_CLASS
999 int leftbit[] = {8,7,6,6,5,5,5,5,4,4,4,4,4,4,4,4,
1000  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
1001  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
1002  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
1003  1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1004  1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1005  1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1006  1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1007  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1008  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1009  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1010  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1011  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1012  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1013  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1014  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
1015 #endif /* EXTDEFS */
1016 
1017 #endif /* not NAUTY_IN_MAGMA */
1018 
1019 #define ANSIPROT 1
1020 #define EXTPROC(func,args) extern func args; /* obsolete */
1021 
1022 /* The following is for C++ programs that read nauty.h. Compile nauty
1023  itself using C, not C++. */
1024 
1025 #ifdef __cplusplus
1026 extern "C" {
1027 #endif
1028 
1029 extern void alloc_error(char*);
1030 extern int bestcell(graph*,int*,int*,int,int,int,int);
1031 extern void breakout(int*,int*,int,int,int,set*,int);
1032 extern boolean cheapautom(int*,int,boolean,int);
1033 extern void doref(graph*,int*,int*,int,int*,int*,permutation*,set*,int*,
1034  void(*)(graph*,int*,int*,int,int*,permutation*,set*,int*,int,int),
1035  void(*)(graph*,int*,int*,int,int,int,permutation*,int,boolean,int,int),
1036  int,int,int,boolean,int,int);
1037 extern boolean isautom(graph*,permutation*,boolean,int,int);
1038 extern dispatchvec dispatch_graph;
1039 extern int itos(int,char*);
1040 extern void fmperm(permutation*,set*,set*,int,int);
1041 extern void fmptn(int*,int*,int,set*,set*,int,int);
1042 extern void longprune(set*,set*,set*,set*,int);
1043 extern void nauty(graph*,int*,int*,set*,int*,optionblk*,
1044  statsblk*,set*,int,int,int,graph*);
1045 extern int nextelement(set*,int,int);
1046 extern int orbjoin(int*,permutation*,int);
1047 extern void permset(set*,set*,int,permutation*);
1048 extern void putstring(FILE*,char*);
1049 extern void refine(graph*,int*,int*,int,int*,permutation*,set*,int*,int,int);
1050 extern void refine1(graph*,int*,int*,int,int*,permutation*,set*,int*,int,int);
1051 extern void shortprune(set*,set*,int);
1052 extern void targetcell(graph*,int*,int*,int,int,set*,int*,
1053  int*,int,int,int(*)(graph*,int*,int*,int,int,int,int),int,int);
1054 extern int testcanlab(graph*,graph*,int*,int*,int,int);
1055 extern void updatecan(graph*,graph*,permutation*,int,int,int);
1056 extern void writeperm(FILE*,permutation*,boolean,int,int);
1057 extern void nauty_freedyn(void);
1058 extern void nauty_check(int,int,int,int);
1059 extern void naugraph_check(int,int,int,int);
1060 extern void nautil_check(int,int,int,int);
1061 extern void nautil_freedyn(void);
1062 extern void naugraph_freedyn(void);
1063 
1064 #ifdef __cplusplus
1065 }
1066 #endif
1067 
1068 #endif /* _NAUTY_H_ */
Definition: nauty.h:747
Definition: nauty.h:724
Definition: nauty.h:696