Boost logo

Boost Users :

From: Elvanör (elvanor2004_at_[hidden])
Date: 2005-04-17 17:13:56


Hi,

I am running into problems using bundled properties and the newly
implemented subgraph for them.

In my experience, it seems they are working correctly with the root
subgraph, but they don't translate correctly to the children. The code
compiles, meaning there is the interface, but I get segfaults at
runtime and I think they are related to that problem, for exemple:

void tree_gibbs_sampler(Graph & g, unsigned int max_steps, unsigned int
burnoff)
{
        typedef typename graph_traits<Graph>::vertex_iterator VertexIterator;
        typedef typename graph_traits<Graph>::adjacency_iterator
AdjacencyIterator;
        typedef typename graph_traits<Graph>::vertex_descriptor
VertexDescriptor;
        typedef typename graph_traits<Graph>::edge_descriptor EdgeDescriptor;
        
        AdjacencyIterator w,w_end;
        VertexIterator v, v_end;
        VertexDescriptor u;
        subgraph <Graph> subgraph_g;

        copy_graph(g, subgraph_g);
        copy_graph(g, f);
        
        cout << g[0] << endl;
        u = vertex(0,subgraph_g);
        cout << subgraph_g[u] << endl;
        
// here the last two line produce the same numbers...

// here I do something to the root subgraph and produce childrens...

        for ( tie(current_tree, current_tree_end) = subgraph_g.children();
current_tree != current_tree_end; ++current_tree)
        {
                
                for (tie(v,v_end) = vertices (*current_tree); v!= v_end; ++v)
                {
                
                cout << (*current_tree)[*v] << endl;
                
                }

        }

// The last for loop produces strange results, the bundled properties
(here it is just adress to pointers) are not at all consistent
anymore... (with the ones in the original graph or even root subgraph)

So I think there is a problem with the current implementation.

Jean-Noël Rivasseau



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