[SciPy-user] Interaction of sparse and dense matrices in scipy

Nils Wagner nwagner at mecha.uni-stuttgart.de
Mon Feb 20 09:30:38 EST 2006


Nils Wagner wrote:
>Robert Cimrman wrote:
>  
>>Nils Wagner wrote:
>>
>> 
>>    
>>>dense                           sparse
>>>
>>>dot(C,D)                      A*B
>>>linalg.norm(C)            linalg.norm(C.todense())
>>>linalg.kron(C,D)           ?
>>>identity(n), eye(n)           
>>>   
>>>      
>>Hi Nils,
>>I have just added speye, spidentity to the scipy.sparse (using spdiags). 
>>You can test them in svn.
>>
>>r.
>>
>> 
>>    
>Hi Robert,
>
>Great ! Thank you very much ! :-)
>
>Nils
>
>  
>>_______________________________________________
>>SciPy-user mailing list
>>SciPy-user at scipy.net
>>http://www.scipy.net/mailman/listinfo/scipy-user
>> 
>>    
>
>
> 
>
>_______________________________________________
>SciPy-user mailing list
>SciPy-user at scipy.net
>http://www.scipy.net/mailman/listinfo/scipy-user
>  


Hi Robert,

Is there a special reason why you have used the CSC format ?

speye(n, m=None, k=0, dtype='d')
    speye( n, m ) returns a (n, m) matrix tored
    in CSC sparse matrix format, where the  k-th diagonal is all ones,
    and everything else is zeros.

It should be stored instead of tored ;-)

spidentity(n, dtype='d')
    spidentity( n ) returns the identity matrix of shape (n, n) stored
    in CSC sparse matrix format.

Thank you again.

Nils


 





More information about the SciPy-User mailing list