Skip to content

Commit d7ce4ef

Browse files
oops k
1 parent c98efb3 commit d7ce4ef

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/differentiation/compute_jacobian_ad.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,12 @@ function forwarddiff_color_jacobian!(J::AbstractMatrix{<:Number},
109109
for j in 1:chunksize
110110
dx .= partials.(fx, j)
111111
if ArrayInterface.fast_scalar_indexing(x1)
112-
for j in 1:length(cols_index)
113-
if color[cols_index[j]] == color_i
112+
for k in eachindex(cols_index)
113+
if color[cols_index[k]] == color_i
114114
if J isa SparseMatrixCSC
115-
J.nzval[j] = dx[rows_index[j]]
115+
J.nzval[k] = dx[rows_index[k]]
116116
else
117-
J[rows_index[j],cols_index[j]] = dx[rows_index[j]]
117+
J[rows_index[k],cols_index[k]] = dx[rows_index[k]]
118118
end
119119
end
120120
end

0 commit comments

Comments
 (0)