@@ -171,7 +171,6 @@ mutable struct TrustRegionCache{iip, fType, algType, uType, resType, pType,
171
171
p3:: floatType
172
172
p4:: floatType
173
173
ϵ:: floatType
174
- iter_arr:: SVector{5, Float64} # can be modified to take variable length input
175
174
176
175
function TrustRegionCache {iip} (f:: fType , alg:: algType , u:: uType , fu:: resType , p:: pType ,
177
176
uf:: ufType , linsolve:: L , J:: jType ,
@@ -186,7 +185,7 @@ mutable struct TrustRegionCache{iip, fType, algType, uType, resType, pType,
186
185
g:: resType , shrink_counter:: Int , step_size:: su2Type ,
187
186
u_tmp:: tmpType , fu_new:: resType , make_new_J:: Bool ,
188
187
r:: floatType , p1:: floatType , p2:: floatType , p3:: floatType ,
189
- p4:: floatType , ϵ:: floatType , iter_arr :: SVector{5, Float64} ) where {iip, fType, algType, uType,
188
+ p4:: floatType , ϵ:: floatType ) where {iip, fType, algType, uType,
190
189
resType, pType, INType,
191
190
tolType, probType, ufType, L,
192
191
jType, JC, floatType, trustType,
@@ -202,7 +201,7 @@ mutable struct TrustRegionCache{iip, fType, algType, uType, resType, pType,
202
201
expand_factor, loss,
203
202
loss_new, H, g, shrink_counter,
204
203
step_size, u_tmp, fu_new,
205
- make_new_J, r, p1, p2, p3, p4, ϵ, iter_arr )
204
+ make_new_J, r, p1, p2, p3, p4, ϵ)
206
205
end
207
206
end
208
207
@@ -324,7 +323,7 @@ function SciMLBase.__init(prob::NonlinearProblem{uType, iip}, alg::TrustRegion,
324
323
p4 = convert (eltype (u), 1.0e18 ) # M
325
324
initial_trust_radius = convert (eltype (u), p1 * (norm (fu)^ 0.99 ))
326
325
end
327
- iter_arr = zeros (SVector{ 5 })
326
+
328
327
329
328
return TrustRegionCache {iip} (f, alg, u, fu, p, uf, linsolve, J, jac_config,
330
329
1 , false , maxiters, internalnorm,
@@ -541,9 +540,6 @@ function SciMLBase.solve!(cache::TrustRegionCache)
541
540
while ! cache. force_stop && cache. iter < cache. maxiters &&
542
541
cache. shrink_counter < cache. alg. max_shrink_times
543
542
perform_step! (cache)
544
- if cache. iter <= 5
545
- cache. iter_arr[cache. iter] = cache. u[end ]
546
- end
547
543
cache. iter += 1
548
544
end
549
545
0 commit comments