@@ -2077,22 +2077,6 @@ function _store_solution(model::Optimizer, ret::HighsInt)
20772077 resize! (x. rowdual, numRows)
20782078 x. model_status = Highs_getModelStatus (model)
20792079 statusP = Ref {HighsInt} ()
2080- certificates = MOI. get (model, ComputeInfeasibilityCertificate ())
2081- if certificates && x. model_status == kHighsModelStatusInfeasible
2082- ret = Highs_getDualRay (model, statusP, x. rowdual)
2083- # Don't `_check_ret(ret)` here, just bail is there isn't a dual ray.
2084- x. has_dual_ray = (ret == kHighsStatusOk) && (statusP[] == 1 )
2085- if x. has_dual_ray
2086- _compute_farkas_variable_dual (model, x. coldual)
2087- end
2088- elseif certificates && x. model_status == kHighsModelStatusUnbounded
2089- ret = Highs_getPrimalRay (model, statusP, x. colvalue)
2090- # Don't `_check_ret(ret)` here, just bail is there isn't a dual ray.
2091- x. has_primal_ray = (ret == kHighsStatusOk) && (statusP[] == 1 )
2092- end
2093- if x. has_dual_ray || x. has_primal_ray
2094- return # If a ray is present, we don't query the solution
2095- end
20962080 Highs_getIntInfoValue (model, " primal_solution_status" , statusP)
20972081 x. primal_solution_status = statusP[]
20982082 Highs_getIntInfoValue (model, " dual_solution_status" , statusP)
@@ -2106,6 +2090,25 @@ function _store_solution(model::Optimizer, ret::HighsInt)
21062090 Highs_getBasis (model, x. colstatus, x. rowstatus)
21072091 end
21082092 end
2093+ if ! MOI. get (model, ComputeInfeasibilityCertificate ())
2094+ return
2095+ end
2096+ if x. model_status == kHighsModelStatusInfeasible
2097+ ret = Highs_getDualRay (model, statusP, x. rowdual)
2098+ # Don't `_check_ret(ret)` here, just bail is there isn't a dual ray.
2099+ x. has_dual_ray = (ret == kHighsStatusOk) && (statusP[] == 1 )
2100+ if x. has_dual_ray
2101+ _compute_farkas_variable_dual (model, x. coldual)
2102+ x. dual_solution_status = kHighsSolutionStatusNone
2103+ end
2104+ elseif x. model_status == kHighsModelStatusUnbounded
2105+ ret = Highs_getPrimalRay (model, statusP, x. colvalue)
2106+ # Don't `_check_ret(ret)` here, just bail is there isn't a dual ray.
2107+ x. has_primal_ray = (ret == kHighsStatusOk) && (statusP[] == 1 )
2108+ if x. has_primal_ray
2109+ x. primal_solution_status = kHighsSolutionStatusNone
2110+ end
2111+ end
21092112 return
21102113end
21112114
0 commit comments