Pardon, this is another sentence but analogue problem Conventional cross product (http://www.jsoftware.com/jwiki/JPhrases/ParitySymmetry) cross2=: ((_1: |.[)*(1:|.]))-((1: |.[)*(_1: |. ])) 3 8 2 cross2 6 4 5 _32 3 36 There is a shorter sentence: vx=:1:|.(]*1:|.[)-[*1:|.] 3 8 2 vx 6 4 5 _32 3 36
2011.08.27. 14:04 Cliff Reiter <reit...@lafayette.edu>: > Oops, my variant on the ridiculous won't work correctly with duplicates. > On 8/26/2011 10:32 PM, David Ward Lambert wrote: > > Is there a shorter sentence? [: |: [: (i.>./)"1 |: > > > > I'm thinking this could work: i."SOME RANK>./ > > > > ]a=: (?.@$ */)2 3 6 NB. data, rank 3 > > 18 20 28 30 29 28 > > 22 28 8 7 21 32 > > 31 17 25 32 33 28 > > > > 13 17 29 15 1 25 > > 18 28 33 26 22 9 > > 17 6 34 15 23 35 > > > > >./a NB. want the index of a plane having these maximums > > 18 20 29 30 29 28 > > 22 28 33 26 22 32 > > 31 17 34 32 33 35 > > > > NB. this works but involves two transposes > > |: (i.>./)"1 |: a > > 0 0 1 0 0 0 > > 0 0 1 1 1 0 > > 0 0 1 0 0 1 > > > > NB. this version is ridiculous > > :@# * 0 = ]) (>:@i.@# * (="2>./)) a > > 0 0 1 0 0 0 > > 0 0 1 1 1 0 > > 0 0 1 0 0 1 > > > > > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > > -- > Clifford A. Reiter > Lafayette College, Easton, PA 18042 > http://webbox.lafayette.edu/~reiterc/ > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm