[SciPy-dev] sparse kronsum

Nathan Bell wnbell@gmail....
Sun Feb 10 16:53:38 CST 2008


On Feb 10, 2008 3:53 AM, Nils Wagner <nwagner@iam.uni-stuttgart.de> wrote:

> I just tried it out. print does not work
> for matrices given in block sparse row format.
>
> B = coo_matrix([[1.+1j,2],[3,4-1j]])
> print B results in
>    (0, 0)        (1.0+1.0j)
>    (0, 1)        (2.0+0.0j)
>    (1, 0)        (3.0+0.0j)
>    (1, 1)        (4.0+-1.0j)

Fixed in r3912.  It should work for all sparse classes now.

> Please note that there are two signs in the last entry.
> It should be 4.0-1.0j instead of 4.0+-1.0j.

That appears to be a numpy oddity (bug?):

In [23]: str(array([1 - 3j]))
Out[23]: '[ 1.-3.j]'

In [24]: str(array([1 - 3j])[0])
Out[24]: '(1.0+-3.0j)'

In [55]: complex128(1 - 3j)
Out[55]: (1.0+-3.0j)


-- 
Nathan Bell wnbell@gmail.com
http://graphics.cs.uiuc.edu/~wnbell/


More information about the Scipy-dev mailing list