I get a minor speedup using T2=: t2 +/@:(=/~"1) T2 But what are you using this for?
This calculation is very simple and it might be that it could be restructured so that the consuming system uses T2 directly, instead of using this outer product? Thanks, -- Raul On Thu, May 17, 2012 at 10:00 AM, Tarmo Veskioja <tarm...@gmail.com> wrote: > I would like to find a faster way of computing a similarity distance matrix. > My current solution is the following: > > time=: 6!:2 > 9!:3(5) NB. set system for linear display of verbs > > $ t2 =: 5000 40 $ ?.200000#5 NB. data table of integers, 40 > variables, 5000 records > > find_similarity_distance_matrix =: 13 : '+/@:="1/~ y' > > time '$ find_similarity_distance_matrix t2' > NB. 6.73964 > > Is there a way to improve it, with special code perhaps? > > -Tarmo > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm