Skip to content

Commit

Permalink
Add duplicate terms to linear part of objective in qp2test
Browse files Browse the repository at this point in the history
  • Loading branch information
tkoolen committed Jul 18, 2018
1 parent 851125c commit a9db7cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Test/contquadratic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function qp2test(model::MOI.ModelLike, config::TestConfig)
c2 = MOI.addconstraint!(model, MOI.ScalarAffineFunction(MOI.ScalarAffineTerm.([1.0,1.0], [v[1],v[2]]), 0.0), MOI.GreaterThan(1.0))
@test MOI.get(model, MOI.NumberOfConstraints{MOI.ScalarAffineFunction{Float64}, MOI.GreaterThan{Float64}}()) == 2

obj = MOI.ScalarQuadraticFunction(MOI.ScalarAffineTerm.(0.0, v), MOI.ScalarQuadraticTerm.([2.0, 0.5, 0.5, 2.0, 1.0, 1.0, 1.0], [v[1], v[1], v[1], v[2], v[2], v[3], v[3]], [v[1], v[2], v[2], v[2], v[3], v[3], v[3]]), 0.0)
obj = MOI.ScalarQuadraticFunction([MOI.ScalarAffineTerm.(1.0, v); MOI.ScalarAffineTerm.(-1.0, v)], MOI.ScalarQuadraticTerm.([2.0, 0.5, 0.5, 2.0, 1.0, 1.0, 1.0], [v[1], v[1], v[1], v[2], v[2], v[3], v[3]], [v[1], v[2], v[2], v[2], v[3], v[3], v[3]]), 0.0)
@test MOI.canset(model, MOI.ObjectiveFunction{MOI.ScalarQuadraticFunction{Float64}}())
MOI.set!(model, MOI.ObjectiveFunction{MOI.ScalarQuadraticFunction{Float64}}(), obj)
@test MOI.canset(model, MOI.ObjectiveSense())
Expand Down

0 comments on commit a9db7cd

Please sign in to comment.