Eigen  3.4.90 (git rev 9589cc4e7fd8e4538bedef80dd36c7738977a8be)
 
Loading...
Searching...
No Matches
Eigen::indexing Namespace Reference

Functions

template<int N>
static const auto fix ()
 
template<typename SizeType, typename IncrType>
auto lastN (SizeType size, IncrType incr) -> decltype(seqN(Eigen::placeholders::last -(size - fix< 1 >()) *incr, size, incr))
 
template<typename FirstType, typename LastType, typename IncrType>
auto seq (FirstType f, LastType l, IncrType incr)
 
template<typename FirstType, typename SizeType, typename IncrType>
ArithmeticSequence< typename internal::cleanup_index_type< FirstType >::type, typename internal::cleanup_index_type< SizeType >::type, typename internal::cleanup_seq_incr< IncrType >::type > seqN (FirstType first, SizeType size, IncrType incr)
 

Variables

static constexpr Eigen::internal::all_t all
 
static constexpr const last_t last
 
static constexpr auto lastp1
 

Detailed Description

The sole purpose of this namespace is to be able to import all functions and symbols that are expected to be used within operator() for indexing and slicing. If you already imported the whole Eigen namespace:

using namespace Eigen;
Namespace containing all symbols from the Eigen library.
Definition B01_Experimental.dox:1

then you are already all set. Otherwise, if you don't want/cannot import the whole Eigen namespace, the following line:

is equivalent to:

using Eigen::fix;
using Eigen::seq;
using Eigen::placeholders::lastN; // c++11 only
static constexpr const last_t last
Definition IndexedViewHelper.h:48
static constexpr Eigen::internal::all_t all
Definition IndexedViewHelper.h:86
static const auto fix()
static constexpr auto lastp1
Definition IndexedViewHelper.h:68
auto seq(FirstType f, LastType l, IncrType incr)
ArithmeticSequence< typename internal::cleanup_index_type< FirstType >::type, typename internal::cleanup_index_type< SizeType >::type, typename internal::cleanup_seq_incr< IncrType >::type > seqN(FirstType first, SizeType size, IncrType incr)
Definition ArithmeticSequence.h:105

Function Documentation

◆ fix()

template<int N>
static const auto Eigen::fix ( )
static

This identifier permits to construct an object embedding a compile-time integer N.

Template Parameters
Nthe compile-time integer value

It is typically used in conjunction with the Eigen::seq and Eigen::seqN functions to pass compile-time values to them:

seqN(10,fix<4>,fix<-3>) // <=> [10 7 4 1]
static const auto fix()
ArithmeticSequence< typename internal::cleanup_index_type< FirstType >::type, typename internal::cleanup_index_type< SizeType >::type, typename internal::cleanup_seq_incr< IncrType >::type > seqN(FirstType first, SizeType size, IncrType incr)
Definition ArithmeticSequence.h:105

See also the function fix(int) to pass both a compile-time and runtime value.

In c++14, it is implemented as:

template<int N> static const internal::FixedInt<N> fix{};

where internal::FixedInt<N> is an internal template class similar to std::integral_constant <int,N> Here, fix<N> is thus an object of type internal::FixedInt<N>.

See also
fix<N>(int), seq, seqN

◆ lastN()

template<typename SizeType, typename IncrType>
auto Eigen::placeholders::lastN ( SizeType size,
IncrType incr ) -> decltype(seqN(Eigen::placeholders::last - (size - fix<1>()) * incr, size, incr))

[c++11]

Returns
a symbolic ArithmeticSequence representing the last size elements with increment incr.

It is a shortcut for:

seqN(last-(size-fix<1>)*incr, size, incr)
static constexpr const last_t last
Definition IndexedViewHelper.h:48
See also
lastN(SizeType), seqN(FirstType,SizeType), seq(FirstType,LastType,IncrType)

◆ seq()

template<typename FirstType, typename LastType, typename IncrType>
auto Eigen::seq ( FirstType f,
LastType l,
IncrType incr )
Returns
an ArithmeticSequence starting at f, up (or down) to l, and with positive (or negative) increment incr

It is essentially an alias to:

seqN(f, (l-f+incr)/incr, incr);
See also
seqN(FirstType,SizeType,IncrType), seq(FirstType,LastType)

◆ seqN()

template<typename FirstType, typename SizeType, typename IncrType>
ArithmeticSequence< typename internal::cleanup_index_type< FirstType >::type, typename internal::cleanup_index_type< SizeType >::type, typename internal::cleanup_seq_incr< IncrType >::type > Eigen::seqN ( FirstType first,
SizeType size,
IncrType incr )
Returns
an ArithmeticSequence starting at first, of length size, and increment incr
See also
seqN(FirstType,SizeType), seq(FirstType,LastType,IncrType)

Variable Documentation

◆ all

Eigen::internal::all_t Eigen::placeholders::all
staticconstexpr

Can be used as a parameter to DenseBase::operator()(const RowIndices&, const ColIndices&) to index all rows or columns

◆ last

const last_t Eigen::placeholders::last
staticconstexpr

Can be used as a parameter to Eigen::seq and Eigen::seqN functions to symbolically reference the last element/row/columns of the underlying vector or matrix once passed to DenseBase::operator()(const RowIndices&, const ColIndices&).

This symbolic placeholder supports standard arithmetic operations.

A typical usage example would be:

using namespace Eigen;
VectorXd v(n);
v(seq(2,last-2)).setOnes();
Matrix< double, Dynamic, 1 > VectorXd
DynamicĂ—1 vector of type double.
Definition Matrix.h:479
auto seq(FirstType f, LastType l, IncrType incr)
See also
end

◆ lastp1

auto Eigen::placeholders::lastp1
staticconstexpr

Can be used as a parameter to Eigen::seq and Eigen::seqN functions to symbolically reference the last+1 element/row/columns of the underlying vector or matrix once passed to DenseBase::operator()(const RowIndices&, const ColIndices&).

This symbolic placeholder supports standard arithmetic operations. It is essentially an alias to last+fix<1>.

See also
last