5.8 Calcul des valeurs propres des matrices sym´ etriques
205
[p]=sturm(dd,bb,x);
n=length(dd);
nch=0;
s=0;
for i=2:n+1
if p(i)*p(i-1)<=0
nch=nch+1;
end
if p(i)==0
s=s+1;
end
end
nch=nch-s;
return
Programme 41 - bound : Calcul de l’intervalle J = [α, β]
function [alfa,beta]=bound(dd,bb)
%BOUND Calcul de l’intervalle [ALPHA,BETA] pour la m´ ethode de Givens.
n=length(dd);
alfa=dd(1)-abs(bb(1));
temp=dd(n)-abs(bb(n-1));
if temp
alfa=temp;
end
for i=2:n-1
temp=dd(i)-abs(bb(i-1))-abs(bb(i));
if temp
alfa=temp;
end
end
beta=dd(1)+abs(bb(1)); temp=dd(n)+abs(bb(n-1));
if temp>beta
beta=temp;
end
for i=2:n-1
temp=dd(i)+abs(bb(i-1))+abs(bb(i));
if temp>beta
beta=temp;
end
end
return
205
[p]=sturm(dd,bb,x);
n=length(dd);
nch=0;
s=0;
for i=2:n+1
if p(i)*p(i-1)<=0
nch=nch+1;
end
if p(i)==0
s=s+1;
end
end
nch=nch-s;
return
Programme 41 - bound : Calcul de l’intervalle J = [α, β]
function [alfa,beta]=bound(dd,bb)
%BOUND Calcul de l’intervalle [ALPHA,BETA] pour la m´ ethode de Givens.
n=length(dd);
alfa=dd(1)-abs(bb(1));
temp=dd(n)-abs(bb(n-1));
if temp
end
for i=2:n-1
temp=dd(i)-abs(bb(i-1))-abs(bb(i));
if temp
end
end
beta=dd(1)+abs(bb(1)); temp=dd(n)+abs(bb(n-1));
if temp>beta
beta=temp;
end
for i=2:n-1
temp=dd(i)+abs(bb(i-1))+abs(bb(i));
if temp>beta
beta=temp;
end
end
return
