Skip to content

Commit 19d85b0

Browse files
authored
Merge pull request #479 from JuliaOpt/bl/rmcanget
Remove canget
2 parents f2cbf24 + 7af8b06 commit 19d85b0

35 files changed

+210
-1042
lines changed

docs/src/apimanual.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ end
397397
MOI.optimize!(optimizer)
398398

399399
termination_status = MOI.get(optimizer, MOI.TerminationStatus())
400-
objvalue = MOI.canget(optimizer, MOI.ObjectiveValue()) ? MOI.get(optimizer, MOI.ObjectiveValue()) : NaN
400+
objvalue = MOI.get(optimizer, MOI.ObjectiveValue())
401401
if termination_status != MOI.Success
402402
error("Solver terminated with status $termination_status")
403403
end

docs/src/apireference.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ AbstractConstraintAttribute
2020
Functions for getting and setting attributes.
2121

2222
```@docs
23-
canget
2423
get
2524
get!
2625
set!

src/Bridges/bridgeoptimizer.jl

Lines changed: 13 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,6 @@ function MOI.delete!(b::AbstractBridgeOptimizer, ci::CI)
115115
end
116116

117117
# Attributes
118-
function MOI.canget(b::AbstractBridgeOptimizer,
119-
attr::Union{MOI.NumberOfConstraints{F, S},
120-
MOI.ListOfConstraintIndices{F, S}}) where {F, S}
121-
if isbridged(b, F, S)
122-
return MOI.canget(b.bridged, attr)
123-
else
124-
return MOI.canget(b.model, attr)
125-
end
126-
end
127118
function MOI.get(b::AbstractBridgeOptimizer,
128119
attr::MOI.ListOfConstraintIndices{F, S}) where {F, S}
129120
if isbridged(b, F, S)
@@ -162,9 +153,6 @@ function MOI.get(b::AbstractBridgeOptimizer,
162153
return _numberof(b, b.model, attr)
163154
end
164155
end
165-
function MOI.canget(b::AbstractBridgeOptimizer, attr::MOI.ListOfConstraints)
166-
return MOI.canget(b.model, attr) && MOI.canget(b.bridged, attr)
167-
end
168156
function MOI.get(b::AbstractBridgeOptimizer, attr::MOI.ListOfConstraints)
169157
list_of_types = [MOI.get(b.model, attr); MOI.get(b.bridged, attr)]
170158
# Some constraint types show up in `list_of_types` even when all the
@@ -178,11 +166,6 @@ function MOI.get(b::AbstractBridgeOptimizer, attr::MOI.ListOfConstraints)
178166
end
179167

180168
# Model an optimizer attributes
181-
function MOI.canget(b::AbstractBridgeOptimizer,
182-
attr::Union{MOI.AbstractModelAttribute,
183-
MOI.AbstractOptimizerAttribute})
184-
return MOI.canget(b.model, attr)
185-
end
186169
function MOI.get(b::AbstractBridgeOptimizer,
187170
attr::Union{MOI.AbstractModelAttribute,
188171
MOI.AbstractOptimizerAttribute})
@@ -196,11 +179,6 @@ function MOI.set!(b::AbstractBridgeOptimizer,
196179
end
197180

198181
# Variable attributes
199-
function MOI.canget(b::AbstractBridgeOptimizer,
200-
attr::MOI.AbstractVariableAttribute,
201-
::Type{VI})
202-
return MOI.canget(b.model, attr, VI)
203-
end
204182
function MOI.get(b::AbstractBridgeOptimizer,
205183
attr::MOI.AbstractVariableAttribute,
206184
index::VI)
@@ -228,44 +206,15 @@ function MOI.set!(b::AbstractBridgeOptimizer,
228206
end
229207

230208
# Constraint attributes
231-
## Result constraint attributes
232-
const ResultConstraintAttribute = Union{MOI.ConstraintPrimalStart,
233-
MOI.ConstraintDualStart,
234-
MOI.ConstraintPrimal,
235-
MOI.ConstraintDual,
236-
MOI.ConstraintBasisStatus}
237-
function MOI.canget(b::AbstractBridgeOptimizer, attr::ResultConstraintAttribute,
238-
ci::Type{CI{F, S}}) where {F, S}
239-
if isbridged(b, F, S)
240-
return MOI.canget(b, attr, concrete_bridge_type(b, F, S))
241-
else
242-
return MOI.canget(b.model, attr, ci)
243-
end
244-
end
245-
function MOI.get(b::AbstractBridgeOptimizer, attr::ResultConstraintAttribute,
246-
ci::CI)
247-
if isbridged(b, typeof(ci))
248-
MOI.get(b, attr, bridge(b, ci))
249-
else
250-
MOI.get(b.model, attr, ci)
251-
end
252-
end
253-
## Model constraint attributes
254-
const ModelConstraintAttribute = Union{MOI.ConstraintName,
255-
MOI.ConstraintFunction,
256-
MOI.ConstraintSet}
257-
function MOI.canget(b::AbstractBridgeOptimizer, attr::ModelConstraintAttribute,
258-
ci::Type{CI{F, S}}) where {F, S}
259-
if isbridged(b, F, S)
260-
return MOI.canget(b.bridged, attr, ci)
261-
else
262-
return MOI.canget(b.model, attr, ci)
263-
end
264-
end
265-
function MOI.get(b::AbstractBridgeOptimizer, attr::ModelConstraintAttribute,
209+
function MOI.get(b::AbstractBridgeOptimizer,
210+
attr::MOI.AbstractConstraintAttribute,
266211
ci::CI)
267212
if isbridged(b, typeof(ci))
268-
MOI.get(b.bridged, attr, ci)
213+
if MOIU.is_result_attribute(attr)
214+
MOI.get(b, attr, bridge(b, ci))
215+
else
216+
MOI.get(b.bridged, attr, ci)
217+
end
269218
else
270219
MOI.get(b.model, attr, ci)
271220
end
@@ -318,14 +267,6 @@ function MOI.set!(b::AbstractBridgeOptimizer, ::MOI.ConstraintFunction,
318267
end
319268

320269
# Name
321-
function MOI.canget(b::AbstractBridgeOptimizer, IdxT::Type{<:MOI.Index},
322-
name::String)
323-
if isbridged(b, IdxT)
324-
return MOI.canget(b.bridged, IdxT, name)
325-
else
326-
return MOI.canget(b.model, IdxT, name)
327-
end
328-
end
329270
function MOI.get(b::AbstractBridgeOptimizer, IdxT::Type{<:MOI.Index},
330271
name::String)
331272
if isbridged(b, IdxT)
@@ -335,20 +276,15 @@ function MOI.get(b::AbstractBridgeOptimizer, IdxT::Type{<:MOI.Index},
335276
end
336277
end
337278

338-
# For the type-unstable case, we have no information as to whether the
339-
# constraint is in the bridge or the model. Therefore, we try the model first,
340-
# and then the bridge if that fails. As such, we need canget for either the
341-
# bridge or the model.
342-
function MOI.canget(b::AbstractBridgeOptimizer, IdxT::Type{CI},
343-
name::String)
344-
return MOI.canget(b.bridged, IdxT, name) || MOI.canget(b.model, IdxT, name)
345-
end
279+
# We have no information as to whether the constraint is in the bridge or the
280+
# model. Therefore, we try the model first, and then the bridge if that fails.
346281
function MOI.get(b::AbstractBridgeOptimizer, IdxT::Type{CI},
347282
name::String)
348-
if MOI.canget(b.model, IdxT, name)
349-
return MOI.get(b.model, IdxT, name)
350-
else
283+
ci = MOI.get(b.model, IdxT, name)
284+
if ci === nothing
351285
return MOI.get(b.bridged, IdxT, name)
286+
else
287+
return ci
352288
end
353289
end
354290

src/Bridges/detbridge.jl

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -130,19 +130,13 @@ function MOI.delete!(model::MOI.ModelLike, c::LogDetBridge)
130130
end
131131

132132
# Attributes, Bridge acting as a constraint
133-
function MOI.canget(model::MOI.ModelLike, a::MOI.ConstraintPrimal, ::Type{LogDetBridge{T}}) where T
134-
MOI.canget(model, MOI.VariablePrimal(), MOI.VariableIndex) &&
135-
MOI.canget(model, a, CI{MOI.ScalarAffineFunction{T}, MOI.LessThan{T}}) &&
136-
MOI.canget(model, a, CI{MOI.VectorAffineFunction{T}, MOI.PositiveSemidefiniteConeTriangle})
137-
end
138133
function MOI.get(model::MOI.ModelLike, a::MOI.ConstraintPrimal, c::LogDetBridge)
139134
d = length(c.lcindex)
140135
Δ = MOI.get(model, MOI.VariablePrimal(), c.Δ)
141136
t = MOI.get(model, MOI.ConstraintPrimal(), c.tlindex) - sum(log.(Δ[trimap.(1:d, 1:d)]))
142137
x = MOI.get(model, MOI.ConstraintPrimal(), c.sdindex)[1:length(c.Δ)]
143138
[t; x]
144139
end
145-
MOI.canget(model::MOI.ModelLike, a::MOI.ConstraintDual, ::Type{<:LogDetBridge}) = false
146140

147141
# Constraints
148142
MOI.supports(model::MOI.ModelLike, ::MOI.ConstraintSet, ::Type{<:LogDetBridge}) = false
@@ -201,16 +195,11 @@ function MOI.delete!(model::MOI.ModelLike, c::RootDetBridge)
201195
end
202196

203197
# Attributes, Bridge acting as a constraint
204-
function MOI.canget(model::MOI.ModelLike, a::MOI.ConstraintPrimal, ::Type{RootDetBridge{T}}) where T
205-
MOI.canget(model, a, CI{MOI.VectorAffineFunction{T}, MOI.PositiveSemidefiniteConeTriangle}) &&
206-
MOI.canget(model, a, CI{MOI.VectorAffineFunction{T}, MOI.GeometricMeanCone})
207-
end
208198
function MOI.get(model::MOI.ModelLike, a::MOI.ConstraintPrimal, c::RootDetBridge)
209199
t = MOI.get(model, MOI.ConstraintPrimal(), c.gmindex)[1]
210200
x = MOI.get(model, MOI.ConstraintPrimal(), c.sdindex)[1:length(c.Δ)]
211201
[t; x]
212202
end
213-
MOI.canget(model::MOI.ModelLike, ::MOI.ConstraintDual, ::Type{<:RootDetBridge}) = false
214203

215204
# Constraints
216205
MOI.supports(model::MOI.ModelLike, ::MOI.ConstraintSet, ::Type{<:RootDetBridge}) = false

src/Bridges/geomeanbridge.jl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,6 @@ function MOI.delete!(model::MOI.ModelLike, c::GeoMeanBridge)
139139
end
140140

141141
# Attributes, Bridge acting as a constraint
142-
function MOI.canget(model::MOI.ModelLike, a::MOI.ConstraintPrimal,
143-
::Type{GeoMeanBridge{T, F, G}}) where {T, F, G}
144-
MOI.canget(model, a, CI{F, MOI.LessThan{T}}) &&
145-
MOI.canget(model, a, CI{G, MOI.RotatedSecondOrderCone})
146-
end
147142
function _getconstrattr(model, a, c::GeoMeanBridge{T}) where T
148143
output = Vector{T}(undef, c.d)
149144
output[1] = MOI.get(model, a, c.tubc)
@@ -163,7 +158,6 @@ function MOI.get(model::MOI.ModelLike, a::MOI.ConstraintPrimal, c::GeoMeanBridge
163158
output[1] += MOI.get(model, MOI.VariablePrimal(), c.xij[1]) / sqrt(N)
164159
output
165160
end
166-
MOI.canget(model::MOI.ModelLike, a::MOI.ConstraintDual, ::Type{<:GeoMeanBridge}) = false
167161
#function MOI.get(model::MOI.ModelLike, a::MOI.ConstraintDual, c::GeoMeanBridge)
168162
# output = _getconstrattr(model, a, c)
169163
#end

src/Bridges/intervalbridge.jl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,10 @@ function MOI.delete!(model::MOI.ModelLike, c::SplitIntervalBridge)
3636
end
3737

3838
# Attributes, Bridge acting as a constraint
39-
function MOI.canget(model::MOI.ModelLike, attr::MOI.ConstraintPrimal, ::Type{SplitIntervalBridge{T, F}}) where {T, F}
40-
return MOI.canget(model, attr, CI{F, MOI.GreaterThan{T}})
41-
end
4239
function MOI.get(model::MOI.ModelLike, attr::MOI.ConstraintPrimal, c::SplitIntervalBridge)
4340
# lower and upper should give the same value
4441
return MOI.get(model, attr, c.lower)
4542
end
46-
function MOI.canget(model::MOI.ModelLike, attr::MOI.ConstraintDual, ::Type{SplitIntervalBridge{T, F}}) where {T, F}
47-
return MOI.canget(model, attr, CI{F, MOI.GreaterThan{T}}) &&
48-
MOI.canget(model, attr, CI{F, MOI.LessThan{T}})
49-
end
5043
function MOI.get(model::MOI.ModelLike, a::MOI.ConstraintDual, c::SplitIntervalBridge)
5144
# Should be nonnegative
5245
lower_dual = MOI.get(model, MOI.ConstraintDual(), c.lower)

src/Bridges/rsocbridge.jl

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,7 @@ function _get(model, attr::Union{MOI.ConstraintPrimal, MOI.ConstraintDual}, c::R
7979
[x[1]/s2+x[2]/s2; x[1]/s2-x[2]/s2; x[3:end]]
8080
end
8181
# Need to define both `get` methods and redirect to `_get` to avoid ambiguity in dispatch
82-
function MOI.canget(model::MOI.ModelLike, a::MOI.ConstraintPrimal,
83-
::Type{RSOCBridge{T, F}}) where {T, F}
84-
MOI.canget(model, a, CI{F, MOI.SecondOrderCone})
85-
end
8682
MOI.get(model::MOI.ModelLike, attr::MOI.ConstraintPrimal, c::RSOCBridge) = _get(model, attr, c)
87-
function MOI.canget(model::MOI.ModelLike, a::MOI.ConstraintDual,
88-
::Type{RSOCBridge{T, F}}) where {T, F}
89-
MOI.canget(model, a, CI{F, MOI.SecondOrderCone})
90-
end
9183
MOI.get(model::MOI.ModelLike, attr::MOI.ConstraintDual, c::RSOCBridge) = _get(model, attr, c)
9284

9385
MOI.supports(model::MOI.ModelLike, ::MOI.ConstraintSet, ::Type{<:RSOCBridge}) = false

src/Bridges/soctopsdbridge.jl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ _SOCtoPSDCaff(f::MOI.VectorAffineFunction, ::Type) = _SOCtoPSDCaff(f, MOIU.eachs
6767
MOI.supportsconstraint(::Type{SOCtoPSDCBridge{T}}, ::Type{<:Union{MOI.VectorOfVariables, MOI.VectorAffineFunction{T}}}, ::Type{MOI.SecondOrderCone}) where T = true
6868
addedconstrainttypes(::Type{SOCtoPSDCBridge{T}}, ::Type{<:Union{MOI.VectorOfVariables, MOI.VectorAffineFunction{T}}}, ::Type{MOI.SecondOrderCone}) where T = [(MOI.VectorAffineFunction{T}, MOI.PositiveSemidefiniteConeTriangle)]
6969

70-
function MOI.canget(instance::MOI.AbstractOptimizer, a::Union{MOI.ConstraintPrimal, MOI.ConstraintDual}, ::Type{SOCtoPSDCBridge{T}}) where T
71-
MOI.canget(instance, a, CI{MOI.VectorAffineFunction{T}, MOI.PositiveSemidefiniteConeTriangle})
72-
end
7370
function MOI.get(instance::MOI.AbstractOptimizer, a::MOI.ConstraintPrimal, c::SOCtoPSDCBridge)
7471
MOI.get(instance, a, c.cr)[trimap.(1:c.dim, 1)]
7572
end
@@ -134,9 +131,6 @@ function _RSOCtoPSDCaff(f::MOI.VectorAffineFunction, ::Type{T}) where T
134131
_SOCtoPSDCaff(f_scalars[[1; 3:n]], g)
135132
end
136133

137-
function MOI.canget(instance::MOI.AbstractOptimizer, a::Union{MOI.ConstraintPrimal, MOI.ConstraintDual}, ::Type{RSOCtoPSDCBridge{T}}) where T
138-
MOI.canget(instance, a, CI{MOI.VectorAffineFunction{T}, MOI.PositiveSemidefiniteConeTriangle})
139-
end
140134
function MOI.get(instance::MOI.AbstractOptimizer, a::MOI.ConstraintPrimal, c::RSOCtoPSDCBridge)
141135
x = MOI.get(instance, MOI.ConstraintPrimal(), c.cr)[[trimap(1, 1); trimap(2, 2); trimap.(2:c.dim, 1)]]
142136
x[2] /= 2 # It is (2u*I)[1,1] so it needs to be divided by 2 to get u

src/Bridges/squarepsdbridge.jl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,6 @@ function MOI.delete!(model::MOI.ModelLike, bridge::SquarePSDBridge)
149149
end
150150

151151
# Attributes, Bridge acting as a constraint
152-
function MOI.canget(model::MOI.ModelLike, attr::MOI.ConstraintPrimal,
153-
::Type{<:SquarePSDBridge{T, F}}) where {T, F}
154-
return MOI.canget(model, attr, CI{F, MOI.PositiveSemidefiniteConeTriangle})
155-
end
156152
function MOI.get(model::MOI.ModelLike, attr::MOI.ConstraintPrimal,
157153
bridge::SquarePSDBridge{T}) where T
158154
tri = MOI.get(model, attr, bridge.psd)
@@ -167,11 +163,6 @@ function MOI.get(model::MOI.ModelLike, attr::MOI.ConstraintPrimal,
167163
end
168164
return sqr
169165
end
170-
function MOI.canget(model::MOI.ModelLike, attr::MOI.ConstraintDual,
171-
::Type{SquarePSDBridge{T, F, G}}) where {T, F, G}
172-
return MOI.canget(model, attr, CI{F, MOI.PositiveSemidefiniteConeTriangle}) &&
173-
MOI.canget(model, attr, CI{G, MOI.EqualTo{T}})
174-
end
175166
function MOI.get(model::MOI.ModelLike, attr::MOI.ConstraintDual,
176167
bridge::SquarePSDBridge)
177168
tri = MOI.get(model, attr, bridge.psd)

src/Test/UnitTests/basic_constraint_tests.jl

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -168,17 +168,12 @@ function basic_constraint_test_helper(model::MOI.ModelLike, config::TestConfig,
168168

169169
@test MOI.supportsconstraint(model, F, S)
170170

171-
@testset "NumberOfConstraints" begin
172-
@test MOI.canget(model, MOI.NumberOfConstraints{F,S}())
173-
end
174-
175171
@testset "addconstraint!" begin
176172
@test MOI.get(model, MOI.NumberOfConstraints{F,S}()) == 0
177173
c = MOI.addconstraint!(model, constraint_function, set)
178174
@test MOI.get(model, MOI.NumberOfConstraints{F,S}()) == 1
179175

180176
@testset "ConstraintName" begin
181-
@test MOI.canget(model, MOI.ConstraintName(), typeof(c))
182177
@test MOI.get(model, MOI.ConstraintName(), c) == ""
183178
@test MOI.supports(model, MOI.ConstraintName(), typeof(c))
184179
MOI.set!(model, MOI.ConstraintName(), c, "c")
@@ -187,20 +182,17 @@ function basic_constraint_test_helper(model::MOI.ModelLike, config::TestConfig,
187182

188183
if get_constraint_function
189184
@testset "ConstraintFunction" begin
190-
@test MOI.canget(model, MOI.ConstraintFunction(), typeof(c))
191185
@test MOI.get(model, MOI.ConstraintFunction(), c) constraint_function
192186
end
193187
end
194188
if get_constraint_set
195189
@testset "ConstraintSet" begin
196-
@test MOI.canget(model, MOI.ConstraintSet(), typeof(c))
197190
@test MOI.get(model, MOI.ConstraintSet(), c) == set
198191
end
199192
end
200193
end
201194

202195
@testset "ListOfConstraintIndices" begin
203-
@test MOI.canget(model, MOI.ListOfConstraintIndices{F,S}())
204196
c_indices = MOI.get(model, MOI.ListOfConstraintIndices{F,S}())
205197
@test length(c_indices) == MOI.get(model, MOI.NumberOfConstraints{F,S}()) == 1
206198
end

src/Test/UnitTests/constraints.jl

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@ function getconstraint(model::MOI.ModelLike, config::TestConfig)
1111
c1: x >= 1.0
1212
c2: x <= 2.0
1313
""")
14-
@test !MOI.canget(model, MOI.ConstraintIndex, "c3")
15-
@test MOI.canget(model, MOI.ConstraintIndex, "c1")
16-
@test MOI.canget(model, MOI.ConstraintIndex{MOI.SingleVariable, MOI.GreaterThan{Float64}}, "c1")
17-
@test !MOI.canget(model, MOI.ConstraintIndex{MOI.SingleVariable, MOI.LessThan{Float64}}, "c1")
18-
@test MOI.canget(model, MOI.ConstraintIndex, "c2")
19-
@test !MOI.canget(model, MOI.ConstraintIndex{MOI.SingleVariable, MOI.GreaterThan{Float64}}, "c2")
20-
@test MOI.canget(model, MOI.ConstraintIndex{MOI.SingleVariable, MOI.LessThan{Float64}}, "c2")
14+
@test MOI.get(model, MOI.ConstraintIndex, "c3") === nothing
15+
@test MOI.get(model, MOI.ConstraintIndex{MOI.SingleVariable, MOI.LessThan{Float64}}, "c1") === nothing
16+
@test MOI.get(model, MOI.ConstraintIndex{MOI.SingleVariable, MOI.GreaterThan{Float64}}, "c2") === nothing
2117
c1 = MOI.get(model, MOI.ConstraintIndex{MOI.SingleVariable, MOI.GreaterThan{Float64}}, "c1")
18+
@test MOI.get(model, MOI.ConstraintIndex, "c1") == c1
2219
@test MOI.isvalid(model, c1)
2320
c2 = MOI.get(model, MOI.ConstraintIndex{MOI.SingleVariable, MOI.LessThan{Float64}}, "c2")
21+
@test MOI.get(model, MOI.ConstraintIndex, "c2") == c2
2422
@test MOI.isvalid(model, c2)
2523
end
2624
unittests["getconstraint"] = getconstraint

src/Test/UnitTests/modifications.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ function solve_set_singlevariable_lessthan(model::MOI.ModelLike, config::TestCon
2424
)
2525
@test MOI.supports(model, MOI.ConstraintSet(), typeof(c))
2626
MOI.set!(model, MOI.ConstraintSet(), c, MOI.LessThan(2.0))
27-
@test MOI.canget(model, MOI.ConstraintSet(), typeof(c))
2827
@test MOI.get(model, MOI.ConstraintSet(), c) == MOI.LessThan(2.0)
2928
test_model_solution(model, config;
3029
objective_value = 2.0,
@@ -94,7 +93,6 @@ function solve_set_scalaraffine_lessthan(model::MOI.ModelLike, config::TestConfi
9493
)
9594
@test MOI.supports(model, MOI.ConstraintSet(), typeof(c))
9695
MOI.set!(model, MOI.ConstraintSet(), c, MOI.LessThan(2.0))
97-
@test MOI.canget(model, MOI.ConstraintSet(), typeof(c))
9896
@test MOI.get(model, MOI.ConstraintSet(), c) == MOI.LessThan(2.0)
9997
test_model_solution(model, config;
10098
objective_value = 2.0,
@@ -163,7 +161,6 @@ function solve_func_scalaraffine_lessthan(model::MOI.ModelLike, config::TestConf
163161
MOI.set!(model, MOI.ConstraintFunction(), c,
164162
MOI.ScalarAffineFunction([MOI.ScalarAffineTerm(2.0, x)], 0.0)
165163
)
166-
@test MOI.canget(model, MOI.ConstraintFunction(), typeof(c))
167164
foo = MOI.get(model, MOI.ConstraintFunction(), c)
168165
@test foo MOI.ScalarAffineFunction([MOI.ScalarAffineTerm(2.0, x)], 0.0)
169166
test_model_solution(model, config;

0 commit comments

Comments
 (0)