Closed blegat closed 3 years ago
Merging #114 (a8452d6) into master (addb861) will decrease coverage by
0.45%
. The diff coverage is41.66%
.
@@ Coverage Diff @@
## master #114 +/- ##
==========================================
- Coverage 86.31% 85.86% -0.46%
==========================================
Files 4 4
Lines 475 481 +6
==========================================
+ Hits 410 413 +3
- Misses 65 68 +3
Impacted Files | Coverage Δ | |
---|---|---|
src/MOI_wrapper.jl | 76.98% <41.66%> (-0.70%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update addb861...a8452d6. Read the comment docs.
@blegat you were faster than me :)
If it's of interest, I was writing a test for that too: (I guess it's easier if I just post it here directly)
@testset "Iteration Limit" begin
# Problem data
v = [5.0, 3.0, 1.0]
w = [2.0, 1.5, 0.3]
MOI.empty!(bridged)
MOI.set(bridged, MOI.RawParameter("maxit"), 1)
MOI.set(bridged, MOI.Silent(), true)
x = MOI.add_variables(bridged, 3)
for xj in x
MOI.add_constraint(bridged, MOI.SingleVariable(xj), MOI.Interval(0.0, 1.0))
end
# Constraint
MOI.add_constraint(bridged, MOI.ScalarAffineFunction(MOI.ScalarAffineTerm.(w, x), 0.0), MOI.LessThan(3.0))
# Set the objective
MOI.set(bridged,
MOI.ObjectiveFunction{MOI.ScalarAffineFunction{Float64}}(),
MOI.ScalarAffineFunction(MOI.ScalarAffineTerm.(v, x), 0.0)
)
MOI.set(bridged, MOI.ObjectiveSense(), MOI.MAX_SENSE)
MOI.optimize!(bridged)
@test MOI.get(bridged, MOI.TerminationStatus()) == MOI.ITERATION_LIMIT
end
Closes https://github.com/jump-dev/ECOS.jl/issues/113