Boost logo

Boost Users :

Subject: Re: [Boost-users] How to convert graphtraits<Graph>::in_edge to graphtraits<Graph>::edge
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2009-03-25 08:35:24


> *
> for(boost::tie(iedge_s,iedge_
> * *end) = boost::in_edges(v,g); iedge_s!=iedge_end; ++iedge_s)
> {
> Vertex src = boost::source(*iedge_s,g);
> Vertex target = boost::target(*iedge_s,g);
> cout << g[src]->id << "-->" << g[target]->id << endl;
> EdgeProperties *ep = g[*iedge_s]; // <==== Line 10; g[*iedge_s]
> is returning null
> cout << ep->sourceI << endl; // <==== This is giving
> segmentation fault;
> }
> **
> ***here g[*iedge_s] is returning null**
> is it the problem because iam using (*iedge_s) as (edge_descriptor) or
> the problem somewhere in my code where in i had not properly assigned the
> property object
> to that specific edge.
>

Any kind of edge iterator (in, out, etc.) dereferences to an edge
descriptor, so you're not missing anything. You're not actually modifying
the edge set in that loop are you? That will cause some serious problems.
Otherwise, it looks like you may have missed an initialization.

Andrew Sutton
andrew.n.sutton_at_[hidden]



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