[mlpack-git] [mlpack/mlpack] Hilbert R tree (#664)
Ryan Curtin
notifications at github.com
Tue Jun 21 11:32:03 EDT 2016
> + {
> + // Get the position at which the point should be inserted
> + // Update the largest Hilbert value of the node
> + size_t pos = hilbertValue.InsertPoint(node, node->Dataset().col(point));
> +
> + // Move points
> + for (size_t i = node->NumPoints(); i > pos; i--)
> + node->Points()[i] = node->Points()[i-1];
> + // Insert the point
> + node->Points()[pos] = point;
> + node->Count()++;
> + }
> + else
> + {
> + // Calculate the Hilbert value
> + hilbertValue.InsertPoint(node, node->Dataset().col(point));
I think it would be possible here to just pass `point` instead of `node->Dataset().col(point)`, and then refactor `DiscreteHilbertValue::InsertPoint()` to take a `size_t` instead, since we only have one dataset. But it is up to you if you want to do that. I don't think there would be any noticeable advantage or disadvantage.
---
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/664/files/f9127cea62d5ce1ad8d5f59931de108a2f7cdd9b#r67891986
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160621/73078020/attachment.html>
More information about the mlpack-git
mailing list