Skip to content

Commit

Permalink
more minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yash-rs committed Sep 17, 2023
1 parent f8b6685 commit 137d8fd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/raphson.jl
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,11 @@ function objective_linesearch(cache::NewtonRaphsonCache) ## returns the objectiv
end

function perform_linesearch!(cache::NewtonRaphsonCache)
@unpack u, fu, du1, alg, α, g_o = cache
@unpack u, fu, du1, alg, α = cache
fo, g!, fg! = objective_linesearch(cache)
cache.f_o = fo(u)
g!(cache.g_o, u)
@unpack f_o, g_o = cache
ϕ(α) = fo(u .- α .* du1)

function (α)
Expand All @@ -214,9 +217,7 @@ function perform_linesearch!(cache::NewtonRaphsonCache)
function ϕdϕ(α)
return (fg!(g_o, u .- α .* du1), dot(g_o, -du1))
end
cache.f_o = fo(u)
@unpack f_o = cache
cache.α, cache.f_o = alg.linesearch(ϕ, dϕ, ϕdϕ, 1.0, f_o, dot(du1, g_o))
cache.α, cache.f_o = alg.linesearch(ϕ, dϕ, ϕdϕ, 1.0, f_o, dot(du1, -g_o))
end

function SciMLBase.solve!(cache::NewtonRaphsonCache)
Expand Down

0 comments on commit 137d8fd

Please sign in to comment.