Skip to content

From Uno status to MOI #605

@ocots

Description

@ocots

@cvanaret @amontoison It seems to me that this is not completely ok:

function _status_code_mapping(uno_termination_status::Cint, uno_solution_status::Cint)
if uno_termination_status == UnoSolver.UNO_ITERATION_LIMIT
return (MOI.ITERATION_LIMIT, MOI.UNKNOWN_RESULT_STATUS) # here we could test feasibility
elseif uno_termination_status == UnoSolver.UNO_TIME_LIMIT
return (MOI.TIME_LIMIT, MOI.UNKNOWN_RESULT_STATUS) # here we could test feasibility
elseif uno_termination_status == UnoSolver.UNO_EVALUATION_ERROR
return (MOI.INVALID_MODEL, MOI.UNKNOWN_RESULT_STATUS)
elseif uno_termination_status == UnoSolver.UNO_ALGORITHMIC_ERROR
return (MOI.OTHER_ERROR, MOI.UNKNOWN_RESULT_STATUS)
else # UNO_SUCCESS
if uno_solution_status == UnoSolver.UNO_FEASIBLE_KKT_POINT
return (MOI.LOCALLY_SOLVED, MOI.FEASIBLE_POINT)
elseif uno_solution_status == UnoSolver.UNO_FEASIBLE_FJ_POINT
return (MOI.LOCALLY_SOLVED, MOI.FEASIBLE_POINT)
elseif uno_solution_status == UnoSolver.UNO_INFEASIBLE_STATIONARY_POINT
return (MOI.LOCALLY_INFEASIBLE, MOI.INFEASIBLE_POINT)
elseif uno_solution_status == UnoSolver.UNO_FEASIBLE_SMALL_STEP
return (MOI.SLOW_PROGRESS, MOI.FEASIBLE_POINT)
elseif uno_solution_status == UnoSolver.UNO_INFEASIBLE_SMALL_STEP
return (MOI.SLOW_PROGRESS, MOI.INFEASIBLE_POINT)
else # UNO_UNBOUNDED
return (MOI.DUAL_INFEASIBLE, MOI.FEASIBLE_POINT)
end
end
end

According to

const UNO_SUCCESS = Cint(0)
const UNO_ITERATION_LIMIT = Cint(1)
const UNO_TIME_LIMIT = Cint(2)
const UNO_EVALUATION_ERROR = Cint(3)
const UNO_ALGORITHMIC_ERROR = Cint(4)
const UNO_USER_TERMINATION = Cint(5)
const UNO_NOT_OPTIMAL = Cint(0)
const UNO_FEASIBLE_KKT_POINT = Cint(1)
const UNO_FEASIBLE_FJ_POINT = Cint(2)
const UNO_INFEASIBLE_STATIONARY_POINT = Cint(3)
const UNO_FEASIBLE_SMALL_STEP = Cint(4)
const UNO_INFEASIBLE_SMALL_STEP = Cint(5)
const UNO_UNBOUNDED = Cint(6)

I would write

function _status_code_mapping(uno_termination_status::Cint, uno_solution_status::Cint)
    if uno_termination_status == UnoSolver.UNO_ITERATION_LIMIT
        return (MOI.ITERATION_LIMIT, MOI.UNKNOWN_RESULT_STATUS) # here we could test feasibility
    elseif uno_termination_status == UnoSolver.UNO_TIME_LIMIT
        return (MOI.TIME_LIMIT, MOI.UNKNOWN_RESULT_STATUS) # here we could test feasibility
    elseif uno_termination_status == UnoSolver.UNO_EVALUATION_ERROR
        return (MOI.INVALID_MODEL, MOI.UNKNOWN_RESULT_STATUS)
    elseif uno_termination_status == UnoSolver.UNO_ALGORITHMIC_ERROR
        return (MOI.OTHER_ERROR, MOI.UNKNOWN_RESULT_STATUS)
    elseif uno_optimization_status == UnoSolver.UNO_USER_TERMINATION
        return (MOI.INTERRUPTED, MOI.UNKNOWN_RESULT_STATUS)         # THIS IS NEW
    else # UNO_SUCCESS
        if uno_solution_status == UnoSolver.UNO_FEASIBLE_KKT_POINT
            return (MOI.LOCALLY_SOLVED, MOI.FEASIBLE_POINT)
        elseif uno_solution_status == UnoSolver.UNO_FEASIBLE_FJ_POINT
            return (MOI.LOCALLY_SOLVED, MOI.FEASIBLE_POINT)
        elseif uno_solution_status == UnoSolver.UNO_INFEASIBLE_STATIONARY_POINT
            return (MOI.LOCALLY_INFEASIBLE, MOI.INFEASIBLE_POINT)
        elseif uno_solution_status == UnoSolver.UNO_FEASIBLE_SMALL_STEP
            return (MOI.SLOW_PROGRESS, MOI.FEASIBLE_POINT)
        elseif uno_solution_status == UnoSolver.UNO_INFEASIBLE_SMALL_STEP
            return (MOI.SLOW_PROGRESS, MOI.INFEASIBLE_POINT)
        elseif uno_solution_status == UnoSolver.UNO_UNBOUNDED
            return (MOI.DUAL_INFEASIBLE, MOI.FEASIBLE_POINT)
        else # UNO_NOT_OPTIMAL
            return ....  # TO BE COMPLETED
        end
    end
end

@cvanaret @amontoison What do you think?

When you set max_iterations to 0, then you get optimization_status = UNO_SUCCESS, solution_status = UNO_NOT_OPTIMAL which falls in

else # UNO_UNBOUNDED
return (MOI.DUAL_INFEASIBLE, MOI.FEASIBLE_POINT)

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions