Yes, thanks Ben, that's exactly what I had in mind.

Clever.  It never occurred to me to use / to insert the verb between the
"dyadic" data elements.
It might have if I had been using  an N x 3 or more array, as I am used to
using / for series as an "accumulator", but in the trivial dyadic case, I
completely went blank!

The human mind...



On 30 April 2014 11:48, David Lambert <[email protected]> wrote:

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