<p>Yes it will fail when R is negative. But for distances we don't have to deal with negative R values... so, do you mean that this could be confussing for futures users? I should have defined it as:<br>
  BOOST_REQUIRE_LE( abs((R) - (L)), (E) * abs(R))<br>
(replace R by abs(R))</p>

<p>About strong/weak conditions, I have considered them before but, as we need strong condition for KNN and weak conditions for KFN, I thought it would be clearer to have a general macro for both of them.<br>
I mean:</p>

<p>BOOST_REQUIRE_CLOSE imposes strong condition:<br>
    | R - L | &lt;= E * |L|    &amp;&amp;    | R - L | &lt;= E * |R|</p>

<p>As you suggested, we could use boost::test_tools::check_is_close to create another macro to impose weak condition, let's call it BOOST_REQUIRE_WEAK_CLOSE:<br>
   | R - L | &lt;= E * |L|    ||    | R - L | &lt;= E * |R|</p>

<p>But none of them is enough for both KNN and KFN.... we should use BOOST_REQUIRE_CLOSE for KNN and BOOST_REQUIRE_WEAK_CLOSE for KFN.</p>

<p>So, if you agree, I can replace R by abs(R)  in the definition of REQUIRE_RELATIVE_ERR, and continue using it...</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/pull/684#issuecomment-225220899">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFGlCqOY-N54r1wxYCWe7kqPKelooks5qKYgEgaJpZM4IvhJu">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFAuT9l-AYoizkm4pHWmJuxukZp5_ks5qKYgEgaJpZM4IvhJu.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/mlpack/mlpack/pull/684#issuecomment-225220899"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>