I apologize for omitting

diff =: 2&(-~/\)  NB. differences of a vector

Kip

Raul Miller wrote:
> On Fri, Aug 21, 2009 at 8:37 AM, Kip Murray<[email protected]> wrote:
>> But I don't want p to recreate the difference table every time it is called. 
>>  Is
>> there a way to rewrite conjunction interp so that
>>
>>    q =: 3 interp1 data
>>
>>    q
>> 0 1 6 6 +/ .* 0 1 2 3 ! ]
> 
> Essentially, you need to remove y from the
> definition of interp.
> 
> That said, i would like to also request you
> provide the definitions of the words you are
> asking for help with.  So far, I have:
> 
> data =: 3 ^~ i. 11
> interp=: 2 : '(y !~ i. >: m) +/ . * {. (>: m) difftb n'
> difftb =: 4 : '|: diff^:(i.x) x {. y'
> 
> But you did not provide a definition for diff.
> 
> Also, just for fun, here's a "polynomial by example"
> adverb:
>    poly=: 1 :'((#~ +./\.@:~:&0) (%. ^/~...@i.@#)&.x:m)&p.'
>    0 1 8 27 64 125 216 343 512 729 1000 poly
> 0 0 0 1&p.
> 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to