2
0
mirror of https://gitlab.com/libeigen/eigen.git synced 2024-12-27 07:29:52 +08:00
eigen/doc/snippets/MatrixBase_diagonal_int.cpp
Benoit Jacob 9afd1324fd constant Diagonal ---> DiagonalBits
introduce ei_is_diagonal to check for it
DiagonalCoeffs ---> Diagonal and allow Index to by Dynamic
-> add MatrixBase::diagonal(int) with unittest and doc
2009-05-10 16:24:39 +00:00

6 lines
270 B
C++

Matrix4i m = Matrix4i::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here are the coefficients on the 1st super-diagonal and 2nd sub-diagonal of m:" << endl
<< m.diagonal(1).transpose() << endl
<< m.diagonal(-2).transpose() << endl;