Warning, file /include/Rivet/Math/eigen3/src/Core/util/IndexedViewHelper.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef EIGEN_INDEXED_VIEW_HELPER_H
0012 #define EIGEN_INDEXED_VIEW_HELPER_H
0013
0014 namespace RivetEigen {
0015
0016 namespace internal {
0017 struct symbolic_last_tag {};
0018 }
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038 static const symbolic::SymbolExpr<internal::symbolic_last_tag> last;
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052 #ifdef EIGEN_PARSED_BY_DOXYGEN
0053 static const auto lastp1 = last+fix<1>;
0054 #else
0055
0056
0057 static const symbolic::AddExpr<symbolic::SymbolExpr<internal::symbolic_last_tag>,symbolic::ValueExpr<RivetEigen::internal::FixedInt<1> > > lastp1(last+fix<1>());
0058 #endif
0059
0060 namespace internal {
0061
0062
0063 inline Index eval_expr_given_size(Index x, Index ) { return x; }
0064
0065 template<int N>
0066 FixedInt<N> eval_expr_given_size(FixedInt<N> x, Index ) { return x; }
0067
0068 template<typename Derived>
0069 Index eval_expr_given_size(const symbolic::BaseExpr<Derived> &x, Index size)
0070 {
0071 return x.derived().eval(last=size-1);
0072 }
0073
0074
0075 template<typename T, typename EnableIf = void> struct get_compile_time_incr {
0076 enum { value = UndefinedIncr };
0077 };
0078
0079
0080 template<typename T>
0081 EIGEN_CONSTEXPR Index first(const T& x) EIGEN_NOEXCEPT { return x.first(); }
0082
0083
0084
0085 template<typename T,int XprSize,typename EnableIf=void>
0086 struct IndexedViewCompatibleType {
0087 typedef T type;
0088 };
0089
0090 template<typename T,typename Q>
0091 const T& makeIndexedViewCompatible(const T& x, Index , Q) { return x; }
0092
0093
0094
0095
0096
0097 struct SingleRange {
0098 enum {
0099 SizeAtCompileTime = 1
0100 };
0101 SingleRange(Index val) : m_value(val) {}
0102 Index operator[](Index) const { return m_value; }
0103 static EIGEN_CONSTEXPR Index size() EIGEN_NOEXCEPT { return 1; }
0104 Index first() const EIGEN_NOEXCEPT { return m_value; }
0105 Index m_value;
0106 };
0107
0108 template<> struct get_compile_time_incr<SingleRange> {
0109 enum { value = 1 };
0110 };
0111
0112
0113 template<typename T, int XprSize>
0114 struct IndexedViewCompatibleType<T,XprSize,typename internal::enable_if<internal::is_integral<T>::value>::type> {
0115
0116
0117
0118 typedef SingleRange type;
0119 };
0120
0121 template<typename T, int XprSize>
0122 struct IndexedViewCompatibleType<T, XprSize, typename enable_if<symbolic::is_symbolic<T>::value>::type> {
0123 typedef SingleRange type;
0124 };
0125
0126
0127 template<typename T>
0128 typename enable_if<symbolic::is_symbolic<T>::value,SingleRange>::type
0129 makeIndexedViewCompatible(const T& id, Index size, SpecializedType) {
0130 return eval_expr_given_size(id,size);
0131 }
0132
0133
0134
0135
0136
0137 struct all_t { all_t() {} };
0138
0139
0140 template<int XprSize>
0141 struct AllRange {
0142 enum { SizeAtCompileTime = XprSize };
0143 AllRange(Index size = XprSize) : m_size(size) {}
0144 EIGEN_CONSTEXPR Index operator[](Index i) const EIGEN_NOEXCEPT { return i; }
0145 EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT { return m_size.value(); }
0146 EIGEN_CONSTEXPR Index first() const EIGEN_NOEXCEPT { return 0; }
0147 variable_if_dynamic<Index,XprSize> m_size;
0148 };
0149
0150 template<int XprSize>
0151 struct IndexedViewCompatibleType<all_t,XprSize> {
0152 typedef AllRange<XprSize> type;
0153 };
0154
0155 template<typename XprSizeType>
0156 inline AllRange<get_fixed_value<XprSizeType>::value> makeIndexedViewCompatible(all_t , XprSizeType size, SpecializedType) {
0157 return AllRange<get_fixed_value<XprSizeType>::value>(size);
0158 }
0159
0160 template<int Size> struct get_compile_time_incr<AllRange<Size> > {
0161 enum { value = 1 };
0162 };
0163
0164 }
0165
0166
0167
0168
0169
0170
0171 static const RivetEigen::internal::all_t all;
0172
0173
0174 namespace placeholders {
0175 typedef symbolic::SymbolExpr<internal::symbolic_last_tag> last_t;
0176 typedef symbolic::AddExpr<symbolic::SymbolExpr<internal::symbolic_last_tag>,symbolic::ValueExpr<RivetEigen::internal::FixedInt<1> > > end_t;
0177 typedef RivetEigen::internal::all_t all_t;
0178
0179 EIGEN_DEPRECATED static const all_t all = RivetEigen::all;
0180 EIGEN_DEPRECATED static const last_t last = RivetEigen::last;
0181 EIGEN_DEPRECATED static const end_t end = RivetEigen::lastp1;
0182 }
0183
0184 }
0185
0186 #endif