10 #ifndef EIGEN_ARITHMETIC_SEQUENCE_H
11 #define EIGEN_ARITHMETIC_SEQUENCE_H
20 template<
typename T>
struct cleanup_seq_incr {
21 typedef typename cleanup_index_type<T,DynamicIndex>::type type;
30 template<
typename FirstType=Index,
typename SizeType=Index,
typename IncrType=
internal::FixedInt<1> >
31 class ArithmeticSequence;
33 template<
typename FirstType,
typename SizeType,
typename IncrType>
34 ArithmeticSequence<typename internal::cleanup_index_type<FirstType>::type,
35 typename internal::cleanup_index_type<SizeType>::type,
36 typename internal::cleanup_seq_incr<IncrType>::type >
58 template<
typename FirstType,
typename SizeType,
typename IncrType>
97 template<
typename FirstType,
typename SizeType,
typename IncrType>
98 ArithmeticSequence<typename internal::cleanup_index_type<FirstType>::type,
typename internal::cleanup_index_type<SizeType>::type,
typename internal::cleanup_seq_incr<IncrType>::type >
106 template<
typename FirstType,
typename SizeType>
107 ArithmeticSequence<typename internal::cleanup_index_type<FirstType>::type,
typename internal::cleanup_index_type<SizeType>::type >
112 #ifdef EIGEN_PARSED_BY_DOXYGEN
123 template<
typename FirstType,
typename LastType,
typename IncrType>
124 auto seq(FirstType f, LastType l, IncrType incr);
135 template<
typename FirstType,
typename LastType>
136 auto seq(FirstType f, LastType l);
140 template<
typename FirstType,
typename LastType>
141 auto seq(FirstType f, LastType l) -> decltype(
seqN(
typename internal::cleanup_index_type<FirstType>::type(f),
142 (
typename internal::cleanup_index_type<LastType>::type(l)
143 -
typename internal::cleanup_index_type<FirstType>::type(f)+fix<1>())))
145 return seqN(
typename internal::cleanup_index_type<FirstType>::type(f),
146 (
typename internal::cleanup_index_type<LastType>::type(l)
147 -
typename internal::cleanup_index_type<FirstType>::type(f)+fix<1>()));
150 template<
typename FirstType,
typename LastType,
typename IncrType>
151 auto seq(FirstType f, LastType l, IncrType incr)
152 -> decltype(
seqN(
typename internal::cleanup_index_type<FirstType>::type(f),
153 (
typename internal::cleanup_index_type<LastType>::type(l)
154 -
typename internal::cleanup_index_type<FirstType>::type(f)+
typename internal::cleanup_seq_incr<IncrType>::type(incr)
155 ) /
typename internal::cleanup_seq_incr<IncrType>::type(incr),
156 typename internal::cleanup_seq_incr<IncrType>::type(incr)))
158 typedef typename internal::cleanup_seq_incr<IncrType>::type CleanedIncrType;
159 return seqN(
typename internal::cleanup_index_type<FirstType>::type(f),
160 (
typename internal::cleanup_index_type<LastType>::type(l)
161 -
typename internal::cleanup_index_type<FirstType>::type(f)+CleanedIncrType(incr)) / CleanedIncrType(incr),
162 CleanedIncrType(incr));
168 namespace placeholders {
176 template<
typename SizeType,
typename IncrType>
189 template<
typename SizeType>
202 struct make_size_type {
203 typedef std::conditional_t<symbolic::is_symbolic<T>::value,
Index,
T> type;
206 template<
typename FirstType,
typename SizeType,
typename IncrType,
int XprSize>
207 struct IndexedViewCompatibleType<ArithmeticSequence<FirstType,SizeType,IncrType>, XprSize> {
208 typedef ArithmeticSequence<Index,typename make_size_type<SizeType>::type,IncrType> type;
211 template<
typename FirstType,
typename SizeType,
typename IncrType>
212 ArithmeticSequence<Index,typename make_size_type<SizeType>::type,IncrType>
218 template<
typename FirstType,
typename SizeType,
typename IncrType>
220 enum { value = get_fixed_value<IncrType,DynamicIndex>::value };
const SizeType & sizeObject() const
ArithmeticSequence(FirstType first, SizeType size, IncrType incr)
Index operator[](Index i) const
ArithmeticSequence(FirstType first, SizeType size)
auto reverse() const -> decltype(Eigen::seqN(m_first+(m_size+fix<-1 >()) *m_incr, m_size,-m_incr))
const FirstType & firstObject() const
const IncrType & incrObject() const
static const Eigen::internal::all_t all
Index eval_expr_given_size(Index x, Index)
EIGEN_CONSTEXPR Index first(const T &x) EIGEN_NOEXCEPT
ArithmeticSequence< Index, typename make_size_type< SizeType >::type, IncrType > makeIndexedViewCompatible(const ArithmeticSequence< FirstType, SizeType, IncrType > &ids, Index size, SpecializedType)
auto lastN(SizeType size, IncrType incr) -> decltype(seqN(Eigen::placeholders::last-(size-fix< 1 >()) *incr, size, incr))
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)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.