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.

13 lines
552 B

  1. MatrixXcd X = MatrixXcd::Random(4,4);
  2. MatrixXcd A = X + X.adjoint();
  3. cout << "Here is a random self-adjoint 4x4 matrix:" << endl << A << endl << endl;
  4. Tridiagonalization<MatrixXcd> triOfA(A);
  5. MatrixXd T = triOfA.matrixT();
  6. cout << "The tridiagonal matrix T is:" << endl << T << endl << endl;
  7. cout << "We can also extract the diagonals of T directly ..." << endl;
  8. VectorXd diag = triOfA.diagonal();
  9. cout << "The diagonal is:" << endl << diag << endl;
  10. VectorXd subdiag = triOfA.subDiagonal();
  11. cout << "The subdiagonal is:" << endl << subdiag << endl;