Gauss, LU, Cholesky

http://homepages.warwick.ac.uk/~ecsgaj/matrixAlgSlidesC.pdf

https://www.quantstart.com/articles/Cholesky-Decomposition-in-Python-and-NumPy/


invert UT matrix

https://stackoverflow.com/questions/420612/is-there-around-a-straightforward-way-to-invert-a-triangular-upper-or-lower-ma

n = size(A,1);
B = zeros(n);
for i=1:n
    B(i,i) = 1/A(i,i);
    for j=1:i-1
        s = 0;
        for k=j:i-1
            s = s + A(i,k)*B(k,j);
        end
        B(i,j) = -s*B(i,i);
    end
end

Code for a Gaussian elimination

Solves a linear system

$A \vec{x} = \vec{y}$


Basic code for LU


Exo 1

Numerical stability

https://dspace.mit.edu/bitstream/handle/1721.1/75282/18-335j-fall-2006/contents/lecture-notes/lec12.pdf


Exo 2


Determinants

the determinant of L is 1 so

det A = det P det U

some row operations


Sort the rows

...so that the ones with first coeff close to 0 are at the end


P is trivial now


Solution to the system


Hilbert matrix



invert an upper triangular unipotent matrix by recursion