Skip to content

Commit 3cee23b

Browse files
committed
revert changes
1 parent 6b6135d commit 3cee23b

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/trustRegion.jl

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ mutable struct TrustRegionCache{iip, fType, algType, uType, resType, pType,
171171
p3::floatType
172172
p4::floatType
173173
ϵ::floatType
174-
iter_arr::SVector{5, Float64} #can be modified to take variable length input
175174

176175
function TrustRegionCache{iip}(f::fType, alg::algType, u::uType, fu::resType, p::pType,
177176
uf::ufType, linsolve::L, J::jType,
@@ -186,7 +185,7 @@ mutable struct TrustRegionCache{iip, fType, algType, uType, resType, pType,
186185
g::resType, shrink_counter::Int, step_size::su2Type,
187186
u_tmp::tmpType, fu_new::resType, make_new_J::Bool,
188187
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,
190189
resType, pType, INType,
191190
tolType, probType, ufType, L,
192191
jType, JC, floatType, trustType,
@@ -202,7 +201,7 @@ mutable struct TrustRegionCache{iip, fType, algType, uType, resType, pType,
202201
expand_factor, loss,
203202
loss_new, H, g, shrink_counter,
204203
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, ϵ)
206205
end
207206
end
208207

@@ -324,7 +323,7 @@ function SciMLBase.__init(prob::NonlinearProblem{uType, iip}, alg::TrustRegion,
324323
p4 = convert(eltype(u), 1.0e18) # M
325324
initial_trust_radius = convert(eltype(u), p1 * (norm(fu)^0.99))
326325
end
327-
iter_arr = zeros(SVector{5})
326+
328327

329328
return TrustRegionCache{iip}(f, alg, u, fu, p, uf, linsolve, J, jac_config,
330329
1, false, maxiters, internalnorm,
@@ -541,9 +540,6 @@ function SciMLBase.solve!(cache::TrustRegionCache)
541540
while !cache.force_stop && cache.iter < cache.maxiters &&
542541
cache.shrink_counter < cache.alg.max_shrink_times
543542
perform_step!(cache)
544-
if cache.iter <= 5
545-
cache.iter_arr[cache.iter] = cache.u[end]
546-
end
547543
cache.iter += 1
548544
end
549545

0 commit comments

Comments
 (0)