Alfonso Salazar wrote:
> the new row 1 is 1|.1{m
> the new row 2 is 2|.2{m
> etc.
Just use dyad |. with the appropriate rank:
M =: 1 0 0 1 0 1 0 , 0 0 1 0 0 0 1 ,: 0 0 1 0 1 0 1
newM =: 1 0 0 1 0 1 0 , 0 1 0 0 0 1 0 ,: 1 0 1 0 1 0 0
(|."_1~ [EMAIL PROTECTED]) M
1 0 0 1 0 1 0
0 1 0 0 0 1 0
1 0 1 0 1 0 0
newM -: (|."_1~ [EMAIL PROTECTED]) M
1
To be more explicit, you could replace |."_1 with |."0 1 . In both cases,
reverse is invoked once for each pairing of a
scalar from the left with a row from the right (just as you wrote out, above).
-Dan
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm