Skip to content

Commit 42cd5fd

Browse files
committed
fix option priority for MadNLP
1 parent 13e1ac5 commit 42cd5fd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/OptimizationMadNLP/src/OptimizationMadNLP.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,12 +345,14 @@ function __map_optimizer_args(cache,
345345
else
346346
print_level = verbose
347347
end
348-
# use MadNLP defaults
349-
tol = isnothing(reltol) ? 1e-8 : reltol
348+
349+
!isnothing(reltol) && @warn "reltol not supported by MadNLP."
350+
tol = isnothing(abstol) ? 1e-8 : abstol
350351
max_iter = isnothing(maxiters) ? 3000 : maxiters
351352
max_wall_time = isnothing(maxtime) ? 1e6 : maxtime
352353

353354
MadNLP.MadNLPSolver(nlp;
355+
opt.additional_options...,
354356
print_level, tol, max_iter, max_wall_time,
355357
opt.rethrow_error,
356358
opt.disable_garbage_collector,
@@ -363,7 +365,6 @@ function __map_optimizer_args(cache,
363365
opt.hessian_constant,
364366
opt.hessian_approximation,
365367
opt.mu_init,
366-
opt.additional_options...
367368
)
368369
end
369370

0 commit comments

Comments
 (0)