Boost.Python,如何从C ++数组返回numpy错误?

时间:2018-08-29 14:56:25

标签: c++ boost-python

我定义了一个2d和3d C ++数组

// ROW x COL
auto ** arr1 = (double **)malloc(ROW * sizeof(double *));
for (int i = 0; i < ROW; i++) arr1[i] = (double *)malloc(COL * sizeof(double));

// ROW x COL1 x COL2
auto *** arr2 = (double ***)malloc(ROW * sizeof(double **));
for (int i=0; i < ROW; i++) {
    arr2[i] = (double **)malloc(COL1 * sizeof(double *));
    for (int j=0; j < COL1; j++) {
        arr2[i][j] = (double *)malloc(COL2 * sizeof(double));
    }
}

如何使用Boost.Python将这些数组转换为低开销的numpy数组?

0 个答案:

没有答案