Decomposition Object
The basic object in the Linear Algebra Module nonsymmetric eigenvalue classes is the
RWEigDecomp<double> object, which represents the eigenvalues and eigenvectors of a matrix. Here is a short program that reads a matrix from standard input, computes its eigenvalue decomposition, and prints out its eigenvalues and eigenvectors:
#include <iostream>
#include <rw/lapack/eig.h>
int main()
{
RWGenMat<double> A; // 1
std::cin >> A;
RWEigDecomp<double> decomp(A); // 2
std::cout << decomp.eigenValues() << std::endl; // 3
std::cout << decomp.leftEigenVectors() << std::endl; // 4
std::cout << decomp.rightEigenVectors() << std::endl;
return 0;
}