Skip to content

Commit 6a51dfc

Browse files
authored
fix scale of diagonal terms in ScalarQuadraticFunction (#308)
1 parent 29b16b1 commit 6a51dfc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Test/contquadratic.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ function qcp2test(model::MOI.ModelLike, config::TestConfig)
350350
x = MOI.addvariable!(model)
351351
@test MOI.get(model, MOI.NumberOfVariables()) == 1
352352

353-
cf = MOI.ScalarQuadraticFunction(MOI.VariableIndex[x],Float64[0.0],[x],[x],[1.0], 0.0)
353+
cf = MOI.ScalarQuadraticFunction(MOI.VariableIndex[x],Float64[0.0],[x],[x],[2.0], 0.0)
354354
@test MOI.canaddconstraint(model, typeof(cf), MOI.LessThan{Float64})
355355
c = MOI.addconstraint!(model, cf, MOI.LessThan(2.0))
356356
@test MOI.get(model, MOI.NumberOfConstraints{MOI.ScalarQuadraticFunction{Float64}, MOI.LessThan{Float64}}()) == 1
@@ -410,7 +410,7 @@ function qcp3test(model::MOI.ModelLike, config::TestConfig)
410410
x = MOI.addvariable!(model)
411411
@test MOI.get(model, MOI.NumberOfVariables()) == 1
412412

413-
cf = MOI.ScalarQuadraticFunction(MOI.VariableIndex[],Float64[],[x],[x],[1.0], 0.0)
413+
cf = MOI.ScalarQuadraticFunction(MOI.VariableIndex[],Float64[],[x],[x],[2.0], 0.0)
414414
@test MOI.canaddconstraint(model, typeof(cf), MOI.LessThan{Float64})
415415
c = MOI.addconstraint!(model, cf, MOI.LessThan(2.0))
416416
@test MOI.get(model, MOI.NumberOfConstraints{MOI.ScalarQuadraticFunction{Float64}, MOI.LessThan{Float64}}()) == 1

0 commit comments

Comments
 (0)