The way variables are represented internally by MOIU.GenericModel is encapsulated in the following 4 lines
|
num_variables_created::Int64 |
|
# If nothing, no variable has been deleted so the indices of the |
|
# variables are VI.(1:num_variables_created) |
|
variable_indices::Union{Nothing,Set{VI}} |
|
# Union of flags of `S` such that a `SingleVariable`-in-`S` |
|
# constraint was added to the model and not deleted yet. |
|
single_variable_mask::Vector{UInt8} |
|
# Bounds set by `SingleVariable`-in-`S`: |
|
variable_bounds::Box{T} |
We could factor them out into a
ModelLike supporting only these
SingleVariable constraints.
This would allow MOI wrapper that need this to just have this as a field as well and not have to redo all the work.
That would apply to all solvers currently having the
VariableInfo struct.
The issue is that this is currently hardcoded for a few
SingleVariable constraints of interest.
EDIT: just notice that this is close to what #1468 does
The way variables are represented internally by
MOIU.GenericModelis encapsulated in the following 4 linesMathOptInterface.jl/src/Utilities/model.jl
Lines 993 to 1001 in a1d3ed9
We could factor them out into a
ModelLikesupporting only theseSingleVariableconstraints.This would allow MOI wrapper that need this to just have this as a field as well and not have to redo all the work.
That would apply to all solvers currently having the
VariableInfostruct.The issue is that this is currently hardcoded for a few
SingleVariableconstraints of interest.EDIT: just notice that this is close to what #1468 does