Skip to content

Commit

Permalink
Add more conditions for jac_prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
YingboMa committed Oct 22, 2019
1 parent ac5d76f commit 7532bff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/derivative_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,8 @@ function build_J_W(alg,u,uprev,p,t,dt,f,uEltypeNoUnits,::Val{true})
return nothing, nothing
end
end
if ArrayInterface.isstructured(f.jac_prototype) || f.jac_prototype isa SparseMatrixCSC
n = length(u)
if size(f.jac_prototype) != (n, n) || ArrayInterface.isstructured(f.jac_prototype) || f.jac_prototype isa SparseMatrixCSC
J = similar(f.jac_prototype)
W = similar(J)
elseif DiffEqBase.has_jac(f) && !DiffEqBase.has_Wfact(f) && f.jac_prototype !== nothing
Expand Down

0 comments on commit 7532bff

Please sign in to comment.