@@ -2348,12 +2348,14 @@ end
23482348"""
23492349 ConflictStatus()
23502350
2351- Return an `MOI.TerminationStatusCode` indicating the status of the last computed conflict.
2352- If a minimal conflict is found, it will return `MOI.OPTIMAL`. If the problem is feasible, it will
2353- return `MOI.INFEASIBLE`. If `compute_conflict` has not been called yet, it will return
2351+ Return an `MOI.TerminationStatusCode` indicating the status of the last
2352+ computed conflict. If a minimal conflict is found, it will return
2353+ `MOI.OPTIMAL`. If the problem is feasible, it will return `MOI.INFEASIBLE`. If
2354+ `compute_conflict` has not been called yet, it will return
23542355`MOI.OPTIMIZE_NOT_CALLED`.
23552356"""
2356- struct ConflictStatus <: MOI.AbstractModelAttribute end
2357+ struct ConflictStatus <: MOI.AbstractModelAttribute end
2358+
23572359MOI. is_set_by_optimize (:: ConflictStatus ) = true
23582360
23592361function MOI. get (model:: Optimizer , :: ConflictStatus )
@@ -2398,45 +2400,103 @@ end
23982400
23992401"""
24002402 ConstraintConflictStatus()
2401- A Boolean constraint attribute indicating whether the constraint participates in the last computed conflict.
2403+
2404+ A Boolean constraint attribute indicating whether the constraint participates
2405+ in the last computed conflict.
24022406"""
24032407struct ConstraintConflictStatus <: MOI.AbstractConstraintAttribute end
2408+
24042409MOI. is_set_by_optimize (:: ConstraintConflictStatus ) = true
24052410
2406- function MOI. get (model:: Optimizer , :: ConstraintConflictStatus , index:: MOI.ConstraintIndex{<:MOI.SingleVariable, <:LQOI.LE} )
2411+ function MOI. get (
2412+ model:: Optimizer , :: ConstraintConflictStatus ,
2413+ index:: MOI.ConstraintIndex{MOI.SingleVariable, <:MOI.LessThan}
2414+ )
24072415 _ensure_conflict_computed (model)
2408- return ! _is_feasible (model) && Bool (get_intattrelement (model. inner, " IISUB" , LQOI. get_column (model, model[index])))
2416+ if _is_feasible (model)
2417+ return false
2418+ end
2419+ return get_intattrelement (model. inner, " IISUB" , _info (model, index). column) > 0
24092420end
24102421
2411- function MOI. get (model:: Optimizer , :: ConstraintConflictStatus , index:: MOI.ConstraintIndex{<:MOI.SingleVariable, <:LQOI.GE} )
2422+ function MOI. get (
2423+ model:: Optimizer , :: ConstraintConflictStatus ,
2424+ index:: MOI.ConstraintIndex{MOI.SingleVariable, <:MOI.GreaterThan}
2425+ )
24122426 _ensure_conflict_computed (model)
2413- return ! _is_feasible (model) && Bool (get_intattrelement (model. inner, " IISLB" , LQOI. get_column (model, model[index])))
2427+ if _is_feasible (model)
2428+ return false
2429+ end
2430+ return get_intattrelement (model. inner, " IISLB" , _info (model, index). column) > 0
24142431end
24152432
2416- function MOI. get (model:: Optimizer , :: ConstraintConflictStatus , index:: MOI.ConstraintIndex{<:MOI.SingleVariable, <:Union{LQOI.EQ, LQOI.IV}} )
2433+ function MOI. get (
2434+ model:: Optimizer , :: ConstraintConflictStatus ,
2435+ index:: MOI.ConstraintIndex {
2436+ MOI. SingleVariable, <: Union{MOI.EqualTo, MOI.Interval}
2437+ }
2438+ )
24172439 _ensure_conflict_computed (model)
2418- return ! _is_feasible (model) && (
2419- Bool (get_intattrelement (model. inner, " IISUB" , LQOI. get_column (model, model[index]))) || Bool (get_intattrelement (model. inner, " IISLB" , model[index])))
2440+ if _is_feasible (model)
2441+ return false
2442+ end
2443+ if get_intattrelement (model. inner, " IISLB" , _info (model, index). column) > 0
2444+ return true
2445+ end
2446+ return get_intattrelement (model. inner, " IISUB" , _info (model, index). column) > 0
24202447end
24212448
2422- function MOI. get (model:: Optimizer , :: ConstraintConflictStatus , index:: MOI.ConstraintIndex{<:MOI.ScalarAffineFunction, <:Union{LQOI.LE, LQOI.GE, LQOI.EQ}} )
2449+ function MOI. get (
2450+ model:: Optimizer , :: ConstraintConflictStatus ,
2451+ index:: MOI.ConstraintIndex {
2452+ MOI. ScalarAffineFunction{Float64},
2453+ <: Union{MOI.LessThan, MOI.GreaterThan, MOI.EqualTo}
2454+ }
2455+ )
24232456 _ensure_conflict_computed (model)
2424- return ! _is_feasible (model) && Bool (get_intattrelement (model. inner, " IISConstr" , model[index]))
2457+ if _is_feasible (model)
2458+ return false
2459+ end
2460+ return get_intattrelement (model. inner, " IISConstr" , _info (model, index). row) > 0
24252461end
24262462
2427- function MOI. get (model:: Optimizer , :: ConstraintConflictStatus , index:: MOI.ConstraintIndex{<:MOI.ScalarQuadraticFunction, <:Union{LQOI.LE, LQOI.GE}} )
2463+ function MOI. get (
2464+ model:: Optimizer , :: ConstraintConflictStatus ,
2465+ index:: MOI.ConstraintIndex {
2466+ MOI. ScalarQuadraticFunction{Float64},
2467+ <: Union{MOI.LessThan, MOI.GreaterThan}
2468+ }
2469+ )
24282470 _ensure_conflict_computed (model)
2429- return ! _is_feasible (model) && Bool (get_intattrelement (model. inner, " IISQConstr" , model[index]))
2471+ if _is_feasible (model)
2472+ return false
2473+ end
2474+ return get_intattrelement (model. inner, " IISQConstr" , _info (model, index). row) > 0
24302475end
24312476
2432- function MOI. supports (:: Optimizer , :: ConstraintConflictStatus , :: Type{MOI.ConstraintIndex{<:MOI.SingleVariable, <:LQOI.LinSets}} )
2477+ function MOI. supports (
2478+ :: Optimizer , :: ConstraintConflictStatus ,
2479+ :: Type{<:MOI.ConstraintIndex{MOI.SingleVariable, <:SCALAR_SETS}}
2480+ )
24332481 return true
24342482end
24352483
2436- function MOI. supports (:: Optimizer , :: ConstraintConflictStatus , :: Type{MOI.ConstraintIndex{<:MOI.ScalarAffineFunction, <:Union{LQOI.LE, LQOI.GE, LQOI.EQ}}} )
2484+ function MOI. supports (
2485+ :: Optimizer , :: ConstraintConflictStatus ,
2486+ :: Type {<: MOI.ConstraintIndex {
2487+ MOI. ScalarAffineFunction{Float64},
2488+ <: Union{MOI.LessThan, MOI.GreaterThan, MOI.EqualTo}
2489+ }}
2490+ )
24372491 return true
24382492end
24392493
2440- function MOI. supports (:: Optimizer , :: ConstraintConflictStatus , :: Type{MOI.ConstraintIndex{<:MOI.ScalarQuadraticFunction, <:Union{LQOI.LE, LQOI.GE}}} )
2494+ function MOI. supports (
2495+ :: Optimizer , :: ConstraintConflictStatus ,
2496+ :: Type {<: MOI.ConstraintIndex {
2497+ MOI. ScalarQuadraticFunction{Float64},
2498+ <: Union{MOI.LessThan, MOI.GreaterThan}
2499+ }}
2500+ )
24412501 return true
24422502end
0 commit comments