mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-06 09:07:10 +08:00
12 lines
481 B
C++
12 lines
481 B
C++
MatrixXd X = MatrixXd::Random(5, 5);
|
|
MatrixXd A = X + X.transpose();
|
|
cout << "Here is a random symmetric 5x5 matrix:" << endl << A << endl << endl;
|
|
|
|
VectorXd diag(5);
|
|
VectorXd subdiag(4);
|
|
internal::tridiagonalization_inplace(A, diag, subdiag, true);
|
|
cout << "The orthogonal matrix Q is:" << endl << A << endl;
|
|
cout << "The diagonal of the tridiagonal matrix T is:" << endl << diag << endl;
|
|
cout << "The subdiagonal of the tridiagonal matrix T is:" << endl
|
|
<< subdiag << endl;
|