EIGEN 复数矩阵求特征值,特征向量

#include

#include

 

Eigen::MatrixXcd A(4,4) = Eigen::MatrixXcd::Random(4, 4);

Eigen::ComplexEigenSolver es(A);

Eigen::MatrixXcd B = es.eigenvalues();
Eigen::MatrixXcd C = es.eigenvectors();
cout << "eigenvalues is \n" << B << endl;
cout << "size of B is \n" << B.size() << endl;
cout << "rows of B is \n" << B.rows() << endl;
cout << "cols of B is \n" << B.cols() << endl;
cout << "eigenvectors is \n" << C << endl;
cout << "size of C is \n" << C.size() << endl;
cout << "rows of C is \n" << C.rows() << endl;
cout << "cols of C is \n" << C.cols() << endl;

你可能感兴趣的:(Eigen)