Servers
For both symmetric and nonsymmetric eigenvalue problems, you can increase your control over the computation of the decomposition by using an eigenvalue server object.
There are two nonsymmetric eigenvalue server classes:
RWSchurEigServer<double> is the default server; it constructs the decomposition using a Schur decomposition.
RWHessEigServer<double> determines the eigenvalues directly from a Hessenberg decomposition and then computes the eigenvectors using inverse iteration. The
RWHessEigServer<double> is preferred if you need only a few eigenvectors.
Both types of servers can be configured to return only selected eigenvectors. Here is how to use the
RWHessEigServer<double> to compute only the first five right eigenvectors:
#include <iostream>
#include <rw/lapack/eigsrv.h>
int main()
{
RWGenMat<double> A; // 1
std::cin >> A;
RWHessEigServer<double> server; // 2
server.computeLeftEigenVectors(true); // 3
server.selectEigenVectors(RWRange(0,4)); // 4
RWEigDecomp<double> decomp = server(A); // 5
std::cout << decomp.rightEigenVectors() << std::endl;
return 0;
}