[SciPy-user] Construct sparse matrix from sparse blocks

Nathan Bell wnbell@gmail....
Fri Feb 8 15:08:30 CST 2008


On Feb 8, 2008 2:43 PM, Neilen Marais <nmarais@sun.ac.za> wrote:
> I was unaware of the bmat like interface. I simply implemented the
> interface that seemed easiest implementation wise to me. Both the bmat
> and sparse hstack/vstack interfaces sound pretty nice to me... Avoids the
> possiblity of messing up the offsets.

Very well, I'll adapt your code to provide bmat/hstack/vstack-like
functionality.

Regarding names, we already have spkron ~= kron and spdiags ~= diag.
I think we'll have to abandon this approach for the proposed functions
since spbmat, sphstack, spvstack  are terrible :)

Which is better,

  column_stack_sparse
  row_stack_sparse
  block_matrix_sparse

or

  sparse_column_stack
  sparse_row_stack
  sparse_block_matrix


I prefer the XXX_sparse format since it aids tab completion.  Suggestions?

-- 
Nathan Bell wnbell@gmail.com
http://graphics.cs.uiuc.edu/~wnbell/


More information about the SciPy-user mailing list