Gotta a const Graph also:
property_map
This line compiles now, but I get a new compile error from the astar_search
line. The important bits are:
typedef boost::property_map::type
EdgeWeightMap;
EdgeWeightMap edgeWeightMap = get(&EdgeProp::cost, graph);
std::vector<VertexRef> predecessors(num_vertices(graph));
astar_search( graph,
start,
aStarHeuristic,
boost::weight_map(edgeWeightMap).
predecessor_map(&predecessors[0]).
visitor(aStarVisitor) );
The error is:
/usr/include/c++/4.3/bits/allocator.h:84: instantiated
from 'std::allocator<const double>'
/usr/include/c++/4.3/bits/stl_vector.h:75: instantiated
from 'std::_Vector_base'
/usr/include/c++/4.3/bits/stl_vector.h:176: instantiated
from 'std::vector'
/usr/include/boost/graph/astar_search.hpp:360: instantiated from 'void
boost::detail::astar_dispatch1(VertexListGraph&, typename
boost::graph_traits<G>::vertex_descriptor, AStarHeuristic, CostMap,
DistanceMap, WeightMap, IndexMap, ColorMap, const Params&) [with
VertexListGraph = const boost::adjacency_list,
AStarHeuristic = AStarHeuristic, CostMap =
boost::detail::error_property_not_found, DistanceMap =
boost::detail::error_property_not_found, WeightMap =
boost::bundle_property_map, boost::detail::edge_desc_impl, EdgeProp, const double>, IndexMap =
boost::vec_adj_list_vertex_id_map, unsigned int>, ColorMap =
boost::detail::error_property_not_found, Params =
boost::bgl_named_params,
boost::detail::edge_desc_impl, EdgeProp,
const double>, boost::edge_weight_t, boost::no_property> > >]'
/usr/include/boost/graph/astar_search.hpp:394: instantiated from 'void
boost::astar_search(VertexListGraph&, typename
boost::graph_traits<G>::vertex_descriptor, AStarHeuristic, const
boost::bgl_named_params&) [with VertexListGraph = const
boost::adjacency_list, AStarHeuristic = AStarHeuristic,
P = AStarVisitor, T = boost::graph_visitor_t, R =
boost::bgl_named_params,
boost::detail::edge_desc_impl, EdgeProp,
const double>, boost::edge_weight_t, boost::no_property> >]'
/home/a.brooks/shh/src/libs/prm/test/stupid.cpp:83: instantiated from here
/usr/include/c++/4.3/ext/new_allocator.h:82: error: 'const _Tp*
__gnu_cxx::new_allocator<_Tp>::address(const _Tp&) const [with _Tp = const
double]' cannot be overloaded
/usr/include/c++/4.3/ext/new_allocator.h:79: error: with '_Tp*
__gnu_cxx::new_allocator<_Tp>::address(_Tp&) const [with _Tp = const double]'
Any other ideas?
Thanks again,
Alex