[Jprogramming] a vector product

Raul Miller rauldmiller at gmail.com
Thu Aug 16 08:49:36 HKT 2007


On 8/15/07, Roger Hui <rhui000 at shaw.ca> wrote:
> CT=: 3 : '(C.!.2 p) (<"1 p=. (i.!y) A. i.y)}1$.$~y'

Using some of J's newer features, and require'stats',
this can be reexpressed as:

   CT2=: perm C.!.2@[`(<"1@[)`]} 1 $. $~

   (CT-:CT2)"0>:i.6
1 1 1 1 1 1

--
Raul


More information about the Programming mailing list