Noted only by inference in this timing orgy, but the really cool thing about the answers given is that they all generalize to multidimensional arrays.
Also, maybe there's something to be learned from the wide variation in relative timings here: maybe it's not too important to spend a lot of effort speeding up some of these expressions, especially if the tweaks don't travel well. That said, I got Name Time Space ------ ----- ----- coord0 1.000 1.380 coord1 1.275 1.000 on my dual-core Intel T2500(?) running at 2.00 GHz with 2 GB physical RAM. This was run while a long-running J program was taking up all the CPU on one of the cores. On 1/30/07, ramacd <[EMAIL PROTECTED]> wrote:
Joey; I'm inclined to put this in the "so obvious in retrospect" category: The machinery that coord uses is essentially what monadic $. uses. It seems fitting that the implementor of $. (at least, I'm presuming so) would make the connection. BTW, do you have a URL reference for this most efficient ~:? ------------------------------------------------------------------------ |\/| Randy A MacDonald | APL: If you can say it, it's done.. (ram) |/\| [EMAIL PROTECTED] | |\ | | The only real problem with APL is that BSc(Math) UNBF'83 | it is "still ahead of its time." Sapere Aude | - Morten Kromberg Natural Born APL'er | Demo website: http://156.34.82.188/ -----------------------------------------------------(INTP)----{ gnat }- ----- Original Message ----- From: "Joey K Tuttle" <[EMAIL PROTECTED]> To: "Programming forum" <[email protected]> Sent: Tuesday, January 30, 2007 1:37 PM Subject: Re: [Jprogramming] matrix to coordinates > At 09:03 -0800 2007/01/30, Roger Hui wrote: > > > > J6.02x J6.01c > >f M 0.530783 1.00664e8 0.524774 1.00664e8 > >g M 0.637148 1.21485e8 0.658235 1.21533e8 > >h M 0.274866 7.54994e7 0.847815 2.43272e8 > ^^^^^^^^^^^^^^^^^^ > As Jeff Shallit once said to me (about the > most efficient phrase for ~: in APL), "That's > cheating!" (or maybe he said "not fair" :) > > But nice! > > - joey > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
-- Devon McCormick ^me^ at acm. org is my preferred e-mail ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
