source: pacpussensors/trunk/Vislab/lib3dv-1.2.0/lib3dv/eigen/doc/snippets/Tridiagonalization_diagonal.cpp

Last change on this file was 136, checked in by ldecherf, 8 years ago

Doc

File size: 552 bytes
Line 
1MatrixXcd X = MatrixXcd::Random(4,4);
2MatrixXcd A = X + X.adjoint();
3cout << "Here is a random self-adjoint 4x4 matrix:" << endl << A << endl << endl;
4
5Tridiagonalization<MatrixXcd> triOfA(A);
6MatrixXd T = triOfA.matrixT();
7cout << "The tridiagonal matrix T is:" << endl << T << endl << endl;
8
9cout << "We can also extract the diagonals of T directly ..." << endl;
10VectorXd diag = triOfA.diagonal();
11cout << "The diagonal is:" << endl << diag << endl;
12VectorXd subdiag = triOfA.subDiagonal();
13cout << "The subdiagonal is:" << endl << subdiag << endl;
Note: See TracBrowser for help on using the repository browser.