Skip to content

Commit 32a68b6

Browse files
check for a Jacobian before autodiffing
1 parent ce05bf6 commit 32a68b6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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.1.0"
4+
version = "1.1.1"
55

66
[deps]
77
ArrayInterfaceCore = "30b0a656-2188-435a-8636-2ec0e6a096e2"

src/jacobian.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ function jacobian!(J::AbstractMatrix{<:Number}, cache)
3232
jac_config = cache.jac_config
3333
alg = cache.alg
3434

35-
if alg_autodiff(alg)
35+
if SciMLBase.has_jac(f)
36+
f.jac(J, x, cache.p)
37+
elseif alg_autodiff(alg)
3638
forwarddiff_color_jacobian!(J, uf, x, jac_config)
3739
#cache.destats.nf += 1
3840
else

0 commit comments

Comments
 (0)