[mlpack-git] [mlpack/mlpack] Universal B tree implementation (#746)

Ryan Curtin notifications at github.com
Thu Aug 25 11:48:51 EDT 2016


> +      size_t oldI = newToOld[i];
> +      size_t newIndex = newFromOld[index];
> +
> +      data.swap_cols(i, newFromOld[index]);
> +
> +      size_t tmp = newFromOld[index];
> +      newFromOld[index] = i;
> +      newFromOld[oldI] = tmp;
> +
> +      tmp = newToOld[i];
> +      newToOld[i] = newToOld[newIndex];
> +      newToOld[newIndex] = tmp;
> +
> +      tmp = oldFromNew[i];
> +      oldFromNew[i] = oldFromNew[newIndex];
> +      oldFromNew[newIndex] = tmp;

I believe this rearranging is only done in the first level of building the tree (at which point `oldFromNew` is initialized in the same way `newToOld` is initialized here), so does it make sense to simply remove the `newToOld` member used here and instead use `oldFromNew`?  If so, maybe it makes sense to have the other overload of `PerformSplit` call this one after initializing the `oldFromNew` vector.  I suspect I may have overlooked something here, so let me know if I have. :)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/746/files/f17843fc8e8ef2b1c4b04d572c521575f20a1f3c#r76269981
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160825/929c5ba0/attachment.html>


More information about the mlpack-git mailing list