SUNphi  1.0
TensComp.hpp File Reference

Defines the Tensor Components. More...

Go to the source code of this file.

Classes

struct  SUNphi::BaseTensComp
 
struct  SUNphi::ConstrainAreTensComps< Args >
 
struct  SUNphi::TensComp< T, Size, MaxKnownSubMultiple >
 

Macros

#define DEFINE_TENS_COMP_CLASS(TYPE, N)
 Defines a TensComp, with name TYPE and max N. More...
 
#define DEFINE_TENS_COMP(BINDER, TYPE, CONST_NAME, HMANY)
 
#define DEFINE_RW_CN_TENS_COMP(BINDER, TYPE, CONST_NAME, HMANY)
 

Typedefs

template<typename T , typename Ret = void>
using SUNphi::EnableIfIsTensComp = EnableIf< isTensComp< T >,Ret >
 
template<typename T >
using SUNphi::ConstrainIsTensComp = ConstrainIsBaseOf< BaseTensComp,T >
 
template<typename T >
using SUNphi::ConstrainIsNotTensComp = ConstrainIsNotBaseOf< BaseTensComp,T >
 

Variables

template<typename T >
constexpr bool SUNphi::isTensComp = isBaseOf<BaseTensComp ,T>
 
constexpr int SUNphi::DYNAMIC =-1
 Constant used to instantiate a Dynamic-size TensComp.
 

Detailed Description

Defines the Tensor Components.

Definition in file TensComp.hpp.

Macro Definition Documentation

#define DEFINE_RW_CN_TENS_COMP (   BINDER,
  TYPE,
  CONST_NAME,
  HMANY 
)
Value:
\ \
constexpr const int N ## CONST_NAME=HMANY; \
MAYBE_UNUSED(N ## CONST_NAME); \
\
/* Defines the Row TYPE component */ \
DEFINE_TENS_COMP(rw ## TYPE,Rw ## TYPE,RW_ ## TYPE,N ## CONST_NAME); \
\
/* Defines the Column TYPE component */ \
DEFINE_TENS_COMP(cn ## TYPE,Cn ## TYPE,CN_ ## TYPE,N ## CONST_NAME); \
\
/* Makes the Row and Column TYPE component twinned */ \
DECLARE_TENS_COMPS_ARE_TWIN(Rw ## TYPE,Cn ## TYPE); \
\
/* Declares a row or column (aliasing) binder for type TYPE */ \
\ \
using TYPE=Cn ## TYPE; \ \
template<> \
struct TwinTensCompOf<TYPE> \
{ \ \
using Rw=Rw ## TYPE; \
\ \
using Cn=Cn ## TYPE; \
}
#define DEFINE_NAMED_RW_OR_COL_BINDER(TG,NAME)
Defines a Binder named NAME for type RwTG or CnTG.
Definition: Bind.hpp:34
#define MAYBE_UNUSED(A)
Suppress the "Unused Variable" warning at any scope.
Definition: Unused.hpp:23
#define DECLARE_TENS_COMPS_ARE_TWIN(T1, T2)
Declare a pair of TensComp twins one of the other.
Definition: TwinsComp.hpp:48
#define DEFINE_TENS_COMP(BINDER,TYPE,CONST_NAME,HMANY)
Definition: TensComp.hpp:73

Define row and TensComp named Rw/CnTYPE with maximal component N

Defines also a common binder-instantiator named BINDER, a TensKind suffixing TYPE with Kind, and a constat holding the maximal value, named NCONST_NAME

Definition at line 91 of file TensComp.hpp.

#define DEFINE_TENS_COMP (   BINDER,
  TYPE,
  CONST_NAME,
  HMANY 
)
Value:
\ \
constexpr const int N ## CONST_NAME=HMANY; \
MAYBE_UNUSED(N ## CONST_NAME); \
#define MAYBE_UNUSED(A)
Suppress the "Unused Variable" warning at any scope.
Definition: Unused.hpp:23
#define DEFINE_NAMED_BINDER(TG,NAME)
Defines a Binder named NAME for type TG.
Definition: Bind.hpp:23
#define DEFINE_TENS_COMP_CLASS(TYPE, N)
Defines a TensComp, with name TYPE and max N.
Definition: TensComp.hpp:61

Define a TensComp named TYPE with maximal component N

Defines also a binder-instantiator named BINDER, a TensKind suffixing TYPE with Kind, and a constat holding the maximal value, named NCONST_NAME

Definition at line 73 of file TensComp.hpp.

#define DEFINE_TENS_COMP_CLASS (   TYPE,
 
)
Value:
\
struct TYPE : public TensComp<TYPE,N> \
{ \
PROVIDE_NAME(#TYPE); \
}
#define PROVIDE_NAME(STR)
Provides a static name() method to a class, returning STR.
Definition: String.hpp:24

Defines a TensComp, with name TYPE and max N.

Definition at line 61 of file TensComp.hpp.

Typedef Documentation

template<typename T >
using SUNphi::ConstrainIsNotTensComp = typedef ConstrainIsNotBaseOf<BaseTensComp ,T>

Class forcing T not to inherits from BaseTensComp

Definition at line 20 of file TensComp.hpp.

template<typename T >
using SUNphi::ConstrainIsTensComp = typedef ConstrainIsBaseOf<BaseTensComp ,T>

Class forcing T to inherits from BaseTensComp

Definition at line 20 of file TensComp.hpp.

template<typename T , typename Ret = void>
using SUNphi::EnableIfIsTensComp = typedef EnableIf< isTensComp <T> ,Ret>

Provides the class itself if T is of the given type

Provides the class itself if T satisfies the condition

Definition at line 20 of file TensComp.hpp.

Variable Documentation

template<typename T >
constexpr bool SUNphi::isTensComp = isBaseOf<BaseTensComp ,T>

Expression which is true if T inherits from BaseTensComp

Definition at line 20 of file TensComp.hpp.