Skip to content

Commit

Permalink
revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
yash-rs committed Apr 23, 2023
1 parent 6b6135d commit 3cee23b
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/trustRegion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 3cee23b

Please sign in to comment.