Talk:LU decomposition: Difference between revisions

Content added Content deleted
Line 51: Line 51:


Why is this so?
Why is this so?

:First, the LU decomposition is not unique. Notably, the algorithm usually force the main diagonal of L **or** U to be all 1. But there is an additional twist: the "A=LU" decomposition may not exist. This happens if one of the pivots is zero in Gauss algorithm. Then you have to swap rows to continue. And like with Gauss algorithm, it's possible to always apply row pivoting, to get at each step the maximum pivot in absolute value, to enhance the numerical precision. The decomposition is then PA=LU, with P a permutation matrix, thus LU is the same as A with possibly some rows swapped. It's what the VBA code does, as well as other implementations. However, even if the result is on the test cases, there is a bug in the code: the maximum pivot is selected, but not in absolute value. Which means the zero pivot would be selected if all other choices were < 0. I'll change this. [[User:Eoraptor|Eoraptor]] ([[User talk:Eoraptor|talk]]) 13:46, 15 August 2020 (UTC)