From ed832d69fb3fe75fc4f12324736e587a3bf216c0 Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Thu, 13 Apr 2023 01:00:22 +0200 Subject: [PATCH] fix for solve_in_loop script --- scripts/utils.jl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/utils.jl b/scripts/utils.jl index 840eb80..5dd6c80 100644 --- a/scripts/utils.jl +++ b/scripts/utils.jl @@ -81,14 +81,13 @@ function solve_in_loop(model::JuMP.Model, args...; logdir, optimizer, data) abs(certified_λ - old_lambda) / (abs(certified_λ) + abs(old_lambda)) @info "Certification failed with λ = $λ" certified_λ rel_change status + if rel_change < 1e-9 + @info "No progress detected, breaking" certified_λ rel_change status + break + end end old_lambda = certified_λ - - if rel_change < 1e-9 - @info "No progress detected, breaking" certified_λ rel_change status - break - end end return status == JuMP.OPTIMAL ? old_lambda : NaN