blob: 3cdce679b2e96b6507f597f5e5575a735bec9e19 [file] [log] [blame]
Brian Silverman72890c22015-09-19 14:37:37 -04001MatrixXd X = MatrixXd::Random(5,5);
2MatrixXd A = X + X.transpose();
3cout << "Here is a random symmetric 5x5 matrix:" << endl << A << endl << endl;
4
5VectorXd diag(5);
6VectorXd subdiag(4);
Austin Schuhc55b0172022-02-20 17:52:35 -08007VectorXd hcoeffs(4); // Scratch space for householder reflector.
8internal::tridiagonalization_inplace(A, diag, subdiag, hcoeffs, true);
Brian Silverman72890c22015-09-19 14:37:37 -04009cout << "The orthogonal matrix Q is:" << endl << A << endl;
10cout << "The diagonal of the tridiagonal matrix T is:" << endl << diag << endl;
11cout << "The subdiagonal of the tridiagonal matrix T is:" << endl << subdiag << endl;