On Wed, Nov 4, 2009 at 4:40 AM, Sumant Oemrawsingh soemraws@xs4all.nl wrote: ...
This is where I do not agree. GSL has not explicitly done 2D FFTs, that is true. However, it provides a mechanism to implement this yourself. When you say offset is not in GSLL because it is not in GSL, I don't think you appreciate the ease with which an offset is introduced to a C array; you just add a number to it. Thus, an array a of size n can be passed with an offset by saying a+offset, where the latter array has a size n-offset. Therefore, GSL doesn't have to explicitly provide the offset as a parameter.
Well, it turns out offset *is* in GSLL, much to my surprise! However, it looks at first blush like it's wrongly implemented, but works for offset = 0 which is all I've ever tested. There is a function #'offset which reads a value set in the definition; see the defclass for foreign-array in data/foreign-array.lisp. It looks like this value is computed in find-original-array in data/foreign-friendly.lisp by making use of displaced arrays. Much of this code comes from Tamas Papp's foreign-friendly arrays; but in adapting it to GSLL, I'm not sure I got the tracking of the foreign array with the displaced CL array right.
The second problem I see is that while #'c-pointer correctly takes into account the offset for #+(and native sbcl) in foreign-friendly.lisp, it looks like it's just reading out the slot value in #'c-pointer for #-native in the defclass foreign-array. I don't see the offset being used there, so this might give the wrong answer.
If you want to dig into this code to see if it works or confirm there might be a problem, then we can fix this up. That should give you the ability to offset a (m)array, and so do the 2D FFT with reasonable ease as in the C case.
Liam