Interesting discussion at c.l.a ---------- Forwarded message ---------- From: [EMAIL PROTECTED] Date: 17 Jun 2006 07:08:46 -0700 Subject: Re: Axis specification in APL2 To:
One need not rearrange the arguments with J ranks (Sharp APL too, I suppose). X1 +"1"1 2 Y1 2 4 6 5 7 9 8 10 12 11 13 15 17 19 21 20 22 24 23 25 27 26 28 30 Where X1=. 1+i.2 3 Y1=. 1+i.2 4 3 X1;Y1 +-----+--------+ |1 2 3| 1 2 3| |4 5 6| 4 5 6| | | 7 8 9| | |10 11 12| | | | | |13 14 15| | |16 17 18| | |19 20 21| | |22 23 24| +-----+--------+ Martin Turner wrote: > > "rbe" <[EMAIL PROTECTED]> wrote in news:1148844185.809977.57690 > > @i39g2000cwa.googlegroups.com: > > > >> With rank, there is NO need (or benefit) to have the bracket axis > >> notation any more. Period. end of story. > > > > Okay, how do you do this with rank: > > > > {rho}{rho}X > > 2 > > {rho}{rho}Y > > 3 > > X+[1 3]Y > > > > > > A few comments: > > 1. Randy: I don't have access to an APL2 system at the moment. Please > > post simple data and result for same. I think a conjunction of rank > > with the > > transpose conjunction (whose name I forget) might do the trick for you. > > I did say that rank does about 99% of what the APL2 axis brackets do, > > not 100%... > > > > --- Text cut here --- > > Randy's point is that the rank operator works on contiguous axes only. To > work on non-contiguous axes (eg 1 and 3) one must re-arrange one or other of > the arguments. > > His example was ... > > Given: > #io {is} 1 > x {is} 2 3 {rho} {iota} 6 > y {is} 2 4 3 {rho} {iota} 24 > > How to obtain: > 2 4 6 > 5 7 9 > 8 10 12 > 11 13 15 > > 17 19 21 > 20 22 24 > 23 25 27 > 26 28 30 > > > Brown: x +[1 3] y > > Iverson: 2 1 3 {transpose} x (+{paw}2 2) 2 1 3 {transpose}y > > > Bob's point is different. He argues that knowing axis operation of x +[1 3] > y, can one predict the behaviour of x function[1 3]y (eg x ,[1 3]y)? The > axis operator in APL2 seems to me to be erratic/complex, whereas the rank > operator is simple, powerful and elegant. > > There is often a choice to be made between utility and beauty, but in this > case the rank operator seems to win on both counts. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
