Boost logo

Boost Users :

Subject: [Boost-users] Adjacency List vertex access
From: Carlo jardinier (dr.prof.xyz_at_[hidden])
Date: 2011-05-04 07:07:31


I try to use the adjacency list from boost. I can fill the list with
vertices and edges, but somehow I cannot access a specific vertex or
edge.

For example this is not working (see test.cpp):
**
struct EdgeProperties {
      bool bConnectedBond;
      EdgeProperties(){bConnectedBond=false;}
};
struct VertexProperties{
       int index;
       int spin;
       bool bOnCluster;
       VertexProperties(): spin(){ bOnCluster = false;}
       ~VertexProperties(){ }
};
typedef adjacency_list< vecS, vecS, bidirectionalS, VertexProperties,
EdgeProperties > Graph;
typedef graph_traits< Graph >::vertex_iterator Vit;

Graph g(9);
unsigned int i = 3;
Vit vi;
vi = vertex(i,g);
**

I want vi to bi an iterator that points on the 3. vertex of the graph g.
I attached the error message from g++ when compiling.

Can anyone help?





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