%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function y=condI(A) // y=normI(A)*normAm1I(A); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function y=condIc(a) // // calcule une approximation // du conditionnement en norme 2 // d'une matrice triangulaire inf. y=normAm1Ic(a)*normI(a) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function conda=Cond1(a) // // calcule une approximation en norme 1 // du conditionnement de la matrice carrée a // par des critères d'optimisation // // initialisation n=size(a,1); x=ones(n,1)/n; // x_i=1/n xt=a\x; ksi=sign(xt); xb=a'\ksi; pasbon =norm(xb,%inf)>xb'*x; conda=norm(xt,1)*norm(a,1) while pasbon [maxx,j]=max(abs(xb)); x=zeros(n,1);x(j)=1; xt=a\x; ksi=sign(xt); xb=a'\ksi; if norm(xb,%inf)<=xb'*x then conda=norm(xt,1)*norm(a,1); pasbon=0 else [maxx,j]=max(abs(xb)); x=zeros(n,1);x(j)=1; end; end; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [PA,Pb]=precond0(A,b) // // Preconditionnement diagonal [sortie, entree]=argn(0); if (entree<2) then, //on preconditionne la matrice A if (sortie~=1) then error('probleme d''arguments'); else PA=A; for i=1:size(PA,1) //tester si la matrice est carree if abs(PA(i,i))>1.e-5 then PA(i,:)=PA(i,:)/PA(i,i) end end end else //on preconditionne la matrice A et le vecteur b PA=A;Pb=b; for i=1:size(PA,1) //tester si la matrice est carree p=PA(i,i); if abs(p)>1.e-5 then PA(i,:)=PA(i,:)/p; Pb(i)=b(i)/p; end end end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function PA=precondP(A,k) // // Preconditionnement polynomial if rayons(eye(A)-A)>=.99 then error('chercher un autre preconditionnement') end; PA=eye(A); if k ~= 0 then PA=eye(A); C=eye(A)-A; for i=1:k, PA=PA+C^i, end; end;