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−1A=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=Ln−1Pn−1…L1P1.The factors Pi and Li are defined by partial pivoting. Pi is the identity matrix with rows i and
pvt[i-1]
interchanged. Li is the identity matrix with Fji, for j=i+1,…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 methodLU.factor()
on that instance.An exception is raised if U, the upper triangular part of the factorization, has a zero diagonal element.