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

Ralf Gommers ralf.gommers at gmail.com
Sun Nov 12 05:18:14 EST 2017


On Fri, Nov 10, 2017 at 8:53 AM, William Sheffler <willsheffler at gmail.com>
wrote:

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

No worries, you're in the right place.

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?
>

That C++ implementation does not have a defined API and is in practice an
implementation detail behind the Python API that we could change in any
release. So I would not recommend to attempt to reach into the scipy.sparse
internals here.

Ralf


> 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
>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at python.org
> https://mail.python.org/mailman/listinfo/scipy-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20171112/2720c53d/attachment.html>


More information about the SciPy-Dev mailing list