row ( n matrix -- row ) (original) (raw)

row ( n matrix -- row )
Matrix operations

Prev: matrix-set-nths ( obj pairs matrix -- )
Next: rows ( seq matrix -- rows )

Vocabulary
math.matrices

Inputs

n an integer
matrix a matrix

Outputs

row a sequence

Word description
Get the nth row of the matrix.

Notes
Like most Factor sequences, indexing is 0-based. The first row is given by m 0 row.

Examples

USING: kernel math.matrices prettyprint ; { { 1 2 } { 3 4 } } 1 swap row .
{ 3 4 }

Definition

USING: sequences ;

IN: math.matrices

: row ( n matrix -- row ) nth ; inline