Skip to content

Commit d00d833

Browse files
polgreensmowton
authored andcommitted
Fix: several grapht functions were uncompilable if ever called
edgest is a map from node_indext to some type edget. In order to access the node_indext, you must access the first element of the pair. I've also updated the iterators.
1 parent b9014de commit d00d833

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

src/util/graph.h

+10-18
Original file line numberDiff line numberDiff line change
@@ -709,12 +709,11 @@ std::size_t grapht<N>::connected_subgraphs(
709709

710710
const nodet &node=nodes[n];
711711

712-
for(typename edgest::const_iterator
713-
it=node.out.begin();
714-
it!=node.out.end();
715-
it++)
716-
if(!visited[*it])
717-
s.push(*it);
712+
for(const auto &o : node.out)
713+
{
714+
if(!visited[o.first])
715+
s.push(o.first);
716+
}
718717
}
719718

720719
nr++;
@@ -805,20 +804,13 @@ void grapht<N>::make_chordal()
805804
const nodet &n=tmp[i];
806805

807806
// connect all the nodes in n.out with each other
808-
809-
for(typename edgest::const_iterator
810-
it1=n.out.begin();
811-
it1!=n.out.end();
812-
it1++)
813-
for(typename edgest::const_iterator
814-
it2=n.out.begin();
815-
it2!=n.out.end();
816-
it2++)
807+
for(const auto &o1 : n.out)
808+
for(const auto &o2 : n.out)
817809
{
818-
if(*it1!=*it2)
810+
if(o1.first!=o2.first)
819811
{
820-
tmp.add_undirected_edge(*it1, *it2);
821-
this->add_undirected_edge(*it1, *it2);
812+
tmp.add_undirected_edge(o1.first, o2.first);
813+
this->add_undirected_edge(o1.first, o2.first);
822814
}
823815
}
824816

0 commit comments

Comments
 (0)