Skip to content

Commit 2d8a921

Browse files
remove sub_kwarg dict
1 parent 2cf5bb8 commit 2d8a921

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/R2N.jl

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ For advanced usage, first define a solver "R2NSolver" to preallocate the memory
138138
- `θ::T = 1/(1 + eps(T)^(1 / 5))`: is the model decrease fraction with respect to the decrease of the Cauchy model;
139139
- `compute_opnorm::Bool = false`: whether the operator norm of Bₖ should be computed at each iteration. If false, a Rayleigh quotient is computed instead. The first option causes the solver to converge in fewer iterations but the computational cost per iteration is larger;
140140
- `m_monotone::Int = 1`: monotonicity parameter. By default, R2N is monotone but the non-monotone variant will be used if `m_monotone > 1`;
141-
- `sub_kwargs::Dict{Symbol}`: a dictionary containing the keyword arguments to be sent to the subsolver. The solver will fail if invalid keyword arguments are provided to the subsolver.
142141
143142
The algorithm stops either when `√(ξₖ/νₖ) < atol + rtol*√(ξ₀/ν₀) ` or `ξₖ < 0` and `√(-ξₖ/νₖ) < neg_tol` where ξₖ := f(xₖ) + h(xₖ) - φ(sₖ; xₖ) - ψ(sₖ; xₖ), and √(ξₖ/νₖ) is a stationarity measure.
144143
@@ -172,7 +171,6 @@ function R2N(
172171
selected = pop!(kwargs_dict, :selected, 1:(nlp.meta.nvar))
173172
x0 = pop!(kwargs_dict, :x0, nlp.meta.x0)
174173
reg_nlp = RegularizedNLPModel(nlp, h, selected)
175-
sub_kwargs = pop!(kwargs_dict, :sub_kwargs, Dict{Symbol, Any}())
176174
return R2N(
177175
reg_nlp,
178176
x = x0,
@@ -187,7 +185,6 @@ function R2N(
187185
η1 = options.η1,
188186
η2 = options.η2,
189187
γ = options.γ,
190-
sub_kwargs = sub_kwargs;
191188
kwargs_dict...,
192189
)
193190
end
@@ -223,7 +220,6 @@ function SolverCore.solve!(
223220
β::T = 1 / eps(T),
224221
θ::T = 1/(1 + eps(T)^(1 / 5)),
225222
compute_opnorm::Bool = false,
226-
sub_kwargs::Dict = Dict(),
227223
) where {T, V, G}
228224
reset!(stats)
229225

@@ -366,11 +362,11 @@ function SolverCore.solve!(
366362
solver.subpb.model.σ = σk
367363
isa(solver.subsolver, R2DHSolver) && (solver.subsolver.D.d[1] = 1/ν₁)
368364
if isa(solver.subsolver, R2Solver) #FIXME
369-
sub_kwargs[] = ν₁
365+
solve!(solver.subsolver, solver.subpb, solver.substats; x = s1, atol = sub_atol, ν = ν₁)
370366
else
371-
sub_kwargs[:σk] = σk
367+
solve!(solver.subsolver, solver.subpb, solver.substats; x = s1, atol = sub_atol, σk = σk)
372368
end
373-
solve!(solver.subsolver, solver.subpb, solver.substats; x = s1, atol = sub_atol, sub_kwargs...)
369+
374370

375371
s .= solver.substats.solution
376372

0 commit comments

Comments
 (0)