Algosim documentation: row

row

Represents a row in a matrix.

Syntax

The returned value is an lvalue.

Description

If A is a matrix and n is an integer between 1 and height(A) (inclusively), then row(A, n) represents the nth row of A; typewise this is a vector. row(A, n) is an lvalue, so it may be assigned to. The value assigned to it must be a vector of dimension width(A). If A is a real matrix, row(A, n) can only be assigned a real vector.

Examples

A ≔ ❨❨2, 1, −i❩, ❨1, 0, 2❩, ❨4, i, 2❩, ❨0, 1, −1❩❩
⎛ 2   1  −i⎞
⎜ 1   0   2⎟
⎜ 4   i   2⎟
⎝ 0   1  −1⎠
row(A, 1)
 ⎛2 ⎞
e⎜1 ⎟
 ⎝−i⎠
row(A, 1) ≔ ❨10, 5, 10❩
 ⎛10⎞
e⎜5 ⎟
 ⎝10⎠
A
⎛10   5  10⎞
⎜ 1   0   2⎟
⎜ 4   i   2⎟
⎝ 0   1  −1⎠

See also