Yes, I think I've got it now. See the demo below.
Thanks very much RE, Raul and =@@i .
Please let me know if this seems incorrect or
if there are other comments.
[a=.5 ?...@$ 4
2 3 3 0 2
[b=.5 4 ?...@$ 20
6 15 19 12
14 19 0 17
0 14 6 18
13 18 11 12
18 0 10 2
ea0=. ] </.~ (| {.)"_1
ea1=. 3 <. (| {.)"_1
ea2=. +/@]`(*/@])`(>./@])`($ 0:)@.
a (([: ,@:(~.&>)[:ea0/.~ ea1)([(<"0...@[ea2)"0 1 each])ea0) b
+--------+--+-----+
|52 38 30|19|0 0 0|
+--------+--+-----+
NB. I really want to do something more like the following.
NB. Notice the change of rank on ea2 above vs below.
NB. The answers are different here, but I will change
NB. the gerund term to get the same answer in both.
a (([: ,@:(~.&>)[:ea0/.~ ea1)([(<"0...@[ea2)"0 2 each])ea0) b
+-----------+----------+-----+
|24 29 35 32|14 19 0 17|0 0 0|
+-----------+----------+-----+
On Tue, Feb 2, 2010 at 8:12 AM, Aai <[email protected]> wrote:
> a=.5 ?...@$ 4
> b=.5 4 ?...@$ 20
>
> FWIW: Grouping in this case can be done like:
>
> a (]</.~ (| {.)"_1) b
> +-----------+----------+-----------+
> | 6 15 19 12|14 19 0 17|13 18 11 12|
> | 0 14 6 18| | |
> |18 0 10 2| | |
> +-----------+----------+-----------+
>
> =@@i
--
(B=) <-----my sig
Brian Schott
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm