From 9afd1324fd809631cd0762908629c30d72e61b40 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Sun, 10 May 2009 16:24:39 +0000 Subject: 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 --- doc/snippets/MatrixBase_diagonal_int.cpp | 4 ++-- doc/snippets/MatrixBase_diagonal_template_int.cpp | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 doc/snippets/MatrixBase_diagonal_template_int.cpp (limited to 'doc') diff --git a/doc/snippets/MatrixBase_diagonal_int.cpp b/doc/snippets/MatrixBase_diagonal_int.cpp index 0e73d1c16..7b66abf67 100644 --- a/doc/snippets/MatrixBase_diagonal_int.cpp +++ b/doc/snippets/MatrixBase_diagonal_int.cpp @@ -1,5 +1,5 @@ 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; + << m.diagonal(1).transpose() << endl + << m.diagonal(-2).transpose() << endl; diff --git a/doc/snippets/MatrixBase_diagonal_template_int.cpp b/doc/snippets/MatrixBase_diagonal_template_int.cpp new file mode 100644 index 000000000..0e73d1c16 --- /dev/null +++ b/doc/snippets/MatrixBase_diagonal_template_int.cpp @@ -0,0 +1,5 @@ +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; -- cgit v1.2.3