diff --git a/compileTimeOptions.h b/compileTimeOptions.h
index 4b32d858a5135937d2ca727bc610df329f31b17e..526e6ec2611f3897ca3c7e148c6c7109d985f1ad 100644
--- a/compileTimeOptions.h
+++ b/compileTimeOptions.h
@@ -20,3 +20,6 @@ REQUIRES(EXPLICIT_NORMAL_EDGES, USE_NEXT_FORB)
BOOL_OPTION(USE_TWO_CUTS, 1)
REQUIRES(USE_TWO_CUTS, USE_NEXT_FORB && EXPLICIT_NORMAL_EDGES)
+BOOL_OPTION(USE_DOUBLE_SUBDIVISIONS, 0)
+REQUIRES(USE_DOUBLE_SUBDIVISIONS, USE_NEXT_FORB && EXPLICIT_NORMAL_EDGES)
+
diff --git a/group-connectivity.h b/group-connectivity.h
index 1ff1eb042c156a25bb54a0c68b9b02d432df04d9..ec326fbd21bbc324ba8af34e4ff1a0209efe4993 100644
--- a/group-connectivity.h
+++ b/group-connectivity.h
@@ -11,6 +11,7 @@
typedef int EdgeId;
typedef int DirectedEdgeId;
typedef std::pair<DirectedEdgeId, DirectedEdgeId> TwoCut;
+typedef std::vector<EdgeId> DoubleSubdivision;
struct AbstractTester {
bool isConnected;
@@ -25,6 +26,7 @@ struct AbstractTester {
int edges,
std::vector<EdgeId> spanningTree,
std::vector<TwoCut> twoCuts,
+ std::vector<DoubleSubdivision> dSub,
std::vector< std::vector<DirectedEdgeId> > elementaryCycles
) =0;
virtual std::vector<size_t> getClasses() =0;
@@ -60,6 +62,7 @@ struct Tester : public AbstractTester {
int edges_,
std::vector<EdgeId> spanningTree,
std::vector<TwoCut> twoCuts_,
+ std::vector<DoubleSubdivision> dSub,
std::vector< std::vector<DirectedEdgeId> > elementaryCycles
) {
edges = edges_;
diff --git a/groupConnectivity.pyx b/groupConnectivity.pyx
index 356f3ed1308e0c8b899fe1e5333d6a706adb25c9..b70b9ed4f2b693ea69b1324d5c7121b07ba0622b 100644
--- a/groupConnectivity.pyx
+++ b/groupConnectivity.pyx
@@ -16,9 +16,10 @@ cdef extern from "group-connectivity.h":
ctypedef int EdgeId
ctypedef int DirectedEdgeId
ctypedef pair[DirectedEdgeId, DirectedEdgeId] TwoCut
+ ctypedef vector[EdgeId] DoubleSubdivision
cdef cppclass AbstractTester:
- void init(int, vector[EdgeId], vector[TwoCut], vector[vector[DirectedEdgeId]])
+ void init(int, vector[EdgeId], vector[TwoCut], vector[DoubleSubdivision], vector[vector[DirectedEdgeId]])
vector[size_t] getClasses()
bool run()
@@ -38,7 +39,8 @@ def pathToEdges(G, path):
def testGroupConnectivity(G, group = "Z4", getClasses = False,
- useTwoCuts = True, debug = False):
+ useTwoCuts = True, useDoubleSubdivisions = False,
+ debug = False):
cdef AbstractTester* tester = NULL
if group == "Z4":
tester = new Tester[Z4[int]]()
@@ -65,6 +67,8 @@ def testGroupConnectivity(G, group = "Z4", getClasses = False,
spanningTreeEdges = [ l for (_, _, l) in spanningTree.edge_iterator() ]
+
+
twoCuts = []
if useTwoCuts:
availableEdges = set(spanningTreeEdges)
@@ -95,7 +99,7 @@ def testGroupConnectivity(G, group = "Z4", getClasses = False,
print "Elementary cycles: ", elemCycles
print "Two cuts: ", twoCuts
- tester.init(G.num_edges(), spanningTreeEdges, twoCuts, elemCycles)
+ tester.init(G.num_edges(), spanningTreeEdges, twoCuts, [], elemCycles)
ret = tester.run()
if getClasses: