Eigen  3.4.1 (git rev 28ded8800c26864e537852658428ab44c8399e87)
 
Loading...
Searching...
No Matches
Eigen::indexing Namespace Reference

Functions

template<int N>
static const auto fix ()
 
template<typename SizeType>
auto lastN (SizeType size) -> decltype(seqN(Eigen::last+fix< 1 >() -size, size))
 
template<typename FirstType, typename LastType>
auto seq (FirstType f, LastType l) -> decltype(seqN(typename internal::cleanup_index_type< FirstType >::type(f),(typename internal::cleanup_index_type< LastType >::type(l) - typename internal::cleanup_index_type< FirstType >::type(f)+fix< 1 >())))
 
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 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::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
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) -> decltype(seqN(Eigen::last+fix< 1 >() -size, size))
Definition ArithmeticSequence.h:322
auto seq(FirstType f, LastType l) -> decltype(seqN(typename internal::cleanup_index_type< FirstType >::type(f),(typename internal::cleanup_index_type< LastType >::type(l) - typename internal::cleanup_index_type< FirstType >::type(f)+fix< 1 >())))
Definition ArithmeticSequence.h:188

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: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>
auto Eigen::lastN ( SizeType size) -> decltype(seqN(Eigen::last+fix<1>()-size, size))

[c++11]

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

It is a shortcut for:

auto seq(FirstType f, LastType l) -> decltype(seqN(typename internal::cleanup_index_type< FirstType >::type(f),(typename internal::cleanup_index_type< LastType >::type(l) - typename internal::cleanup_index_type< FirstType >::type(f)+fix< 1 >())))
Definition ArithmeticSequence.h:188
static const symbolic::SymbolExpr< internal::symbolic_last_tag > last
Definition IndexedViewHelper.h:38
See also
lastN(SizeType,IncrType, seqN(FirstType,SizeType), seq(FirstType,LastType)

◆ seq()

template<typename FirstType, typename LastType>
auto Eigen::seq ( FirstType f,
LastType l ) -> decltype(seqN(typename internal::cleanup_index_type<FirstType>::type(f), ( typename internal::cleanup_index_type<LastType>::type(l) - typename internal::cleanup_index_type<FirstType>::type(f)+fix<1>())))
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();
Matrix< double, Dynamic, 1 > VectorXd
Definition Matrix.h:519
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