Boost logo

Boost Users :

Subject: Re: [Boost-users] Default weight map doesn't work for weighted grid graph in A-star search
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2010-07-01 00:59:01


On Wed, 30 Jun 2010, W.P. McNeill wrote:

> Digging through the error stack it looked like the problem may have been with a vertex_iterator declaration at the top of astar_search()
> function (astar_search.hpp line 285), so I tried to compile the following trivial program with grid_graph:
> #include <boost/graph/grid_graph.hpp>
>
> int main(int argc, char* argv[]) {
>   using namespace boost;
>   graph_traits< grid_graph<2> >::vertex_iterator vi;
>   return 0;
> }
>
> Note that it is just vanilla grid_graph, with no edge weights or other code defined by me.
>
> I get the following compilation error:
>
> g++ -g -I/opt/local/include   -c -o main.o main.cpp
> /opt/local/include/boost/iterator/transform_iterator.hpp: In constructor ‘boost::transform_iterator<UnaryFunction, Iterator, Reference,
> Value>::transform_iterator() [with UnaryFunc = boost::detail::grid_graph_vertex_at<boost::grid_graph<2ul, size_t, size_t> >, Iterator =
> boost::counting_iterator<size_t, boost::use_default, boost::use_default>, Reference = boost::use_default, Value = boost::use_default]’:
> main.cpp:7:   instantiated from here
> /opt/local/include/boost/iterator/transform_iterator.hpp:100: error: no matching function for call to
> ‘boost::detail::grid_graph_vertex_at<boost::grid_graph<2ul, size_t, size_t> >::grid_graph_vertex_at()’
> /opt/local/include/boost/graph/grid_graph.hpp:104: note: candidates are:
> boost::detail::grid_graph_vertex_at<Graph>::grid_graph_vertex_at(const Graph*) [with Graph = boost::grid_graph<2ul, size_t, size_t>]
> /opt/local/include/boost/graph/grid_graph.hpp:100: note:                 boost::detail::grid_graph_vertex_at<boost::grid_graph<2ul,
> size_t, size_t> >::grid_graph_vertex_at(const boost::detail::grid_graph_vertex_at<boost::grid_graph<2ul, size_t, size_t> >&)
> make: *** [main.o] Error 1
>
> This looks wrong to me.  I thought the fact that grid_graph models the VertexList concept would ensure that I could declare a default
> vertex_iterator.

This is a bug; it's been fixed in the trunk for a few days. Could you
please see if that version
(https://svn.boost.org/svn/boost/trunk/boost/graph/grid_graph.hpp) works?

-- Jeremiah Willcock


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net