On 26/10/2007, Travis E. Oliphant <[EMAIL PROTECTED]> wrote:
> There is an optimization where-in the inner-loops are done over the
> dimension with the smallest stride.
>
> What other cache-coherent optimizations do you recommend?
That sounds like a very good first step. I'm far from an expert on
Anne Archibald wrote:
> On 26/10/2007, Georg Holzmann <[EMAIL PROTECTED]> wrote:
>
>
>> if in that example I also change the strides:
>>
>>int s = tmp->strides[1];
>>tmp->strides[0] = s;
>>tmp->strides[1] = s * dim0[0];
>>
>> Then I get in python the fortran-style array in right orde
On 26/10/2007, Georg Holzmann <[EMAIL PROTECTED]> wrote:
> if in that example I also change the strides:
>
>int s = tmp->strides[1];
>tmp->strides[0] = s;
>tmp->strides[1] = s * dim0[0];
>
> Then I get in python the fortran-style array in right order.
This is the usual way. More or le
Hallo!
> This depends on what you are trying to do, but generally, I find that if
> you can afford it memory-wise, it is much faster to just get a C
> contiguous array if you treat your C array element per element. If you
Yes, but the problem is that this data is very big (up to my memory
lim
Georg Holzmann wrote:
> Hallo!
>
> I found now a way to get the data:
>
>
>> Therefore I do the following (2D example):
>>
>>obj = PyArray_FromDimsAndData(2, dim0, PyArray_DOUBLE, (char*)data);
>>PyArrayObject *tmp = (PyArrayObject*)obj;
>>tmp->flags = NPY_FARRAY;
>>
>
> if in t
Hallo!
I found now a way to get the data:
> Therefore I do the following (2D example):
>
>obj = PyArray_FromDimsAndData(2, dim0, PyArray_DOUBLE, (char*)data);
>PyArrayObject *tmp = (PyArrayObject*)obj;
>tmp->flags = NPY_FARRAY;
if in that example I also change the strides:
int s
Hallo!
I have the following problem: I get a data array in column major storage
order and want to use it as numpy array without copying data.
Therefore I do the following (2D example):
obj = PyArray_FromDimsAndData(2, dim0, PyArray_DOUBLE, (char*)data);
PyArrayObject *tmp = (PyArrayObject