The dictionary definition of f . g<http://www.jsoftware.com/help/dictionary/d300.htm>(the rank 1 _ thing) is the basis of the improvement to +/ .* from 2004 <http://www.jsoftware.com/help/release/pdt504.htm>. This speed-up has special meaning for me, because it's the last improvement I was able to tell Ken about and because of the way it happened ("Hey Ken, if I implement inner product the way the dictionary has specified it for the last 10 years, I get a factor of x speed-up.")
On Wed, Dec 7, 2011 at 10:15 AM, Kip Murray <k...@math.uh.edu> wrote: > I'll be damned! Rank 1 _ ! Thank you, Raul. > > > On 12/7/2011 11:10 AM, Raul Miller wrote: > > Oh, it's certainly doable -- it's that 'simple J' makes some things more > > complicated. > > > > That said, inner product is not very complicated: > > > > mv =: ([: +/ *)"1 > > mm =: [: |: (mv"2 1 |:) > > > > $ (i.3 4 5)+/ .*i.5 6 7 > > 3 4 6 7 > > > > ((i. 3 4 5) mm i.5 6 7) -: (i. 3 4 5) +/ .* i.5 6 7 > > |length error: mm > > > > ((i. 3 4 5) ([: +/ *)"(1 _) i.5 6 7) -: (i. 3 4 5) +/ .* i.5 6 7 > > 1 > > > > And, my other example becomes: > > ([:< [: toupper>)"0 'this';'is';'a';'test' > > > > And, in general, artificially restricting vocabulary can make concepts > > clearer. For example, it can also be instructive to express inner > product > > without using J's multiply verb. > > > > However, "instructive" and "simple" are not the same thing. Also, > sticking > > with a single restriction for too long enshrines the restriction and > leads > > attention away from the concepts that should have been learned. > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm