Skip to content

Commit b0aa0af

Browse files
committed
Newton Raphson ignores jac-prototype
1 parent cb80ed2 commit b0aa0af

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ docs/site/
2323
# environment.
2424
Manifest.toml
2525
docs/src/assets/Project.toml
26+
27+
.vscode

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "NonlinearSolve"
22
uuid = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
33
authors = ["SciML"]
4-
version = "1.9.0"
4+
version = "1.10.0"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"

src/raphson.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ end
106106

107107
function jacobian_caches(alg::NewtonRaphson, f, u, p, ::Val{true})
108108
uf = JacobianWrapper(f, p)
109-
J = ArrayInterface.undefmatrix(u)
109+
J = if f.jac_prototype === nothing
110+
ArrayInterface.undefmatrix(u)
111+
else
112+
f.jac_prototype
113+
end
110114

111115
linprob = LinearProblem(J, _vec(zero(u)); u0 = _vec(zero(u)))
112116
weight = similar(u)

0 commit comments

Comments
 (0)