Boost logo

Boost Users :

From: Andrea Olgiati (andrea.olgiati_at_[hidden])
Date: 2005-01-13 05:52:02


Hi,
A couple of (newbie) questions on subgraphs and property maps:

1. I tried to re-run the example posted at
http://lists.boost.org/MailArchives/boost-users/msg05889.php and I get a
segfault whilst trying to assign name1[B1] - according to a follow-up
message (http://lists.boost.org/MailArchives/boost-users/msg05891.php),
that code snippet was supposed to be working fine. Am I doing something
wrong?

2. Maybe it's another symptom of the same problem, but I am seeing
runtime failures (invalid pointers) when I write code such as:
> Graph *graph = wantFullGraph? rootGraph : subGraph;
> MyPropertyMap mymap = get(my_type_t(), *graph);
> for( v in all vertices in *graph) {
> mymap[v] = blah;
> }
That is, after reading the docs my understanding is that if I pick up a
property map from a (sub)graph, I can use the vertices in that
(sub)graph to address into that map - everything should work fine
provided that I am consistently using the same (sub)graph. Is this
understanding correct?
If so, I'm puzzled - the only way I can get this to work is to do:
> Graph *graph = wantFullGraph? rootGraph : subGraph;
> MyPropertyMap mymap = get(my_type_t(), *rootGraph);
> for( v in all vertices in *graph) {
> v1 = graph->local_to_global(v)
> mymap[v1] = blah;
> }

I am using
- gcc version 3.3.4 (pre 3.3.5 20040809)
- Linux myhost 2.6.8-24.10-default #1 Wed Dec 22 11:54:27 UTC 2004 i686
i686 i386 GNU/Linux

Can someone enlighten me. please?

Thanks,
Andrea


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