From 41046f6ac02a1d947d656d033ecb53a249e7cc7e Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Sun, 20 Jul 2014 15:25:43 +0200 Subject: cleanup --- fast/hypergraph.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'fast/hypergraph.cc') diff --git a/fast/hypergraph.cc b/fast/hypergraph.cc index c3c587c..a01fb3e 100644 --- a/fast/hypergraph.cc +++ b/fast/hypergraph.cc @@ -74,9 +74,11 @@ topological_sort(list& nodes, list::iterator root) auto to = nodes.begin(); while (to != nodes.end()) { if ((**p).is_marked()) { + cout << **p<< endl; // explore edges for (auto e = (**p).outgoing.begin(); e!=(**p).outgoing.end(); ++e) { (**e).mark++; + cout << " " << **e << endl; if ((**e).is_marked()) { (**e).head->mark++; } @@ -88,10 +90,17 @@ topological_sort(list& nodes, list::iterator root) p = to; } else { ++p; - if (p == nodes.end()) { - p = next(to); + /*if (p == nodes.end()) { + for (auto e = (**to).outgoing.begin(); e!=(**to).outgoing.end(); ++e) { + // explore edges + (**e).mark++; + if ((**e).is_marked()) { + (**e).head->mark++; + } + } to = next(to); - } + p = to; + }*/ } } cout << "---" << endl; @@ -151,6 +160,7 @@ read(Hypergraph& hg, string fn) e->head = hg.nodes_by_id[e->head_id_]; hg.edges.push_back(e); hg.nodes_by_id[e->head_id_]->incoming.push_back(e); + e->arity = 0; for (auto it = e->tails_ids_.begin(); it != e->tails_ids_.end(); ++it) { hg.nodes_by_id[*it]->outgoing.push_back(e); e->tails.push_back(hg.nodes_by_id[*it]); -- cgit v1.2.3