Re: [Jprogramming] Dumb ffi question

2014-12-01 Thread Brian Schott
I was referring to the mention of *inefficient* hierarchical clustering. On Mon, Dec 1, 2014 at 2:54 PM, Raul Miller wrote: > I do not see any use of the foreign function interface, there. (I > looked for 'cd', '15', '!:' and 'require'). > > Did you refer to the right page? Or am I looking for t

Re: [Jprogramming] Dumb ffi question

2014-12-01 Thread Raul Miller
I do not see any use of the foreign function interface, there. (I looked for 'cd', '15', '!:' and 'require'). Did you refer to the right page? Or am I looking for the wrong things? Thanks, -- Raul On Mon, Dec 1, 2014 at 11:53 AM, Brian Schott wrote: > Scott, you might want to look at the fol

Re: [Jprogramming] Dumb ffi question

2014-12-01 Thread Brian Schott
Scott, you might want to look at the following link. http://www.jsoftware.com/jwiki/BrianSchott/code/cluster On Mon, Dec 1, 2014 at 2:08 AM, Scott Locklin 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

Re: [Jprogramming] Dumb ffi question

2014-12-01 Thread bill lam
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 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

Re: [Jprogramming] Dumb ffi question

2014-12-01 Thread bill lam
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

[Jprogramming] Dumb ffi question

2014-11-30 Thread Scott Locklin
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