aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/snippets/Tridiagonalization_decomposeInPlace.cpp
blob: 1d0961aeec1ee8e1613c9e42b0e90bca0c4099c2 (plain)
1
2
3
4
5
6
7
8
9
10
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;