Skip to content

Commit c98efb3

Browse files
don't reuse i
1 parent b40f408 commit c98efb3

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 i in 1:length(cols_index)
113-
if color[cols_index[i]] == color_i
112+
for j in 1:length(cols_index)
113+
if color[cols_index[j]] == color_i
114114
if J isa SparseMatrixCSC
115-
J.nzval[i] = dx[rows_index[i]]
115+
J.nzval[j] = dx[rows_index[j]]
116116
else
117-
J[rows_index[i],cols_index[i]] = dx[rows_index[i]]
117+
J[rows_index[j],cols_index[j]] = dx[rows_index[j]]
118118
end
119119
end
120120
end

0 commit comments

Comments
 (0)