Boost Users :
From: Sebastian Weber (sebastian.weber_at_[hidden])
Date: 2005-07-22 07:57:58
I'm trying to initialize my adjacency_list graph via an EdgeIterator.
Since I do not want parallel edges to be present in my graph, but still
use vecS as EdgeList-storage because of memory considerations, my
EdgeIterator needs somehow a reference to the graph under construction.
Some code might explain it better:
typedef boost::adjacency_list<boost::vecS, boost::vecS,
boost::undirectedS > graph_t;
typedef boost::my_edge_iterator<base_rand_gen_t, graph_t> SFGen;
graph_t bg = graph_t(SFGen(bg, base_rand, 100), SFGen(), 100);
This code compiles fine, but seg-faults immediatly since bg does not
seem to be defined when my iterator gets constructed. A solution would
be to provide a add_edge_range-function which gets as input the
EdgeIterator and the corresponding empty boost graph. This function
would then build up the graph or is there a better way to do this?
Thanks a lot in advance for your 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