oop that should be

(15!:14<'array')+(8*{:$array)*i.{.$array

or something like that.

On Mon, Dec 1, 2014 at 5:14 PM, bill lam <[email protected]> wrote:
> You can try the followings:
> first obtain the address of the array using 15!:14 (see wdooo.ijs)
> then calculate the address of each array[][0],
> offset should be 8*{:$array
> then pass them as a rank-1 integer (*x)
>
> (15!:14<'array')+8*i.{:$array
>
> (untested)
>
> On Mon, Dec 1, 2014 at 3:08 PM, Scott Locklin <[email protected]> wrote:
>> So, I have this pile of C code that uses rank-2 arrays as double**, then
>> subsets them with loops like "array[i][j]." I'm so used to the J FFI working
>> flawlessly on C code (most of which sensibly uses double*), I forgot that a
>> J-array doesn't work like that, and was kind of shocked when the code dumped
>> core on me.
>>
>> Is there any magic J incantation I can do to my arrays so that C can more
>> easily digest them, or should I just write a C macro to dereference the
>> double pointer?
>>
>> This is for hierarchical clustering, if anyone is interested in that sort of
>> thing (a most un-J like algorithm, sadly). Maybe 2-d wavelets as well.
>>
>> -SL
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to