Skip to content

Commit e3bf043

Browse files
committed
add solve model for new NLS solver
1 parent 54f104e commit e3bf043

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
function solve_modelNLSST_TR(PData::PDataNLSST, Jx, Fx, norm_∇f, calls, max_calls, δ::T) where {T}
2+
# cas particulier Steihaug-Toint
3+
# ϵ = sqrt(eps(T)) # * 100.0 # old
4+
# cgtol = max(ϵ, min(cgtol, 9 * cgtol / 10, 0.01 * norm(g)^(1.0 + PData.ζ))) # old
5+
6+
ζ, ξ, maxtol, mintol = PData.ζ, PData.ξ, PData.maxtol, PData.mintol
7+
n = length(Fx)
8+
# precision = max(1e-12, min(0.5, (norm_∇f^ζ)))
9+
# Tolerance used in Assumption 2.6b in the paper ( ξ > 0, 0 < ζ ≤ 1 )
10+
cgatol = PData.cgatol(ζ, ξ, maxtol, mintol, norm_∇f)
11+
cgrtol = PData.cgrtol(ζ, ξ, maxtol, mintol, norm_∇f)
12+
13+
solver = PData.solver
14+
solve!(
15+
solver,
16+
Jx,
17+
Fx,
18+
atol = cgatol,
19+
rtol = cgrtol,
20+
radius = δ,
21+
itmax = min(max_calls - sum(calls), max(2 * n, 50)),
22+
verbose = 0,
23+
)
24+
25+
@. PData.d = -solver.x
26+
PData.OK = solver.stats.solved
27+
28+
return PData.d, PData.λ
29+
end

0 commit comments

Comments
 (0)