Skip to content

Commit 48b9f2f

Browse files
committed
refactor: tol should map to a relative tolerance, not an absolute one
1 parent f44e510 commit 48b9f2f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/OptimizationIpopt/src/OptimizationIpopt.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ function __map_optimizer_args(cache,
106106
if !isnothing(maxtime)
107107
Ipopt.AddIpoptNumOption(prob, "max_cpu_time", maxtime)
108108
end
109-
if !isnothing(abstol)
110-
Ipopt.AddIpoptNumOption(prob, "tol", abstol)
109+
if !isnothing(reltol)
110+
Ipopt.AddIpoptNumOption(prob, "tol", reltol)
111111
end
112112
if verbose isa Bool
113113
Ipopt.AddIpoptIntOption(prob, "print_level", verbose * 5)

lib/OptimizationIpopt/test/additional_tests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ using LinearAlgebra
9393
prob = OptimizationProblem(optfunc, x0, nothing;
9494
lcons = fill(4.0, n-2),
9595
ucons = fill(6.0, n-2))
96-
sol = solve(prob, IpoptOptimizer(); maxiters = 1000, abstol=1e-6)
96+
sol = solve(prob, IpoptOptimizer(); maxiters = 1000, reltol=1e-6)
9797

9898
@test SciMLBase.successful_retcode(sol)
9999
@test length(sol.u) == n

lib/OptimizationIpopt/test/advanced_features.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ using SparseArrays
1818

1919
# Test with tight tolerances
2020
sol = solve(prob, IpoptOptimizer();
21-
abstol = 1e-10,
21+
reltol = 1e-10,
2222
acceptable_tol = 1e-8,
2323
acceptable_iter = 5)
2424

0 commit comments

Comments
 (0)