I have been trying to write a version of e. for sorted arrays, using
I. , since it appears to offer performance benefits.  My attempt is
the verb e below:

e=:[ = ] {~ I.~

time=:6!:2
P=:i.&.(p:^:_1) 1e6

   10 time '(i.1000) e P'
0.0001042
   10 time '(i.1000) e. P'
0.0069257

Is this a sensible approach, or are there better ways to do it?

Best wishes,

John



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

Reply via email to