[mlpack-git] [mlpack/mlpack] Approximate Neighbor Search for Dual tree algorithms. (#684)

Ryan Curtin notifications at github.com
Fri Jun 10 15:12:43 EDT 2016


> @@ -35,4 +34,9 @@
>  
>  #endif
>  
> +// Require the approximation L to be within a relative error of E respect to the
> +// actual value R.
> +#define REQUIRE_RELATIVE_ERR( L, R, E ) \
> +    BOOST_REQUIRE_LE( abs((R) - (L)), (E) * (R))

It's up to you (or, at least, I don't have a strong opinion).  The only issue with adding `REQUIRE_RELATIVE_ERR` is that it should be clearly documented, because another developer might expect something a little different out of a relative error condition.  Personally, I might consider using `BOOST_REQUIRE_CLOSE` with tolerance epsilon for KNN and with tolerance epsilon(1 + epsilon) for KFN (I think I did those calculations right) in order to avoid adding a new macro, but like I said, either way is fine, as long as the new macro is well-documented.

---
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/684/files/07879a2cc79b35b10d7fae687d6e27ad90a9f2d7#r66666544
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160610/29d95827/attachment.html>


More information about the mlpack-git mailing list