Skip to content

Commit d0a1512

Browse files
committed
fix: halley's method for matrices
1 parent 7f323fb commit d0a1512

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

lib/SimpleNonlinearSolve/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SimpleNonlinearSolve"
22
uuid = "727e6d20-b764-4bd8-a329-72de5adea6c7"
33
authors = ["SciML"]
4-
version = "2.2.1"
4+
version = "2.2.2"
55

66
[deps]
77
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"

lib/SimpleNonlinearSolve/src/halley.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ function SciMLBase.__solve(
7474
end
7575

7676
aᵢ = J_fact \ NLBUtils.safe_vec(fx)
77-
hvvp = Utils.compute_hvvp(prob, autodiff, fx_cache, x, aᵢ)
77+
hvvp = Utils.compute_hvvp(
78+
prob, autodiff, fx_cache, x, NLBUtils.restructure(x, aᵢ))
7879
bᵢ = J_fact \ NLBUtils.safe_vec(hvvp)
7980

8081
cᵢ_ = NLBUtils.safe_vec(cᵢ)

lib/SimpleNonlinearSolve/src/utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ function compute_hvvp(prob, autodiff, fx, x, dir)
171171
else
172172
@closure (u, p) -> only(DI.pushforward(prob.f, autodiff, u, (dir,), Constant(p)))
173173
end
174-
only(DI.pushforward(jvp_fn, autodiff, x, (dir,), Constant(prob.p)))
174+
return only(DI.pushforward(jvp_fn, autodiff, x, (dir,), Constant(prob.p)))
175175
end
176176

177177
end

0 commit comments

Comments
 (0)