Thanks for the shout out, but I feel obliged to confess that I stole that /: trick from eesuk in the 2006 "zig zag order" thread.
http://www.jsoftware.com/pipermail/programming/2006-November/004156.html (The moment I wrote that expression still stands out as one of the proudest of my 12+ year J career. Only slightly dampened by reading eesuk's improved version seconds later ;) -Dan > On Mar 27, 2014, at 5:55 PM, Jose Mario Quintana > <[email protected]> wrote: > > See http://www.jsoftware.com/pipermail/programming/2008-October/012505.html > ;) > > >> On Thu, Feb 27, 2014 at 1:42 AM, Raul Miller <[email protected]> wrote: >> >> Same as i.@# in =@i.@# >> >> It's generating a list of distinct values which = will use to >> construct an identity matrix. >> >> Mind you, it might have made more sense for = to always construct >> identity matrices. >> >> But in terms of time, constructing an identity matrix is O(n^2) and \: >> is O(n log n) or better (if it's using bin sort, which I am not sure >> it ever is), and identity matrix construction is usually not a >> bottleneck even in situations where it's used a lot. >> >> So, as Roger Hui put it: Bravo! >> >> Thanks, >> >> -- >> Raul >> >> On Thu, Feb 27, 2014 at 1:36 AM, Michal Wallace >> <[email protected]> wrote: >>> What purpose does the \: serve there? >>> >>> (*=) 9 7 5 3 >>> >>> 9 0 0 0 >>> >>> 0 7 0 0 >>> >>> 0 0 5 0 >>> >>> 0 0 0 3 >>> ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
