[ create a new paste ] login | about

Link: http://codepad.org/98AovhZO    [ raw code | output | fork ]

dreamlax - C++, pasted on Jul 2:
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>
#include <boost/graph/visitors.hpp>
#include <vector>
#include <map>
#include <boost/foreach.hpp>



using namespace boost;
using std::vector;
typedef boost::adjacency_list<vecS, vecS, bidirectionalS > graphImpl_t;


int main()
{
 
  graphImpl_t gg(9);
  
  typedef  graphImpl_t::vertex_descriptor vertex_t;
  typedef  graphImpl_t::edge_descriptor edge_t;
  vertex_t src;
  std::map<vertex_t, vertex_t> pred;
  boost::associative_property_map< std::map<vertex_t, vertex_t> > preds(pred);
  
  std::map<vertex_t, int> dist;
  boost::associative_property_map< std::map<vertex_t, int> > dists(dist); 
  
  
  std::map<edge_t, int> weight;
  boost::associative_property_map< std::map<edge_t, int> > weights(int); 

  vector<vertex_t> p(num_vertices(gg));
 
  dijkstra_shortest_paths(gg, src, predecessor_map(preds).weight_map(weights).distance_map(dists).visitor(make_dijkstra_visitor(record_predecessors(p, on_edg_relaxed()) )));

}


Output:
1
2
3
4
/usr/include/boost/graph/named_function_params.hpp: In instantiation of 'boost::bgl_named_params<boost::associative_property_map<__gnu_debug_def::map<boost::detail::edge_desc_impl<boost::bidirectional_tag, unsigned int>, int, std::less<boost::detail::edge_desc_impl<boost::bidirectional_tag, unsigned int> >, std::allocator<std::pair<const boost::detail::edge_desc_impl<boost::bidirectional_tag, unsigned int>, int> > > > ()(int), boost::edge_weight_t, boost::bgl_named_params<boost::associative_property_map<__gnu_debug_def::map<unsigned int, unsigned int, std::less<unsigned int>, std::allocator<std::pair<const unsigned int, unsigned int> > > >, boost::vertex_predecessor_t, boost::no_property> >':
t.cpp:36:   instantiated from here
Line 57: error: field 'boost::bgl_named_params<boost::associative_property_map<__gnu_debug_def::map<boost::detail::edge_desc_impl<boost::bidirectional_tag, unsigned int>, int, std::less<boost::detail::edge_desc_impl<boost::bidirectional_tag, unsigned int> >, std::allocator<std::pair<const boost::detail::edge_desc_impl<boost::bidirectional_tag, unsigned int>, int> > > > ()(int), boost::edge_weight_t, boost::bgl_named_params<boost::associative_property_map<__gnu_debug_def::map<unsigned int, unsigned int, std::less<unsigned int>, std::allocator<std::pair<const unsigned int, unsigned int> > > >, boost::vertex_predecessor_t, boost::no_property> >::m_value' invalidly declared function type
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: