What would you like to Propose?
I would like to propose the addition of LU decomposition algorithm under src/main/java/com/thealgorithms/matrix
This algorithm is widely used in:
- Solving systems of linear equations (Ax = b)
- Finding matrix inverses
- Computing determinants efficiently
Issue details
The above mentioned algorithm decomposes a square matrix A into product of 2 matrices:
A = L * U
where:
- L is a lower triangular matrix with 1s on its diagonal
- U is an upper triangular matrix
Example:
Matrix:
A = {
{2, -1, -2},
{-4, 6, 3},
{-4, -2, 8}
}
Expected Output:
L = {
{1.000, 0.000, 0.000},
{-2.000, 1.000, 0.000},
{-2.000, -1.000, 1.000}
}
U = {
{2.000, -1.000, -2.000},
{0.000, 4.000, -1.000},
{0.000, 0.000, 3.000}
}
Time Complexity: O(n^3)
Reference: https://en.wikipedia.org/wiki/LU_decomposition
Additional Information
No response