MatrixXd X = MatrixXd::Random(5, 5); | |
MatrixXd A = X + X.transpose(); | |
cout << "Here is a random symmetric 5x5 matrix:" << endl << A << endl << endl; | |
Tridiagonalization<MatrixXd> triOfA(A); | |
MatrixXd Q = triOfA.matrixQ(); | |
cout << "The orthogonal matrix Q is:" << endl << Q << endl; | |
MatrixXd T = triOfA.matrixT(); | |
cout << "The tridiagonal matrix T is:" << endl << T << endl << endl; | |
cout << "Q * T * Q^T = " << endl << Q * T * Q.transpose() << endl; |