I have the following doubts about Gauss algorithm with partial pivoting:
- Say that I sum to the second row the first row multiplied by $k$. In the $L$ matrix, should I sum to the second row the first row multiplied for $k$ or $-k$?
- The $P$ matrix contains all row swaps, so for example if I swap the second row with the first one, it will contain the identity matrix with the first and second row swapped. Can I swap rows only before starting the algorithm of also in the middle of it( when I already started pivoting)? And if yes, when I swap two rows, should I perform the swap also on the $L$ matrix?
In the first it should be $-k$ and the swapping of rows is possible while the algorithm is running, you have to swap some parts of the rows in $L$.