Skip to main content

lup

lup(matrix: any[] | Mat) : any[]

param matrix - The matrix to be decomposed using the LU method. Needs to be a square matrix.

returns: any[] - The matrix L , U and the column vector p from the decomposition.

This function decomposes a square matrix using the LU decomposition method. It returns a lower triangular matrix (L), an upper triangular matrix (U), and pivot (p). Note that these can be access by calling {result}.L, {result}.U, {result}.p as we'll see in the following example. This is because the return value is an object with members L, U and p.