From 703539110b5c26f01ac37fe6114afdbb5c3c6c99 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 9 Sep 2008 09:30:23 +0000 Subject: add the missing templated version of block for sub-vectors --- doc/QuickStartGuide.dox | 2 ++ doc/snippets/MatrixBase_template_int.cpp | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 doc/snippets/MatrixBase_template_int.cpp (limited to 'doc') diff --git a/doc/QuickStartGuide.dox b/doc/QuickStartGuide.dox index 8d1799fdd..d55e07856 100644 --- a/doc/QuickStartGuide.dox +++ b/doc/QuickStartGuide.dox @@ -351,6 +351,8 @@ mat = 2 7 8 \endcode +Also note that maxCoeff and minCoeff can takes optional arguments returning the coordinates of the respective min/max coeff: \link MatrixBase::maxCoeff(int*,int*) const maxCoeff(int* i, int* j) \endlink, \link MatrixBase::minCoeff(int*,int*) const minCoeff(int* i, int* j) \endlink. + \b Side \b note: The all() and any() functions are especially useful in combinaison with coeff-wise comparison operators (\ref CwiseAll "example"). diff --git a/doc/snippets/MatrixBase_template_int.cpp b/doc/snippets/MatrixBase_template_int.cpp new file mode 100644 index 000000000..4041a2214 --- /dev/null +++ b/doc/snippets/MatrixBase_template_int.cpp @@ -0,0 +1,5 @@ +RowVector5i v = RowVector5i::Random(); +cout << "Here is the vector v:" << endl << v << endl; +cout << "Here is v.block<2>(1):" << endl << v.start<2>() << endl; +v.block<2>(2).setZero(); +cout << "Now the vector v is:" << endl << v << endl; -- cgit v1.2.3