Skip to content

Commit

Permalink
Fix return type of SimplexIterations (#573)
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored Sep 22, 2024
1 parent b8cea15 commit 1545373
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/MOI_wrapper/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3240,28 +3240,28 @@ function MOI.get(model::Optimizer, attr::MOI.SolveTimeSec)
return valueP[]
end

function MOI.get(model::Optimizer, attr::MOI.SimplexIterations)
function MOI.get(model::Optimizer, attr::MOI.SimplexIterations)::Int64
_throw_if_optimize_in_progress(model, attr)
valueP = Ref{Cdouble}()
ret = GRBgetdblattr(model, "IterCount", valueP)
_check_ret(model, ret)
return valueP[]
end

function MOI.get(model::Optimizer, attr::MOI.BarrierIterations)
function MOI.get(model::Optimizer, attr::MOI.BarrierIterations)::Int64
_throw_if_optimize_in_progress(model, attr)
valueP = Ref{Cint}()
ret = GRBgetintattr(model, "BarIterCount", valueP)
_check_ret(model, ret)
return Int(valueP[])
return valueP[]
end

function MOI.get(model::Optimizer, attr::MOI.NodeCount)
function MOI.get(model::Optimizer, attr::MOI.NodeCount)::Int64
_throw_if_optimize_in_progress(model, attr)
valueP = Ref{Cdouble}()
ret = GRBgetdblattr(model, "NodeCount", valueP)
_check_ret(model, ret)
return round(Int64, valueP[])
return valueP[]
end

function MOI.get(model::Optimizer, attr::MOI.RelativeGap)
Expand All @@ -3284,15 +3284,15 @@ function MOI.get(model::Optimizer, attr::MOI.DualObjectiveValue)
return valueP[]
end

function MOI.get(model::Optimizer, attr::MOI.ResultCount)
function MOI.get(model::Optimizer, attr::MOI.ResultCount)::Int
_throw_if_optimize_in_progress(model, attr)
if model.has_infeasibility_cert || model.has_unbounded_ray
return 1
end
valueP = Ref{Cint}()
ret = GRBgetintattr(model, "SolCount", valueP)
_check_ret(model, ret)
return Int(valueP[])
return valueP[]
end

function MOI.get(model::Optimizer, ::MOI.Silent)
Expand Down

0 comments on commit 1545373

Please sign in to comment.