[SciPy-user] sparse matrix formats

David Grant david at dwavesys.com
Tue Oct 26 17:29:54 CDT 2004

Travis Oliphant wrote:

> David Grant wrote:
>> I am a bit boggled by all these sparse matrix types in the sparse class.
>> Can anyone recommend which are the standard one I should use (when in 
>> doubt)?
> spmatrix is just the base class and is not functional by itself:
> The formats at the top are currently best supported.
> csc_matrix  --- used internally by lot's of routines, best for 
> numerics but can be slow to construct using Python indexing
> csr_matrix  ---  nearly as fast as csc_matrix and useful for fast 
> transpose operations.
> dok_matrix --- fast construction in Python (just a simple dictionary), 
> but must be converted to csc_matrix for fast matrix multiplication, etc.

Thanks a lot!

> I hope this helps,
> The documentation is lacking for Sparse, but the code should be fairly 
> readable.  Just ignore all but csc_matrix, csr_matrix, and dok_matrix  
> for now.

Yeah, it looks like those are the only three with complete-ish code written.

> There are some bugs in dok_matrix  and in mixed csc csr matrix 
> multiplication in SciPy 0.3.2 that have been fixed in CVS.

David J. Grant
Scientific Officer
Intellectual Property
D-Wave Systems Inc.
tel: 604.732.6604
fax: 604.732.6614


This electronic transmission, and any documents attached hereto, is
confidential. The information is intended only for use by the recipient
named above. If you have received this electronic message in error,
please notify the sender and delete the electronic message. Any
disclosure, copying, distribution, or use of the contents of
information received in error is strictly prohibited.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: david.vcf
Type: text/x-vcard
Size: 334 bytes
Desc: not available
Url : http://www.scipy.net/pipermail/scipy-user/attachments/20041026/83049079/david.vcf

More information about the SciPy-user mailing list