ComplexEigenSolver_compute.cpp
Go to the documentation of this file.
1 MatrixXcf A = MatrixXcf::Random(4,4);
2 cout << "Here is a random 4x4 matrix, A:" << endl << A << endl << endl;
3 
4 ComplexEigenSolver<MatrixXcf> ces;
5 ces.compute(A);
6 cout << "The eigenvalues of A are:" << endl << ces.eigenvalues() << endl;
7 cout << "The matrix of eigenvectors, V, is:" << endl << ces.eigenvectors() << endl << endl;
8 
9 complex<float> lambda = ces.eigenvalues()[0];
10 cout << "Consider the first eigenvalue, lambda = " << lambda << endl;
11 VectorXcf v = ces.eigenvectors().col(0);
12 cout << "If v is the corresponding eigenvector, then lambda * v = " << endl << lambda * v << endl;
13 cout << "... and A * v = " << endl << A * v << endl << endl;
14 
15 cout << "Finally, V * D * V^(-1) = " << endl
16  << ces.eigenvectors() * ces.eigenvalues().asDiagonal() * ces.eigenvectors().inverse() << endl;
ces
cout<< "Here is a random 4x4 matrix, A:"<< endl<< A<< endl<< endl;ComplexEigenSolver< MatrixXcf > ces
Definition: ComplexEigenSolver_compute.cpp:4
A
Definition: test_numpy_dtypes.cpp:298
v
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
lambda
cout<< "The eigenvalues of A are:"<< endl<< ces.eigenvalues()<< endl;cout<< "The matrix of eigenvectors, V, is:"<< endl<< ces.eigenvectors()<< endl<< endl;complex< float > lambda
Definition: ComplexEigenSolver_compute.cpp:9
complex
Definition: datatypes.h:12


gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:32:08