Skip to main content

LU decomposition

LU decomposition or LU factorization of a square matrix A is a factorization of AA as the product of two matrices L and U: A=LU, where LL is a lower-triangular matrix and UU is an upper-triangular matrix.

Syntax

lu_decomposition(Matrix)

Description

Given a matrix, returns a list with the matrices LL and UU. If the permutation matrix is different of the identity matrix or the option permutation_matrix is set to 1, the permutation matrix is returned at the first position.

linear_algebra.lu_decomposition.calc.png

Options

Below is a complete list of options that may be used in the lu_decomposition function.

Option

Description

Format

Default value

permutation_matrix

We can choose if the permutation matrix is showed or not. When the value equals 0, the permutation matrix is returned if and only if it is different from the identity matrix. If it is set to 1, the permutation matrix is returned always. If it is set to -1, the permutation matrix is not returned.

{permutation_matrix=-1}

{permutation_matrix=0}