Overview
The LU decomposition decomposes a matrix into the multiplication of a lower triangular matrix and an upper triangular matrix.A triangular matrix is one for which all values either above or below the diagonal are zero. For example, the following is an upper triangular matrix.
{%
\begin{bmatrix}
a & b & c \\
0 & d & e\\
0 & 0 & f \\
\end{bmatrix}
%}
whereas a lower triangular matrix has the form
{%
\begin{bmatrix}
a & 0 & 0 \\
b & c & 0\\
d & e & f \\
\end{bmatrix}
%}
An LU decomposition, therefore, factors a given matrix A, into the product of two matrices as follows:
{% A = LU %}
Algorithm
The LU decomposition uses Gaussian EliminationLinear Algebra Module
let la = await import("/lib/linear-algebra/v1.0.0/linear-algebra.mjs");
let ans = la.LU(matrix1);