lapack_plu(): Demonstrate the use of tril() and triu() functions. Reconstruct P, L, U factors from compressed LAPACK output. Given the following matrix A: [[1 2 3] [4 5 6] [7 8 0]] Calling LAPACK for a P' * L * U factorization call dgetrf ( a, n, n, lda, ipiv, info ) returns the following compressed information: compressed LU info: [[7. 8. 0. ] [0.142857 0.857143 3. ] [0.571429 0.5 4.5 ]] compressed pivot info P: [3 3 3] U = np.triu ( ALU, 0 ) [[7. 8. 0. ] [0. 0.857143 3. ] [0. 0. 4.5 ]] L = np.tril ( ALU, -1 ) + np.identity ( n ) [[1. 0. 0. ] [0.142857 1. 0. ] [0.571429 0.5 1. ]] P is a permutation, reconstructed from p [[0. 0. 1.] [1. 0. 0.] [0. 1. 0.]] Check PLU = P' * L * U = A? [[0.999999 1.999999 3. ] [4.000003 5.0000035 6. ] [7. 8. 0. ]]