Description Usage Arguments Details Value See Also Examples

The elementary row operation `rowadd`

adds multiples of one or more rows to other rows of a matrix.
This is usually used as a means to solve systems of linear equations, of the form *A x = b*, and `rowadd`

corresponds to adding equals to equals.

1 | ```
rowadd(x, from, to, mult)
``` |

`x` |
a numeric matrix, possibly consisting of the coefficient matrix, A, joined with a vector of constants, b. |

`from` |
the index of one or more source rows. If |

`to` |
the index of one or more destination rows |

`mult` |
the multiplier(s) |

The functions `rowmult`

and `rowswap`

complete the basic operations used in reduction
to row echelon form and Gaussian elimination. These functions are used for demonstration purposes.

the matrix `x`

, as modified

Other elementary row operations: `rowmult`

,
`rowswap`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ```
A <- matrix(c(2, 1, -1,
-3, -1, 2,
-2, 1, 2), 3, 3, byrow=TRUE)
b <- c(8, -11, -3)
# using row operations to reduce below diagonal to 0
Ab <- cbind(A, b)
(Ab <- rowadd(Ab, 1, 2, 3/2)) # row 2 <- row 2 + 3/2 row 1
(Ab <- rowadd(Ab, 1, 3, 1)) # row 3 <- row 3 + 1 row 1
(Ab <- rowadd(Ab, 2, 3, -4)) # row 3 <- row 3 - 4 row 2
# multiply to make diagonals = 1
(Ab <- rowmult(Ab, 1:3, c(1/2, 2, -1)))
# The matrix is now in triangular form
# Could continue to reduce above diagonal to zero
echelon(A, b, verbose=TRUE, fractions=TRUE)
``` |

matlib documentation built on April 4, 2018, 5:03 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.