TutorialLinAlgSelfAdjointEigenSolver.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <Eigen/Dense>
3 
4 int main()
5 {
7  A << 1, 2, 2, 3;
8  std::cout << "Here is the matrix A:\n" << A << std::endl;
10  if (eigensolver.info() != Eigen::Success) abort();
11  std::cout << "The eigenvalues of A are:\n" << eigensolver.eigenvalues() << std::endl;
12  std::cout << "Here's a matrix whose columns are eigenvectors of A \n"
13  << "corresponding to these eigenvalues:\n"
14  << eigensolver.eigenvectors() << std::endl;
15 }
MatrixXcf A
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:182
Computes eigenvalues and eigenvectors of selfadjoint matrices.
ComputationInfo info() const
Reports whether previous computation was successful.
const EigenvectorsType & eigenvectors() const
Returns the eigenvectors of given matrix.
const RealVectorType & eigenvalues() const
Returns the eigenvalues of given matrix.
@ Success
Definition: Constants.h:446