diff --git a/compileTimeOptions.h b/compileTimeOptions.h index 4ef5d52e7c6508c7d741330f5a66a857715fe80d..10fa76ac861c27825491a57e361739e1f59809ab 100644 --- a/compileTimeOptions.h +++ b/compileTimeOptions.h @@ -14,9 +14,9 @@ BOOL_OPTION(OPTIMIZE_COMBINE, 0) BOOL_OPTION(USE_NEXT_FORB, 1) -BOOL_OPTION(EXPLICIT_NOMAL_EDGES, 0) +BOOL_OPTION(EXPLICIT_NORMAL_EDGES, 0) REQUIRES(EXPLICIT_NORMAL_EDGES, USE_NEXT_FORB) BOOL_OPTION(USE_TWO_CUTS, 0) -REQUIRES(USE_TWO_CUTS, USE_NEXT_FORB && EXPLICIT_NOMAL_EDGES) +REQUIRES(USE_TWO_CUTS, USE_NEXT_FORB && EXPLICIT_NORMAL_EDGES) diff --git a/group-connectivity.h b/group-connectivity.h index f7950ac2acca45ef71704178aa66049834637bdc..fc1b5082ea56a2d6630462d09a0e2e1738053c5b 100644 --- a/group-connectivity.h +++ b/group-connectivity.h @@ -44,6 +44,9 @@ struct Tester : public AbstractTester { std::vector<EdgeId> classEdges; std::vector< std::pair<EdgeId, Mapping> > nonClassEdges; +# if EXPLICIT_NORMAL_EDGES + std::vector< EdgeId > normalEdges; +# endif virtual void init( int edges_, @@ -75,12 +78,22 @@ struct Tester : public AbstractTester { map.assign(edge, neg ? Ring::one : Ring::negate(Ring::one)); } } + +# if EXPLICIT_NORMAL_EDGES + std::vector<bool> edgeList(edges, 1); + for (size_t i = 0; i < edges; i++) + if (edgeList[i]) normalEdges.push_back(i); +# endif } #if USE_NEXT_FORB bool nextForb(Mapping& forb) { +# if EXPLICIT_NORMAL_EDGES + for (auto i : normalEdges) { +# else for (size_t i = 0; i < edges; i++) { +# endif T v = forb[i] + 1; if (v >= Ring::size) { forb.assign(i, 1);