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.100 x86.64 (2281, heads/master-20276adfbc, Sep 6 2024 14:17:49)