11#ifndef EIGEN_INDEXED_VIEW_HELPER_H
12#define EIGEN_INDEXED_VIEW_HELPER_H
17struct symbolic_last_tag {};
52#ifdef EIGEN_PARSED_BY_DOXYGEN
57static const symbolic::AddExpr<symbolic::SymbolExpr<internal::symbolic_last_tag>,symbolic::ValueExpr<Eigen::internal::FixedInt<1> > >
lastp1(last+fix<1>());
66FixedInt<N> eval_expr_given_size(FixedInt<N> x,
Index ) {
return x; }
68template<
typename Derived>
69Index eval_expr_given_size(
const symbolic::BaseExpr<Derived> &x,
Index size)
71 return x.derived().eval(
last=size-1);
75template<
typename T,
typename EnableIf =
void>
struct get_compile_time_incr {
81EIGEN_CONSTEXPR
Index first(
const T& x) EIGEN_NOEXCEPT {
return x.first(); }
85template<
typename T,
int XprSize,
typename EnableIf=
void>
86struct IndexedViewCompatibleType {
90template<
typename T,
typename Q>
91const T& makeIndexedViewCompatible(
const T& x,
Index , Q) {
return x; }
101 SingleRange(
Index val) : m_value(val) {}
102 Index operator[](
Index)
const {
return m_value; }
103 static EIGEN_CONSTEXPR
Index size() EIGEN_NOEXCEPT {
return 1; }
104 Index first() const EIGEN_NOEXCEPT {
return m_value; }
108template<>
struct get_compile_time_incr<SingleRange> {
113template<
typename T,
int XprSize>
114struct IndexedViewCompatibleType<T,XprSize,typename internal::enable_if<internal::is_integral<T>::value>::type> {
118 typedef SingleRange type;
121template<
typename T,
int XprSize>
122struct IndexedViewCompatibleType<T, XprSize, typename enable_if<symbolic::is_symbolic<T>::value>::type> {
123 typedef SingleRange type;
128typename enable_if<symbolic::is_symbolic<T>::value,SingleRange>::type
129makeIndexedViewCompatible(
const T&
id,
Index size, SpecializedType) {
130 return eval_expr_given_size(
id,size);
137struct all_t { all_t() {} };
142 enum { SizeAtCompileTime = XprSize };
143 AllRange(
Index size = XprSize) : m_size(size) {}
144 EIGEN_CONSTEXPR
Index operator[](
Index i)
const EIGEN_NOEXCEPT {
return i; }
145 EIGEN_CONSTEXPR
Index size() const EIGEN_NOEXCEPT {
return m_size.value(); }
146 EIGEN_CONSTEXPR
Index first() const EIGEN_NOEXCEPT {
return 0; }
147 variable_if_dynamic<Index,XprSize> m_size;
151struct IndexedViewCompatibleType<all_t,XprSize> {
152 typedef AllRange<XprSize> type;
155template<
typename XprSizeType>
156inline AllRange<get_fixed_value<XprSizeType>::value> makeIndexedViewCompatible(all_t , XprSizeType size, SpecializedType) {
157 return AllRange<get_fixed_value<XprSizeType>::value>(size);
160template<
int Size>
struct get_compile_time_incr<AllRange<Size> > {
171static const Eigen::internal::all_t
all;
174namespace placeholders {
176 typedef symbolic::AddExpr<symbolic::SymbolExpr<internal::symbolic_last_tag>,symbolic::ValueExpr<Eigen::internal::FixedInt<1> > > end_t;
177 typedef Eigen::internal::all_t all_t;
Definition: SymbolicIndex.h:214
static const symbolic::SymbolExpr< internal::symbolic_last_tag > last
Definition: IndexedViewHelper.h:38
static const auto lastp1
Definition: IndexedViewHelper.h:53
static const Eigen::internal::all_t all
Definition: IndexedViewHelper.h:171
Namespace containing all symbols from the Eigen library.
Definition: Core:141
const int UndefinedIncr
Definition: Constants.h:31
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74