[SciPy-user] fast max() on sparse matrices
Tue Jan 6 11:58:29 CST 2009
Thanks for all the help, the sparse module is pretty powerful stuff. I'll
pull together a small scale example and post it tonight.
On Mon, Jan 5, 2009 at 8:42 PM, Nathan Bell <firstname.lastname@example.org> wrote:
> On Mon, Jan 5, 2009 at 8:04 PM, Peter Skomoroch
> <email@example.com> wrote:
> > Nathan,
> > You said:
> > "... some matrices permit duplicate entries.
> > Currently, we implicitly sum duplicate values together (e.g. when
> > computing sparse matrix-vector products) and when converting to other
> > formats."
> > Could you elaborate on that a bit? I'm trying to track down a nasty bug
> > right now where the result of a sparse matrix-matrix product (A_sparse *
> > B_dense) does not agree with the corresponding dense product (A_dense *
> > B_dense).
> It's a little costly to detect the presence of duplicates in the CSR,
> CSC, and COO formats so we adopt the convention that a matrix with
> duplicates should behave as if those duplicates were summed together.
> If A and B are sparse matrices then A * B should be close to
> dot(A.toarray(), B.toarray()). The only difference between the two
> would be due to to order of operations.
> Note that there's another oddity w.r.t. sorting of the indices in the
> CSR/CSC formats. Certain operations will shuffle the nonzeros about,
> so it's dangerous to share arrays between multiple CSR/CSC matrices.
> I suspect Robert's suggestion might be the source of your problems.
> If not, try to reduce the problem to something small and reproduceable
> and we'll try to sort it out.
> Nathan Bell firstname.lastname@example.org
> SciPy-user mailing list
Peter N. Skomoroch
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-user