Newsgroups: comp.lang.apl Path: utzoo!utgpu!news-server.csri.toronto.edu!torsqnt!jtsv16!blister!itcyyz!yrloc!rbe From: rbe@yrloc.ipsa.reuter.COM (Robert Bernecky) Subject: Re: Grade Down Columns of An Array Message-ID: <1991Jun23.172018.4316@yrloc.ipsa.reuter.COM> Reply-To: rbe@yrloc.ipsa.reuter.COM (Robert Bernecky) Organization: Snake Island Research Inc, Toronto References: <33789@usc.edu> Date: Sun, 23 Jun 91 17:20:18 GMT In article <33789@usc.edu> ann@neuro.usc.edu (Ann Simpson Chapin) writes: >Does anyone know how to grade down the columns of an array (rank 2) so that >each column of the array is graded down as if it is a separate vector? >I do not want to have to create an interative function, and I also do not >want to have to create separate vectors from each column, grade down each >vector, and then reconcatenate the vectors into the original array. >response. I am using APL Plus II on a 386 with plenty on memory and a >math coprocessor..... As pointed out by LJ DIckey, you can use function rank if using a modern dialect of APL (J or SHARP APL/PC). Otherwise, you can try this approach, which I used back in the dark ages on a card sorter, IF your data is small numbers such as student test scores, etc. Consider the array x to be numbers in the range from 0 to 100. Add 1000 to column one, 2000 to column two, etc. In SHARP APL, this would be x+rank 1 (1000 times iota negative one take rho x). Now ravel and upgrade, than take the 1000 residue. Basically, each set of numbers sorts within the x000'th column. Bob Robert Bernecky rbe@yrloc.ipsa.reuter.com bernecky@itrchq.itrc.on.ca Snake Island Research Inc (416) 368-6944 FAX: (416) 360-4694 18 Fifth Street, Ward's Island Toronto, Ontario M5J 2B9 Canada