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

nicky van foreest vanforeest at gmail.com
Tue Jan 6 02:50:16 EST 2009


Hi Nathan,

Thanks for your feedback.

> For conformity with dense matrices, max() should return zero if the
> nonzero entries of the matrix are all negative and there is at least
> one missing value in the matrix.  This might surprise people who
> expect the largest nonzero value instead.  For instance,
> csr_matrix([[0,-1]]).max() should be 0.

To bring things in line with dense matrices a norm operator would be
the most logical, so that norm(A, infty) would yield the max of the
absolute values, etc. I suppose this will be more difficult than
implementing max(), but anyway that is what I ultimately would expect
to use and be consistent with the dense matrices.

bye

Nicky



More information about the SciPy-User mailing list