Update code snippet for tridiagonalize_inplace.

(cherry picked from commit fb1718ad14485ccf733d90807253e47c1f72e275)
This commit is contained in:
Antonio Sanchez 2021-08-12 08:30:12 -07:00 committed by Antonio Sánchez
parent 6d2506040c
commit 0d89012708

View File

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