|
Boost Users : |
Subject: Re: [Boost-users] [BGL]Why the output of algorithms are vertex sequence(PredecessorMap)? How about parallel edges??
From: Li Ning (Ning.c.Li_at_[hidden])
Date: 2009-05-11 01:41:06
Andrew Sutton-2 wrote:
>
>>
>> "Remove" also invalidates vertex descriptors!
>>>
>>>
>>> For VertexList == vecS, yes. My advice regarding this would be: If
>>> you're
>>> using vecS for vectors, don't remove vertices. If you have to remove
>>> vertices, use listS and never call num_vertices,
>>>
>>> For anything other than vecS, remove_vertex shouldn't invalidate
>>> descriptors other than the one removed. I hope.
>>>
>>
>> Yes, and as I understand it, ditto iterators.
>> So the question still stands!
>
>
> I can rephrase my previous answer. Descriptors provide improved stability
> over iterators. With vectors, iterators are invalidated on insert and
> erase,
> but descriptors are only invalidated on erase/remove. With linked memory
> structures (e.g,. lists and trees) neither set of operations (should)
> invalidate other iterators or descriptors.
>
> Andrew Sutton
> andrew.n.sutton_at_[hidden]
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
I understand. The descriptor exists because of 'add_edge' like functions.
And the inter-reference between vertex & edge is operated on descriptor will
eliminate affect of 'add' operation. However, remove still has invalidate
problem.
-- View this message in context: http://www.nabble.com/-BGL-Why-the-output-of-algorithms-are-vertex-sequence%28PredecessorMap%29--How-about-parallel-edges---tp23439356p23477369.html Sent from the Boost - Users mailing list archive at Nabble.com.
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