문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top