开发者

ctypes, pyrex, swig, or cython for this problem?

I have about 20 simple C++ classes that represent various probability distributions. I would like to make these available in Python. What is the easiest way to do this? I don't mind having a program automatically generate wrappers, but I don't want to retype the classes.

Also, some of my classes use Boost uBLAS libraries. 开发者_高级运维 Is there a way to automatically pass in numpy arrays from Python?


Actually, none of those.

I use Boost.Python extensively to operate a C++ library from Python.

There are easy converters for uBlas and NumPy, if you don't mind copying values around. If you do, you can try to get PyUblas to work, which enables memory sharing between NumPy and uBlas.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜