This repository was archived by the owner on Feb 9, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +20
-8
lines changed
Expand file tree Collapse file tree 3 files changed +20
-8
lines changed Original file line number Diff line number Diff line change 11julia 0.7
2- MathOptInterface 0.6 0.7
2+ MathOptInterface 0.7 0.8
33Mosek
44Compat 1
Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ mutable struct MosekModel <: MOI.AbstractOptimizer
250250 conecounter :: Int
251251
252252 # ##########################
253- trm :: Rescode
253+ trm :: Union{Nothing, Rescode}
254254 solutions :: Vector{MosekSolution}
255255
256256 # ##########################
@@ -336,7 +336,7 @@ function MosekOptimizer(; kws...)
336336 Int[], # c_block_slack
337337 Int[], # c_coneid
338338 0 , # cone counter
339- Mosek . MSK_RES_OK ,# trm
339+ nothing ,# trm
340340 MosekSolution[],
341341 true ) # feasibility_sense
342342end
@@ -418,11 +418,12 @@ function MOI.empty!(model::MosekModel)
418418 model. c_block_slack = Int[]
419419 model. c_coneid = Int[]
420420 model. conecounter = 0
421- model. trm = Mosek . MSK_RES_OK
421+ model. trm = nothing
422422 model. solutions = MosekSolution[]
423423 model. feasibility = true
424424end
425425
426+ MOIU. supports_default_copy_to (:: MosekModel , copy_names:: Bool ) = ! copy_names
426427function MOI. copy_to (dest:: MosekModel , src:: MOI.ModelLike ; copy_names= true )
427428 return MOIU. default_copy_to (dest, src, copy_names)
428429end
Original file line number Diff line number Diff line change @@ -486,31 +486,42 @@ end
486486
487487# ### Status codes
488488function MOI. get (m:: MosekModel ,attr:: MOI.TerminationStatus )
489- if m. trm == MSK_RES_OK
490- MOI. Success
489+ if m. trm === nothing
490+ MOI. OptimizeNotCalled
491+ elseif m. trm == MSK_RES_OK
492+ if any (sol -> sol. solsta == MSK_SOL_STA_PRIM_INFEAS_CER, m. solutions)
493+ MOI. Infeasible
494+ elseif any (sol -> sol. solsta == MSK_SOL_STA_DUAL_INFEAS_CER,
495+ m. solutions)
496+ MOI. DualInfeasible
497+ else
498+ MOI. Optimal
499+ end
491500 elseif m. trm == MSK_RES_TRM_MAX_ITERATIONS
492501 MOI. IterationLimit
493502 elseif m. trm == MSK_RES_TRM_MAX_TIME
494503 MOI. TimeLimit
495504 elseif m. trm == MSK_RES_TRM_OBJECTIVE_RANGE
496505 MOI. ObjectiveLimit
497506 elseif m. trm == MSK_RES_TRM_MIO_NEAR_REL_GAP
498- MOI. AlmostSuccess
507+ MOI. AlmostOptimal
499508 elseif m. trm == MSK_RES_TRM_MIO_NEAR_ABS_GAP
500- MOI. AlmostSuccess
509+ MOI. AlmostOptimal
501510 elseif m. trm == MSK_RES_TRM_MIO_NUM_RELAXS
502511 MOI. OtherLimit
503512 elseif m. trm == MSK_RES_TRM_MIO_NUM_BRANCHES
504513 MOI. NodeLimit
505514 elseif m. trm == MSK_RES_TRM_NUM_MAX_NUM_INT_SOLUTIONS
506515 MOI. SolutionLimit
507516 elseif m. trm == MSK_RES_TRM_STALL
517+ println (" STALL" )
508518 MOI. SlowProgress
509519 elseif m. trm == MSK_RES_TRM_USER_CALLBACK
510520 MOI. Interrupted
511521 elseif m. trm == MSK_RES_TRM_MAX_NUM_SETBACKS
512522 MOI. OtherLimit
513523 elseif m. trm == MSK_RES_TRM_NUMERICAL_PROBLEM
524+ println (" NUMERICAL_PROBLEM" )
514525 MOI. SlowProgress
515526 elseif m. trm == MSK_RES_TRM_INTERNAL
516527 MOI. OtherError
You can’t perform that action at this time.
0 commit comments