transpose ( matrix -- newmatrix ) (original) (raw)

Vocabulary
math.matrices

Inputs

Outputs

Word description
Transpose the input matrix over its main-diagonal. The main diagonal itself is preserved, whereas the anti-diagonal is reversed.

Notes

This word is an alias for flip, so that it may be recognised as the common mathematical operation.
This word is the opposite variant of anti-transpose.

Examples

USING: math.matrices sequences prettyprint ; 5 transpose .
{ { 0 0 0 0 4 } { 0 0 0 3 0 } { 0 0 2 0 0 } { 0 1 0 0 0 } { 0 0 0 0 0 } }

Definition