Skip to content

Instantly share code, notes, and snippets.

@rdisipio
Created May 25, 2021 21:46
Show Gist options
  • Save rdisipio/c99e0e4c0dd6c9ce6e66577149a17a8b to your computer and use it in GitHub Desktop.
Save rdisipio/c99e0e4c0dd6c9ce6e66577149a17a8b to your computer and use it in GitHub Desktop.
Matrix-vector multiplication with CSR matrix
y = [0 for _ in range(n)]
for i in range(n):
for k in range(Ap[i], Ap[i+1]):
j = Aj[k]
y[i] += Ax[k] * v[j]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment