[SciPy-Dev] Sparse matrix manipulation in c++

William Sheffler willsheffler at gmail.com
Thu Nov 9 14:53:42 EST 2017


Hello scipy-dev,

First, forgive me if this is not the right forum, I am no scipy-dev!

I have a mixed c++/python/pybind11 project in which I'd like to use a
couple of sparse matrix types (bsr_matrix and csr_matrix, if that matters).
I don't want to 'reinvent the wheel'...  using Scipys implementation would
be (a) better and (2) easier. But, I will need to access the data from c++
as well as python. The scipy implementation is C++, so it seems this should
be possible. But what is the 'right' way to make my c++ understand scipy
sparse arrays?

I don't suppose there is some nice buffer-protocol-like abstraction? Pybind
has a nice, 'magical' solution to this for numpy compatibility that avoids
having to link against specific versions of numpy, but the details are a
bit beyond me.

Many thanks for any advice!
Will Sheffler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20171109/ddbe920a/attachment.html>


More information about the SciPy-Dev mailing list