diff --git a/ALFI/ALFI/util/linalg.h b/ALFI/ALFI/util/linalg.h index 01bdda7..522c0e0 100644 --- a/ALFI/ALFI/util/linalg.h +++ b/ALFI/ALFI/util/linalg.h @@ -45,7 +45,7 @@ namespace alfi::util::linalg { i_max = k; } } - if (max_a < epsilon) { + if (max_a <= epsilon) { std::cerr << "Error in function " << __FUNCTION__ << ": Matrix A is degenerate. Returning an empty array..." << std::endl; return {}; } diff --git a/ALFI/ALFI/util/numeric.h b/ALFI/ALFI/util/numeric.h index 137670d..24b5965 100644 --- a/ALFI/ALFI/util/numeric.h +++ b/ALFI/ALFI/util/numeric.h @@ -7,6 +7,6 @@ namespace alfi::util::numeric { template bool are_equal(Number a, Number b, Number epsilon = std::numeric_limits::epsilon()) { - return std::abs(a - b) < epsilon || std::abs(a - b) < std::max(std::abs(a), std::abs(b)) * epsilon; + return std::abs(a - b) <= epsilon || std::abs(a - b) <= std::max(std::abs(a), std::abs(b)) * epsilon; } } \ No newline at end of file diff --git a/tests/test_data b/tests/test_data index 167bd0f..638f783 160000 --- a/tests/test_data +++ b/tests/test_data @@ -1 +1 @@ -Subproject commit 167bd0f1f95372d5770ecf577c852a381b45b98d +Subproject commit 638f783565d9df83e543e37e0ca5340c331c60b2