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)? I know that one of my matrices is a diagonal matrix and the other matrix is 100% dense, however, it is tensor-producted with the identity matrix, so it becomes less dense. Some elements will be close to zero and can be truncated as well. Most values will be around the diagonals close to the main diagonal. _formats = {'csc':[0,"Compressed Sparse Column"], 'csr':[1,"Compressed Sparse Row"], 'dok':[2,"Dictionary Of Keys"], 'lil':[3,"LInked List"], 'dod':[4,"Dictionary of Dictionaries"], 'sss':[5,"Symmetric Sparse Skyline"], 'coo':[6,"COOrdinate"], 'lba':[7,"Linpack BAnded"], 'egd':[8,"Ellpack-itpack Generalized Diagonal"], 'dia':[9,"DIAgonal"], 'bsr':[10,"Block Sparse Row"], 'msr':[11,"Modified compressed Sparse Row"], 'bsc':[12,"Block Sparse Column"], 'msc':[13,"Modified compressed Sparse Column"], 'ssk':[14,"Symmetric SKyline"], 'nsk':[15,"Nonsymmetric SKyline"], 'jad':[16,"JAgged Diagonal"], 'uss':[17,"Unsymmetric Sparse Skyline"], 'vbr':[18,"Variable Block Row"], 'und':[19,"Undefined"] } -- David J. Grant Scientific Officer Intellectual Property D-Wave Systems Inc. tel: 604.732.6604 fax: 604.732.6614 ************************** CONFIDENTIAL COMMUNICATION 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.
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. 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. 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. -Travis
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 ************************** CONFIDENTIAL COMMUNICATION 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.
participants (2)
-
David Grant
-
Travis Oliphant