[mlpack-git] [mlpack] Fix bug #358 (CosineTreeTest/CosineNodeCosineSplit test sometimes fails, only on i386) (#581)
Ryan Curtin
notifications at github.com
Wed Mar 23 11:08:38 EDT 2016
> + numMax2Errors++;
> +
> + for (j = 0, k = i; j < rightIndices.size(); j++, k++)
> + if(cosineMax2 - cosines(k) <= cosines(k) - cosineMin - precision)
> + numMax2Errors++;
> +
> + if(numMax1Errors > 0 && numMax2Errors > 0)
> + {
> + // cosineMax and cosineMax2 do not match
> + // we should report the problem
> + 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);
> + }
Do you think we could replace this if block with just
```
BOOST_REQUIRE_EQUAL(numMax1Errors, 0);
BOOST_REQUIRE_EQUAL(numMax2Errors, 0);
```
If that fails, it won't print as much information, but even so the `BOOST_CHECK_LT` calls won't print enough useful information to debug the problem without digging deeper.
---
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/581/files/e5076dbce032c7f66f295b10729f375ccfe89cec#r57175342
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160323/4550cb5e/attachment-0001.html>
More information about the mlpack-git
mailing list