Skip to content

Commit d7334c1

Browse files
committed
Fix blegat's comments
1 parent fa62308 commit d7334c1

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

src/Utilities/model.jl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -851,8 +851,11 @@ addition to being different between constraints `F`-in-`S` for the same types
851851
use the the value of the index directly in a dictionary representing a mapping
852852
between constraint indices and something else.
853853
854-
If `is_optimizer = true`, the resulting stuct is a subtype of
855-
`MOIU.AbstractOptimizer`, otherwise, it is a subtype of `MOIU.AbstractModelLike`.
854+
If `is_optimizer = true`, the resulting struct is a subtype of
855+
of `MOIU.AbstractOptimizer`, which is a subtype of
856+
[`MathOptInterface.AbstractOptimizer`](@ref), otherwise, it is a subtype of
857+
`MOIU.AbstractModelLike`, which is a subtype of
858+
[`MathOptInterface.ModelLike`](@ref).
856859
857860
### Examples
858861
@@ -866,8 +869,8 @@ The model describing an linear program would be:
866869
(), # untyped scalar functions
867870
(MOI.ScalarAffineFunction,), # typed scalar functions
868871
(MOI.VectorOfVariables,), # untyped vector functions
869-
(MOI.VectorAffineFunction,) # typed vector functions
870-
true
872+
(MOI.VectorAffineFunction,), # typed vector functions
873+
false
871874
)
872875
```
873876
@@ -886,7 +889,7 @@ struct LPModelVectorConstraints{T, F <: MOI.AbstractVectorFunction} <: MOIU.Cons
886889
nonnegatives::Vector{MOIU.ConstraintEntry{F, MOI.Nonnegatives}}
887890
nonpositives::Vector{MOIU.ConstraintEntry{F, MOI.Nonpositives}}
888891
end
889-
mutable struct LPModel{T} <: MOIU.AbstractOptimizer{T}
892+
mutable struct LPModel{T} <: MOIU.AbstractModel{T}
890893
name::String
891894
sense::MOI.OptimizationSense
892895
objective::Union{MOI.SingleVariable, MOI.ScalarAffineFunction{T}, MOI.ScalarQuadraticFunction{T}}

test/Utilities/model.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module TestExternalModel
2525
(NewFunction,),
2626
(),
2727
(),
28-
(),
28+
()
2929
)
3030
MathOptInterface.Utilities.@model(ExternalOptimizer,
3131
(MathOptInterface.ZeroOne, NewSet,),
@@ -45,8 +45,10 @@ end
4545
optimizer = TestExternalModel.ExternalOptimizer{Float64}()
4646
@test isa(model, MOIU.AbstractModelLike{Float64})
4747
@test !isa(model, MOIU.AbstractOptimizer{Float64})
48+
@test !isa(model, MOI.AbstractOptimizer)
4849
@test !isa(optimizer, MOIU.AbstractModelLike{Float64})
4950
@test isa(optimizer, MOIU.AbstractOptimizer{Float64})
51+
@test isa(optimizer, MOI.AbstractOptimizer)
5052
end
5153

5254
@testset "External @model" begin

0 commit comments

Comments
 (0)