[mlpack-git] master: Use absolute value when considering relative error. (7f4dfd0)

gitdub at mlpack.org gitdub at mlpack.org
Wed Jun 22 14:09:07 EDT 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/a9f5622c8a14409111f2d71bf5c0f8aaa8ad4ae1...37fda23945b4f998cd5fa6ec011ae345236c8552

>---------------------------------------------------------------

commit 7f4dfd005a8aa71afa703012ab613a3afc08785a
Author: MarcosPividori <marcos.pividori at gmail.com>
Date:   Tue Jun 14 11:44:18 2016 -0300

    Use absolute value when considering relative error.


>---------------------------------------------------------------

7f4dfd005a8aa71afa703012ab613a3afc08785a
 src/mlpack/tests/test_tools.hpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mlpack/tests/test_tools.hpp b/src/mlpack/tests/test_tools.hpp
index 2d4e56e..77fd1c1 100644
--- a/src/mlpack/tests/test_tools.hpp
+++ b/src/mlpack/tests/test_tools.hpp
@@ -37,6 +37,6 @@
 // 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))
+    BOOST_REQUIRE_LE( abs((R) - (L)), (E) * abs(R))
 
 #endif




More information about the mlpack-git mailing list