[Scipy-tickets] [SciPy] #1284: function to create sparse block diagonal matrix from (sparse) blocks

SciPy Trac scipy-tickets@scipy....
Tue Sep 21 01:37:46 CDT 2010

#1284: function to create sparse block diagonal matrix from (sparse) blocks
 Reporter:  rc            |       Owner:  wnbell
     Type:  enhancement   |      Status:  new   
 Priority:  normal        |   Milestone:  0.9.0 
Component:  scipy.sparse  |     Version:  0.7.0 
 Keywords:                |  
 There is scipy.sparse.bmat() that can construct a sparse matrix given the
 individual blocks, but it is not very convenient to use for block-diagonal
 matrices, cf. [1].

 The attached patch contains the bdiag() function that addresses this
 issue. The name is IMHO consistent with bmat(), but note that its dense
 analogue in scipy.linalg is called block_diag().

 The function bdiag() uses a slightly different strategy when collecting
 the blocks than bmat() - it uses lists instead of object arrays. I am not
 sure about performance implications, but the code looks simpler.

 [1] http://mail.scipy.org/pipermail/scipy-user/2009-May/021105.html

Ticket URL: <http://projects.scipy.org/scipy/ticket/1284>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.

More information about the Scipy-tickets mailing list