Boost logo

Boost Users :

From: Joaquín Mª López Muñoz (joaquin_at_[hidden])
Date: 2007-10-03 02:08:21


Jeffrey Holle ha escrito:

> JOAQUIN LOPEZ MU?Z wrote:
> > ----- Mensaje original -----
> > De: Jeffrey Holle <jeffreyholle_at_[hidden]>
> > Fecha: Martes, Octubre 2, 2007 11:08 pm
> > Asunto: Re: [Boost-users] [multi_key] problems using modify_key with a
> > composite_key index
> > Para: Boost Users mailing list <boost-users_at_[hidden]>
> >
> >> While my swap method is now working correctly, I have found the
> >> the use of modify on a composite_key in order to preform a swap
> >> has corrupted the index.

[...]

> The situation that I described above is considerable more complicated.
> By the time my app hangs up in the iteration loop through the elements
> in row 2, my sort function has executed 4 times, producing a sum of 2
> swaps. The arrant behavior of the composite_key index starts appearing
> at the end of the 3rd sort operation. Then I see that a vertex order of
> "7,10,9,11" get changed to "11,7". This makes no sense to me, swapping
> elements shouldn't reduce the number of elements in a row.

There is a situation in which you can see such reduction of elements:
modify() will *erase* the element if the modification has resulted in a collision
for some index with unique keys. In your particular case, index #0 is
unique on entry::m_vertex, so you might want to check whether your
procedure somehow can change this member so that it becomes a duplicate
of a preexisting value.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


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