Re: [Boost-bugs] [Boost C++ Libraries] #5881: BGL isomorphism: off-by-one error in isomorphism.hpp

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5881: BGL isomorphism: off-by-one error in isomorphism.hpp
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-09-10 10:56:15


#5881: BGL isomorphism: off-by-one error in isomorphism.hpp
---------------------------------------------+------------------------------
  Reporter: Esa Määttä <esa.maatta@…> | Owner: jewillco
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: graph
   Version: Boost 1.47.0 | Severity: Problem
Resolution: | Keywords:
---------------------------------------------+------------------------------

Comment (by Esa Määttä <esa.maatta@…>):

 Replying to [comment:1 jewillco]:
> This code appears to be correct using the definition of `max_invariant`
 in the documentation. Is the test case incorrect, or do you think
 `isomorphism` itself is incorrect?

 You can test it by changing the indexing of the multiplicity vector to
 .at() and with a simple two node graph:

 {{{
 digraph G {
 0;
 1;
 0->1 ;
 1->1 ;
 }
 }}}

 And with code like this:

 {{{
 #!cpp
 154 std::vector<size_type> multiplicity(max_invariant, 0);
 155 BGL_FORALL_VERTICES_T(v, G1, Graph1) {
 156 std::cout << "v: " << v << ", " << "invariant(v): " <<
 invariant1(v)
 157 << ", max_invariant: " << max_invariant <<
 std::endl;
 158 ++multiplicity.at(invariant1(v));
 159 }
 }}}

 The output for me is:

 {{{
 v: 0, invariant(v): 3, max_invariant: 5
 v: 1, invariant(v): 5, max_invariant: 5
 terminate called without an active exception
 Aborted
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5881#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC