EIGEN 複數矩陣求特徵值,特徵向量

#include <iostream>

#include <Eigen/Dense>

 

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

Eigen::ComplexEigenSolver<Eigen::MatrixXcd> 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;

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章