diff --git a/src/digraphs-debug.h b/src/digraphs-debug.h index 8f660e574..d144cc2b2 100644 --- a/src/digraphs-debug.h +++ b/src/digraphs-debug.h @@ -21,10 +21,11 @@ #ifndef DIGRAPHS_SRC_DIGRAPHS_DEBUG_H_ #define DIGRAPHS_SRC_DIGRAPHS_DEBUG_H_ -#include -#include +// C headers +#include // for assert -#include "digraphs-config.h" +// Digraphs package headers +#include "digraphs-config.h" // for DIGRAPHS_KERNEL_DEBUG // DIGRAPHS_ASSERT is a version of 'assert' which is enabled by the // configure option --enable-debug diff --git a/src/digraphs.c b/src/digraphs.c index 6d1d7d544..f7a4b046e 100644 --- a/src/digraphs.c +++ b/src/digraphs.c @@ -12,7 +12,16 @@ ** *******************************************************************************/ -#include "src/digraphs.h" +#include "digraphs.h" + +#include +#include + +#include "bliss-0.73/bliss_C.h" + +#include "digraphs-debug.h" +#include "homos.h" +#include "planar.h" #undef PACKAGE #undef PACKAGE_BUGREPORT diff --git a/src/digraphs.h b/src/digraphs.h index fad324269..b28c1c4be 100644 --- a/src/digraphs.h +++ b/src/digraphs.h @@ -15,14 +15,8 @@ #ifndef DIGRAPHS_SRC_DIGRAPHS_H_ #define DIGRAPHS_SRC_DIGRAPHS_H_ -#include -#include -#include - -#include "bliss-0.73/bliss_C.h" - -#include "src/compiled.h" /* GAP headers */ -#include "src/homos.h" +// GAP headers +#include "src/compiled.h" // for Obj, Int Int DigraphNrVertices(Obj digraph); Int DigraphNrEdges(Obj digraph); diff --git a/src/homos.c b/src/homos.c index ebcc13fcf..96b0ff83e 100644 --- a/src/homos.c +++ b/src/homos.c @@ -9,8 +9,17 @@ ** ********************************************************************************/ -#include "src/homos.h" -#include "src/digraphs-config.h" +#include "homos.h" + +// C headers +#include // for setjmp + +// Bliss headers +#include "bliss-0.73/bliss_C.h" // for BlissGraph, . . . + +// Digraphs package headers +#include "digraphs-debug.h" // for DIGRAPHS_ASSERT +#include "schreier-sims.h" // for PermColl, . . . //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// @@ -109,33 +118,6 @@ static void init_mask(void) { //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// -// COUNT_TRUES_BLOCK: this is from gap/src/blister.h, it counts the number of -// bits in a block which are set to 1. -//////////////////////////////////////////////////////////////////////////////// - -static inline UInt COUNT_TRUES_BLOCK(UInt block) { -#if USE_POPCNT && defined(HAVE___BUILTIN_POPCOUNTL) - return __builtin_popcountl(block); -#else -#if SIZEOF_VOID_P == 8 - block = (block & 0x5555555555555555L) + ((block >> 1) & 0x5555555555555555L); - block = (block & 0x3333333333333333L) + ((block >> 2) & 0x3333333333333333L); - block = (block + (block >> 4)) & 0x0f0f0f0f0f0f0f0fL; - block = (block + (block >> 8)); - block = (block + (block >> 16)); - block = (block + (block >> 32)) & 0x00000000000000ffL; -#else - block = (block & 0x55555555) + ((block >> 1) & 0x55555555); - block = (block & 0x33333333) + ((block >> 2) & 0x33333333); - block = (block + (block >> 4)) & 0x0f0f0f0f; - block = (block + (block >> 8)); - block = (block + (block >> 16)) & 0x000000ff; -#endif - return block; -#endif -} - //////////////////////////////////////////////////////////////////////////////// // new_bit_array: get a pointer to a new BitArray with space for // bits, and with every bit set to false. @@ -597,8 +579,7 @@ inline static bool is_adjacent_digraph(Digraph* digraph, Vertex i, Vertex j) { //////////////////////////////////////////////////////////////////////////////// // new_bliss_digraphs_graph: get a new bliss (undirected, vertex coloured) -// digraph from -// the Digraph pointed to by . +// digraph from the Digraph pointed to by . //////////////////////////////////////////////////////////////////////////////// static BlissGraph* new_bliss_digraphs_graph_from_digraph(Digraph* digraph, diff --git a/src/homos.h b/src/homos.h index c8a59d76f..bc03dec55 100644 --- a/src/homos.h +++ b/src/homos.h @@ -12,11 +12,11 @@ #ifndef DIGRAPHS_SRC_HOMOS_H_ #define DIGRAPHS_SRC_HOMOS_H_ -#include -#include +// GAP headers +#include "src/compiled.h" -#include "bliss-0.73/bliss_C.h" -#include "src/schreier-sims.h" +// Digraphs package headers +#include "perms.h" // for UIntS void homo_hook_print(); typedef UIntS Vertex; diff --git a/src/perms.c b/src/perms.c index 686e23d5c..8dc831d21 100644 --- a/src/perms.c +++ b/src/perms.c @@ -11,7 +11,15 @@ ** This file is free software, see the digraphs/LICENSE. ** *******************************************************************************/ -#include "src/perms.h" + +#include "perms.h" + +// C headers +#include // for malloc, . . . +#include // memcpy + +// Digraphs package headers +#include "digraphs-debug.h" // for DIGRAPHS_ASSERT // variables for debugging memory leaks UIntL nr_ss_allocs; diff --git a/src/perms.h b/src/perms.h index f30f31ab4..df33dd8bc 100644 --- a/src/perms.h +++ b/src/perms.h @@ -15,11 +15,7 @@ #ifndef DIGRAPHS_SRC_PERMS_H_ #define DIGRAPHS_SRC_PERMS_H_ -#include -#include -#include -#include -#include +#include // for bool #define MAXVERTS 512 #define UNDEFINED MAXVERTS + 1 diff --git a/src/schreier-sims.c b/src/schreier-sims.c index c68853122..9a9edafda 100644 --- a/src/schreier-sims.c +++ b/src/schreier-sims.c @@ -12,7 +12,14 @@ ** *******************************************************************************/ -#include "src/schreier-sims.h" +#include "schreier-sims.h" + +// C headers +#include "stdlib.h" // for NULL +#include "string.h" // for memset + +// Digraphs package headers +#include "digraphs-debug.h" // for DIGRAPHS_ASSERT // Schreier-Sims set up diff --git a/src/schreier-sims.h b/src/schreier-sims.h index 777724c14..85fd7d88c 100644 --- a/src/schreier-sims.h +++ b/src/schreier-sims.h @@ -15,7 +15,7 @@ #ifndef DIGRAPHS_SRC_SCHREIER_SIMS_H_ #define DIGRAPHS_SRC_SCHREIER_SIMS_H_ -#include "src/perms.h" +#include "perms.h" // for PermColl and UIntS extern bool point_stabilizer(PermColl* gens, UIntS const pt, PermColl** out);