Boost logo

Boost Users :

From: Stephan Diederich (stephan.diederich_at_[hidden])
Date: 2007-01-15 08:16:52


Hi Alejandro,

On 1/14/07, Alejandro Marcos Aragón <aaragon2_at_[hidden]> wrote:
> I was wondering if the library handles the edge removal for graphs that
> use the vecS as a container for the vertices and the setS for the edges.
> I've been trying to use the function and I have a segmentation fault.

I cannot reproduce this here with 1.33.1. What version of Boost are you using?
Additionally a compilabe test-case would be very helpful.

Here's what I've tried:

#include <iostream>
#include <boost/graph/adjacency_list.hpp>

int main(){
   using namespace boost;
   typedef adjacency_list<vecS,vecS,directedS,no_property,no_property,no_property,setS>
tGraph;
   tGraph g;
   tGraph::vertex_descriptor u,v;
   u = add_vertex(g);
   v = add_vertex(g);
   bool success; tGraph::edge_descriptor e;
   tie(e,success) = add_edge(u,v,g);
   if(!success){
      std::cout << "Could not add edge to graph! \n";
   }
   else{
      std::cout << "num_edges before remove: " << num_edges(g) << "\n";
      remove_edge(u,v,g);
      std::cout << "num_edges after remove: " << num_edges(g) << "\n";
   }
}

Cheers,
Stephan


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