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

Ryan Curtin notifications at github.com
Thu Aug 25 11:05:17 EDT 2016


> +namespace mlpack {
> +
> +namespace bound {
> +
> +namespace addr {
> +
> +/**
> + * Calculate the address of a point. Be careful, the point and the address
> + * variables should be equal-sized and the type of the address should correspond
> + * to the type of the vector.
> + *
> + * @param address The resulting address.
> + * @param point The point that is being translated to the address.
> + */
> +template<typename AddressType, typename VecType>
> +void PointToAddress(AddressType& address, const VecType& point)

If you don't mind, I'd like to add some documentation on what exactly is going on in this function.  I spent a long time reading it, and it appears that really all we are doing (from a high level) is reordering the bits in the floating point number.  So in the one-dimensional case, we have a number of the form

```
[[ mantissa ][ exponent ]]
```

but your code transforms it roughly to

```
[[ exponent ][ mantissa ]]
```

(but not exactly, since some modification of the mantissa may be necessary).  In the multi-dimensional case, after we transform the representation, we have to interleave the bits of the new representation across all of the elements in the address vector.  Is that correct?  If so I can add those comments (or you can add them if you like, maybe it is better if you add them since you are more familiar with the code).

-- 
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#r76261196
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160825/758c284d/attachment-0001.html>


More information about the mlpack-git mailing list