Boost logo

Boost Users :

Subject: [Boost-users] How to convert graphtraits<Graph>::in_edge to graphtraits<Graph>::edge
From: Phani Deepak (phanidee_at_[hidden])
Date: 2009-03-24 14:05:24


hi,
       i have stored some bundled properties for an edge.
*
class EdgeProperties {
    public:
    int targetI;// Terminal No. interms of target node
    int sourceI;// Terminal No. interms of source node
    EdgeProperties(int s,int t):sourceI(s-1),targetI(t-1) { }
};*

my Graph is :
*typedef
boost::adjacency_list<boost::listS,boost::listS,boost::bidirectionalS,
EdgeProperties *> Graph;
Graph g;
*
Now iam iterating through in_edges of some vertex v;
*graphtraits<Graph>::in_edge_iterator iedge_s,iedge_end;
for(boost::tie(iedge_s,iedge_end) = boost::in_edges(v,g);
iedge_s!=iedge_end; ++iedge_s){
       EdgeProperties *ep = g[*iedge_s]; // <==== **Line 10**
       cout << ep->sourceI << endl; // <==== **This is
giving segmentation fault;**
}
*
I checked the *ep* pointer. it is coming out as null in line 10;

is there any problem while using *in_edge_descriptor* as *edge_descriptor**(
for g[edge_descriptor]* ) in *Line 10* ??
*
*please help.

-
Phani.
*
*



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