| echelon {lintools} | R Documentation | 
Reduced row echelon form
Description
Transform the equalities in a system of linear (in)equations or Reduced Row Echelon form (RRE)
Usage
echelon(A, b, neq = nrow(A), nleq = 0, eps = 1e-08)
Arguments
| A | 
 | 
| b | 
 | 
| neq | 
 | 
| nleq | [ | 
| eps | 
 | 
Value
A list with the following components:
- A: the- Amatrix with equalities transformed to RRE form.
- b: the constant vector corresponding to- A
- neq: the number of equalities in the resulting system.
- nleq: the number of inequalities of the form- a.x <= b. This will only be passed to the output.
Details
The parameters A, b and neq describe a system of the form Ax<=b, where
the first neq rows are equalities. The equalities are transformed to RRE form.
A system of equations is in reduced row echelon form when
- All zero rows are below the nonzero rows 
- For every row, the leading coefficient (first nonzero from the left) is always right of the leading coefficient of the row above it. 
- The leading coefficient equals 1, and is the only nonzero coefficient in its column. 
Examples
echelon(
 A = matrix(c(
    1,3,1,
    2,7,3,
    1,5,3,
    1,2,0), byrow=TRUE, nrow=4)
 , b = c(4,-9,1,8)
 , neq=4
)