[SciPy-user] Construct sparse matrix from sparse blocks
Nathan Bell
wnbell at gmail.com
Fri Feb 8 13:02:41 EST 2008
On Feb 8, 2008 8:15 AM, Neilen Marais <nmarais at sun.ac.za> wrote:
> Thanks for the suggestion. I ended up writing the function at the end of
> the message. If anyone else finds it useful I think it may be a good idea to
> put it somewhere in scipy.sparse?
Thanks for sharing this with us. I think it would make a useful
addition to scipy.sparse, so if there are no objections I'll integrate
it in some form.
Do you actually need the the row and column offset, or would a sparse
analog of numpy's bmat() be more appropriate?
http://www.scipy.org/Numpy_Example_List_With_Doc#bmat
Specifically, would it be preferable to produce your example
A = [A_aa 0 ]
[0 A_bb]
using the interface merge_sparse_blocks currently supports or something like
bmat_sparse( [[A_aa, None],[None,A_bb]] )
We could also provide hstack_sparse() and vstack_sparse() functions
also. Thoughts?
--
Nathan Bell wnbell at gmail.com
http://graphics.cs.uiuc.edu/~wnbell/
More information about the SciPy-User
mailing list