From: Ivan V. i B. <iv...@ca...> - 2006-10-05 08:42:56
|
En/na Tim Hochberg ha escrit:: > Ivan Vilata i Balaguer wrote: >> It seemed that discontiguous arrays worked OK in Numexpr since r1977 o= r >> so, but I have come across some alignment or striding problems which c= an >> be seen with the following code:: > I looked at this just a little bit and clearly this bit from interp_bod= y=20 > cannot work in the presence of recor arrays: >=20 > //.... > intp sf1 =3D sb1 / sizeof(double); \ > //... > #define f1 ((double *)x1)[j*sf1] >=20 > There are clearly some assumptions that sb1 is evenly divisible by=20 > sizeof(double). [...] I noticed something strange in those statements when implementing support for strings, and I must confess that I didn't grasp their meaning, so I implemented it a little differently for strings:: #define s1 ((char *)x1 + j*params.memsteps[arg1]) That seemed to work, but it might not be right (though I tested a bit), and certainly it may not be efficient enough. Here you have my previous patches if you want to have a look at how I (try to) do it: 1.http://www.mail-archive.com/numpy-discussion%40lists.sourceforge.net/ms= g01551.html 2.http://www.mail-archive.com/numpy-discussion%40lists.sourceforge.net/ms= g02261.html 3.http://www.mail-archive.com/numpy-discussion%40lists.sourceforge.net/ms= g02644.html :: Ivan Vilata i Balaguer >qo< http://www.carabos.com/ C=C3=A1rabos Coop. V. V V Enjoy Data "" |