Skip to content

Commit

Permalink
check for a Jacobian before autodiffing
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Dec 11, 2022
1 parent ce05bf6 commit 32a68b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "NonlinearSolve"
uuid = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
authors = ["SciML"]
version = "1.1.0"
version = "1.1.1"

[deps]
ArrayInterfaceCore = "30b0a656-2188-435a-8636-2ec0e6a096e2"
Expand Down
4 changes: 3 additions & 1 deletion src/jacobian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ function jacobian!(J::AbstractMatrix{<:Number}, cache)
jac_config = cache.jac_config
alg = cache.alg

if alg_autodiff(alg)
if SciMLBase.has_jac(f)
f.jac(J, x, cache.p)
elseif alg_autodiff(alg)
forwarddiff_color_jacobian!(J, uf, x, jac_config)
#cache.destats.nf += 1
else
Expand Down

0 comments on commit 32a68b6

Please sign in to comment.