bug su power method, aggiunto calcolo autovalori con matrici simili

This commit is contained in:
2014-12-16 19:36:03 +01:00
parent 6e14720cdb
commit 436bc12ec0
3 changed files with 20 additions and 5 deletions

12
functions/eigenvalues.m Normal file
View File

@@ -0,0 +1,12 @@
function [ values, err ] = eigenvalues( A, ite, toll )
i=0;
err = inf;
while (i < ite) && (err > toll)
[q,r] = qr(A);
A1= r * q
err = norm(diag(A1) - diag(A),inf) / norm (diag(A1),inf);
A = A1;
i=i+1;
end
values = diag(A);