|
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.GaussianElimination
public class GaussianElimination
The Gaussian elimination performs elementary row operations to reduce a matrix to the row echelon form.
The two elementary row operations are: swapping rows, and adding multiples of a row to another row. This is equivalent to multiplying the original matrix with invertible matrices from the left. For a square matrix, this algorithm essentially computes an LU decomposition.
These two identities always hold:
T %*% A == UP %*% A == L %*% U
| Field Summary | |
|---|---|
double |
epsilon
a precision parameter: when a number |x| ≤ ε, it is considered 0 |
| Constructor Summary | |
|---|---|
GaussianElimination(Matrix A)
Construct an instance of the Gaussian Elimination algorithm with partial pivoting. |
|
GaussianElimination(Matrix A,
boolean usePivoting,
double epsilon)
Construct an instance of the Gaussian Elimination algorithm. |
|
| Method Summary | |
|---|---|
Matrix |
L()
Get a copy of the lower triangular matrix L, such that
P %*% A == L %*% U
|
PermutationMatrix |
P()
Get a copy of the permutation matrix, P, such that
P %*% A == L %*% U
|
Matrix |
T()
Get a copy of the transformation matrix, T, such that
T %*% A == U
|
Matrix |
U()
Get a copy of the upper triangular matrix U, such that
T %*% A == U
P %*% A == L %*% U
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final double epsilon
| Constructor Detail |
|---|
public GaussianElimination(Matrix A,
boolean usePivoting,
double epsilon)
A - a matrixusePivoting - true if partial pivoting is wanted, e.g., for numerical stability.
In general, no pivoting means no row interchanges.
It can be done only if Gaussian elimination never run into zeros on the diagonal.
Since division by zero is a fatal error we usually avoid this pivoting strategy.epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0public GaussianElimination(Matrix A)
A - a matrix| Method Detail |
|---|
public Matrix T()
T, such that
T %*% A == U
Tpublic Matrix U()
U, such that
T %*% A == UP %*% A == L %*% U
U matrixpublic Matrix L()
L, such that
P %*% A == L %*% U
U matrixpublic PermutationMatrix P()
P, such that
P %*% A == L %*% U
P
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||