Skip to content

Commit a344318

Browse files
Update OptimizationNLopt.jl
1 parent 222dd9d commit a344318

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

lib/OptimizationNLopt/src/OptimizationNLopt.jl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function __map_optimizer_args!(cache::OptimizationCache, opt::NLopt.Opt;
7575

7676
if !isnothing(local_options)
7777
for j in Dict(pairs(local_options))
78-
eval(Meta.parse("NLopt." * string(j.first) * "!"))(local_meth, j.second)
78+
NLopt.nlopt_set_param(opt, j.first, j.second)
7979
end
8080
end
8181

@@ -93,12 +93,7 @@ function __map_optimizer_args!(cache::OptimizationCache, opt::NLopt.Opt;
9393
# add optimiser options from kwargs
9494
for j in kwargs
9595
if j.first != :cons_tol
96-
# Handle special parameters that use nlopt_set_param
97-
if j.first == :dual_ftol_rel
98-
NLopt.nlopt_set_param(opt, "dual_ftol_rel", j.second)
99-
else
100-
eval(Meta.parse("NLopt." * string(j.first) * "!"))(opt, j.second)
101-
end
96+
NLopt.nlopt_set_param(opt, j.first, j.second)
10297
end
10398
end
10499

0 commit comments

Comments
 (0)