transpose ( matrix -- newmatrix )

Matrix operations

Matrix operations

Prev: | dimension ( matrix -- dimension ) |

Next: | anti-transpose ( matrix -- newmatrix ) |

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

Examples

Definition

math.matrices

Inputs

matrix | a matrix |

Outputs

newmatrix | a matrix |

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 <iota> <anti-diagonal-matrix> 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 } }

{ { 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

This documentation was generated offline from a
`load-all`

image. If you want, you can also
browse the documentation from within the UI developer tools. See
the Factor website
for more information.

Factor 0.99 x86.64 (2190, heads/master-46c625f8dc, Feb 4 2023 19:37:27)