|
1 | | -mutable struct JacobianCache{CacheType1,CacheType2,CacheType3,ColorType,SparsityType,fdtype,returntype} |
| 1 | +mutable struct JacobianCache{CacheType1,CacheType2,CacheType3,CacheType4,ColorType,SparsityType,fdtype,returntype} |
2 | 2 | x1 :: CacheType1 |
3 | | - x2 :: CacheType1 |
4 | | - fx :: CacheType2 |
5 | | - fx1 :: CacheType3 |
| 3 | + x2 :: CacheType2 |
| 4 | + fx :: CacheType3 |
| 5 | + fx1 :: CacheType4 |
6 | 6 | colorvec :: ColorType |
7 | 7 | sparsity :: SparsityType |
8 | 8 | end |
@@ -98,7 +98,7 @@ function JacobianCache( |
98 | 98 | _fx = fx |
99 | 99 | end |
100 | 100 | _x2 = zero(_x1) |
101 | | - JacobianCache{typeof(_x1),typeof(_fx),typeof(fx1),typeof(colorvec),typeof(sparsity),fdtype,returntype}(_x1,_x2,_fx,fx1,colorvec,sparsity) |
| 101 | + JacobianCache{typeof(_x1),typeof(_x2),typeof(_fx),typeof(fx1),typeof(colorvec),typeof(sparsity),fdtype,returntype}(_x1,_x2,_fx,fx1,colorvec,sparsity) |
102 | 102 | end |
103 | 103 |
|
104 | 104 | function _make_Ji(::SparseMatrixCSC, rows_index,cols_index,dx,colorvec,color_i,nrows,ncols) |
@@ -157,14 +157,14 @@ void_setindex!(args...) = (setindex!(args...); return) |
157 | 157 | function finite_difference_jacobian( |
158 | 158 | f, |
159 | 159 | x, |
160 | | - cache::JacobianCache{T1,T2,T3,cType,sType,fdtype,returntype}, |
| 160 | + cache::JacobianCache{T1,T2,T3,T4,cType,sType,fdtype,returntype}, |
161 | 161 | f_in=nothing; |
162 | 162 | relstep=default_relstep(fdtype, eltype(x)), |
163 | 163 | absstep=relstep, |
164 | 164 | colorvec = cache.colorvec, |
165 | 165 | sparsity = cache.sparsity, |
166 | 166 | jac_prototype = nothing, |
167 | | - dir=true) where {T1,T2,T3,cType,sType,fdtype,returntype} |
| 167 | + dir=true) where {T1,T2,T3,T4,cType,sType,fdtype,returntype} |
168 | 168 |
|
169 | 169 | x1, fx, fx1 = cache.x1, cache.fx, cache.fx1 |
170 | 170 |
|
@@ -325,13 +325,13 @@ function finite_difference_jacobian!( |
325 | 325 | J, |
326 | 326 | f, |
327 | 327 | x, |
328 | | - cache::JacobianCache{T1,T2,T3,cType,sType,fdtype,returntype}, |
| 328 | + cache::JacobianCache{T1,T2,T3,T4,cType,sType,fdtype,returntype}, |
329 | 329 | f_in = nothing; |
330 | 330 | relstep = default_relstep(fdtype, eltype(x)), |
331 | 331 | absstep = relstep, |
332 | 332 | colorvec = cache.colorvec, |
333 | 333 | sparsity = cache.sparsity, |
334 | | - dir = true) where {T1,T2,T3,cType,sType,fdtype,returntype} |
| 334 | + dir = true) where {T1,T2,T3,T4,cType,sType,fdtype,returntype} |
335 | 335 |
|
336 | 336 | m, n = size(J) |
337 | 337 | _color = reshape(colorvec, axes(x)...) |
|
0 commit comments