Something confused me on the subject page. The shift right is only for a vector 
and behaves differently for a matrix.  

|.!.f says it will shift right 1, but when I tried it on a matrix, it shifts 
down. 

  ]a=:4 4 $ 1 0 0 0 0
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1

   |.!._1 a
_1 _1 _1 _1
 1  0  0  0
 0  1  0  0
 0  0  1  0

same as:
   _1 |.!._1 a
_1 _1 _1 _1
 1  0  0  0
 0  1  0  0
 0  0  1  0

For it to shift right it needs to identify the second axis:

   0 _1|.!._1 a
_1 1 0 0
_1 0 1 0
_1 0 0 1
_1 0 0 0

Anyway just thought to mention it since, at least for newbies, they might find 
it confusing.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to