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

Ryan Curtin notifications at github.com
Thu Aug 25 11:06:52 EDT 2016


> +        point(i) = std::numeric_limits<VecElemType>::lowest();
> +    }
> +  }
> +}
> +
> +/**
> + * Compare two addresses. The function returns 1 if the first address is greater
> + * than the second one, -1 if the first address is less than the second one,
> + * otherwise the function returns 0.
> + */
> +template<typename AddressType1, typename AddressType2>
> +int CompareAddresses(const AddressType1& addr1, const AddressType2& addr2)
> +{
> +  static_assert(sizeof(typename AddressType1::elem_type) ==
> +      sizeof(typename AddressType2::elem_type), "We aren't able to compare "
> +      "adresses of distinct sizes");

Ah, okay, I forgot that `AddressElemType` is only ever `uint32_t` or `uint64_t`.  It's your call whether or not you want to change it.  I think we should keep the two different `AddressType1` and `AddressType2` types, otherwise a user can't call `CompareAddresses` with a subview (like `matrix.col(i)`) and a point, or other weird derived Armadillo types like that.

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


More information about the mlpack-git mailing list