Fix tridiagonalize snippet for 3.4.

Fixes #2770.
This commit is contained in:
Antonio Sanchez 2024-03-12 22:04:46 -07:00
parent 3ee06ec52f
commit 7893285e59

View File

@ -5,8 +5,7 @@ cout << "Here is a random symmetric 5x5 matrix:" << endl << A << endl << endl;
VectorXd diag(5);
VectorXd subdiag(4);
VectorXd hcoeffs(4); // Scratch space for householder reflector.
VectorXd workspace(5);
internal::tridiagonalization_inplace(A, diag, subdiag, hcoeffs, workspace, true);
internal::tridiagonalization_inplace(A, diag, subdiag, hcoeffs, 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;