Boost logo

Boost Users :

From: Todd A. Gibson (tgibson_at_[hidden])
Date: 2005-07-06 12:23:02


I am working with brandes_betweenness_centrality in the BGL and am
having difficulty correctly constructing the syntax for retrieving an
EdgeCentralityMap using exterior properties. I can successfully
invoke the function using bundled properties:

struct EdgeAttrs {
  unsigned int index;
  double weight;

template<class GraphType>
boost::python::list betweenness_centrality(GraphType& g)
  typedef typename GraphType::edge_descriptor Edge;
  std::vector<float> centmap(num_vertices(g));
  std::vector<float> edgecent(num_edges(g));

  brandes_betweenness_centrality (g,
      boost::get(vertex_index, g), float()))
        boost::get(&EdgeAttrs::index, g),float()))
    .weight_map(boost::get(&EdgeAttrs::weight, g)));

Among my attempts, here's a typical one that won't compile:

  typedef typename std::map<Edge, double> EdgeMap;
  EdgeMap myedges;
  boost::associative_property_map< EdgeMap > edge_assoc_map(myedges);
  brandes_betweenness_centrality(g, ...
    .edge_centrality_map(edge_assoc_map) ...)

Can someone enlighten me?

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at