Closed idiotWu closed 3 years ago
Just checked the Eigen documentation for FullPivLU
and found this method decomposes matrix A
as A = P^-1 * L * U * Q^-1
.
Maybe it's better to change to following comment to match the original docs?
Edit: tried P^-1 * L * U * Q^-1
but got [[0.25, 1], [0, 0]]
which didn't equal to the given matrix [[2, 1], [1, 4]]
, am I missing something else?
Good point. In practice, L is strictly lower triangular, which means that we need to add the identity matrix to complete the reconstruction
I will update the documentation to
LU decomposition consists in decomposing a square matrix A as a product A = P^-1 (L + I) U * Q^-1 Where U is upper triangular L lower triangular, I is the identity matrix, and P & Q are two permutation matrices
Thanks!
Problem
eigen.Decompositions.lu()
returns wrong values which don't satisfyLU = A
.Steps to Reproduce
Run the following code in demo page...
...and you will get:
While the expected values are: