Eigen::ArithmeticSequence< FirstType, SizeType, IncrType > Class Template Reference

#include <ArithmeticSequence.h>

Public Types

enum  { IncrAtCompileTime = internal::get_fixed_value<IncrType, DynamicIndex>::value }
 

Public Member Functions

constexpr ArithmeticSequence ()=default
 
constexpr ArithmeticSequence (FirstType first, SizeType size)
 
constexpr ArithmeticSequence (FirstType first, SizeType size, IncrType incr)
 
constexpr Index size () const
 
constexpr Index first () const
 
constexpr Index operator[] (Index i) const
 
constexpr const FirstType & firstObject () const
 
constexpr const SizeType & sizeObject () const
 
constexpr const IncrType & incrObject () const
 
constexpr auto reverse () const -> decltype(Eigen::seqN(m_first+(m_size+fix<-1 >()) *m_incr, m_size, -m_incr))
 

Protected Attributes

FirstType m_first
 
SizeType m_size
 
IncrType m_incr
 

Detailed Description

template<typename FirstType, typename SizeType, typename IncrType>
class Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >

This class represents an arithmetic progression \( a_0, a_1, a_2, ..., a_{n-1}\) defined by its first value \( a_0 \), its size (aka length) n, and the increment (aka stride) that is equal to \( a_{i+1}-a_{i}\) for any i.

It is internally used as the return type of the Eigen::seq and Eigen::seqN functions, and as the input arguments of DenseBase::operator()(const RowIndices&, const ColIndices&), and most of the time this is the only way it is used.

Template Parameters
FirstTypetype of the first element, usually an Index, but internally it can be a symbolic expression
SizeTypetype representing the size of the sequence, usually an Index or a compile time integral constant. Internally, it can also be a symbolic expression
IncrTypetype of the increment, can be a runtime Index, or a compile time integral constant (default is compile-time 1)
See also
Eigen::seq, Eigen::seqN, DenseBase::operator()(const RowIndices&, const ColIndices&), class IndexedView

Member Enumeration Documentation

◆ anonymous enum

template<typename FirstType , typename SizeType , typename IncrType >
anonymous enum
Enumerator
IncrAtCompileTime 
69  {
70  // SizeAtCompileTime = internal::get_fixed_value<SizeType>::value,
72  };
@ IncrAtCompileTime
Definition: ArithmeticSequence.h:71
static const int value
Definition: IntegralConstant.h:156

Constructor & Destructor Documentation

◆ ArithmeticSequence() [1/3]

template<typename FirstType , typename SizeType , typename IncrType >
constexpr Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >::ArithmeticSequence ( )
constexprdefault

◆ ArithmeticSequence() [2/3]

template<typename FirstType , typename SizeType , typename IncrType >
constexpr Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >::ArithmeticSequence ( FirstType  first,
SizeType  size 
)
inlineconstexpr
65 : m_first(first), m_size(size) {}
SizeType m_size
Definition: ArithmeticSequence.h:89
FirstType m_first
Definition: ArithmeticSequence.h:88
constexpr Index size() const
Definition: ArithmeticSequence.h:75
constexpr Index first() const
Definition: ArithmeticSequence.h:78

◆ ArithmeticSequence() [3/3]

template<typename FirstType , typename SizeType , typename IncrType >
constexpr Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >::ArithmeticSequence ( FirstType  first,
SizeType  size,
IncrType  incr 
)
inlineconstexpr
67  : m_first(first), m_size(size), m_incr(incr) {}
IncrType m_incr
Definition: ArithmeticSequence.h:90

Member Function Documentation

◆ first()

template<typename FirstType , typename SizeType , typename IncrType >
constexpr Index Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >::first ( ) const
inlineconstexpr
Returns
the first element \( a_0 \) in the sequence
78 { return m_first; }

References Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >::m_first.

◆ firstObject()

template<typename FirstType , typename SizeType , typename IncrType >
constexpr const FirstType& Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >::firstObject ( ) const
inlineconstexpr

◆ incrObject()

template<typename FirstType , typename SizeType , typename IncrType >
constexpr const IncrType& Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >::incrObject ( ) const
inlineconstexpr

◆ operator[]()

template<typename FirstType , typename SizeType , typename IncrType >
constexpr Index Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >::operator[] ( Index  i) const
inlineconstexpr
Returns
the value \( a_i \) at index i in the sequence.
81 { return m_first + i * m_incr; }
int i
Definition: BiCGSTAB_step_by_step.cpp:9

References i, Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >::m_first, and Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >::m_incr.

◆ reverse()

template<typename FirstType , typename SizeType , typename IncrType >
constexpr auto Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >::reverse ( ) const -> decltype(Eigen::seqN(m_first + (m_size + fix<-1>()) * m_incr, m_size, -m_incr))
inlineconstexpr
93  {
94  return seqN(m_first + (m_size + fix<-1>()) * m_incr, m_size, -m_incr);
95  }
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

References Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >::m_first, Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >::m_incr, Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >::m_size, and Eigen::seqN().

◆ size()

template<typename FirstType , typename SizeType , typename IncrType >
constexpr Index Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >::size ( ) const
inlineconstexpr
Returns
the size, i.e., number of elements, of the sequence
75 { return m_size; }

References Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >::m_size.

◆ sizeObject()

template<typename FirstType , typename SizeType , typename IncrType >
constexpr const SizeType& Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >::sizeObject ( ) const
inlineconstexpr

Member Data Documentation

◆ m_first

◆ m_incr

◆ m_size

template<typename FirstType , typename SizeType , typename IncrType >
SizeType Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >::m_size
protected

The documentation for this class was generated from the following file: