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

Ryan Curtin notifications at github.com
Fri Jun 10 09:56: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))

This will fail if R is negative.  I think maybe a better choice here is to use the Boost test tools implementation... by default `BOOST_REQUIRE_CLOSE()` checks both the condition above and also | R - L | <= E * |L|, which works for nearest neighbor search, but not furthest neighbor search (unless you, as an argument, set `E = e(1 + e)`).  So you could do that, or you could look at `boost/test/test_tools.hpp` and see how `BOOST_REQUIRE_CLOSE` is defined, and you can develop a new macro that uses `boost::test_tools::check_is_close` with the `FPC_WEAK` comparison type, and I think that would work for what you are doing.

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


More information about the mlpack-git mailing list