|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.numericalmethod.suanshu.matrix.doubles.factorization.gaussianelimination.GaussJordanElimination
public class GaussJordanElimination
Gauss-Jordan elimination performs elementary row operations to reduce a matrix to the reduced row echelon form.
The three elementary row operations are: scaling rows, swapping rows, and adding multiples of a row to another row.
This identity always holds:
T %*% A == U
where U is in the reduced row echelon form.
This implementation makes sure that the leading 1s are numerically 1,
for future comparison purpose.
Suppose there is a leading 1 at [i, j],
U.get(i, j) == 1
always returns true.
| Field Summary | |
|---|---|
double |
epsilon
a precision parameter: when a number |x| ≤ ε, it is considered 0 |
int |
ncols
number of columns |
int |
nrows
number of rows |
boolean |
usePivoting
true if partial pivoting is wanted, e.g., for numerical stability |
| Constructor Summary | |
|---|---|
GaussJordanElimination(Matrix A)
Construct an instance of the Gauss-Jordan Elimination algorithm. |
|
GaussJordanElimination(Matrix A,
boolean usePivoting,
double epsilon)
Construct an instance of the Gauss-Jordan Elimination algorithm. |
|
| Method Summary | |
|---|---|
Matrix |
T()
Get the transformation matrix, T, such that
T %*% A == U |
Matrix |
U()
Get the reduced row echelon form matrix, such that T %*% A == U |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final int nrows
public final int ncols
public final boolean usePivoting
true if partial pivoting is wanted, e.g., for numerical stability
public final double epsilon
| Constructor Detail |
|---|
public GaussJordanElimination(Matrix A,
boolean usePivoting,
double epsilon)
A - a matrixusePivoting - true if partial pivoting is wanted, e.g., for numerical stabilityepsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0public GaussJordanElimination(Matrix A)
A - a matrix| Method Detail |
|---|
public Matrix T()
T, such that
T %*% A == U
Tpublic Matrix U()
T %*% A == U
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||