SUNphi  1.0
SUNphi::TensKind< T > Class Template Reference

#include <TensKind.hpp>

Inheritance diagram for SUNphi::TensKind< T >:
SUNphi::BaseTensKind

Classes

class  _BlendWithTypes
 
class  _BlendWithTypes< Tuple< Oths... > >
 
struct  _firstVectorizingComp
 
struct  _Merged
 
struct  _Merged< IntSeq< IDelims... >, IntSeq< IGroups... > >
 Struct used to merge the components of the TensKind. More...
 
struct  ConstrainIsValidCompMerge
 Helper to constrain the cast. More...
 
struct  TensCompsListMerged
 
struct  TensCompsListMerged< IntSeq< IComps... > >
 Create a TensComp merging the components IComps. More...
 

Public Types

using DynCompsPos = decltype(_DynCompsPos< 0 >(intSeq<>))
 Position of dynamical components.
 
typedef Tuple< T... > types
 Tuple containing all types.
 
template<typename Tab >
using AllButType = TensKindFromTuple< decltype(getAllButType< Tab >(types{}))>
 Get all types but one.
 
using Twinned = TensKind< TwinCompOf< T >... >
 Get the twinned (transposed) type.
 
using IsMatrixComp = IntSeq<(hasTwin< T > and tupleHasType< T, typename Twinned::types >)... >
 Reports through an IntSeq whether a component is Matricial or not.
 
template<typename Is >
using InsertTrueTwinnedPos = InsertTrueTwinnedPosOfTuple< Is, types >
 Insert in the IntSeq Is the points where true twinned types are present.
 
using IsDiagComp = IntSeq<((not tupleHasType< T, typename Twinned::types >) or posOfTypeNotAsserting< T, typename Twinned::types > >=posOfType< T, types >)... >
 Report which components are needed to represent the Diagonal.
 
using DiagCompsPos = FilterVariadicClassPos< IsNotNull, IsDiagComp >
 Position of Diagonal components.
 
using Diag = TensKindFromTuple< decltype(getIndexed(DiagCompsPos{}, types{}))>
 TensKind corresponding to the types of the diagonal.
 
template<typename Is >
using Merged = typename _Merged< Is, IntsUpTo< Is::size-1 >>::type
 Merged components according to IntSeq Is.
 
template<typename OthTk , typename = ConstrainIsTensKind<OthTk>>
using BlendWithTensKind = typename _BlendWithTypes< typename OthTk::types >::type
 

Static Public Member Functions

static constexpr const char * name ()
 Name of the Tk provided with "name()" suffix.
 

Static Public Attributes

static constexpr int nDynamic
 Number of dynamical components. More...
 
static constexpr bool isFullyStatic
 Check if the type is fully static. More...
 
static constexpr int nTypes
 Number of types of the kind. More...
 
template<typename Oth , typename = ConstrainIsTensKind<Oth>>
static constexpr bool contains
 Check that another TensKind is contained. More...
 
template<typename TC , typename = ConstrainIsTensComp<TC>, typename = ConstrainIsDynamic<TC>>
static constexpr TypeIf< isTensComp< TC > and isDynamic< TC >, int > dynCompPos
 Returns the position of a dynamical size. More...
 
template<typename F >
static constexpr int firstVectorizingComp
 
static constexpr int maxStaticIdx
 Maximal value of the index, restricted to the statical components. More...
 
template<int... Ints>
static constexpr int tensCompsListTotMaxKnownSubMultiple
 Maximal total submultiple of a list of components. More...
 
template<int... Ints>
static constexpr int tensCompsListTotSize
 
template<typename Is >
static constexpr bool isValidCompMerge
 Determines whether an IntSeq is a valid CastMerge type for the TensKind. More...
 

Private Types

typedef IntSeq<(T::size==DYNAMIC)... > AreDynamic
 Check that all types are different. More...
 

Static Private Member Functions

template<int NScanned, int... CompsPos>
static decltype(auto) constexpr _DynCompsPos (const IntSeq< CompsPos... > &)
 

Detailed Description

template<class... T>
class SUNphi::TensKind< T >

Tensor Kind used to define the structure of a tensor

The tensor kind defines the list of components of a tensor. It is used to the define the underlying set of components of a TensorStorage, or the returned type of a SmET

Definition at line 84 of file TensKind.hpp.

Member Typedef Documentation

template<class... T>
typedef IntSeq<(T::size==DYNAMIC)...> SUNphi::TensKind< T >::AreDynamic
private

Check that all types are different.

An integer sequence defining whether the types are dynamic or not

Definition at line 87 of file TensKind.hpp.

template<class... T>
template<typename OthTk , typename = ConstrainIsTensKind<OthTk>>
using SUNphi::TensKind< T >::BlendWithTensKind = typename _BlendWithTypes<typename OthTk::types>::type

Blend the TensKind with another one

The TensComp already present are not appended. Example:

using MyTk1=TensKind<RwCol,Spin>;
using MyTk2=TensKind<RwCol,CnCol>;
using MyTkBRes=typename MyTk1::BlendWithTensKind<MyTk2>;
// same asTensKind<RwCol,Spin,CnCol>

Definition at line 418 of file TensKind.hpp.

Member Function Documentation

template<class... T>
template<int NScanned, int... CompsPos>
static decltype(auto) constexpr SUNphi::TensKind< T >::_DynCompsPos ( const IntSeq< CompsPos... > &  )
inlinestaticprivate

Position of dynamical components

Internal implementation

Definition at line 100 of file TensKind.hpp.

Member Data Documentation

template<class... T>
template<typename Oth , typename = ConstrainIsTensKind<Oth>>
constexpr bool SUNphi::TensKind< T >::contains
static
Initial value:
=
tupleHasTypes<typename Oth::types,types>

Check that another TensKind is contained.

Definition at line 144 of file TensKind.hpp.

template<class... T>
template<typename TC , typename = ConstrainIsTensComp<TC>, typename = ConstrainIsDynamic<TC>>
constexpr TypeIf<isTensComp<TC> and isDynamic<TC>,int> SUNphi::TensKind< T >::dynCompPos
static
Initial value:
=
AreDynamic::template hSumFirst<posOfType<TC,types>>

Returns the position of a dynamical size.

Definition at line 152 of file TensKind.hpp.

template<class... T>
template<typename F >
constexpr int SUNphi::TensKind< T >::firstVectorizingComp
static
Initial value:

Return the position of the first component needed to vectorize

If no factorization is possible, returns -1

Todo:
Add the possibility that the accumulated size is more than needed, so we can split the outermost component to allow for other kind of optimization
Todo:
Include a variation of the vectorization according to the kind of SIMD vector

Definition at line 211 of file TensKind.hpp.

template<class... T>
constexpr bool SUNphi::TensKind< T >::isFullyStatic
static
Initial value:
=
(nDynamic==0)

Check if the type is fully static.

Definition at line 131 of file TensKind.hpp.

template<class... T>
template<typename Is >
constexpr bool SUNphi::TensKind< T >::isValidCompMerge
static
Initial value:
=
isOrderedIntSeq<Is> and
(Is::template element<0> ==0) and
(Is::last == nTypes)

Determines whether an IntSeq is a valid CastMerge type for the TensKind.

Definition at line 314 of file TensKind.hpp.

template<class... T>
constexpr int SUNphi::TensKind< T >::maxStaticIdx
static
Initial value:
=
IntSeq<(T::size>=0 ? T::size : 1)...>::hMul

Maximal value of the index, restricted to the statical components.

Definition at line 246 of file TensKind.hpp.

template<class... T>
constexpr int SUNphi::TensKind< T >::nDynamic
static
Initial value:

Number of dynamical components.

Definition at line 127 of file TensKind.hpp.

template<class... T>
constexpr int SUNphi::TensKind< T >::nTypes
static
Initial value:
=
sizeof...(T)

Number of types of the kind.

Definition at line 138 of file TensKind.hpp.

template<class... T>
template<int... Ints>
constexpr int SUNphi::TensKind< T >::tensCompsListTotMaxKnownSubMultiple
static
Initial value:
=
IntSeq<TupleElementType<Ints,types>::maxKnownSubMultiple...>::hMul

Maximal total submultiple of a list of components.

Definition at line 253 of file TensKind.hpp.

template<class... T>
template<int... Ints>
constexpr int SUNphi::TensKind< T >::tensCompsListTotSize
static
Initial value:
=
(TupleElementType<Ints,types>::isDynamic | ...) ? DYNAMIC :

Total size of a list of components

If any component is dynamic, returns DYNAMIC, otherwise the product

Definition at line 260 of file TensKind.hpp.


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