%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [Q,R]=Householder(A) // // Décomposition QR calculee par // l'algorithme de Householder // La matrice A est carree [m,n]=size(A); R=A;Q=eye(A); for k=1:m-1 i=k-1;j=n-i;v=R(k:n,k);w=v+norm(v)*[1 ;zeros(j-1,1)]; Hw=House(w); Hk=[eye(i,i) zeros(i,j); zeros(j,i) Hw]; Q=Hk*Q; R(k:n,k:n)=Hw*R(k:n,k:n); end; Q=Q'; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [L,U]=FactoLU(A) // [m,n]=size(A); if m~=n then, error('la matrice n''est pas carree'), end; zero=1.e-12; for k=1:n-1 if abs(A(k,k)) seuil then A(i,k)=A(i,k)/A(k,k); end for j=k+1:n if abs(A(i,j)) > seuil then A(i,j)=A(i,j)-A(i,k)*A(k,j); end; end; end; end; U=triu(A);L=A-U+diag(ones(n,1)); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function A=CHOLESKY(A) // [m,n]=size(A); if m~=n then, error('la matrice n''est pas carree'), end; zero=1.e-10; if norm(A-A','inf')>zero then, error('matrice non symetrique'), end; for j=1:n for k=1:j-1 A(j,j)=A(j,j)-A(j,k)*A(j,k); end; if A(j,j)< zero then, error('matrice non positive '), end; if abs(A(j,j))< zero then, error('matrice non définie'), end; A(j,j)=sqrt(A(j,j)); for i=j+1:n for k=1:j-1 A(i,j)=A(i,j)-A(j,k)*A(i,k); end; A(i,j)=A(i,j)/A(j,j); end; end; A=tril(A);