Skip to content

Commit d613dcd

Browse files
authoredDec 29, 2022
Merge pull request #253 from scipopt/relax-test
relax test assumption on repaired solution
2 parents 80604aa + ecbef29 commit d613dcd

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed
 

‎test/MOI_additional.jl

+7-12
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,15 @@ end
273273

274274
# x + y <= 1
275275
c = MOI.add_constraint(
276-
optimizer,
277-
MOI.ScalarAffineFunction(MOI.ScalarAffineTerm.([1.0, 1.0], [x, y]), 0.0),
278-
MOI.LessThan(1.0))
276+
optimizer, 1.0x + y,
277+
MOI.LessThan(1.0),
278+
)
279279

280280
# max x + 2y
281-
MOI.set(optimizer, MOI.ObjectiveFunction{MOI.ScalarAffineFunction{Float64}}(),
282-
MOI.ScalarAffineFunction(MOI.ScalarAffineTerm.([1.0, 2.0], [x, y]), 0.0))
281+
MOI.set(
282+
optimizer, MOI.ObjectiveFunction{MOI.ScalarAffineFunction{Float64}}(),
283+
1.0x + 2.0y,
284+
)
283285
MOI.set(optimizer, MOI.ObjectiveSense(), MOI.MAX_SENSE)
284286

285287
# optimal solution: x = 0, y = 1, value = 2
@@ -305,11 +307,6 @@ end
305307
MOI.optimize!(optimizer)
306308
@test MOI.get(optimizer, MOI.TerminationStatus()) == MOI.SOLUTION_LIMIT
307309
@test MOI.get(optimizer, MOI.PrimalStatus()) == MOI.FEASIBLE_POINT
308-
309-
# we should get back our start values, completed to a solution
310-
@test MOI.get(optimizer, MOI.ObjectiveValue()) 1.0 atol=atol rtol=rtol
311-
@test MOI.get(optimizer, MOI.VariablePrimal(), x) 1.0 atol=atol rtol=rtol
312-
@test MOI.get(optimizer, MOI.VariablePrimal(), y) 0.0 atol=atol rtol=rtol
313310
end
314311

315312
@testset "No dual solution" begin
@@ -384,8 +381,6 @@ end
384381
@test_broken MOI.get(model, MOI.TerminationStatus()) == config.optimal_status
385382
@test_broken MOI.get(model, MOI.PrimalStatus()) == MOI.FEASIBLE_POINT
386383
else
387-
@info "presolving $presolving"
388-
@info "$(SCIP.SCIP_versionnumber())"
389384
@test MOI.get(model, MOI.TerminationStatus()) == config.optimal_status
390385
@test MOI.get(model, MOI.PrimalStatus()) == MOI.FEASIBLE_POINT
391386
@test (MOI.get(model, MOI.ObjectiveValue()), T(115 // 4), config)

0 commit comments

Comments
 (0)
Please sign in to comment.