Skip to content

Commit e890b3d

Browse files
committed
fix sparsity
1 parent e9ad65c commit e890b3d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/jacobians.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ function finite_difference_jacobian(
192192
return dx
193193
end
194194

195-
if jac_prototype isa Nothing
195+
if jac_prototype isa Nothing && sparsity isa Nothing
196196
J = mapreduce(calculate_Ji_forward, hcat, 1:maximum(colorvec))
197197
else
198198
@inbounds for color_i 1:maximum(colorvec)
@@ -227,7 +227,7 @@ function finite_difference_jacobian(
227227
return dx
228228
end
229229

230-
if jac_prototype isa Nothing
230+
if jac_prototype isa Nothing && sparsity isa Nothing
231231
J = mapreduce(calculate_Ji_central, hcat, 1:maximum(colorvec))
232232
else
233233
@inbounds for color_i 1:maximum(colorvec)
@@ -261,7 +261,7 @@ function finite_difference_jacobian(
261261
return dx
262262
end
263263

264-
if jac_prototype isa Nothing
264+
if jac_prototype isa Nothing && sparsity isa Nothing
265265
J = mapreduce(calculate_Ji_complex, hcat, 1:maximum(colorvec))
266266
else
267267
@inbounds for color_i 1:maximum(colorvec)

0 commit comments

Comments
 (0)