From a22c77dbc3f53e7b5034ad23d58d9590fe375183 Mon Sep 17 00:00:00 2001 From: oscarddssmith Date: Thu, 12 Sep 2024 11:33:19 -0400 Subject: [PATCH] simplify jac_config --- .../src/derivative_wrappers.jl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/OrdinaryDiffEqDifferentiation/src/derivative_wrappers.jl b/lib/OrdinaryDiffEqDifferentiation/src/derivative_wrappers.jl index 5104b94e86..1093ab555e 100644 --- a/lib/OrdinaryDiffEqDifferentiation/src/derivative_wrappers.jl +++ b/lib/OrdinaryDiffEqDifferentiation/src/derivative_wrappers.jl @@ -258,13 +258,11 @@ function jacobian!(J::AbstractMatrix{<:Number}, f, x::AbstractArray{<:Number}, nothing end -function build_jac_config(alg, f::F1, uf::F2, du1, uprev, u, tmp, du2, - ::Val{transform} = Val(true)) where {transform, F1, F2} +function build_jac_config(alg, f::F1, uf::F2, du1, uprev, u, tmp, du2) where {F1, F2} haslinsolve = hasfield(typeof(alg), :linsolve) if !DiffEqBase.has_jac(f) && # No Jacobian if has analytical solution - (transform || !DiffEqBase.has_Wfact(f)) && # No Jacobian if has_Wfact and Wfact is the one that's used - (!transform || !DiffEqBase.has_Wfact_t(f)) && # No Jacobian has_Wfact and Wfact_t is the one that's used + (!DiffEqBase.has_Wfact_t(f)) && ((concrete_jac(alg) === nothing && (!haslinsolve || (haslinsolve && # No Jacobian if linsolve doesn't want it (alg.linsolve === nothing || LinearSolve.needs_concrete_A(alg.linsolve))))) || (concrete_jac(alg) !== nothing && concrete_jac(alg))) # Jacobian if explicitly asked for