diff --git a/doc/TutorialSlicingIndexing.dox b/doc/TutorialSlicingIndexing.dox index a1b00dfc4..fdb38e9f0 100644 --- a/doc/TutorialSlicingIndexing.dox +++ b/doc/TutorialSlicingIndexing.dox @@ -18,6 +18,21 @@ Each argument can be: - An ArithmeticSequence as constructed by the Eigen::seq, Eigen::seqN, or Eigen::placeholders::lastN functions. - Any 1D vector/array of integers including %Eigen's vector/array, expressions, std::vector, std::array, as well as plain C arrays: `int[N]`. +The symbols \c last, \c lastp1, \c end, \c all, and \c lastN live in the Eigen::placeholders namespace, +while \c seq, \c seqN, and \c fix live directly in the Eigen namespace. +For convenience, they are all re-exported via the Eigen::indexing namespace. +To make the code examples on this page compile, add one of the following: +\code +using namespace Eigen::indexing; +// or individually: +using Eigen::placeholders::last; +using Eigen::placeholders::all; +using Eigen::placeholders::lastN; +using Eigen::seq; +using Eigen::seqN; +using Eigen::fix; +\endcode + More generally, it can accepts any object exposing the following two member functions: \code operator[]() const; @@ -57,7 +72,7 @@ Taking a set of rows, columns, or elements, uniformly spaced within a matrix or -The \c firstIdx and \c lastIdx parameters can also be defined with the help of the Eigen::last symbol representing the index of the last row, column or element of the underlying matrix/vector once the arithmetic sequence is passed to it through operator(). +The \c firstIdx and \c lastIdx parameters can also be defined with the help of the Eigen::placeholders::last symbol representing the index of the last row, column or element of the underlying matrix/vector once the arithmetic sequence is passed to it through operator(). Here are some examples for a 2D array/matrix \c A and a 1D array/vector \c v. @@ -148,7 +163,7 @@ Here comes \ref Eigen_placeholders_lastN : In terms of performance, %Eigen and the compiler can take advantage of compile-time size and increment. To this end, you can enforce compile-time parameters using Eigen::fix. -Such compile-time value can be combined with the Eigen::last symbol: +Such compile-time value can be combined with the Eigen::placeholders::last symbol: \code v(seq(last-fix<7>, last-fix<2>)) \endcode In this example %Eigen knowns at compile-time that the returned expression has 6 elements.