imsl.linalg.lu_factor

lu_factor(a)

Compute the pivoted LU factorization of a matrix.

Parameters:a ((N,N) array_like) – Square matrix to be factorized.
Returns:
  • pvt ((N,) ndarray) – The pivot sequence determined during the factorization.
  • fac ((N,N) ndarray) – The LU factorization of the matrix.

Notes

The computed LU factorization of matrix A satisfies \(L^{-1}A = U\). Let \(F\) denote the matrix stored in fac. The triangular matrix \(U\) is then stored in the upper triangle of \(F\). The strict lower triangle of \(F\) contains the information needed to reconstruct \(L^{-1}\) using

\(L^{-1} = L_{n-1}P_{n-1} \ldots L_1P_1.\)

The factors \(P_i\) and \(L_i\) are defined by partial pivoting. \(P_i\) is the identity matrix with rows i and pvt[i-1] interchanged. \(L_i\) is the identity matrix with \(F_{ji}\), for \(j = i+1,\ldots n\), inserted below the diagonal in column i.

The factorization efficiency is based on a technique of “loop unrolling and jamming” by Dr. Leonard J. Harding of the University of Michigan, Ann Arbor, Michigan.

This function creates a temporary LU() instance and calls method LU.factor() on that instance.

An exception is raised if \(U\), the upper triangular part of the factorization, has a zero diagonal element.