1
价值我想使用boost ::蟒蛇来包装一个函数返回值蟒的boost :: python的提取物C++从numpy.ndarray返回值
array(28.4)
型
numpy.ndarray
我的天堂无法将此值提取到C++类型。以下是我想出了到目前为止(和结果):
double resultValue = python::extract<double>(result[0]);
:0-d阵列不能被索引
double resultValue = python::extract<double>(result);
:没有注册转换器能够从此类型的numpy生成一个类型为double的C++右值numpy.ndarray
void* resultValue = python::extract<void*>(result);
:没有注册转换器能够提取的C++指针从类型numpy.ndarray
人们希望这个Python对象类型为void * __ptr64,在最后一个版本的标准黑客会工作 - 但事实并非如此。迄今为止,我还没有尝试任何std :: type,例如vector。
任何想法?
感谢您的帮助。但是,在我的boost 1_58_0版本中,没有boost/numpy.h头文件。这不是助推库的一部分吗? – user1934212
哦,boost :: numpy不是主要发行版的一部分。它位于https://github.com/ndarray/Boost.NumPy 得到它与 ** git克隆https://github.com/ndarray/Boost.NumPy.git** – bensch128