Hi Brian,
Your implementation of Henry's suggestion doesn't look faster to me.
2.84443e_5 % 3.79653e_6 NB. time for trimhb % time for trimalt
7.49218
From a more recent post, Henry's suggestion was
tess&(cp;._3"2)&.(2 0 1&|:)i.7 10 3
10000 timespacex 'tess&(cp;._3"2)&.(2 0 1&|:)i.7 10 3'
1.81361e_5 34304
trimalt=: {~ <@:(>:@:(3 * i.)@:<.@:(%&3)&.>)@:}:@:$
10000 timespacex 'trimalt i. 7 10 3'
2.1667e_6 7040
1.81361e_5 % 2.1667e_6
8.37038
JVERSION
Engine: j806/j64/darwin
Beta-1: commercial/2017-03-09T12:01:12
Library: 8.06.01
Qt IDE: 1.5.3/5.6.2
Platform: Darwin 64
Installer: J806 install
InstallPath: /users/bobtherriault/j64-806
Contact: www.jsoftware.com
Cheers, bob
> On Jun 2, 2017, at 2:42 AM, Brian Schott <[email protected]> wrote:
>
> Second, to return to the timing issue, Henry's approach does seem to be
> (much) faster.
>
> trimhb =: tess&(cp ;._3)"2 &.(0 1&|:)
> 100000 timespacex 'trimhb i. 7 10 3'
> 2.84443e_5 31744
> 100000 timespacex 'trimalt i. 7 10 3'
> 3.79653e_6 7040
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm