@@ -2077,22 +2077,6 @@ function _store_solution(model::Optimizer, ret::HighsInt)
2077
2077
resize! (x. rowdual, numRows)
2078
2078
x. model_status = Highs_getModelStatus (model)
2079
2079
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
2096
2080
Highs_getIntInfoValue (model, " primal_solution_status" , statusP)
2097
2081
x. primal_solution_status = statusP[]
2098
2082
Highs_getIntInfoValue (model, " dual_solution_status" , statusP)
@@ -2106,6 +2090,25 @@ function _store_solution(model::Optimizer, ret::HighsInt)
2106
2090
Highs_getBasis (model, x. colstatus, x. rowstatus)
2107
2091
end
2108
2092
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
2109
2112
return
2110
2113
end
2111
2114
0 commit comments