Dag Sverre Seljebotn wrote:
>
> Well, there's no way a float** will fit within the NumPy memory model, so
> the memory must be copied somehow. Using a memcpy per row will likely be
> faster but is fundamentally the same thing.
There is, if a contiguous block is allocated instead of individual rows.
double **array = malloc(nrows * sizeof(double*));
double *array_buffer = malloc(nrows * ncols * sizeof(double));
for (int i=0; i<nrows; i++)
array[i] = array_buffer + i * ncols;
Sturla Molden
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev