Multiply dense numpy matrix with sparse scipy vector

[email protected]
Newsgroups gmane.comp.python.scientific.user
Message-ID <[email protected]>
Upon profiling, we found that multiplying a dense numpy matrix, e.g.

A = np.eye(5)

with a sparse scipy vector, e.g.

x = scipy.sparse.coo_matrix(np.eye(5)[4]).T

did in fact not make use of the sparsity of x when using @. That is:

A @ x

is not a sparse computation.

How can this be done?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.