From 78bf6ec643b43f4800130ed73f743067b64d9031 Mon Sep 17 00:00:00 2001 From: Tan Shjie <746715040@qq.com> Date: Tue, 20 Aug 2024 15:56:01 +0800 Subject: [PATCH] Update compass_search.cpp 0 <= stop range < start range --- src/algorithms/compass_search.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/compass_search.cpp b/src/algorithms/compass_search.cpp index 01d2b3a6e..cc4f881ec 100644 --- a/src/algorithms/compass_search.cpp +++ b/src/algorithms/compass_search.cpp @@ -53,8 +53,8 @@ compass_search::compass_search(unsigned max_fevals, double start_range, double s pagmo_throw(std::invalid_argument, "The start range must be in (0, 1], while a value of " + std::to_string(start_range) + " was detected."); } - if (stop_range > 1. || stop_range >= start_range || std::isnan(stop_range)) { - pagmo_throw(std::invalid_argument, "the stop range must be in (start_range, 1], while a value of " + if (stop_range < 0. || stop_range >= start_range || std::isnan(stop_range)) { + pagmo_throw(std::invalid_argument, "the stop range must be in [0, start_range), while a value of " + std::to_string(stop_range) + " was detected."); } if (reduction_coeff >= 1. || reduction_coeff <= 0. || std::isnan(reduction_coeff)) {