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 KDTree.sc:init() sorted = array.copy; is a shallow copy (the array is copied, but each point's coordinates, which are array themselves, gets referenced instead), so if(lastIsLabel, { label = location.pop }); pops from the original list.
I understand that we don't want to copy at every recursion of the init process, so a solution is to deep copy the original array when creating the tree. Maybe it should be said in the docs?
In KDTree.sc:init()
sorted = array.copy;
is a shallow copy (the array is copied, but each point's coordinates, which are array themselves, gets referenced instead), soif(lastIsLabel, { label = location.pop });
pops from the original list.I understand that we don't want to copy at every recursion of the init process, so a solution is to deep copy the original array when creating the tree. Maybe it should be said in the docs?
The text was updated successfully, but these errors were encountered: