I wrote:
> sm2=:(2;(2 2 2$1 1 1 1 1 0 1 2);a.e.'+:')&;:
> cutsm=: 4{."2 0:>. 1 _1+"1 (_1 +/\@(|.!.0) #;.1) + sm2;.1

That 0:>. is unnecessary, and can be removed for a trivial
speed increase:

sm2=:(2;(2 2 2$1 1 1 1 1 0 1 2);a.e.'+:')&;:
cutsm=: 4{."(2) 1 _1+"1 (_1 +/\@(|.!.0) #;.1) + sm2;.1

   'cut"1 data' %&(6!:2) 'cutsm"1 data'
3.63392

-- 
Raul

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to