Skip to content

Commit

Permalink
Fix output of RawStatusString (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored Mar 10, 2022
1 parent de21844 commit 8e39503
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "HiGHS"
uuid = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
version = "1.1.0"
version = "1.1.1"

[deps]
HiGHS_jll = "8fd58aa0-07eb-5a78-9b36-339c94fd15ea"
Expand Down
39 changes: 38 additions & 1 deletion src/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1667,7 +1667,44 @@ function MOI.get(model::Optimizer, ::MOI.ResultCount)
end

function MOI.get(model::Optimizer, ::MOI.RawStatusString)
return string(model.solution.model_status)
if model.solution.status == _OPTIMIZE_NOT_CALLED
return "OPTIMIZE_NOT_CALLED"
elseif model.solution.status == _OPTIMIZE_ERRORED
return "There was an error calling optimize!"
elseif model.solution.model_status == kHighsModelStatusNotset
return "kHighsModelStatusNotset"
elseif model.solution.model_status == kHighsModelStatusLoadError
return "kHighsModelStatusLoadError"
elseif model.solution.model_status == kHighsModelStatusModelError
return "kHighsModelStatusModelError"
elseif model.solution.model_status == kHighsModelStatusPresolveError
return "kHighsModelStatusPresolveError"
elseif model.solution.model_status == kHighsModelStatusSolveError
return "kHighsModelStatusSolveError"
elseif model.solution.model_status == kHighsModelStatusPostsolveError
return "kHighsModelStatusPostsolveError"
elseif model.solution.model_status == kHighsModelStatusModelEmpty
return "kHighsModelStatusModelEmpty"
elseif model.solution.model_status == kHighsModelStatusOptimal
return "kHighsModelStatusOptimal"
elseif model.solution.model_status == kHighsModelStatusInfeasible
return "kHighsModelStatusInfeasible"
elseif model.solution.model_status == kHighsModelStatusUnboundedOrInfeasible
return "kHighsModelStatusUnboundedOrInfeasible"
elseif model.solution.model_status == kHighsModelStatusUnbounded
return "kHighsModelStatusUnbounded"
elseif model.solution.model_status == kHighsModelStatusObjectiveBound
return "kHighsModelStatusObjectiveBound"
elseif model.solution.model_status == kHighsModelStatusObjectiveTarget
return "kHighsModelStatusObjectiveTarget"
elseif model.solution.model_status == kHighsModelStatusTimeLimit
return "kHighsModelStatusTimeLimit"
elseif model.solution.model_status == kHighsModelStatusIterationLimit
return "kHighsModelStatusIterationLimit"
else
@assert model.solution.model_status kHighsModelStatusUnknown
return "kHighsModelStatusUnknown"
end
end

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

2 comments on commit 8e39503

@odow
Copy link
Member Author

@odow odow commented on 8e39503 Mar 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/56333

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.1.1 -m "<description of version>" 8e39503c2f75ca66446e4559ba3f920f4165dafa
git push origin v1.1.1

Please sign in to comment.