ComplexEigenSolver_compute.cpp
Go to the documentation of this file.
00001 MatrixXcf A = MatrixXcf::Random(4,4);
00002 cout << "Here is a random 4x4 matrix, A:" << endl << A << endl << endl;
00003 
00004 ComplexEigenSolver<MatrixXcf> ces;
00005 ces.compute(A);
00006 cout << "The eigenvalues of A are:" << endl << ces.eigenvalues() << endl;
00007 cout << "The matrix of eigenvectors, V, is:" << endl << ces.eigenvectors() << endl << endl;
00008 
00009 complex<float> lambda = ces.eigenvalues()[0];
00010 cout << "Consider the first eigenvalue, lambda = " << lambda << endl;
00011 VectorXcf v = ces.eigenvectors().col(0);
00012 cout << "If v is the corresponding eigenvector, then lambda * v = " << endl << lambda * v << endl;
00013 cout << "... and A * v = " << endl << A * v << endl << endl;
00014 
00015 cout << "Finally, V * D * V^(-1) = " << endl
00016      << ces.eigenvectors() * ces.eigenvalues().asDiagonal() * ces.eigenvectors().inverse() << endl;


libicr
Author(s): Robert Krug
autogenerated on Mon Jan 6 2014 11:32:36