[SciPy-user] more help with sparse matrix: creating

Robin robince at gmail.com
Mon Oct 8 13:33:57 EDT 2007


On 10/8/07, Dominique Orban <dominique.orban at gmail.com> wrote:
>
> I hope this helps.
> Dominique


It certainly does help - thanks a lot for your time...

In this case I know the nnz exactly in advance, which is why I was keen to
preallocate.

Unfortunately it seems I still can't do the MATLAB style indexing I wanted,
something like
M[2, [1,2,3]] = 1
but since I will be updating row by row anyway I can get around this by
creating a temporary row vector to insert with slicing.

Also, if I understand correctly the conversion to csr necessary for
matrix-vector multiplication cannot be done in place - this is a real shame
as it doubles the memory requirements for this over the MATLAB version (I
really want to make this array as big as possible)

Still I'll carry on for now - may have to talk my supervisor into getting me
some more ram!

Thanks again,

Robin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20071008/a0808e3b/attachment.html>


More information about the SciPy-User mailing list