Skip to content

Commit

Permalink
fixup! feat: implement initialization for SimpleNonlinearSolve
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Dec 6, 2024
1 parent 6f85e87 commit 78b4518
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/SimpleNonlinearSolve/src/SimpleNonlinearSolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ function CommonSolve.solve(
cache = SciMLBase.__init(prob, alg, args...; kwargs...)
prob = cache.prob
if cache.retcode == ReturnCode.InitialFailure
return SciMLBase.build_solution(prob, alg, prob.u0, NonlinearSolveBase.Utils.evaluate_f(prob, prob.u0); cache.retcode)
return SciMLBase.build_solution(prob, alg, prob.u0,
NonlinearSolveBase.Utils.evaluate_f(prob, prob.u0); cache.retcode)
end
prob = convert(ImmutableNonlinearProblem, prob)
return solve(prob, alg, args...; kwargs...)
Expand Down Expand Up @@ -105,7 +106,8 @@ function CommonSolve.solve(
cache = SciMLBase.__init(prob, alg, args...; kwargs...)
prob = cache.prob
if cache.retcode == ReturnCode.InitialFailure
return SciMLBase.build_solution(prob, alg, prob.u0, NonlinearSolveBase.Utils.evaluate_f(prob, prob.u0); cache.retcode)
return SciMLBase.build_solution(prob, alg, prob.u0,
NonlinearSolveBase.Utils.evaluate_f(prob, prob.u0); cache.retcode)
end
if sensealg === nothing && haskey(prob.kwargs, :sensealg)
sensealg = prob.kwargs[:sensealg]
Expand Down

0 comments on commit 78b4518

Please sign in to comment.