Computes approximated a pair of eigenvalue and eigenvector.
[mu,b,iter] = linalg_rayleighiteration ( A , mu0 , b0 , rtol , itmax , verbose )
a n-by-n matrix of doubles, real, symetric
a 1-by-1 matrix of doubles, an estimated eigenvalue
a n-by-1 matrix of doubles, an estimated eigenvector
a 1-by-1 matrix of doubles, a relative tolerance
a maximum number of iterations
a 1-by-1 matrix of booleans, set to true to print convergence messages
a 1-by-1 matrix of doubles, an approximated eigenvalue
a n-by-1 matrix of doubles, an approximated eigenvector
the number of iterations performed
Uses Rayleigh iterations to find an approximate eigenvalue and an approximate eigenvector.
The algorithm stops if norm(A*b-mu*b) < rtol*norm(mu*b).
Caution! The algorithm has problems when it comes closer to the exact result, because an intermediate matrix becomes more and more ill-conditionned. In this case, Scilab switches the backslash operator from Gaussian elimination to least squares, which makes the algorithms going nuts. Hence, we cannot use this algorithm with a relative tolerance which is too small.