Skip to content

Commit

Permalink
Merge pull request #12689 from KristofferC/patch-4
Browse files Browse the repository at this point in the history
inbounds and hoist field loading for dense * sparse
  • Loading branch information
jakebolewski committed Aug 19, 2015
2 parents 3ce3f40 + 9eaa2ce commit 9c82059
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions base/sparse/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ function (*){TX,TvA,TiA}(X::StridedMatrix{TX}, A::SparseMatrixCSC{TvA,TiA})
mX, nX = size(X)
nX == A.m || throw(DimensionMismatch())
Y = zeros(promote_type(TX,TvA), mX, A.n)
for multivec_row=1:mX, col = 1:A.n, k=A.colptr[col]:(A.colptr[col+1]-1)
Y[multivec_row, col] += X[multivec_row, A.rowval[k]] * A.nzval[k]
rowval = A.rowval
nzval = A.nzval
@inbounds for multivec_row=1:mX, col = 1:A.n, k=A.colptr[col]:(A.colptr[col+1]-1)
Y[multivec_row, col] += X[multivec_row, rowval[k]] * nzval[k]
end
Y
end
Expand Down

0 comments on commit 9c82059

Please sign in to comment.