File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ function _expr_to_function(expr::Expr)
234
234
@assert Meta. isexpr (expr, :call )
235
235
f = _try_scalar_affine_function (expr)
236
236
if f != = nothing
237
- return f
237
+ return convert (MOI . ScalarAffineFunction{Float64}, f)
238
238
end
239
239
return MOI. ScalarNonlinearFunction (
240
240
expr. args[1 ],
Original file line number Diff line number Diff line change @@ -720,10 +720,10 @@ function test_hs071_free_constraint_nlexpr()
720
720
open (joinpath (@__DIR__ , " data" , " hs071_free_constraint.nl" ), " r" ) do io
721
721
return read! (io, model)
722
722
end
723
- @test MOI. get (model, MOI. ListOfConstraintTypesPresent ()) == [
724
- (MOI . ScalarNonlinearFunction, MOI . GreaterThan{Float64}),
725
- (MOI. ScalarNonlinearFunction , MOI. Interval {Float64}),
726
- ]
723
+ types = MOI. get (model, MOI. ListOfConstraintTypesPresent ())
724
+ @test length (types) == 2
725
+ @test (MOI. ScalarAffineFunction{Float64} , MOI. GreaterThan {Float64}) in types
726
+ @test (MOI . ScalarNonlinearFunction, MOI . Interval{Float64}) in types
727
727
for (F, S) in MOI. get (model, MOI. ListOfConstraintTypesPresent ())
728
728
@test MOI. get (model, MOI. NumberOfConstraints {F,S} ()) == 1
729
729
end
You can’t perform that action at this time.
0 commit comments