I'm interested in calculating the roots of an 11th degree polynom.
To do so, I calculated
the 10x10 companion matrix which eigenvalues are the roots of the polynom.
Now, the eigenvalues could be real or complex and in my code, I just need real ones. Is there a way to find the real eigenvalues only of an upper Hessenberg matrix (companion matrix) using iterations of the QR algorithm?
I tried this: Let A be our upper Hessenberg matrix
M=A for i=1:100 [Q,R]=qr(M); M=R*Q; end
diag(M) will converge to
eig(A) if A is symmetric, if not real eigenvalues exist but complex ones dosen't. I just need real eigenvalues but how to distinguish in
diag(M) values that the entry correspond to a real eigenvalue?