我定义了一个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数组?