Skip to content

Commit

Permalink
R2: pass kwargs through
Browse files Browse the repository at this point in the history
  • Loading branch information
dpo committed Dec 12, 2024
1 parent d0e3b55 commit 63c5e2b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/R2_alg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ function R2(
η1 = options.η1,
η2 = options.η2,
ν = options.ν,
γ = options.γ,
γ = options.γ;
kwargs_dict...
)
end

Expand Down Expand Up @@ -227,7 +228,8 @@ function R2(
η1 = options.η1,
η2 = options.η2,
ν = options.ν,
γ = options.γ,
γ = options.γ;
kwargs...
)
outdict = Dict(
:Fhist => stats.solver_specific[:Fhist],
Expand Down Expand Up @@ -291,12 +293,13 @@ 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 =
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
)
solve!(solver, reg_nlp, stats; callback = cb, max_iter = max_iter, kwargs...)
set_solver_specific!(stats, :Fhist, solver.Fobj_hist[1:(stats.iter + 1)])
set_solver_specific!(stats, :Hhist, solver.Hobj_hist[1:(stats.iter + 1)])
Expand Down

0 comments on commit 63c5e2b

Please sign in to comment.