Skip to content

Commit 8dae64e

Browse files
committed
Relax type restriction on JacobianCache
1 parent cfee15e commit 8dae64e

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/jacobians.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
mutable struct JacobianCache{CacheType1,CacheType2,CacheType3,ColorType,SparsityType,fdtype,returntype}
1+
mutable struct JacobianCache{CacheType1,CacheType2,CacheType3,CacheType4,ColorType,SparsityType,fdtype,returntype}
22
x1 :: CacheType1
3-
x2 :: CacheType1
4-
fx :: CacheType2
5-
fx1 :: CacheType3
3+
x2 :: CacheType2
4+
fx :: CacheType3
5+
fx1 :: CacheType4
66
colorvec :: ColorType
77
sparsity :: SparsityType
88
end
@@ -98,7 +98,7 @@ function JacobianCache(
9898
_fx = fx
9999
end
100100
_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)
102102
end
103103

104104
function _make_Ji(::SparseMatrixCSC, rows_index,cols_index,dx,colorvec,color_i,nrows,ncols)
@@ -157,14 +157,14 @@ void_setindex!(args...) = (setindex!(args...); return)
157157
function finite_difference_jacobian(
158158
f,
159159
x,
160-
cache::JacobianCache{T1,T2,T3,cType,sType,fdtype,returntype},
160+
cache::JacobianCache{T1,T2,T3,T4,cType,sType,fdtype,returntype},
161161
f_in=nothing;
162162
relstep=default_relstep(fdtype, eltype(x)),
163163
absstep=relstep,
164164
colorvec = cache.colorvec,
165165
sparsity = cache.sparsity,
166166
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}
168168

169169
x1, fx, fx1 = cache.x1, cache.fx, cache.fx1
170170

@@ -325,13 +325,13 @@ function finite_difference_jacobian!(
325325
J,
326326
f,
327327
x,
328-
cache::JacobianCache{T1,T2,T3,cType,sType,fdtype,returntype},
328+
cache::JacobianCache{T1,T2,T3,T4,cType,sType,fdtype,returntype},
329329
f_in = nothing;
330330
relstep = default_relstep(fdtype, eltype(x)),
331331
absstep = relstep,
332332
colorvec = cache.colorvec,
333333
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}
335335

336336
m, n = size(J)
337337
_color = reshape(colorvec, axes(x)...)

0 commit comments

Comments
 (0)