matrix-nth ( pair matrix -- elt )

Matrix operations

Matrix operations

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

Next: | matrix-nths ( pairs matrix -- elts ) |

Vocabulary

math.matrices

Inputs

Outputs

Word description

Retrieve the element in the matrix at the zero-indexed row, column pair.

Notes

Errors

Examples

Get the entry at row 1, column 0.

Definition

math.matrices

Inputs

pair | a pair |

matrix | a matrix |

Outputs

elt | an object |

Word description

Retrieve the element in the matrix at the zero-indexed row, column pair.

Notes

• | This word is the two-dimensional variant of nth. |

• | This word is intended for use with "flat" (2-dimensional) matrices. |

Errors

• | bounds-error if the first element in pair is greater than the maximum row index in matrix |

• | bounds-error if the second element in pair is greater than the maximum column index in matrix |

Examples

Get the entry at row 1, column 0.

USING: math.matrices prettyprint ;
{ 1 0 } { { 0 1 } { 2 3 } } matrix-nth .

2

2

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)