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

Ryan Curtin notifications at github.com
Thu Aug 25 10:25:06 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");

I think that you meant to check here if the number of elements in each address was the same, but this only checks that the size of each type of element is the same.  Should we require that the type of element (i.e. double, size_t, whatever) is exactly the same, instead of simply having the same size?

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


More information about the mlpack-git mailing list