[SciPy-Dev] sparse.block_diag improvement

Pauli Virtanen pav at iki.fi
Mon Apr 7 04:28:10 EDT 2014


Severin Holzer-Graf <sholzergr <at> gmail.com> writes:
[clip]
> My question is, is there interest in integrating this in Scipy, and if
> yes, how can this be done best?
> I tried extending the current block_diag in a fork, but the indexing
> trick only works for equally sized matrices. So either add a check in
> the beginning of the existing block_diag and than executing the fast
> way, or writing another function, especially for equally sized
> matrices.

The best way to do it is probably to write the "fast path"
as a separate function with a name starting with "_", and
add an if statement to block_diag calling that in cases
where it's possible to do it in a better way.

-- 
Pauli Virtanen




More information about the SciPy-Dev mailing list