You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
475 B

  1. MatrixXd X = MatrixXd::Random(5,5);
  2. MatrixXd A = X + X.transpose();
  3. cout << "Here is a random symmetric 5x5 matrix:" << endl << A << endl << endl;
  4. VectorXd diag(5);
  5. VectorXd subdiag(4);
  6. internal::tridiagonalization_inplace(A, diag, subdiag, true);
  7. cout << "The orthogonal matrix Q is:" << endl << A << endl;
  8. cout << "The diagonal of the tridiagonal matrix T is:" << endl << diag << endl;
  9. cout << "The subdiagonal of the tridiagonal matrix T is:" << endl << subdiag << endl;