Viktor Cerovski wrote:
> We can define an adverb P that does this kind of computation:
>
>   P=:(&*)(+`)(`:6)/

Raul Miller responded:
>  Or we could use a verb:
>
>      1 2 3 (#."0 _ |.) 1 2 3 4
>  10 49 142

Or we could use a primitive:

           1 2 3 4 p. 1 2 3
        10 49 142

Of course, if we wanted to maintain the order of arguments, we could use
commute:

           1 2 3 p.~ 1 2 3 4
        10 49 142       

For an exploration of the relationship between p. and #. see the (whole)
thread:

        
http://www.jsoftware.com/pipermail/programming/2008-October/012327.html

and, in particular, Oleg's citation of Vector:  

>  This is referred to as Ruf-Horn method in
>  "About polynomials" by Gianluigi Quario, Vector 23 No 4.

>    http://www.vector.org.uk/archive/v234/quario.htm

-Dan


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

Reply via email to