Fix named constraints Error with Gurobi/CPLEX#109
Conversation
Codecov Report
@@ Coverage Diff @@
## master #109 +/- ##
==========================================
- Coverage 95.77% 94.90% -0.87%
==========================================
Files 4 4
Lines 922 942 +20
==========================================
+ Hits 883 894 +11
- Misses 39 48 +9
Continue to review full report at Codecov.
|
src/ParametricOptInterface.jl
Outdated
| name::String, | ||
| ) | ||
| MOI.set(model.optimizer, attr, c, name) | ||
| if typeof(c).parameters[1] == |
There was a problem hiding this comment.
This is very misterious, I think you should parametrize the type to get the information that you want
There was a problem hiding this comment.
So, we should create three separate functions? Like for scalar quadratic function:
MOI.set(
model::Optimizer,
attr::MOI.ConstraintName,
c::MOI.ConstraintIndex{F,S},
name::String,
) where {S<:MOI.AbstractSet, F <: MOI.ScalarQuadraticFunction{T}} where {T}And so on...
There was a problem hiding this comment.
I thinnk that tis is a better approach than manually doing the runtime dispatch. We leave it to the julia compiler.
src/ParametricOptInterface.jl
Outdated
| c::MOI.ConstraintIndex, | ||
| ) | ||
| return MOI.get(model.optimizer, attr, c) | ||
| if typeof(c).parameters[1] == |
Fix named constraints Error with Gurobi/CPLEX
Close #105