Skip to content

Commit e408189

Browse files
Minor fixes (#171)
* Update `unbounded_check!` to correctly bound branch variables excluding the epigraph variable * Update default `cp_depth` from 20 to 5 * Fix CI badge in README
1 parent 4d5c251 commit e408189

9 files changed

Lines changed: 23 additions & 20 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
*.cov
12
*.jl.cov
23
*.jl.*.cov
34
*.jl.mem
45
*.mem
5-
*.cov
66
docs/build/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ EAGO is an open-source development environment for **robust and global optimizat
66

77
| **PSOR Lab** | **Build Status** |
88
|:------------:|:-----------------------------------------------------------------------------------------------:|
9-
| [![](https://img.shields.io/badge/Developed_by-PSOR_Lab-342674)](https://psor.uconn.edu/) | [![Build Status](https://github.com/PSORLab/EAGO.jl/workflows/CI/badge.svg?branch=master)](https://github.com/PSORLab/EAGO.jl/actions?query=workflow%3ACI) [![codecov](https://codecov.io/gh/PSORLab/EAGO.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/PSORLab/EAGO.jl)|
9+
| [![](https://img.shields.io/badge/Developed_by-PSOR_Lab-342674)](https://psor.uconn.edu/) | [![Build Status](https://github.com/PSORLab/EAGO.jl/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/PSORLab/EAGO.jl/actions?query=workflow%3ACI) [![codecov](https://codecov.io/gh/PSORLab/EAGO.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/PSORLab/EAGO.jl)|
1010

1111
| **Documentation** | **Persistent DOI** |
1212
|:-----------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------:|

src/eago_optimizer/moi_wrapper.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function MOI.add_constraint(m::Optimizer, f::F, s::S) where {F<:Union{SAF,SQF,MO
7979
model = MOI.Nonlinear.Model()
8080
backend = MOI.Nonlinear.SparseReverseMode()
8181
vars = MOI.get(m, MOI.ListOfVariableIndices())
82-
evaluator = MOI.Nonlinear.Evaluator(model, backend, vars)
82+
evaluator = MOI.Nonlinear.Evaluator(model, backend, vars)
8383
m._input_problem._nlp_data = MOI.NLPBlockData(evaluator)
8484
end
8585
MOI.Nonlinear.add_constraint(m._input_problem._nlp_data.evaluator.model, f, s)

src/eago_optimizer/optimize/nonconvex/lower_problem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ function lower_problem!(t::ExtensionType, m::GlobalOptimizer{R,S,Q}) where {R,S,
464464
status = RRS_INFEASIBLE
465465
end
466466
if status == RRS_INFEASIBLE
467-
m._lower_feasibility = false
467+
m._lower_feasibility = false
468468
m._lower_objective_value = -Inf
469469
return
470470
end

src/eago_optimizer/optimize/nonconvex/stack_management.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,10 @@ function unbounded_check!(m::GlobalOptimizer)
257257
if m._parameters.unbounded_check
258258
unbounded_flag = false
259259
wp = m._working_problem
260-
for i = 1:_variable_num(BranchVar(), m)
260+
for i in m._branch_to_sol_map
261+
if m._epigraph_occurred && i == m._branch_to_sol_map[end]
262+
continue
263+
end
261264
if !wp._variable_info[i].has_lower_bound
262265
unbounded_flag = true
263266
wp._variable_info[i] = VariableInfo(wp._variable_info[i], GT(-1E6)) # Some solvers break if bounds are too large

src/eago_optimizer/optimize/optimize_nonconvex.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -238,24 +238,24 @@ $(TYPEDSIGNATURES)
238238
239239
Check for problem convergence.
240240
241-
By default, check if the lower and upper bounds have converged to within absolute
241+
By default, checks if the lower and upper bounds have converged to within absolute
242242
and/or relative tolerances.
243243
"""
244244
function convergence_check(t::ExtensionType, m::GlobalOptimizer)
245245

246246
L = m._lower_objective_value
247247
U = m._global_upper_bound
248-
t = (U - L) <= m._parameters.absolute_tolerance
249-
if (U < Inf) && (L > Inf)
250-
t |= (abs(U - L)/(max(abs(L), abs(U))) <= m._parameters.relative_tolerance)
248+
flag = (U - L) <= m._parameters.absolute_tolerance
249+
if (U < Inf) && (L > -Inf)
250+
flag |= (abs(U - L)/(max(abs(L), abs(U))) <= m._parameters.relative_tolerance)
251251
end
252-
if t && m._min_converged_value < Inf
252+
if flag && m._min_converged_value < Inf
253253
m._min_converged_value = min(m._min_converged_value, L)
254-
else
254+
elseif flag
255255
m._min_converged_value = L
256256
end
257257

258-
return t
258+
return flag
259259
end
260260
convergence_check(m::GlobalOptimizer{R,S,Q}) where {R,S,Q<:ExtensionType} = convergence_check(_ext(m), m)
261261

@@ -392,7 +392,7 @@ function global_solve!(m::GlobalOptimizer)
392392
node_selection!(m)
393393
print_node!(m)
394394

395-
# Perform prepocessing and log the time
395+
# Perform preprocessing and log the time
396396
m._last_preprocess_time += @elapsed preprocess!(m)
397397

398398
# Continue if the node has not been proven infeasible
@@ -403,7 +403,7 @@ function global_solve!(m::GlobalOptimizer)
403403
print_results!(m, true)
404404

405405
# Continue if lower problem is not infeasible and problem
406-
# problem has not yet converged
406+
# has not yet converged
407407
if m._lower_feasibility && !convergence_check(m)
408408

409409
# Solve the upper bounding problem and log the time

src/eago_optimizer/parse.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ function reform_epigraph_min!(m::GlobalOptimizer, d::ParsedProblem, f::BufferedQ
235235
if !_is_input_min(m)
236236
MOIU.operate!(-, Float64, sqf_obj)
237237
end
238-
d._objective_saf = SAF([SAT(1.0, VI(ηi))], 0.0)
238+
d._objective_saf = SAF([SAT(1.0, VI(ηi))], 0.0)
239239
push!(sqf_obj.affine_terms, SAT(-1.0, VI(ηi)))
240240
_constraints(ip, SQF, LT)[CI{SQF,LT}(ip._constraint_count += 1)] = (sqf_obj, LT(0.0))
241241
push!(wp._sqf_leq, BufferedQuadraticIneq(sqf_obj, LT(0.0)))

src/eago_optimizer/types/global_optimizer.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ Base.@kwdef mutable struct EAGOParameters
148148
absolute_constraint_feas_tolerance::Float64 = 1E-8
149149

150150
# Options for constraint propagation
151-
"Depth in B&B tree above which constraint propagation should be disabled (default = 20)"
152-
cp_depth::Int = 20
151+
"Depth in B&B tree above which constraint propagation should be disabled (default = 5)"
152+
cp_depth::Int = 5
153153
"Number of times to repeat forward-reverse pass routine (default = 3)"
154154
cp_repetitions::Int = 3
155155
"Disable constraint propagation if the ratio of new node volume to beginning node volume exceeds

src/eago_script/scrubber.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ end
5555
"""
5656
scrub(f::Function, n::Int, inplace = false)
5757
58-
Replaces storage objects and circumvents assertions that present a UDF from
58+
Replaces storage objects and circumvents assertions that prevent a UDF from
5959
being overloaded with subtype Real objects by creating a function which
6060
overdubs `f` in `ScrubCtx`.
6161
"""
@@ -86,7 +86,7 @@ Applies scrub to every user-defined function in the a `MOI.NLPBlockData` structu
8686
"""
8787
function scrub!(d::MOI.NLPBlockData)
8888
error("Function not updated for newest version of EAGO. Please submit an issue.")
89-
# Scrub multivariant
89+
# Scrub multivariates
9090
user_ops = d.user_operators
9191
mvop_num = length(user_ops.multivariate_operator_evaluator)
9292
for i in 1:mvop_num
@@ -100,7 +100,7 @@ function scrub!(d::MOI.NLPBlockData)
100100
user_ops.multivariate_operator_evaluator[i] = evalr
101101
end
102102

103-
# Scrub univariants
103+
# Scrub univariates
104104
svop_num = length(user_ops.univariate_operator_f)
105105

106106
for i in 1:svop_num

0 commit comments

Comments
 (0)