Skip to content

Commit

Permalink
Move to AbstractModel
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Jan 8, 2025
1 parent 6a7831f commit 027c99e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/ConicProgram/ConicProgram.jl
Original file line number Diff line number Diff line change
Expand Up @@ -155,25 +155,6 @@ function MOI.set(
)
end

# The following `supports` methods are needed because
# `MOI.set(::MOI.ModelLike, ::SlackBridgePrimalDualStart, ::SlackBridge, ::Nothing)`
# checks that the model supports these starting value attributes.
function MOI.supports(
::Model,
::Union{MOI.VariablePrimalStart},
::Type{<:MOI.VariableIndex},
)
return true
end

function MOI.supports(
::Model,
::Union{MOI.ConstraintDualStart,MOI.ConstraintPrimalStart},
::Type{<:MOI.ConstraintIndex},
)
return true
end

function MOI.set(
model::Model,
::MOI.ConstraintDualStart,
Expand Down
19 changes: 19 additions & 0 deletions src/diff_opt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,25 @@ function _enlarge_set(vec::Vector, idx, value)
return
end

# The following `supports` methods are needed because
# `MOI.set(::MOI.ModelLike, ::SlackBridgePrimalDualStart, ::SlackBridge, ::Nothing)`
# checks that the model supports these starting value attributes.
function MOI.supports(
::AbstractModel,
::MOI.VariablePrimalStart,
::Type{<:MOI.VariableIndex},
)
return true
end

function MOI.supports(
::AbstractModel,
::Union{MOI.ConstraintDualStart,MOI.ConstraintPrimalStart},
::Type{<:MOI.ConstraintIndex},
)
return true
end

function MOI.get(
model::AbstractModel,
::MOI.VariablePrimalStart,
Expand Down

0 comments on commit 027c99e

Please sign in to comment.