<< linalg_powfast linalg linalg_solvelu >>

linalg >> linalg > linalg_rayleighiteration

linalg_rayleighiteration

Computes approximated a pair of eigenvalue and eigenvector.

Calling Sequence

mu = linalg_rayleighiteration ( A , mu0 , b0 )
mu = linalg_rayleighiteration ( A , mu0 , b0 , rtol )
mu = linalg_rayleighiteration ( A , mu0 , b0 , rtol , itmax )
mu = linalg_rayleighiteration ( A , mu0 , b0 , rtol , itmax , verbose )
[mu,b] = linalg_rayleighiteration ( ... )
[mu,b,iter] = linalg_rayleighiteration ( ... )

Parameters

A :

a n-by-n matrix of doubles, real, symetric

mu0 :

a 1-by-1 matrix of doubles, an estimated eigenvalue

b0 :

a n-by-1 matrix of doubles, an estimated eigenvector

rtol :

a 1-by-1 matrix of doubles (default rtol = %eps), a relative tolerance

itmax :

a 1-by-1 matrix of doubles, integer value (default itmax = 100), a maximum number of iterations

verbose :

a 1-by-1 matrix of booleans (default verbose = %f), set to true to print convergence messages

mu :

a 1-by-1 matrix of doubles, an approximated eigenvalue

b :

a n-by-1 matrix of doubles, an approximated eigenvector

iter :

the number of iterations performed

Description

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).

Examples

// Example #1
A = [
6 2 3
2 5 1
3 1 3
];
b = [1 1 1]';
mu = 1;
[mu,b,iter]=linalg_rayleighiteration ( A , mu , b )

// Configure options
rtol = 1.e-4;
itmax = 20;
verbose = %f;
[mu,b,iter]=linalg_rayleighiteration ( A , mu , b , rtol , itmax , verbose )

// See what happens
[mu,b,iter]=linalg_rayleighiteration ( A , mu , b , rtol , itmax , %t )

// Example #2
A = [
1 2 3
1 2 1
3 2 1
];
b = [1 1 1]';
mu = 200;
[mu,b,iter]=linalg_rayleighiteration ( A , mu , b )

// Example #3
// The initial eigenvalue is close to the
// exact one.
//
A = [
1 2 3
1 2 1
3 2 1
];
b = [1 1 1]';
mu = 0.7639320225002093067701;
[mu,b,iter]=linalg_rayleighiteration ( A , mu , b )

Authors


Report an issue
<< linalg_powfast linalg linalg_solvelu >>