Rotating ElementsAnother structural operation is to rotate elements within an index. This can be done with the functions RotateLeft and RotateRight. In[1]:=  |
Out[2]//MatrixForm=
|
This rotates left by one step in the first level, thereby operating on the rows; the result is a sparse array. In[3]:=  |
Out[3]=
|
In[4]:=  |
Out[4]//MatrixForm=
|
This rotates left by one step in the second level, that operates on the columns; the result is a sparse array. In[5]:=  |
Out[5]//MatrixForm=
|
This rotates the columns in the opposite direction. In[6]:=  |
Out[6]//MatrixForm=
|
|