diff --git a/src/trustRegion.jl b/src/trustRegion.jl index f8fe95054..df59bea2f 100644 --- a/src/trustRegion.jl +++ b/src/trustRegion.jl @@ -171,7 +171,6 @@ mutable struct TrustRegionCache{iip, fType, algType, uType, resType, pType, p3::floatType p4::floatType ϵ::floatType - iter_arr::SVector{5, Float64} #can be modified to take variable length input function TrustRegionCache{iip}(f::fType, alg::algType, u::uType, fu::resType, p::pType, uf::ufType, linsolve::L, J::jType, @@ -186,7 +185,7 @@ mutable struct TrustRegionCache{iip, fType, algType, uType, resType, pType, g::resType, shrink_counter::Int, step_size::su2Type, u_tmp::tmpType, fu_new::resType, make_new_J::Bool, r::floatType, p1::floatType, p2::floatType, p3::floatType, - p4::floatType, ϵ::floatType, iter_arr::SVector{5, Float64}) where {iip, fType, algType, uType, + p4::floatType, ϵ::floatType) where {iip, fType, algType, uType, resType, pType, INType, tolType, probType, ufType, L, jType, JC, floatType, trustType, @@ -202,7 +201,7 @@ mutable struct TrustRegionCache{iip, fType, algType, uType, resType, pType, expand_factor, loss, loss_new, H, g, shrink_counter, step_size, u_tmp, fu_new, - make_new_J, r, p1, p2, p3, p4, ϵ, iter_arr) + make_new_J, r, p1, p2, p3, p4, ϵ) end end @@ -324,7 +323,7 @@ function SciMLBase.__init(prob::NonlinearProblem{uType, iip}, alg::TrustRegion, p4 = convert(eltype(u), 1.0e18) # M initial_trust_radius = convert(eltype(u), p1 * (norm(fu)^0.99)) end - iter_arr = zeros(SVector{5}) + return TrustRegionCache{iip}(f, alg, u, fu, p, uf, linsolve, J, jac_config, 1, false, maxiters, internalnorm, @@ -541,9 +540,6 @@ function SciMLBase.solve!(cache::TrustRegionCache) while !cache.force_stop && cache.iter < cache.maxiters && cache.shrink_counter < cache.alg.max_shrink_times perform_step!(cache) - if cache.iter <= 5 - cache.iter_arr[cache.iter] = cache.u[end] - end cache.iter += 1 end