Boost logo

Boost Users :

Subject: [Boost-users] boost graph: Error with compressed_sparse_row graph and strong_components
From: aitor (a.soroa_at_[hidden])
Date: 2011-05-09 03:59:24


Hi,

the following example (taken from csr example in boost docs) fails when
calling strong_components algorithm. The error message is:

/usr/include/boost-1.46.1/boost/graph/strong_components.hpp:59: error: no matching function for call to 'get(int*&, unsigned int&)'

the program works with boost 1.41.0

any help would be much appreciated :-)

#include <boost/graph/compressed_sparse_row_graph.hpp>
#include <string>
#include <fstream>
#include <boost/graph/strong_components.hpp>

using namespace boost;

int main()
{
  typedef std::pair<int, int> E;
  E the_edges[] = { E(0, 1), E(0, 2), E(0, 3), E(1, 0), E(1, 3), E(1, 5),
                    E(2, 0), E(2, 5), E(3, 1), E(3, 4), E(4, 1), E(5, 0),
                    E(5, 2) };

  typedef compressed_sparse_row_graph<directedS> WebGraph;
  WebGraph g(boost::edges_are_sorted, &the_edges[0], &the_edges[0] + sizeof(the_edges)/sizeof(E), 6);

  // strong components

  std::vector<int> v(6);
  int i = boost::strong_components(g, &v[0]);

  std::cout << i << "\n";

  return 0;
}


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