SUNphi  1.0
TensKind.hpp File Reference

Defines the Tensor Kind. More...

#include <array>
#include <ints/IntSeqInsert.hpp>
#include <metaprogramming/TypeTraits.hpp>
#include <tens/TensComp.hpp>
#include <tens/TwinsComp.hpp>
#include <tuple/Filter.hpp>
#include <tuple/TupleElements.hpp>
#include <tuple/TupleOrder.hpp>
#include <tuple/TupleTypeCat.hpp>

Go to the source code of this file.

Classes

struct  SUNphi::BaseTensKind
 Defines the BaseTensKind type traits. More...
 
struct  SUNphi::ConstrainAreTensKinds< Args >
 
struct  SUNphi::HasMember_compSize< Type >
 
struct  SUNphi::HasMember_compSize< Type >::Fallback
 
struct  SUNphi::HasMember_compSize< Type >::Derived
 
struct  SUNphi::HasMember_compSize< Type >::Check< U, U >
 
struct  SUNphi::ConstrainHasMember_compSize< T >
 Class forcing T to have a member "compSize" defined. More...
 
struct  SUNphi::ConstrainIsDynamic< Tc >
 Forces type Tc to be a dynamic TensComp. More...
 
struct  SUNphi::_TensKindFromTuple< TP, class >
 
struct  SUNphi::_TensKindFromTuple< Tuple< Tp... > >
 
class  SUNphi::TensKind< T >
 
struct  SUNphi::TensKind< T >::_firstVectorizingComp< F, Pos, InVectorizingSize, IsLastCheckable, NextPos, G, Size, OutVectorizingSize, EnoughToVectorize, CompIsVectorizing, FallBack >
 
struct  SUNphi::TensKind< T >::TensCompsListMerged< Is >
 
struct  SUNphi::TensKind< T >::TensCompsListMerged< IntSeq< IComps... > >
 Create a TensComp merging the components IComps. More...
 
struct  SUNphi::TensKind< T >::_Merged< Is, Ir >
 
struct  SUNphi::TensKind< T >::ConstrainIsValidCompMerge< Is >
 Helper to constrain the cast. More...
 
struct  SUNphi::TensKind< T >::_Merged< IntSeq< IDelims... >, IntSeq< IGroups... > >
 Struct used to merge the components of the TensKind. More...
 
class  SUNphi::TensKind< T >::_BlendWithTypes< Tp >
 
class  SUNphi::TensKind< T >::_BlendWithTypes< Tuple< Oths... > >
 
struct  SUNphi::_BlendTensKinds<... >
 
struct  SUNphi::_BlendTensKinds< Tk >
 
struct  SUNphi::_BlendTensKinds< Head1, Head2, Tail... >
 

Macros

#define STATIC_ASSERT_IS_DYNAMIC(TC)   static_assert(isDynamic<TC>,"Error, Tens Comp is not dynamic")
 

Typedefs

template<int N>
using SUNphi::DynSizes = std::array< int, N >
 
template<typename T , typename Ret = void>
using SUNphi::EnableIfIsTensKind = EnableIf< isTensKind< T >,Ret >
 
template<typename T >
using SUNphi::ConstrainIsTensKind = ConstrainIsBaseOf< BaseTensKind,T >
 
template<typename T >
using SUNphi::ConstrainIsNotTensKind = ConstrainIsNotBaseOf< BaseTensKind,T >
 
template<class TP , class = ConstrainIsTuple<TP>>
using SUNphi::TensKindFromTuple = typename _TensKindFromTuple< TP >::type
 
template<typename... Args>
using SUNphi::BlendTensKinds = typename _BlendTensKinds< Args... >::type
 
template<typename TkToSearch , typename... Tks>
using SUNphi::PosOfTcsOfTkInListOfTks = Tuple< PosOfTypesNotAsserting< typename TkToSearch::types, typename Tks::types >... >
 
template<typename TkToSearch , typename... Tks>
using SUNphi::PosOfTcsOfTkPresInListOfTks = Tuple< FilterVariadicClassPos< IsPresent, PosOfTypesNotAsserting< typename TkToSearch::types, typename Tks::types >>... >
 Position of all the present TensComp of TkToSearch in the list of Tks.
 

Functions

template<typename Type >
constexpr bool SUNphi::hasMember_compSizeHelper ()
 

Variables

template<typename T >
constexpr bool SUNphi::isTensKind = isBaseOf<BaseTensKind ,T>
 
template<typename Type >
constexpr bool SUNphi::hasMember_compSize = hasMember_compSizeHelper<RemRef<Type>>()
 
template<typename T >
static constexpr bool SUNphi::isDynamic
 Returns whether T is a dynamic component. More...
 

Detailed Description

Defines the Tensor Kind.

The tensor kind defines the list of components that form a tensor

Definition in file TensKind.hpp.

Macro Definition Documentation

#define STATIC_ASSERT_IS_DYNAMIC (   TC)    static_assert(isDynamic<TC>,"Error, Tens Comp is not dynamic")

Defines a TensKind type from a Tuple type Static assert if TC is not dynamic

Definition at line 66 of file TensKind.hpp.

Typedef Documentation

template<typename... Args>
using SUNphi::BlendTensKinds = typedef typename _BlendTensKinds<Args...>::type

Blend an arbitrary number of TensKind

Gives visibility to the internal implementation

Definition at line 465 of file TensKind.hpp.

template<typename T >
using SUNphi::ConstrainIsNotTensKind = typedef ConstrainIsNotBaseOf<BaseTensKind ,T>

Class forcing T not to inherits from BaseTensKind

Definition at line 38 of file TensKind.hpp.

template<typename T >
using SUNphi::ConstrainIsTensKind = typedef ConstrainIsBaseOf<BaseTensKind ,T>

Class forcing T to inherits from BaseTensKind

Definition at line 38 of file TensKind.hpp.

template<int N>
using SUNphi::DynSizes = typedef std::array<int,N>

Dynamic sizes of a Tens

Todo:
the array must be replaced with a tuple, whose types must be deduced when instatiating the struct, such that int or long int or whatever is appropriately used!

Dynamic sizes of a Tens

Todo:
the array must be replaced with a tuple, whose types must be deduced when instatiating the struct, such that int or long int or whatever is appropriately used!

Definition at line 35 of file TensKind.hpp.

template<typename T , typename Ret = void>
using SUNphi::EnableIfIsTensKind = typedef EnableIf< isTensKind <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 38 of file TensKind.hpp.

template<typename TkToSearch , typename... Tks>
using SUNphi::PosOfTcsOfTkInListOfTks = typedef Tuple<PosOfTypesNotAsserting<typename TkToSearch::types,typename Tks::types>...>

Position of all the TensComp of TkToSearch in the list of Tks

NOT_PRESENT is inserted in the absent positions

Definition at line 473 of file TensKind.hpp.

template<class TP , class = ConstrainIsTuple<TP>>
using SUNphi::TensKindFromTuple = typedef typename _TensKindFromTuple<TP>::type

Defines a variadic type TensKind taking the same types of a Tuple

Gives visibility to the internal implementation

Definition at line 76 of file TensKind.hpp.

Function Documentation

template<typename Type >
constexpr bool SUNphi::hasMember_compSizeHelper ( )

Intemediate function to distinguish the non-class case

Definition at line 56 of file TensKind.hpp.

Variable Documentation

template<typename Type >
constexpr bool SUNphi::hasMember_compSize = hasMember_compSizeHelper<RemRef<Type>>()

Detect if Type has member (variable or method) compSize

Uses SFINAE to induce ambiguity in the detection of the member

Definition at line 56 of file TensKind.hpp.

template<typename T >
constexpr bool SUNphi::isDynamic
static
Initial value:
=
T::isDynamic

Returns whether T is a dynamic component.

Definition at line 61 of file TensKind.hpp.

template<typename T >
constexpr bool SUNphi::isTensKind = isBaseOf<BaseTensKind ,T>

Expression which is true if T inherits from BaseTensKind

Definition at line 38 of file TensKind.hpp.