[mlpack] 139/207: Update CheckMatrices to support tolerance values
Barak A. Pearlmutter
barak+git at pearlmutter.net
Thu Mar 23 17:53:48 UTC 2017
This is an automated email from the git hooks/post-receive script.
bap pushed a commit to branch master
in repository mlpack.
commit 1e101a7ce456a8bd72efaa55f62afc9a979588ac
Author: shikhar <shikharbhardwaj68 at gmail.com>
Date: Tue Mar 14 23:39:07 2017 +0530
Update CheckMatrices to support tolerance values
---
src/mlpack/tests/test_tools.hpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/mlpack/tests/test_tools.hpp b/src/mlpack/tests/test_tools.hpp
index cefd30e..d5ce126 100644
--- a/src/mlpack/tests/test_tools.hpp
+++ b/src/mlpack/tests/test_tools.hpp
@@ -53,8 +53,8 @@ inline void CheckMatrices(const arma::mat& a, const arma::mat& b,
for (size_t i = 0; i < a.n_elem; ++i)
{
- if (std::abs(a[i]) < 1e-5)
- BOOST_REQUIRE_SMALL(b[i], 1e-5);
+ if (std::abs(a[i]) < tolerance / 2)
+ BOOST_REQUIRE_SMALL(b[i], tolerance / 2);
else
BOOST_REQUIRE_CLOSE(a[i], b[i], tolerance);
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mlpack.git
More information about the debian-science-commits
mailing list