Eigen::internal::FixedInt< N > Class Template Reference

#include <IntegralConstant.h>

Public Member Functions

constexpr operator int () const
 
constexpr FixedInt ()=default
 
constexpr FixedInt (std::integral_constant< int, N >)
 
constexpr FixedInt (VariableAndFixedInt< N > other)
 
constexpr FixedInt<-Noperator- () const
 
template<int M>
constexpr FixedInt< N+Moperator+ (FixedInt< M >) const
 
template<int M>
constexpr FixedInt< N - Moperator- (FixedInt< M >) const
 
template<int M>
constexpr FixedInt< N *Moperator* (FixedInt< M >) const
 
template<int M>
constexpr FixedInt< N/Moperator/ (FixedInt< M >) const
 
template<int M>
constexpr FixedInt< N % Moperator% (FixedInt< M >) const
 
template<int M>
constexpr FixedInt< N|Moperator| (FixedInt< M >) const
 
template<int M>
constexpr FixedInt< N &Moperator& (FixedInt< M >) const
 
constexpr FixedInt operator() () const
 
constexpr VariableAndFixedInt< Noperator() (int val) const
 

Static Public Attributes

static constexpr int value = N
 

Detailed Description

template<int N>
class Eigen::internal::FixedInt< N >

This class embeds a compile-time integer N.

It is similar to c++11 std::integral_constant<int,N> but with some additional features such as:

  • implicit conversion to int
  • arithmetic and some bitwise operators: -, +, *, /, %, &, |
  • c++98/14 compatibility with fix<N> and fix<N>() syntax to define integral constants.

It is strongly discouraged to directly deal with this class FixedInt. Instances are expected to be created by the user using Eigen::fix<N> or Eigen::fix<N>().

where T can a FixedInt<N>, a pointer to function FixedInt<N> (*)(), or numerous other integer-like representations. DynamicKey is either Dynamic (default) or DynamicIndex and used to identify true compile-time values.

For convenience, you can extract the compile-time value N in a generic way using the following helper:

static const int value
Definition: IntegralConstant.h:156

that will give you N if T equals FixedInt<N> or FixedInt<N> (*)(), and DefaultVal if T does not embed any compile-time value (e.g., T==int).

See also
fix<N>, class VariableAndFixedInt

Constructor & Destructor Documentation

◆ FixedInt() [1/3]

template<int N>
constexpr Eigen::internal::FixedInt< N >::FixedInt ( )
constexprdefault

◆ FixedInt() [2/3]

template<int N>
constexpr Eigen::internal::FixedInt< N >::FixedInt ( std::integral_constant< int, N )
inlineconstexpr
61 {}

◆ FixedInt() [3/3]

template<int N>
constexpr Eigen::internal::FixedInt< N >::FixedInt ( VariableAndFixedInt< N other)
inlineconstexpr
63  {
64 #ifndef EIGEN_INTERNAL_DEBUGGING
65  EIGEN_UNUSED_VARIABLE(other);
66 #endif
67  eigen_internal_assert(int(other) == N);
68  }
#define eigen_internal_assert(x)
Definition: Macros.h:916
#define EIGEN_UNUSED_VARIABLE(var)
Definition: Macros.h:966
@ N
Definition: constructor.cpp:22

References eigen_internal_assert, EIGEN_UNUSED_VARIABLE, and N.

Member Function Documentation

◆ operator int()

template<int N>
constexpr Eigen::internal::FixedInt< N >::operator int ( ) const
inlineconstexpr
58 { return N; }

References N.

◆ operator%()

template<int N>
template<int M>
constexpr FixedInt<N % M> Eigen::internal::FixedInt< N >::operator% ( FixedInt< M ) const
inlineconstexpr
93  {
94  return FixedInt<N % M>();
95  }

◆ operator&()

template<int N>
template<int M>
constexpr FixedInt<N & M> Eigen::internal::FixedInt< N >::operator& ( FixedInt< M ) const
inlineconstexpr
103  {
104  return FixedInt<N & M>();
105  }

◆ operator()() [1/2]

template<int N>
constexpr FixedInt Eigen::internal::FixedInt< N >::operator() ( ) const
inlineconstexpr
108 { return *this; }

◆ operator()() [2/2]

template<int N>
constexpr VariableAndFixedInt<N> Eigen::internal::FixedInt< N >::operator() ( int  val) const
inlineconstexpr
110 { return VariableAndFixedInt<N>(val); }
val
Definition: calibrate.py:119

References calibrate::val.

◆ operator*()

template<int N>
template<int M>
constexpr FixedInt<N * M> Eigen::internal::FixedInt< N >::operator* ( FixedInt< M ) const
inlineconstexpr
83  {
84  return FixedInt<N * M>();
85  }

◆ operator+()

template<int N>
template<int M>
constexpr FixedInt<N + M> Eigen::internal::FixedInt< N >::operator+ ( FixedInt< M ) const
inlineconstexpr
73  {
74  return FixedInt<N + M>();
75  }

◆ operator-() [1/2]

template<int N>
constexpr FixedInt<-N> Eigen::internal::FixedInt< N >::operator- ( void  ) const
inlineconstexpr
70 { return FixedInt<-N>(); }
constexpr FixedInt()=default

References N.

◆ operator-() [2/2]

template<int N>
template<int M>
constexpr FixedInt<N - M> Eigen::internal::FixedInt< N >::operator- ( FixedInt< M ) const
inlineconstexpr
78  {
79  return FixedInt<N - M>();
80  }
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186

References N.

◆ operator/()

template<int N>
template<int M>
constexpr FixedInt<N / M> Eigen::internal::FixedInt< N >::operator/ ( FixedInt< M ) const
inlineconstexpr
88  {
89  return FixedInt<N / M>();
90  }

References N.

◆ operator|()

template<int N>
template<int M>
constexpr FixedInt<N | M> Eigen::internal::FixedInt< N >::operator| ( FixedInt< M ) const
inlineconstexpr
98  {
99  return FixedInt<N | M>();
100  }

Member Data Documentation

◆ value

template<int N>
constexpr int Eigen::internal::FixedInt< N >::value = N
staticconstexpr

The documentation for this class was generated from the following file: