<p>In <a href="https://github.com/mlpack/mlpack/pull/581#discussion_r57175998">src/mlpack/tests/cosine_tree_test.cpp</a>:</p>
<pre style='color:#555'>> -
> - for (i = 0; i < leftIndices.size(); i++)
> - BOOST_CHECK_LT(cosineMax - cosines(i), cosines(i) - cosineMin);
> -
> - for (j = 0, k = i; j < rightIndices.size(); j++, k++)
> - BOOST_CHECK_GT(cosineMax - cosines(k), cosines(k) - cosineMin);
> + // If max(cosines) is close to 1.0 cosineMax and cosineMax2 may
> + // differ significantly
> + double cosineMax2 = arma::max(cosines % (cosines < 1.0 - precision));
> +
> +
> + if(std::fabs(cosineMax - cosineMax2) < precision)
> + {
> + // Check with some precision
> +         for (i = 0; i < leftIndices.size(); i++)
> + BOOST_CHECK_LT(cosineMax - cosines(i), cosines(i) - cosineMin + precision);
</pre>
<p>Hm, these should be <code>BOOST_REQUIRE_LT</code> instead of <code>BOOST_CHECK_LT</code> like the rest of the mlpack tests, I'm not sure why the original code used <code>CHECK</code> instead of <code>REQUIRE</code>. I'll go ahead and change this after the merge.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly or <a href="https://github.com/mlpack/mlpack/pull/581/files/e5076dbce032c7f66f295b10729f375ccfe89cec#r57175998">view it on GitHub</a><img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFMMwmD7m_qHiIe4sIAQHpTvOjm1bks5pwVhKgaJpZM4HzbKc.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/581/files/e5076dbce032c7f66f295b10729f375ccfe89cec#r57175998"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>