I have a large sparse matrix A and i want to pick the submatrix of it to do block jacobi iterations.
For the blocks, i have get a matrix Q that contains the index of nonzero entries in its Jth column define the nodes of Jth block.
my code is:
for i=1:J lg=find(Q(level).agg(:,i)); D(i).matrix=inv((sparse(A(lg,lg)))); end D_inverse=sparse(blkdiag(D(1:J).matrix));
and I found that the operations A(lg,lg) cost much time, because A is sparse format,
Is there any other ways to do this purpose (building D_inverse)quickly and efficently?