mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-06 17:17:14 +08:00
Move eigen to third party (#282)
* remove useless statement * Add eigen to third_party dir * remove reducdant lines
This commit is contained in:
21
third_party/eigen/doc/snippets/ComplexEigenSolver_compute.cpp
vendored
Normal file
21
third_party/eigen/doc/snippets/ComplexEigenSolver_compute.cpp
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MatrixXcf A = MatrixXcf::Random(4, 4);
|
||||
cout << "Here is a random 4x4 matrix, A:" << endl << A << endl << endl;
|
||||
|
||||
ComplexEigenSolver<MatrixXcf> ces;
|
||||
ces.compute(A);
|
||||
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 = ces.eigenvalues()[0];
|
||||
cout << "Consider the first eigenvalue, lambda = " << lambda << endl;
|
||||
VectorXcf v = ces.eigenvectors().col(0);
|
||||
cout << "If v is the corresponding eigenvector, then lambda * v = " << endl
|
||||
<< lambda * v << endl;
|
||||
cout << "... and A * v = " << endl << A * v << endl << endl;
|
||||
|
||||
cout << "Finally, V * D * V^(-1) = " << endl
|
||||
<< ces.eigenvectors() * ces.eigenvalues().asDiagonal() *
|
||||
ces.eigenvectors().inverse()
|
||||
<< endl;
|
Reference in New Issue
Block a user