Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 4a04a3c

Browse files
Update src/broyden.jl
1 parent 27e2c6b commit 4a04a3c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/broyden.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@ function SciMLBase.solve(prob::NonlinearProblem,
1616
x = float(prob.u0)
1717
fₙ = f(x)
1818
T = eltype(x)
19-
if length(x) > 1
20-
J⁻¹ = Matrix{T}(I, length(x), length(x))
21-
else
22-
J⁻¹ = 1
23-
end
19+
J⁻¹ = ArrayInterfaceCore.zeromatrix(x)
2420

2521
if SciMLBase.isinplace(prob)
2622
error("Broyden currently only supports out-of-place nonlinear problems")

0 commit comments

Comments
 (0)