[SciPy-user] fast max() on sparse matrices

Robert Kern robert.kern@gmail....
Mon Jan 5 19:32:05 CST 2009


On Mon, Jan 5, 2009 at 19:04, Peter Skomoroch <peter.skomoroch@gmail.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).

Note that if A_dense and B_dense are ndarray objects rather than
(dense) matrix objects, then (A_dense*B_dense) does elementwise
multiplication, not matrix multiplication. spmatrix objects do matrix
multiplication with the * operator.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco


More information about the SciPy-user mailing list