SUNphi  1.0
TwinsComp.hpp File Reference

Header file to define twins TensComp. More...

Go to the source code of this file.

Classes

struct  SUNphi::_TwinCompOf< T, class >
 
struct  SUNphi::TwinTensCompOf< T >
 

Macros

#define DECLARE_TENS_COMPS_ARE_TWIN(T1, T2)
 Declare a pair of TensComp twins one of the other. More...
 

Typedefs

template<class T , class = ConstrainIsTensComp<T>>
using SUNphi::TwinCompOf = typename _TwinCompOf< T >::type
 Specify the twin component of a given TensComp.
 
template<typename Tc , typename SMET , typename = ConstrainIsTensComp<Tc>, typename = ConstrainIsSmET<SMET>, typename TK = typename Unqualified<SMET>::Tk, typename TK_TYPES = typename TK::types, bool Has = tupleHasType<Tc,TK_TYPES>>
using SUNphi::CompOrTwinned = Conditional< Has, Tc, TwinCompOf< Tc >>
 If the TensComp TC is not present in the TensKind of SMET, returns the twin.
 
template<typename Is , typename Tp >
using SUNphi::InsertTrueTwinnedPosOfTuple = decltype(_InsertTrueTwinnedPosOfTuple< 0 >(Is{}, Tp{}))
 

Functions

template<int Pos, int... Ints, typename... T>
decltype(auto) SUNphi::_InsertTrueTwinnedPosOfTuple (IntSeq< Ints... > in, Tuple< T... > types)
 

Variables

template<class T , class = ConstrainIsTensComp<T>>
constexpr bool SUNphi::hasTwin
 

Detailed Description

Header file to define twins TensComp.

The twin component of a TensComp is another TensComp. A pair of TwinComp is used to distinguish row and column component of matrices.

Definition in file TwinsComp.hpp.

Macro Definition Documentation

#define DECLARE_TENS_COMPS_ARE_TWIN (   T1,
  T2 
)
Value:
\ \
template <> \
constexpr inline bool hasTwin<T1> = \
true; \
MAYBE_UNUSED(hasTwin<T1>); \
\ \
template <> \
constexpr inline bool hasTwin<T2> = \
true; \
MAYBE_UNUSED(hasTwin<T2>); \
\ \
template <> \
struct _TwinCompOf<T1> \
{ \ \
using type=ConstrainIsTensComp<T2>::type; \
}; \
\ \
template <> \
struct _TwinCompOf<T2> \
{ \ \
using type=ConstrainIsTensComp<T1>::type; \
}
#define MAYBE_UNUSED(A)
Suppress the "Unused Variable" warning at any scope.
Definition: Unused.hpp:23

Declare a pair of TensComp twins one of the other.

Definition at line 48 of file TwinsComp.hpp.

Typedef Documentation

template<typename Is , typename Tp >
using SUNphi::InsertTrueTwinnedPosOfTuple = typedef decltype(_InsertTrueTwinnedPosOfTuple<0>(Is{},Tp{}))

Insert in the IntSeq the position of all true twinned types

A true twinned type is a type for which the twin is different from itself, and is present in the list

Definition at line 151 of file TwinsComp.hpp.

Function Documentation

template<int Pos, int... Ints, typename... T>
decltype(auto) SUNphi::_InsertTrueTwinnedPosOfTuple ( IntSeq< Ints... >  in,
Tuple< T... >  types 
)

Insert in the IntSeq the position of all true twinned types

Internal implementation

Parameters
inInput IntSeq
typesInput types

Definition at line 96 of file TwinsComp.hpp.

Variable Documentation

template<class T , class = ConstrainIsTensComp<T>>
constexpr bool SUNphi::hasTwin
inline
Initial value:
=
false

Determine if the TensComp has a twin

Default for a generic TensComp: false

Definition at line 27 of file TwinsComp.hpp.