@@ -6,6 +6,8 @@ abstract type PDataFact{T} <: TPData{T} end # Variants using matricial factoriza
66
77abstract type PDataIter{T} <: TPData{T} end # Variants using iterative (Krylov) solvers
88
9+ abstract type PDataIterLS{T} <: TPData{T} end # Variants using iterative (Krylov) solvers for least-square subproblem
10+
911"""
1012 preprocess(PData::TPData, H, g, gNorm2, n1, n2, α)
1113
@@ -220,3 +222,41 @@ function PDataST(
220222 solver = CgSolver (n, n, S)
221223 return PDataST (d, λ, ζ, ξ, maxtol, mintol, cgatol, cgrtol, OK, solver)
222224end
225+
226+ """
227+ PDataNLSST(::Type{S}, ::Type{T}, n)
228+ Return a structure used for the preprocessing of Steihaug-Toint methods for Gauss-Newton approximation of nonlinear least squares.
229+ """
230+ mutable struct PDataNLSST{S,T} <: PDataIterLS{T}
231+ d:: S
232+ λ:: T
233+ ζ:: T # Inexact Newton order parameter: stop when ||∇q|| < ξ * ||g||^(1+ζ)
234+ ξ:: T # Inexact Newton order parameter: stop when ||∇q|| < ξ * ||g||^(1+ζ)
235+ maxtol:: T # Largest tolerance for Inexact Newton
236+ mintol:: T # Smallest tolerance for Inexact Newton
237+ cgatol:: Any
238+ cgrtol:: Any
239+
240+ OK:: Bool # preprocess success
241+ solver:: Union{CglsSolver,LsqrSolver}
242+ end
243+
244+ function PDataNLSST (
245+ :: Type{S} ,
246+ :: Type{T} ,
247+ n,
248+ m;
249+ ζ = T (0.5 ),
250+ ξ = T (0.01 ),
251+ maxtol = T (0.01 ),
252+ mintol = sqrt (eps (T)),
253+ cgatol = (ζ, ξ, maxtol, mintol, gNorm2) -> max (mintol, min (maxtol, ξ * gNorm2^ (1 + ζ))),
254+ cgrtol = (ζ, ξ, maxtol, mintol, gNorm2) -> max (mintol, min (maxtol, ξ * gNorm2^ ζ)),
255+ kwargs... ,
256+ ) where {S,T}
257+ d = S (undef, n)
258+ λ = zero (T)
259+ OK = true
260+ solver = CglsSolver (m, n, S)
261+ return PDataNLSST (d, λ, ζ, ξ, maxtol, mintol, cgatol, cgrtol, OK, solver)
262+ end
0 commit comments