diff --git a/src/R2_alg.jl b/src/R2_alg.jl index 427e11e7..e7098f8b 100644 --- a/src/R2_alg.jl +++ b/src/R2_alg.jl @@ -200,7 +200,7 @@ function R2( η2 = options.η2, ν = options.ν, γ = options.γ; - kwargs_dict... + kwargs_dict..., ) end @@ -229,7 +229,7 @@ function R2( η2 = options.η2, ν = options.ν, γ = options.γ; - kwargs... + kwargs..., ) outdict = Dict( :Fhist => stats.solver_specific[:Fhist], @@ -272,7 +272,7 @@ function R2( η2 = options.η2, ν = options.ν, γ = options.γ; - kwargs... + kwargs..., ) outdict = Dict( :Fhist => stats.solver_specific[:Fhist], @@ -293,12 +293,14 @@ function R2(reg_nlp::AbstractRegularizedNLPModel; kwargs...) max_iter = pop!(kwargs_dict, :max_iter, 10000) solver = R2Solver(reg_nlp, max_iter = max_iter) stats = GenericExecutionStats(reg_nlp.model) - cb = pop!(kwargs_dict, :callback, + cb = pop!( + kwargs_dict, + :callback, (nlp, solver, stats) -> begin solver.Fobj_hist[stats.iter + 1] = stats.solver_specific[:smooth_obj] solver.Hobj_hist[stats.iter + 1] = stats.solver_specific[:nonsmooth_obj] solver.Complex_hist[stats.iter + 1] += 1 - end + end, ) solve!(solver, reg_nlp, stats; callback = cb, max_iter = max_iter, kwargs...) set_solver_specific!(stats, :Fhist, solver.Fobj_hist[1:(stats.iter + 1)])