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

Public Types

enum  {
  SizeAtCompileTime ,
  IncrAtCompileTime
}
 

Public Member Functions

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

Protected Attributes

FirstType m_first
 
IncrType m_incr
 
SizeType m_size
 

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

Definition at line 59 of file ArithmeticSequence.h.

Member Enumeration Documentation

◆ anonymous enum

template<typename FirstType , typename SizeType , typename IncrType >
anonymous enum
Enumerator
SizeAtCompileTime 
IncrAtCompileTime 

Definition at line 65 of file ArithmeticSequence.h.

65  {
66  SizeAtCompileTime = internal::get_fixed_value<SizeType>::value,
67  IncrAtCompileTime = internal::get_fixed_value<IncrType,DynamicIndex>::value
68  };

Constructor & Destructor Documentation

◆ ArithmeticSequence() [1/2]

template<typename FirstType , typename SizeType , typename IncrType >
Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >::ArithmeticSequence ( FirstType  first,
SizeType  size 
)
inline

◆ ArithmeticSequence() [2/2]

template<typename FirstType , typename SizeType , typename IncrType >
Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >::ArithmeticSequence ( FirstType  first,
SizeType  size,
IncrType  incr 
)
inline

Definition at line 63 of file ArithmeticSequence.h.

Member Function Documentation

◆ first()

template<typename FirstType , typename SizeType , typename IncrType >
Index Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >::first ( ) const
inline
Returns
the first element \( a_0 \) in the sequence

Definition at line 74 of file ArithmeticSequence.h.

74 { return m_first; }

◆ firstObject()

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

Definition at line 79 of file ArithmeticSequence.h.

79 { return m_first; }

◆ incrObject()

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

Definition at line 81 of file ArithmeticSequence.h.

81 { return m_incr; }

◆ operator[]()

template<typename FirstType , typename SizeType , typename IncrType >
Index Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >::operator[] ( Index  i) const
inline
Returns
the value \( a_i \) at index i in the sequence.

Definition at line 77 of file ArithmeticSequence.h.

77 { return m_first + i * m_incr; }

◆ reverse()

template<typename FirstType , typename SizeType , typename IncrType >
auto Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >::reverse ( ) const -> decltype(Eigen::seqN(m_first+(m_size+fix<-1>())*m_incr,m_size,-m_incr))
inline

Definition at line 89 of file ArithmeticSequence.h.

89  {
90  return seqN(m_first+(m_size+fix<-1>())*m_incr,m_size,-m_incr);
91  }
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)

◆ size()

template<typename FirstType , typename SizeType , typename IncrType >
Index Eigen::ArithmeticSequence< FirstType, SizeType, IncrType >::size ( ) const
inline
Returns
the size, i.e., number of elements, of the sequence

Definition at line 71 of file ArithmeticSequence.h.

71 { return m_size; }

◆ sizeObject()

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

Definition at line 80 of file ArithmeticSequence.h.

80 { return m_size; }

Member Data Documentation

◆ m_first

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

Definition at line 84 of file ArithmeticSequence.h.

◆ m_incr

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

Definition at line 86 of file ArithmeticSequence.h.

◆ m_size

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

Definition at line 85 of file ArithmeticSequence.h.


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