eigen/doc/snippets/Tridiagonalization_decomposeInPlace.cpp
Jitse Niesen c2f6cbab8d Fix compilation of docs after changes in Eigenvalues module.
Clean-up after revision 469382407ca5d730f23788c593e71e91d24e9b89
.
2010-06-14 10:16:01 +01:00

11 lines
468 B
C++

MatrixXd X = MatrixXd::Random(5,5);
MatrixXd A = X + X.transpose();
cout << "Here is a random symmetric 5x5 matrix:" << endl << A << endl << endl;
VectorXd diag(5);
VectorXd subdiag(4);
ei_tridiagonalization_inplace(A, diag, subdiag, 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;