Package me.autobot.lib.math.linalg
Class LUDecomposition
java.lang.Object
me.autobot.lib.math.linalg.LUDecomposition
A LU Decomposition is a way of decomposing a matrix into the product of a lower triangular matrix and an upper triangular matrix.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new LU Decomposition with the given matrix.LUDecomposition
(Matrix L, Matrix U) Creates a new LU Decomposition with the given lower triangular matrix and upper triangular matrix. -
Method Summary
-
Constructor Details
-
LUDecomposition
Creates a new LU Decomposition with the given lower triangular matrix and upper triangular matrix.- Parameters:
L
- The lower triangular matrix.U
- The upper triangular matrix.
-
LUDecomposition
Creates a new LU Decomposition with the given matrix.- Parameters:
a
- The matrix to decompose.
-
-
Method Details
-
getL
Gets the lower triangular matrix.- Returns:
- The lower triangular matrix.
-
getU
Gets the upper triangular matrix.- Returns:
- The upper triangular matrix.
-
getP
Gets the permutation vector.- Returns:
- The permutation vector.
-
invert
Inverts the matrix.- Returns:
- The inverted matrix.
-
solve
public double[] solve(double[] b) Solves the system of linear equations Ax = b- Parameters:
b
- The right-hand side of the equation.- Returns:
- The solution to the system of linear equations.
-