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

#include <IntegralConstant.h>

Public Member Functions

 operator int () const
 
 VariableAndFixedInt (int val)
 

Static Public Attributes

static const int value = N
 

Protected Attributes

int m_value
 

Detailed Description

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

This class embeds both a compile-time integer N and a runtime integer. Both values are supposed to be equal unless the compile-time value N has a special value meaning that the runtime-value should be used. Depending on the context, this special value can be either Eigen::Dynamic (for positive quantities) or Eigen::DynamicIndex (for quantities that can be negative).

It is the return-type of the function Eigen::fix<N>(int), and most of the time this is the only way it is used. It is strongly discouraged to directly deal with instances of VariableAndFixedInt. Indeed, in order to write generic code, it is the responsibility of the callee to properly convert it to either a true compile-time quantity (i.e. a FixedInt<N>), or to a runtime quantity (e.g., an Index) using the following generic helper:

where T can be a template instantiation of VariableAndFixedInt 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 also extract the compile-time value N using the following helper:

static const int value
Definition: IntegralConstant.h:156

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

See also
fix<N>(int), class FixedInt

Constructor & Destructor Documentation

◆ VariableAndFixedInt()

template<int N>
Eigen::internal::VariableAndFixedInt< N >::VariableAndFixedInt ( int  val)
inline
148 { m_value = val; }
int m_value
Definition: IntegralConstant.h:151
val
Definition: calibrate.py:119

References Eigen::internal::VariableAndFixedInt< N >::m_value, and calibrate::val.

Member Function Documentation

◆ operator int()

template<int N>
Eigen::internal::VariableAndFixedInt< N >::operator int ( ) const
inline

Member Data Documentation

◆ m_value

◆ value

template<int N>
const int Eigen::internal::VariableAndFixedInt< N >::value = N
static

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