I have a sparse matrix A and a column vector a,
In[1]: A
Out[1]: <256x256 sparse matrix of type '<type 'numpy.float64'>'
with 512 stored elements (blocksize = 2x2) in Block Sparse Row format>
In[2]: len(a)
Out[2]: 70
I would to write a submatrix. The code I wrote for this is:
Sub = A.tolil()[a,:][:,a]
The time needed to solve the problem is quite long. I woul like to know if is possible to modify the code in order to make the process faster.