From 05c7fee39150860d7b9fb2a893ffc4e4f4f8e87d Mon Sep 17 00:00:00 2001 From: Alejandro Duarte Date: Wed, 28 Feb 2024 12:48:46 -0500 Subject: [PATCH 1/2] Implement a log error msg --- include/albatross/src/stats/incomplete_gamma.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/albatross/src/stats/incomplete_gamma.hpp b/include/albatross/src/stats/incomplete_gamma.hpp index eafd5bbc..f8174689 100644 --- a/include/albatross/src/stats/incomplete_gamma.hpp +++ b/include/albatross/src/stats/incomplete_gamma.hpp @@ -35,7 +35,12 @@ constexpr double INCOMPLETE_GAMMA_EQUALITY_TRESHOLD = 1e-12; inline double incomplete_gamma_quadrature_inp_vals(double lb, double ub, std::size_t counter) { - ALBATROSS_ASSERT(counter < gauss_legendre_50_points.size()); + if (counter >= gauss_legendre_50_points.size()) { + std::cout << "ERROR: Counter value " << counter + << " is higher than gauss_legendre_50_points size " + << gauss_legendre_50_points.size() << std::endl; + ALBATROSS_ASSERT(false); + } return (ub - lb) * 0.5 * gauss_legendre_50_points[counter] + 0.5 * (ub + lb); } From 1d354ac08e639b0a9af0ea33256c1166e9de46bc Mon Sep 17 00:00:00 2001 From: Alejandro Duarte Date: Wed, 28 Feb 2024 14:09:55 -0500 Subject: [PATCH 2/2] Use cerr for error --- include/albatross/src/stats/incomplete_gamma.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/albatross/src/stats/incomplete_gamma.hpp b/include/albatross/src/stats/incomplete_gamma.hpp index f8174689..262ab9c8 100644 --- a/include/albatross/src/stats/incomplete_gamma.hpp +++ b/include/albatross/src/stats/incomplete_gamma.hpp @@ -36,7 +36,7 @@ constexpr double INCOMPLETE_GAMMA_EQUALITY_TRESHOLD = 1e-12; inline double incomplete_gamma_quadrature_inp_vals(double lb, double ub, std::size_t counter) { if (counter >= gauss_legendre_50_points.size()) { - std::cout << "ERROR: Counter value " << counter + std::cerr << "ERROR: Counter value " << counter << " is higher than gauss_legendre_50_points size " << gauss_legendre_50_points.size() << std::endl; ALBATROSS_ASSERT(false);