RDNumeric::EigenSolvers Namespace Reference


Functions

bool powerEigenSolver (unsigned int numEig, DoubleSymmMatrix &mat, DoubleMatrix &eigenVectors, DoubleVector &eigenValues, int seed=-1)
 Compute the numEig largest eigenvalues and the corresponding eigenvectors.


Function Documentation

bool RDNumeric::EigenSolvers::powerEigenSolver ( unsigned int  numEig,
DoubleSymmMatrix &  mat,
DoubleMatrix &  eigenVectors,
DoubleVector &  eigenValues,
int  seed = -1 
)

Compute the numEig largest eigenvalues and the corresponding eigenvectors.

Parameters:
numEig the number of eigenvalues we are interested in
mat symmetric input matrix of dimension N*N
eigenVectors Matrix used to return the eigenvectors (size = N*numEig)
eigenValues Vector used to return the eigenvalues (size = numEig)
seed Optional values to seed the random value generator used to initialize the eigen vectors
Returns:
a boolean indicating whether or not the calculation converged.
Notes:

Algorithm:

We use the iterative power method, which works like this:

     u = arbitrary unit vector
     tol = 0.001
     currEigVal = 0.0;
     prevEigVal = -1.0e100
     while (abs(currEigVal - prevEigVal) > tol) :
         v = Au
         prevEigVal = currEigVal
         currEigVal = v[i] // where i is the id os the largest absolute component
         u = c*v
    


Generated on Sat May 24 08:36:34 2008 for RDCode by  doxygen 1.5.3