GaussianElimination: Calculation of Gaussian Form of a matrix.

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/found_functions.R

Description

This function calculates the Gaussian Form of a Matrix as well as the "row change" multiplication matrix, in short, both $N$ (the Gaussian Form) and $X$ for a matrix G of the form: $$ N = X G Y $$

Usage

1
2
GaussianElimination(A, B, tol = sqrt(.Machine$double.eps),
verbose = FALSE, fractions = FALSE)

Arguments

A

A Matrix to be turned into Gaussian Form.

B

An identity matrix, which will be returned as the row change multiplication matrix.

tol

Tolerance for checking for 0 pivot.

verbose

If TRUE, print intermediate steps.

fractions

If true, try to express nonintegers as rational numbers.

Value

A matrix

Author(s)

John Fox

References

http://socserv.mcmaster.ca/jfox/Courses/R-course-Berkeley/

See Also

rref

Examples

1
2
3
test_mat <- matrix(c(2,4,4, -6,6,12, 10,-4,-16), nrow=3, ncol=3, byrow=TRUE)
identity_mat <- diag(3)
GaussianElimination(test_mat,identity_mat)

Example output

     [,1] [,2] [,3]       [,4]       [,5]       [,6]
[1,]    1    0    0  0.3333333 -0.3333333 -0.1666667
[2,]    0    1    0 -0.1666667  0.5000000  0.3333333
[3,]    0    0    1  0.2500000 -0.3333333 -0.2500000

quhomology documentation built on May 1, 2019, 8:44 p.m.