You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In voronoi_builder.hpp line 400 the key of a map is altered in-place. Naturally I can't do this in Rust, so the
obvious solution is to remove and then re-insert the object with the new key.
Problem is that does not always work. Somehow the beach-line calculations sometimes requires that the object remains in the old position, while the key is altered.
The root of the problem is that the beachline keys in boost are not transitive (as I understand it). A<B, B<C and yet this could also be true: C<A.
// Change the (A, B) bisector node to the (A, C) bisector node.
const_cast<key_type&>(it_first->first).right_site(site3);
It's impossible to search for the correct beach-line key in a BTree when the keys are corrupted.
So instead I fixed(?) the problem by implementing a Vec based linked-list that emulates a C++ map and it's pointer based iterators. It can only do linear search - but it works! It's also faster than the old (buggy) BTree code.
In voronoi_builder.hpp line 400 the key of a
map
is altered in-place. Naturally I can't do this in Rust, so theobvious solution is to remove and then re-insert the object with the new key.
Problem is that does not always work. Somehow the beach-line calculations sometimes requires that the object remains in the old position, while the key is altered.
The root of the problem is that the beachline keys in boost are not transitive (as I understand it).
A<B
,B<C
and yet this could also be true:C<A
.Same section in rust is builder.rs line 663
Issue can be tested with this input:
Update:
I made a test in boost voronoi 1.76 and added this to
voronoi_builder.hpp
It shows how each item in the beach-line map (in order) compares to the key and it generates this output:
I don't understand how
C++ map()
can find the correct value under such conditions. Doesn't C++ map require Strict weak orderings?The text was updated successfully, but these errors were encountered: