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
The nearest_neighbour() function returns an immutable reference to and existing node.
Nodes with data associated with it, like GeomWithData<[f32;3], usize>, cannot be modified inplace.
Instead one has to use pop_nearest_neighbor, change the data, and then reinsert it.
An use example case for this is an rtree that keeps visitation counts for a set of positions.
The text was updated successfully, but these errors were encountered:
This is by design as we don't want the geometry to change. Try GeomWithData<G, Cell<T>> . Then you can replace the inner T as per Cell semantics (incl. replace with immutable ref. if T is copy; usize is)
Does locate_in_envelope_intersecting_mut have the same issue? It seems like it allows us to change the geometry, but the tree wouldn't know that the envelope haw changed.
The
nearest_neighbour()
function returns an immutable reference to and existing node.Nodes with data associated with it, like
GeomWithData<[f32;3], usize>
, cannot be modified inplace.Instead one has to use
pop_nearest_neighbor
, change the data, and then reinsert it.An use example case for this is an rtree that keeps visitation counts for a set of positions.
The text was updated successfully, but these errors were encountered: