From 27283b62361bee79713cba672c2ec71b7fef6a31 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Wed, 7 Feb 2024 17:26:01 +1300 Subject: [PATCH] Update optimizer_interface.jl --- src/optimizer_interface.jl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/optimizer_interface.jl b/src/optimizer_interface.jl index eaab1c5c08d..1b4004ab466 100644 --- a/src/optimizer_interface.jl +++ b/src/optimizer_interface.jl @@ -617,11 +617,13 @@ function has_optimal_solution( (allow_local && (status == LOCALLY_SOLVED)) || (allow_almost && (status == ALMOST_OPTIMAL)) || (allow_almost && allow_local && (status == ALMOST_LOCALLY_SOLVED)) - primal = primal_status(model; result) - ret &= - (primal == FEASIBLE_POINT) || - (allow_almost && (primal == NEARLY_FEASIBLE_POINT)) - if dual + if ret + primal = primal_status(model; result) + ret &= + (primal == FEASIBLE_POINT) || + (allow_almost && (primal == NEARLY_FEASIBLE_POINT)) + end + if ret && dual dual_stat = dual_status(model; result) ret &= (dual_stat == FEASIBLE_POINT) ||