Sorry, but not on my computer:

   Nx2 =: i.600000 2x
   df1=:+
   6!:2 'z=:df1/ |:Nx2'
0.46775
   6!:2 'z=:df1/"1 Nx2'
1.18481

I was thinking in the first case it does df1 only once (on a lot of data), and 
in the second case many times, element by element.

Greetings,
Ben 
________________________________________
From: [email protected] 
[[email protected]] on behalf of David Lambert 
[[email protected]]
Sent: Wednesday, April 30, 2014 12:48
To: [email protected]
Subject: Re: [Jprogramming] Applying a dyad to exusting matrix data

Time to learn about rank!
In my experience

u"1 N_BY_2_MATRIX

runs faster than

u@:|: N_BY_2_MATRIX
> Date: Wed, 30 Apr 2014 10:49:40 +0100
> From: alexgian<[email protected]>
> To: J Programming forum<[email protected]>
> Subject: [Jprogramming] Applying a dyad to exusting matrix data
> Message-ID:
>       <CAD=r9jom2p_mnztgruxw4_teevqzu2hwaxfi9hzrfmwfc7p...@mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> Suppose I have an Nx2 data matrix, say
> x1 y1
> x2 y2
> x3 y3
> ....
> and a dyadic verb called, say, df1
>
>
> Is there an elegant way to get the result matrix
> x1 df1 y1
> x2 df1 y2
> x3 df1 y3
> .....
>
> without resorting to "from - {" and "take - {." jiggery-pokery
> Or perhaps just a means to convert an expresiion from the
> df1 x1 y1   form, to
> x1 df1 y1
>
> All suggestions gratefully received.
>

----------------------------------------------------------------------
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