Boost logo

Boost Users :

From: Jacques Papper (jpapper_at_[hidden])
Date: 2007-09-10 07:33:17


I'm new to Boost and the graph library and I don't understand why my
compiler complains :

error: no matching function for call to `add_edge(int, int,
boost::compressed_sparse_row_graph<boost::directedS, void, void,
boost::no_property, size_t, size_t>&)'

My code is copied underneath : I'm trying to simply create a CSR graph
and add an edge ... from the CSR header I see that add_edge is an inline
function (same as add_vertex etc...)... Why does this not work ??

Thanks !
Jacques

#include <iostream>
#include "boost/graph/compressed_sparse_row_graph.hpp"
#include "boost/graph/graph_utility.hpp"

int main (int argc, char * argv[]){

  boost::compressed_sparse_row_graph<> csr;
 
  std::cout << "Adding 10 vertices" <<std::endl;
 
  boost::num_vertices(csr);

  boost::add_vertices(10, csr);

  boost::print_graph(csr);

  std::cout << "Adding 2 edges" <<std::endl;
  boost::add_edge(0,1,csr);
  boost::add_edge(2,1,csr);
 

 
  boost::print_graph(csr);
  std::cout << "Adding duplicate edge" <<std::endl;
  boost::add_edge(3,4,csr);
  boost::add_edge(3,4,csr);
 
  boost::print_graph(csr);

}

---------------------------
This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender.
Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons.
Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245


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