Please, help us to better know about our user community by answering the following short survey: https://forms.gle/wpyrxWi18ox9Z5ae9
Eigen  3.4.0
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::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 const Eigen::internal::all_t all
static const symbolic::SymbolExpr< internal::symbolic_last_tag > last
static const 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 Core:141

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::all;
using Eigen::seq;
using Eigen::lastN; // c++11 only
using Eigen::fix;
static const auto fix()
static const Eigen::internal::all_t all
Definition IndexedViewHelper.h:171
static const symbolic::SymbolExpr< internal::symbolic_last_tag > last
Definition IndexedViewHelper.h:38
static const auto lastp1
Definition IndexedViewHelper.h:53
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:162
auto lastN(SizeType size, IncrType incr) -> decltype(seqN(Eigen::last-(size-fix< 1 >()) *incr, size, incr))
Definition ArithmeticSequence.h:331

Function Documentation

◆ fix()

template<int N>
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:162

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>.

In c++98/11, it is implemented as a function:

template<int N> inline internal::FixedInt<N> fix();

Here internal::FixedInt<N> is thus a pointer to function.

If for some reason you want a true object in c++98 then you can write:

which is also valid in c++14.

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

◆ lastN()

template<typename SizeType, typename IncrType>
auto Eigen::lastN ( SizeType size,
IncrType incr ) -> decltype(seqN(Eigen::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 const symbolic::SymbolExpr< internal::symbolic_last_tag > last
Definition IndexedViewHelper.h:38
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

const Eigen::internal::all_t Eigen::all
static

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

◆ last

const symbolic::SymbolExpr<internal::symbolic_last_tag> Eigen::last
static

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();
auto seq(FirstType f, LastType l, IncrType incr)
See also
end

◆ lastp1

const auto Eigen::lastp1
static

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