From 11400744b155dedd86e1a30f43892decbeeeda24 Mon Sep 17 00:00:00 2001 From: Tangi Migot Date: Wed, 17 Apr 2024 08:01:34 -0400 Subject: [PATCH] Use `atol` and `rtol` for default `ctol` (#163) --- src/method.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/method.jl b/src/method.jl index 7797fba..a724d18 100644 --- a/src/method.jl +++ b/src/method.jl @@ -86,7 +86,7 @@ For advanced usage, first define a `PercivalSolver` to preallocate the memory us - `x::V = nlp.meta.x0`: the initial guess; - `atol::T = T(1e-8)`: absolute tolerance; - `rtol::T = T(1e-8)`: relative tolerance; -- `ctol::T = T(1e-8)`: absolute tolerance on the feasibility; +- `ctol::T = atol > 0 ? atol : rtol`: absolute tolerance on the feasibility; - `max_eval::Int = 100000`: maximum number of evaluation of the objective function; - `max_time::Float64 = 30.0`: maximum time limit in seconds; - `max_iter::Int = 2000`: maximum number of iterations; @@ -307,7 +307,7 @@ function SolverCore.solve!( max_eval::Int = 200000, atol::Real = T(1e-8), rtol::Real = T(1e-8), - ctol::Real = T(1e-8), + ctol::Real = atol > 0 ? atol : rtol, subsolver_verbose::Int = 0, cgls_verbose::Int = 0, inity::Bool = false,