Skip to content

Commit

Permalink
Merge pull request #238 from blegat/bl/raw
Browse files Browse the repository at this point in the history
Implement RawStatusString
  • Loading branch information
harshangrjn authored Oct 24, 2023
2 parents 115ef67 + 40ad64e commit b7a6371
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/MOI_wrapper/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ function MOI.get(m::Optimizer, ::TightenedUpperBound, vi::MOI.VariableIndex)
return m.u_var_tight[vi.value]
end

function MOI.get(m::Optimizer, ::MOI.RawStatusString)
return "Alpine ended with status $(m.alpine_status)"
end

MOI.get(m::Optimizer, ::MOI.TerminationStatus) = m.alpine_status

function MOI.get(m::Optimizer, attr::MOI.PrimalStatus)
Expand Down
3 changes: 2 additions & 1 deletion src/log.jl
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ function summary_status(m::Optimizer)
@warn " [EXCEPTION] Indefinite Alpine status. Please report your instance (& solver configuration) as an issue (https://github.com/lanl-ansi/Alpine.jl/issues) to help us make Alpine better."
end

printstyled("\n*** Alpine ended with status $(m.alpine_status) ***\n")
raw = MOI.get(m, MOI.RawStatusString())
printstyled("\n*** $raw ***\n")

return
end
Expand Down
1 change: 1 addition & 0 deletions test/test_algorithm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ end
@test termination_status(m) == MOI.OPTIMAL
@test primal_status(m) == MOI.FEASIBLE_POINT
@test dual_status(m) == MOI.NO_SOLUTION
@test raw_status(m) isa String
@test isapprox(objective_value(m), 0.92906489; atol = 1e-3)
end

Expand Down

0 comments on commit b7a6371

Please sign in to comment.