Skip to content

Commit 466d2cd

Browse files
committed
Bump to Stopping 0.6
1 parent 885e738 commit 466d2cd

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ LinearOperators = "1, 2"
2020
NLPModels = "0.18, 0.19"
2121
SolverCore = "0.2"
2222
SparseMatricesCOO = "0.1, 0.2"
23-
Stopping = "0.4, 0.5"
24-
StoppingInterface = "0.1, 0.2"
23+
Stopping = "0.6"
24+
StoppingInterface = "0.3"
2525
julia = "^1.6"
2626

2727
[extras]

src/main.jl

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,12 @@ function hessian!(workspace::TRARCWorkspace, nlp, x)
140140
end
141141

142142
function TRARC(
143-
nlp_stop::NLPStopping{Pb,M,SRC,NLPAtX{T,S},MStp,LoS};
143+
nlp_stop::NLPStopping{Pb,M,SRC,NLPAtX{Score,T,S},MStp,LoS};
144144
TR::TrustRegion = TrustRegion(T(10.0)),
145145
hess_type::Type{Hess} = HessOp,
146146
pdata_type::Type{ParamData} = PDataKARC,
147147
kwargs...,
148-
) where {Pb,M,SRC,MStp,LoS,S,T,Hess,ParamData}
148+
) where {Pb,M,SRC,MStp,LoS,Score,S,T,Hess,ParamData}
149149
nlp = nlp_stop.pb
150150

151151
if ParamData == PDataNLSST
@@ -170,15 +170,15 @@ function compute_Δq(workspace, Hx, d, ∇f)
170170
end
171171

172172
function TRARC(
173-
nlp_stop::NLPStopping{Pb,M,SRC,NLPAtX{T,S},MStp,LoS},
173+
nlp_stop::NLPStopping{Pb,M,SRC,NLPAtX{Score,T,S},MStp,LoS},
174174
PData::ParamData,
175175
workspace::TRARCWorkspace{T,S,Hess},
176176
TR::TrustRegion;
177177
solve_model::Function = solve_modelKARC,
178178
robust::Bool = true,
179179
verbose::Bool = false,
180180
kwargs...,
181-
) where {Pb,M,SRC,MStp,LoS,S,T,Hess,ParamData}
181+
) where {Pb,M,SRC,MStp,LoS,Score,S,T,Hess,ParamData}
182182
nlp, nlp_at_x = nlp_stop.pb, nlp_stop.current_state
183183
xt, xtnext, ∇f, ∇fnext = workspace.xt, workspace.xtnext, workspace.∇f, workspace.∇fnext
184184
d, Hx = workspace.d, workspace.Hstruct.H
@@ -195,10 +195,11 @@ function TRARC(
195195
norm_∇f = norm(∇f)
196196
nlp_stop.meta.optimality0 = norm_∇f
197197

198-
Stopping._smart_update!(nlp_at_x, x = xt, fx = ft, gx = ∇f)
198+
set_x!(nlp_at_x, xt)
199+
set_fx!(nlp_at_x, ft)
200+
set_gx!(nlp_at_x, ∇f)
199201
OK = start!(nlp_stop)
200202
Hx = hessian!(workspace, nlp, xt)
201-
!OK && Stopping._smart_update!(nlp_at_x, Hx = Hx)
202203

203204
iter = 0 # counter different than stop count
204205
succ, unsucc, verysucc, unsuccinarow = 0, 0, 0, 0
@@ -276,10 +277,11 @@ function TRARC(
276277
end # while !success
277278

278279
nlp_stop.meta.nb_of_stop = iter
279-
Stopping._smart_update!(nlp_at_x, x = xt, fx = ft, gx = ∇f)
280+
set_x!(nlp_at_x, xt)
281+
set_fx!(nlp_at_x, ft)
282+
set_gx!(nlp_at_x, ∇f)
280283
OK = stop!(nlp_stop)
281284
Hx = hessian!(workspace, nlp, xt)
282-
success && Stopping._smart_update!(nlp_at_x, Hx = Hx)
283285
end # while !OK
284286

285287
return nlp_stop

0 commit comments

Comments
 (0)