Skip to content

Commit

Permalink
Update jacobians.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Jun 11, 2019
1 parent 919fc19 commit fa1248b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/jacobians.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function JacobianCache(
fdtype :: Type{T1} = Val{:central},
returntype :: Type{T2} = eltype(x),
inplace :: Type{Val{T3}} = Val{true};
color = 1:length(x)) where {T1,T2,T3}
color = eachindex(x)) where {T1,T2,T3}

if eltype(x) <: Real && fdtype==Val{:complex}
x1 = fill(zero(Complex{eltype(x)}), size(x))
Expand Down Expand Up @@ -96,7 +96,7 @@ function finite_difference_jacobian(f, x::AbstractArray{<:Number},
f_in :: Union{T2,Nothing}=nothing;
relstep=default_relstep(fdtype, eltype(x)),
absstep=relstep,
color = 1:length(x)) where {T1,T2,T3}
color = eachindex(x)) where {T1,T2,T3}

cache = JacobianCache(x, fdtype, returntype, inplace)
finite_difference_jacobian(f, x, cache, f_in; relstep=relstep, absstep=absstep, color=color)
Expand Down

0 comments on commit fa1248b

Please sign in to comment.