Algosim documentation: RowAddMul

RowAddMul

Returns a matrix with a multiple of one row added to another.

Syntax

Description

If A is a matrix, i and j are valid row indices in A, and k is a real number, then RowAddMul(A, i, j, k) returns A with k times its jth row added to its ith row.

This is an elementary row operation.

Examples

A ≔ ❨❨5, 1, 2, 3, 4❩, ❨4, 0, 2, 1, 7❩, ❨6, 3, 0, 4, 7❩, ❨4, 5, 2, 3, 9❩, ❨4, 0, 1, 2, 5❩❩
⎛5  1  2  3  4⎞
⎜4  0  2  1  7⎟
⎜6  3  0  4  7⎟
⎜4  5  2  3  9⎟
⎝4  0  1  2  5⎠
RowAddMul(A, 2, 5, −1)
⎛ 5   1   2   3   4⎞
⎜ 0   0   1  −1   2⎟
⎜ 6   3   0   4   7⎟
⎜ 4   5   2   3   9⎟
⎝ 4   0   1   2   5⎠

See also