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

lozhnikov notifications at github.com
Thu Aug 25 10:44:17 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");

The type of an address is either `uint32_t` or `uint64_t`
```
typedef typename std::conditional<sizeof(ElemType) * CHAR_BIT <= 32,
                                    uint32_t,
                                    uint64_t>::type AddressElemType;
```
So, there is no difference. But maybe you are right and it is better to check types instead of sizes.

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


More information about the mlpack-git mailing list