Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!ukma!asuvax!noao!amethyst!math.arizona.edu!weg From: weg@convx1.ccit.arizona.edu (Eythan Weg) Newsgroups: comp.lang.apl Subject: Re: WANTED: a way to sort array so each column i Message-ID: Date: 14 Apr 91 19:04:40 GMT References: <31931@usc> <13APR91.22583472@uc780.umd.edu> Sender: news@amethyst.math.arizona.edu Organization: University of Arizona, Economics Dept. Lines: 25 In-reply-to: cs450a03@uc780.umd.edu's message of 13 Apr 91 22:58:34 GMT In article <13APR91.22583472@uc780.umd.edu> cs450a03@uc780.umd.edu (Raul Rockwell) writes: A Analla writes: >Could some please suggest a generic function to reorder each column >of an array in descending order where the array is two dimensional. >I would prefer the solution not be iterative and not require breaking >the columns into separate vectors. Well, in general, if you want to order the columns independently, you are already treating them as separate vectors. If you are using J, I'd suggest something like: \:"1&.|: array [... stuff deleted ] I would think to add just a small ~ in front of array. Without it, you will get the permutations for such reorderings. Raul Rockwell Incidentally, how does one write this function in APL2? Eythan Weg