11 #ifndef EIGEN_INTEGRAL_CONSTANT_H
12 #define EIGEN_INTEGRAL_CONSTANT_H
18 template<
int N>
class FixedInt;
19 template<
int N>
class VariableAndFixedInt;
54 static const int value = N;
55 operator int()
const {
return value; }
58 #ifndef EIGEN_INTERNAL_DEBUGGING
59 EIGEN_UNUSED_VARIABLE(other);
61 eigen_internal_assert(
int(other)==N);
82 FixedInt operator() ()
const {
return *
this; }
90 FixedInt(std::integral_constant<int,N>) {}
126 static const int value = N;
127 operator int()
const {
return m_value; }
134 static const int value = Default;
138 static const int value = N;
143 static const int value = N;
148 static const int value = N ;
151 template<
typename T,
int N,
int Default>
153 static const int value = N;
156 template<
typename T> EIGEN_DEVICE_FUNC
Index get_runtime_value(
const T &x) {
return x; }
158 template<
int N> EIGEN_DEVICE_FUNC
Index get_runtime_value(FixedInt<N> (*)()) {
return N; }
164 template<
typename T,
int DynamicKey=Dynamic,
typename EnableIf=
void>
struct cleanup_index_type {
typedef T type; };
185 #ifndef EIGEN_PARSED_BY_DOXYGEN
189 static const internal::FixedInt<N> fix{};
192 inline internal::FixedInt<N> fix() {
return internal::FixedInt<N>(); }
196 template<
int N,
typename T>
197 inline internal::VariableAndFixedInt<N> fix(T val) {
return internal::VariableAndFixedInt<N>(internal::convert_index<int>(val)); }
200 #else // EIGEN_PARSED_BY_DOXYGEN
235 static const auto fix();
266 static const auto fix(
int val);
268 #endif // EIGEN_PARSED_BY_DOXYGEN
272 #endif // EIGEN_INTEGRAL_CONSTANT_H