Sorry about SWIG -- maybe a chance to move on ;-) I'd go with Cython -- this is pretty straightforward, and it handles the buffer protocol for you under the hood.
And with XDress, you can get numpy wrapped std::vector out of the box, I think: https://s3.amazonaws.com/xdress/index.html if you REALLY want to stick with SWIG, take a look a the SWIG numpy interface files -- they are designed for old-fashioned C, but you could probably adapt them. -Chris On Tue, Oct 14, 2014 at 8:59 AM, Toby St Clere Smithe <m...@tsmithe.net> wrote: > John Zwinck <jzwi...@gmail.com> writes: > > Some time ago I needed to do something similar. I fused the NumPy C > > API and Boost.Python with a small bit of code which I then > > open-sourced as part of a slightly larger library. The most relevant > > part for you is here: > > https://github.com/jzwinck/pccl/blob/master/NumPyArray.hpp > > There is also a 'Boost.NumPy', which is quite nice, though perhaps a bit > heavy-duty: > > https://github.com/ndarray/Boost.NumPy/ > > Cheers, > > > Toby > > _______________________________________________ > NumPy-Discussion mailing list > NumPy-Discussion@scipy.org > http://mail.scipy.org/mailman/listinfo/numpy-discussion > -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion