|
49 | 49 | jacobian!!(::Number, cache) = last(value_derivative(cache.uf, cache.u))
|
50 | 50 |
|
51 | 51 | # Build Jacobian Caches
|
52 |
| -function jacobian_caches(alg::AbstractNonlinearSolveAlgorithm, f, u, p, ::Val{iip}; |
| 52 | +function jacobian_caches(alg::AbstractNonlinearSolveAlgorithm, f::F, u, p, ::Val{iip}; |
53 | 53 | linsolve_kwargs = (;), lininit::Val{linsolve_init} = Val(true),
|
54 |
| - linsolve_with_JᵀJ::Val{needsJᵀJ} = Val(false)) where {iip, needsJᵀJ, linsolve_init} |
| 54 | + linsolve_with_JᵀJ::Val{needsJᵀJ} = Val(false)) where {iip, needsJᵀJ, linsolve_init, F} |
55 | 55 | uf = JacobianWrapper{iip}(f, p)
|
56 | 56 |
|
57 | 57 | haslinsolve = hasfield(typeof(alg), :linsolve)
|
@@ -135,9 +135,9 @@ __maybe_symmetric(x::StaticArray) = x
|
135 | 135 | __maybe_symmetric(x::SparseArrays.AbstractSparseMatrix) = x
|
136 | 136 |
|
137 | 137 | ## Special Handling for Scalars
|
138 |
| -function jacobian_caches(alg::AbstractNonlinearSolveAlgorithm, f, u::Number, p, |
| 138 | +function jacobian_caches(alg::AbstractNonlinearSolveAlgorithm, f::F, u::Number, p, |
139 | 139 | ::Val{false}; linsolve_with_JᵀJ::Val{needsJᵀJ} = Val(false),
|
140 |
| - kwargs...) where {needsJᵀJ} |
| 140 | + kwargs...) where {needsJᵀJ, F} |
141 | 141 | # NOTE: Scalar `u` assumes scalar output from `f`
|
142 | 142 | uf = JacobianWrapper{false}(f, p)
|
143 | 143 | needsJᵀJ && return uf, nothing, u, nothing, nothing, u, u, u
|
|
0 commit comments