symengine.py icon indicating copy to clipboard operation
symengine.py copied to clipboard

Support for CSRMatrix

Open FFroehlich opened this issue 7 years ago • 4 comments

I am currently working on code that computes matrix-matrix products of large, sparse matrices (>1k rows/columns, similar number of non-zero entries), which is relatively slow (multiple hours per product). I assume that this could be computed much faster by storing these matrices in a sparse representation and computing the products using respective sparse routines. However, I could not find any support for the sparse matrix class CSRMatrix in this wrapper.

Is this already implemented and I simply did not look in the right place? Are there any plans to support CSRMatrix in this wrapper in the near future?

FFroehlich avatar May 02 '18 14:05 FFroehlich

You're right that it is not yet exposed in this python wrapper. I believe it's simply due to no one having had the time / need for it up till now.

bjodah avatar May 02 '18 14:05 bjodah

Do I correctly understand that implementation would simply require replicating https://github.com/symengine/symengine.py/blob/5496ffcb4d9d24ee4af2754aafc124c5fc0e21c5/symengine/lib/symengine.pxd#L793 and following and adapting it to the CSRMatrix class?

FFroehlich avatar May 02 '18 14:05 FFroehlich

Yes, together with the corresponding adaptions in symengine_wrapper.pyx and adding a few tests to the test suite.

bjodah avatar May 02 '18 14:05 bjodah

Hi, will we see a bind for CSRMatrix soon?

laisnegautier avatar Apr 04 '24 05:04 laisnegautier