1901: Fix adjacency test in p_graph.

https://svn.lrde.epita.fr/svn/oln/trunk/milena Index: ChangeLog from Roland Levillain <roland@lrde.epita.fr> Fix adjacency test in p_graph. * mln/core/p_graph.hh (mln::p_graph<P>::adjacent): Don't return true when arguments (rhs and lhs) are equal. p_graph.hh | 3 +++ 1 file changed, 3 insertions(+) Index: mln/core/p_graph.hh --- mln/core/p_graph.hh (revision 1900) +++ mln/core/p_graph.hh (working copy) @@ -255,6 +255,9 @@ mln_assertion(lhs < this->npoints()); mln_assertion(rhs < this->npoints()); + // Ensure LHS and RHS are *not* equal. + if (rhs == lhs) + return false; // Check whether RHS and LHS are adjacent (i.e., whether RHS is // among the neighbors of LHS). typedef std::vector<util::edge_id> edges_t;
participants (1)
-
Roland Levillain