Skip to content

Commit 22bbaf4

Browse files
add sub_kwargs for TR
1 parent f01f41c commit 22bbaf4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/TR_alg.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ For advanced usage, first define a solver "TRSolver" to preallocate the memory u
131131
- `γ::T = T(3)`: trust-region radius parameter multiplier. Must satisfy `γ > 1`. The trust-region radius is updated as Δ := Δ*γ when the iteration is very successful and Δ := Δ/γ when the iteration is unsuccessful;
132132
- `χ::F = NormLinf(1)`: norm used to define the trust-region;`
133133
- `subsolver::S = R2Solver`: subsolver used to solve the subproblem that appears at each iteration.
134+
- `sub_kwargs::NamedTuple`: a named tuple containing the keyword arguments to be sent to the subsolver. The solver will fail if invalid keyword arguments are provided to the subsolver.
134135
135136
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.
136137
@@ -199,6 +200,7 @@ function SolverCore.solve!(
199200
η1::T = √√eps(T),
200201
η2::T = T(0.9),
201202
γ::T = T(3),
203+
sub_kwargs::NamedTuple = NamedTuple(),
202204
) where {T, G, V}
203205
reset!(stats)
204206

@@ -353,6 +355,7 @@ function SolverCore.solve!(
353355
x = s,
354356
atol = stats.iter == 0 ? 1e-5 : max(sub_atol, min(1e-2, sqrt_ξ1_νInv)),
355357
Δk = ∆_effective / 10,
358+
sub_kwargs...
356359
)
357360
else
358361
solve!(
@@ -362,6 +365,7 @@ function SolverCore.solve!(
362365
x = s,
363366
atol = stats.iter == 0 ? 1e-5 : max(sub_atol, min(1e-2, sqrt_ξ1_νInv)),
364367
ν = ν₁,
368+
sub_kwargs...
365369
)
366370
end
367371
end

0 commit comments

Comments
 (0)