Skip to content

Commit

Permalink
Update src/linalg.jl
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Karrasch <[email protected]>
  • Loading branch information
matbesancon and dkarrasch authored Oct 24, 2024
1 parent 777dff9 commit eedb426
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,9 @@ function *(A::Diagonal, b::AbstractSparseVector)
res = similar(b, T)
nzind_b = nonzeroinds(b)
nzval_b = nonzeros(b)
nzval_res = nonzeros(res)
for idx in eachindex(nzind_b)
res[nzind_b[idx]] = A.diag[nzind_b[idx]] * nzval_b[idx]
nzval_res[idx] = A.diag[nzind_b[idx]] * nzval_b[idx]
end
return res
end
Expand Down

0 comments on commit eedb426

Please sign in to comment.