Class GaussianElimination4SquareMatrix
- java.lang.Object
-
- dev.nm.algebra.linear.matrix.doubles.factorization.gaussianelimination.GaussianElimination4SquareMatrix
-
- All Implemented Interfaces:
LUDecomposition
public class GaussianElimination4SquareMatrix extends Object implements LUDecomposition
This is a wrapper forGaussianElimination
but applies only to square matrices.
-
-
Constructor Summary
Constructors Constructor Description GaussianElimination4SquareMatrix(Matrix A)
Run the Gaussian elimination algorithm on a square matrix.GaussianElimination4SquareMatrix(Matrix A, double epsilon)
Run the Gaussian elimination algorithm on a square matrix.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LowerTriangularMatrix
L()
Get the lower triangular matrix L as in the LU decomposition.PermutationMatrix
P()
Get the permutation matrix P as in P * A = L * U.UpperTriangularMatrix
U()
Get the upper triangular matrix U as in the LU decomposition.
-
-
-
Constructor Detail
-
GaussianElimination4SquareMatrix
public GaussianElimination4SquareMatrix(Matrix A, double epsilon)
Run the Gaussian elimination algorithm on a square matrix.- Parameters:
A
- a square matrixepsilon
- a precision parameter: when a number |x| ≤ ε, it is considered 0- Throws:
IllegalArgumentException
- if A is not square
-
GaussianElimination4SquareMatrix
public GaussianElimination4SquareMatrix(Matrix A)
Run the Gaussian elimination algorithm on a square matrix.- Parameters:
A
- a square matrix- Throws:
IllegalArgumentException
- if A is not square
-
-
Method Detail
-
L
public LowerTriangularMatrix L()
Description copied from interface:LUDecomposition
Get the lower triangular matrix L as in the LU decomposition.- Specified by:
L
in interfaceLUDecomposition
- Returns:
- L
-
U
public UpperTriangularMatrix U()
Description copied from interface:LUDecomposition
Get the upper triangular matrix U as in the LU decomposition.- Specified by:
U
in interfaceLUDecomposition
- Returns:
- U
-
P
public PermutationMatrix P()
Description copied from interface:LUDecomposition
Get the permutation matrix P as in P * A = L * U.- Specified by:
P
in interfaceLUDecomposition
- Returns:
- P
-
-