10#ifndef EIGEN_ARITHMETIC_SEQUENCE_H
11#define EIGEN_ARITHMETIC_SEQUENCE_H
14#include "./InternalHeaderCheck.h"
22struct cleanup_seq_incr {
23 typedef typename cleanup_index_type<T, DynamicIndex>::type type;
32template <
typename FirstType = Index,
typename SizeType = Index,
typename IncrType =
internal::FixedInt<1> >
33class ArithmeticSequence;
35template <
typename FirstType,
typename SizeType,
typename IncrType>
36ArithmeticSequence<typename internal::cleanup_index_type<FirstType>::type,
37 typename internal::cleanup_index_type<SizeType>::type,
38 typename internal::cleanup_seq_incr<IncrType>::type>
39seqN(FirstType first, SizeType size, IncrType incr);
61template <
typename FirstType,
typename SizeType,
typename IncrType>
67 : m_first(
first), m_size(
size), m_incr(incr) {}
71 IncrAtCompileTime = internal::get_fixed_value<IncrType, DynamicIndex>::value
83 constexpr const FirstType& firstObject()
const {
return m_first; }
84 constexpr const SizeType& sizeObject()
const {
return m_size; }
85 constexpr const IncrType& incrObject()
const {
return m_incr; }
93 constexpr auto reverse() const -> decltype(
Eigen::seqN(m_first + (m_size + fix<-1>()) * m_incr, m_size, -m_incr)) {
94 return seqN(m_first + (m_size + fix<-1>()) * m_incr, m_size, -m_incr);
101template <
typename FirstType,
typename SizeType,
typename IncrType>
102ArithmeticSequence<typename internal::cleanup_index_type<FirstType>::type,
103 typename internal::cleanup_index_type<SizeType>::type,
104 typename internal::cleanup_seq_incr<IncrType>::type>
105seqN(FirstType first, SizeType size, IncrType incr) {
107 typename internal::cleanup_index_type<SizeType>::type,
108 typename internal::cleanup_seq_incr<IncrType>::type>(first, size, incr);
114template <
typename FirstType,
typename SizeType>
115ArithmeticSequence<typename internal::cleanup_index_type<FirstType>::type,
116 typename internal::cleanup_index_type<SizeType>::type>
117seqN(FirstType first, SizeType size) {
119 typename internal::cleanup_index_type<SizeType>::type>(first, size);
122#ifdef EIGEN_PARSED_BY_DOXYGEN
134template <
typename FirstType,
typename LastType,
typename IncrType>
135auto seq(FirstType f, LastType l, IncrType incr);
146template <
typename FirstType,
typename LastType>
147auto seq(FirstType f, LastType l);
151template <
typename FirstType,
typename LastType>
152auto seq(FirstType f, LastType l)
153 ->
decltype(seqN(
typename internal::cleanup_index_type<FirstType>::type(f),
154 (
typename internal::cleanup_index_type<LastType>::type(l) -
155 typename internal::cleanup_index_type<FirstType>::type(f) + fix<1>()))) {
156 return seqN(
typename internal::cleanup_index_type<FirstType>::type(f),
157 (
typename internal::cleanup_index_type<LastType>::type(l) -
158 typename internal::cleanup_index_type<FirstType>::type(f) + fix<1>()));
161template <
typename FirstType,
typename LastType,
typename IncrType>
162auto seq(FirstType f, LastType l, IncrType incr)
163 ->
decltype(seqN(
typename internal::cleanup_index_type<FirstType>::type(f),
164 (
typename internal::cleanup_index_type<LastType>::type(l) -
165 typename internal::cleanup_index_type<FirstType>::type(f) +
166 typename internal::cleanup_seq_incr<IncrType>::type(incr)) /
167 typename internal::cleanup_seq_incr<IncrType>::type(incr),
168 typename internal::cleanup_seq_incr<IncrType>::type(incr))) {
169 typedef typename internal::cleanup_seq_incr<IncrType>::type CleanedIncrType;
170 return seqN(
typename internal::cleanup_index_type<FirstType>::type(f),
171 (
typename internal::cleanup_index_type<LastType>::type(l) -
172 typename internal::cleanup_index_type<FirstType>::type(f) + CleanedIncrType(incr)) /
173 CleanedIncrType(incr),
174 CleanedIncrType(incr));
179namespace placeholders {
187template <
typename SizeType,
typename IncrType>
188auto lastN(SizeType size, IncrType incr)
199template <
typename SizeType>
233using Eigen::placeholders::lastN;
Definition ArithmeticSequence.h:62
constexpr Index size() const
Definition ArithmeticSequence.h:75
constexpr Index operator[](Index i) const
Definition ArithmeticSequence.h:81
constexpr Index first() const
Definition ArithmeticSequence.h:78
static constexpr const last_t last
Definition IndexedViewHelper.h:48
static constexpr Eigen::internal::all_t all
Definition IndexedViewHelper.h:86
static constexpr auto lastp1
Definition IndexedViewHelper.h:68
Namespace containing all symbols from the Eigen library.
Definition Core:137
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
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:83