From 1db5a38539cb04cabdc1778473b734e57e068d84 Mon Sep 17 00:00:00 2001 From: Chainfire Date: Sun, 31 Mar 2024 21:26:49 +0200 Subject: [PATCH] Reduce FOREVER from 290 to 200 years (#2938) Prevents wrap observed in emcc, causing find_max_global to exit immediately unless a custom (and non-wrapping) max_runtime is provided. --- dlib/global_optimization/find_max_global.h | 2 +- dlib/global_optimization/find_max_global_abstract.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlib/global_optimization/find_max_global.h b/dlib/global_optimization/find_max_global.h index 6ef559cb0e..12e496e698 100644 --- a/dlib/global_optimization/find_max_global.h +++ b/dlib/global_optimization/find_max_global.h @@ -114,7 +114,7 @@ template static auto go(T&& f, const matrix& a) -> de // ---------------------------------------------------------------------------------------- - const auto FOREVER = std::chrono::hours(24*365*290); // 290 years + const auto FOREVER = std::chrono::hours(24*365*200); // 200 years using stop_condition = std::function; const stop_condition never_stop_early = [](double) { return false; }; diff --git a/dlib/global_optimization/find_max_global_abstract.h b/dlib/global_optimization/find_max_global_abstract.h index 40e49d86ab..d6e9088cfb 100644 --- a/dlib/global_optimization/find_max_global_abstract.h +++ b/dlib/global_optimization/find_max_global_abstract.h @@ -68,7 +68,7 @@ namespace dlib // ---------------------------------------------------------------------------------------- - const auto FOREVER = std::chrono::hours(24*356*290); // 290 years, basically forever + const auto FOREVER = std::chrono::hours(24*356*200); // 200 years, basically forever /*! WHAT THIS OBJECT REPRESENTS