Skip to content

Commit a391372

Browse files
committed
format
1 parent d7bb58d commit a391372

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

src/infeasibility.jl

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,10 @@ function iis_elastic_filter(original_model::MOI.ModelLike, optimizer)
438438

439439
# handle optimize not called
440440
status = MOI.get(original_model, MOI.TerminationStatus())
441-
if !(status in (MOI.INFEASIBLE, MOI.ALMOST_INFEASIBLE, MOI.ALMOST_INFEASIBLE))
441+
if !(
442+
status in
443+
(MOI.INFEASIBLE, MOI.ALMOST_INFEASIBLE, MOI.ALMOST_INFEASIBLE)
444+
)
442445
println(
443446
"iis resolver cannot continue because model is found to be $(status) by the solver",
444447
)
@@ -462,7 +465,8 @@ function iis_elastic_filter(original_model::MOI.ModelLike, optimizer)
462465
for i in 1:max_iterations
463466
MOI.optimize!(model)
464467
status = MOI.get(model, MOI.TerminationStatus())
465-
if status in (MOI.INFEASIBLE, MOI.ALMOST_INFEASIBLE, MOI.ALMOST_INFEASIBLE)
468+
if status in
469+
(MOI.INFEASIBLE, MOI.ALMOST_INFEASIBLE, MOI.ALMOST_INFEASIBLE)
466470
break
467471
end
468472
for (con, func) in constraint_to_affine
@@ -516,17 +520,22 @@ function iis_elastic_filter(original_model::MOI.ModelLike, optimizer)
516520
_set_bound_zero(model, var, has_lower, T)
517521
MOI.optimize!(model)
518522
status = MOI.get(model, MOI.TerminationStatus())
519-
if status in (MOI.INFEASIBLE, MOI.ALMOST_INFEASIBLE, MOI.ALMOST_INFEASIBLE)
523+
if status in
524+
(MOI.INFEASIBLE, MOI.ALMOST_INFEASIBLE, MOI.ALMOST_INFEASIBLE)
520525
# this constraint is not in IIS
521526
elseif status in (
522-
MOI.OPTIMAL, MOI.ALMOST_OPTIMAL, MOI.LOCALLY_SOLVED, MOI.ALMOST_LOCALLY_SOLVED,
523-
)
527+
MOI.OPTIMAL,
528+
MOI.ALMOST_OPTIMAL,
529+
MOI.LOCALLY_SOLVED,
530+
MOI.ALMOST_LOCALLY_SOLVED,
531+
)
524532
push!(cadidates, con)
525533
_fix_to_zero(model, var, T)
526534
elseif status in (
527535
MOI.INFEASIBLE_OR_UNBOUNDED,
528-
MOI.DUAL_INFEASIBLE, MOI.ALMOST_DUAL_INFEASIBLE, # possibily primal unbounded
529-
)
536+
MOI.DUAL_INFEASIBLE,
537+
MOI.ALMOST_DUAL_INFEASIBLE, # possibily primal unbounded
538+
)
530539
MOI.set(model, MOI.ObjectiveSense(), MOI.FEASIBILITY_SENSE)
531540
MOI.optimize!(model)
532541
primal_status = MOI.get(model, MOI.PrimalStatus())
@@ -535,11 +544,7 @@ function iis_elastic_filter(original_model::MOI.ModelLike, optimizer)
535544
push!(cadidates, con)
536545
_fix_to_zero(model, var, T)
537546
MOI.set(model, MOI.ObjectiveSense(), obj_sense)
538-
MOI.set(
539-
model,
540-
MOI.ObjectiveFunction{obj_type}(),
541-
obj_func,
542-
)
547+
MOI.set(model, MOI.ObjectiveFunction{obj_type}(), obj_func)
543548
else
544549
error(
545550
"IIS failed due numerical instability, got status $status,",

0 commit comments

Comments
 (0)