On Fri, Aug 21, 2009 at 3:24 PM, Kip Murray<[email protected]> wrote:
> I apologize for omitting
>
> diff =: 2&(-~/\)  NB. differences of a vector

My apologies also -- I finally noticed that your
followup had this definition.

Anyways, here's a workalike for interp which
caches preserves intermediate results:
   interp2=: 2 :'((i.1+m) ! ]) +/ .* ({. (1+m) difftb n)"_'
   3 interp2 data "0 i. 10
0 1 8 27 64 125 216 343 512 729

and here is a slightly cleaner variation:
   interp3=: 2 :'((i.1+m)&!"0) +/ .* ({. (1+m) difftb n)"_'
   3 interp3 data i. 10
0 1 8 27 64 125 216 343 512 729

Note also, if you wanted to convert
   (y !~ i. >: m)
to tacit form and were not comfortable with
writing tacit expressions, you could try something
like
   13 :'y !~ i. >: 100'
and inspect its result for clues.

FYI,

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

Reply via email to