SUNphi  1.0
SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs > Class Template Reference

#include <RelBind.hpp>

Inheritance diagram for SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >:
SUNphi::BaseRelBinder SUNphi::NnarySmET< RelBinder< _BoundType, _BoundToType, _Ad, _Refs... > > SUNphi::ConstrainAreSmETs< _Refs... > SUNphi::SmET< RelBinder< _BoundType, _BoundToType, _Ad, _Refs... > > SUNphi::BaseNnarySmET SUNphi::BaseSmET SUNphi::BaseSmET

Public Types

using Refs = Tuple< _Refs... >
 
template<int I>
using Ref = TupleElementType< I, Tuple< _Refs... >>
 
using NestedTk = typename RemRef< Ref< 0 >>::Tk
 Tens Kind of the bound type.
 
using NestedTypes = typename NestedTk::types
 Types of the tensor kind.
 
using BoundType = _BoundType
 Type to bind.
 
using BoundToType = _BoundToType
 Type to which to bind.
 
using Tk = typename NestedTk::template AllButType< BoundType >
 TensorKind of the bound expression.
 
using Fund = typename RemRef< Ref< 0 >>::Fund
 Fundamental type. More...
 
using ExtraDelims = IntSeq< extBoundToPos, extBoundToPos+1 >
 
using PosOfResTcsInRefsTk = PosOfTcsOfTkInListOfTks< Tk, typename RemRef< _Refs >::Tk... >
 
using PosOfResTcsPresInRefsTk = PosOfTcsOfTkPresInListOfTks< Tk, typename RemRef< _Refs >::Tk... >
 
using MergeableComps = NnarySmETCompsMergeability< Tuple< typename RemRef< _Refs >::MergeableComps... >, PosOfResTcsInRefsTk, ExtraDelims >
 

Public Member Functions

template<typename Tref >
bool isAliasing (const Tref &alias) const
 
template<typename TC , int I = 0>
int compSize () const
 
decltype(auto) getMaximallyMergedCompsView ()
 
template<typename Is >
decltype(auto) getMergedCompsView () const
 
template<typename... Ts>
decltype(auto) getMergedCompsView (Ts &&...ts)
 
template<typename... Args, typename Id , int... Head, int... Tail>
decltype(auto) relBinderInternalEval (IntSeq< Head... >, IntSeq< Tail... >, const Id &id, const Tuple< Args... > &targs) const
 
template<typename... Ts>
decltype(auto) relBinderInternalEval (Ts &&...ts)
 
template<typename... Args>
decltype(auto) eval (const Args &...args) const
 
template<typename... Ts>
decltype(auto) eval (Ts &&...ts)
 
template<typename Oth >
decltype(auto) operator= (Oth &&oth)
 
template<typename SMET , typename = EnableIf<isSame<Unqualified<SMET>,Unqualified<Ref<0>>>>>
 RelBinder (SMET &&smet, _Ad &&adapter)
 
 ~RelBinder ()
 Destructor.
 
RelBinder< _BoundType, _BoundToType, _Ad, _Refs... > & operator~ ()
 
const RelBinder< _BoundType, _BoundToType, _Ad, _Refs... > & operator~ () const
 
decltype(auto) _refEvalByCompsName (IntSeq< I >, IntSeq< Pos... >, Tp &&targs) const
 < Components to get More...
 
decltype(auto) _refEvalByCompsName (Ts &&...ts)
 
decltype(auto) refEvalByCompsName (Tp &&targs) const
 < Components to get More...
 
decltype(auto) refEvalByCompsName (Tp &&targs)
 
decltype(auto) evalThroughRepresentativeFunctionPassingCompsByName (IntSeq< I... >, const Args &...args) const
 < Components to get More...
 
decltype(auto) evalThroughRepresentativeFunctionPassingCompsByName (Ts &&...ts)
 
decltype(auto) operator() (Oth &&...oth)
 
decltype(auto) operator() (Oth &&...oth) const
 

Static Public Member Functions

template<typename Is , typename = EnableIf<isIntSeq<Is>>>
static constexpr void assertMergeableWith ()
 

Public Attributes

Tuple< Reference< _Refs >... > refs
 

Static Public Attributes

static constexpr int NSmET = 1
 
static constexpr bool isStoring = false
 
static constexpr bool isAssignable = Unqualified<Ref< 0 >>::isAssignable
 
static constexpr int extBoundToPos
 Position inside the external TensKind to which to bind. More...
 

Private Types

using absBinder = Binder< _BoundType, Ref< 0 >>
 Dummy type, in which the _BoundType is absolutely bound.
 

Private Attributes

AddPointerIfFunction< _Ad > adapter
 

Static Private Attributes

static constexpr int boundPos
 Position inside the reference of the TensKind got by the bounder. More...
 
static constexpr int boundToPos
 Position inside the reference of the TensKind to which to bind. More...
 

Detailed Description

template<typename _BoundType, typename _BoundToType, typename _Ad, typename... _Refs>
class SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >

Class to bind a component of a SmET

The first type is the bound (invisible) one, the second one is the free (visible) one

Definition at line 42 of file RelBind.hpp.

Member Typedef Documentation

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
using SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::ExtraDelims = IntSeq<extBoundToPos,extBoundToPos+1>

Additional delimiters

Definition at line 113 of file RelBind.hpp.

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
using SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::Fund = typename RemRef<Ref< 0 >>::Fund

Fundamental type.

Same Fund as Ref 0

Definition at line 98 of file RelBind.hpp.

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
using SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::MergeableComps = NnarySmETCompsMergeability< Tuple<typename RemRef<_Refs>::MergeableComps...>, PosOfResTcsInRefsTk, ExtraDelims>

List of points where the TensKind can be split

Using MergingDelimsForRefs and ExtraDelims to determine the mergability

Definition at line 117 of file RelBind.hpp.

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
using SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::PosOfResTcsInRefsTk = PosOfTcsOfTkInListOfTks<Tk,typename RemRef<_Refs>::Tk...>

Position of all the Result TensComp in each Refs Tk

Definition at line 115 of file RelBind.hpp.

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
using SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::PosOfResTcsPresInRefsTk = PosOfTcsOfTkPresInListOfTks<Tk,typename RemRef<_Refs>::Tk...>

Position of all the Result TensComp present in each Refs Tk

Definition at line 115 of file RelBind.hpp.

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
template<int I>
using SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::Ref = TupleElementType<I,Tuple<_Refs...>>

Type of I-th SmET

Definition at line 48 of file RelBind.hpp.

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
using SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::Refs = Tuple<_Refs...>

Type of the binding references

Definition at line 48 of file RelBind.hpp.

Constructor & Destructor Documentation

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
template<typename SMET , typename = EnableIf<isSame<Unqualified<SMET>,Unqualified<Ref<0>>>>>
SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::RelBinder ( SMET &&  smet,
_Ad &&  adapter 
)
inlineexplicit

Constructor taking a universal reference and the id

Todo:
add check on SMET
Parameters
smetReference to bind
adapterAdapting function

Definition at line 197 of file RelBind.hpp.

Member Function Documentation

decltype(auto) SUNphi::NnarySmET< RelBinder< _BoundType, _BoundToType, _Ad, _Refs... > >::_refEvalByCompsName ( IntSeq< I >  ,
IntSeq< Pos... >  ,
Tp &&  targs 
) const
inlineinherited

< Components to get

Evaluate the I-th reference, getting from the Tuple targs the element Pos

Internal implementation

Definition at line 54 of file NnarySmET.hpp.

decltype(auto) SUNphi::NnarySmET< RelBinder< _BoundType, _BoundToType, _Ad, _Refs... > >::_refEvalByCompsName ( Ts &&...  ts)
inlineinherited

Overload the _refEvalByCompsName const method passing all args

Parameters
tsArguments

Definition at line 61 of file NnarySmET.hpp.

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
template<typename Is , typename = EnableIf<isIntSeq<Is>>>
static constexpr void SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::assertMergeableWith ( )
inlinestatic

Assert that a given merging condition is valid

Definition at line 117 of file RelBind.hpp.

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
template<typename TC , int I = 0>
int SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::compSize ( ) const
inline

Returns the size in the first found ref

TensKind of the I-th SmET

Check if the TensKind contains the TensComp asked

Definition at line 107 of file RelBind.hpp.

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
template<typename... Args>
decltype(auto) SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::eval ( const Args &...  args) const
inline

Evaluator, external interface

Pass to the internal implementation the integer sequence needed to deal properly with the insertion of the arg in the correct position

Value of the boundTo component

Value of the bound component

Parameters
argsComponents to get

Definition at line 151 of file RelBind.hpp.

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
template<typename... Ts>
decltype(auto) SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::eval ( Ts &&...  ts)
inline

Overload the eval const method passing all args

Parameters
tsArguments

Definition at line 188 of file RelBind.hpp.

decltype(auto) SUNphi::NnarySmET< RelBinder< _BoundType, _BoundToType, _Ad, _Refs... > >::evalThroughRepresentativeFunctionPassingCompsByName ( IntSeq< I... >  ,
const Args &...  args 
) const
inlineinherited

< Components to get

Evaluate the result by calling a representative function

The result is obtained after splitting the components, identifying them trough the name of each TensComp

Definition at line 93 of file NnarySmET.hpp.

decltype(auto) SUNphi::NnarySmET< RelBinder< _BoundType, _BoundToType, _Ad, _Refs... > >::evalThroughRepresentativeFunctionPassingCompsByName ( Ts &&...  ts)
inlineinherited

Overload the evalThroughRepresentativeFunctionPassingCompsByName const method passing all args

Parameters
tsArguments

Definition at line 101 of file NnarySmET.hpp.

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
decltype(auto) SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::getMaximallyMergedCompsView ( )
inline

Returns the maximal possible merged comps view

Definition at line 117 of file RelBind.hpp.

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
template<typename Is >
decltype(auto) SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::getMergedCompsView ( ) const
inline

Insert the position of bound component shifting by 1 afterwards

Definition at line 120 of file RelBind.hpp.

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
template<typename... Ts>
decltype(auto) SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::getMergedCompsView ( Ts &&...  ts)
inline

Overload the getMergedCompsView const method passing all args

Parameters
tsArguments

Definition at line 120 of file RelBind.hpp.

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
template<typename Tref >
bool SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::isAliasing ( const Tref &  alias) const
inline

Forward aliasing check to the references

Definition at line 105 of file RelBind.hpp.

decltype(auto) SUNphi::SmET< RelBinder< _BoundType, _BoundToType, _Ad, _Refs... > >::operator() ( Oth &&...  oth)
inlineinherited

Implements the call operator via CRTP

Parameters
othOther quantit

Definition at line 289 of file BaseSmET.hpp.

decltype(auto) SUNphi::SmET< RelBinder< _BoundType, _BoundToType, _Ad, _Refs... > >::operator() ( Oth &&...  oth) const
inlineinherited

Implements the const call operator via CRTP

< Other quantit

Definition at line 290 of file BaseSmET.hpp.

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
template<typename Oth >
decltype(auto) SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::operator= ( Oth &&  oth)
inline

Assign from another object

Parameters
othOther object

Definition at line 190 of file RelBind.hpp.

const RelBinder< _BoundType, _BoundToType, _Ad, _Refs... > & SUNphi::NnarySmET< RelBinder< _BoundType, _BoundToType, _Ad, _Refs... > >::operator~ ( ) const
inlineinherited

Constant cast operator to class T

Definition at line 46 of file NnarySmET.hpp.

RelBinder< _BoundType, _BoundToType, _Ad, _Refs... > & SUNphi::NnarySmET< RelBinder< _BoundType, _BoundToType, _Ad, _Refs... > >::operator~ ( )
inlineinherited

Cast operator to class T

Definition at line 46 of file NnarySmET.hpp.

decltype(auto) SUNphi::NnarySmET< RelBinder< _BoundType, _BoundToType, _Ad, _Refs... > >::refEvalByCompsName ( Tp &&  targs) const
inlineinherited

< Components to get

Evaluate the I-th reference, getting from the Tuple targs the element Pos

External implementation, using PosOfResTcsPresInRefsTk to dispatch components

Position of TensComp of the reference Tk present in thr result

Definition at line 68 of file NnarySmET.hpp.

decltype(auto) SUNphi::NnarySmET< RelBinder< _BoundType, _BoundToType, _Ad, _Refs... > >::refEvalByCompsName ( Tp &&  targs)
inlineinherited

Evaluate the I-th reference, getting from the Tuple targs the element Pos

Non const version

Definition at line 82 of file NnarySmET.hpp.

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
template<typename... Args, typename Id , int... Head, int... Tail>
decltype(auto) SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::relBinderInternalEval ( IntSeq< Head... >  ,
IntSeq< Tail... >  ,
const Id &  id,
const Tuple< Args... > &  targs 
) const
inline

Evaluator for RelBinder

Internal Evaluator, inserting the id at the correct position in the list of args. Check on type B is omitted, as the function is called only from an already checked smet

Parameters
idComponent to insert
targsComponents to get

Definition at line 131 of file RelBind.hpp.

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
template<typename... Ts>
decltype(auto) SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::relBinderInternalEval ( Ts &&...  ts)
inline

Overload the relBinderInternalEval const method passing all args

Parameters
tsArguments

Definition at line 143 of file RelBind.hpp.

Member Data Documentation

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
AddPointerIfFunction<_Ad> SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::adapter
private

Adapter, used to remap the boundTo component

The pointer is needed to allow non-member function to be passed as adaptor, see: https://stackoverflow.com/questions/13233213/can-a-function-type-be-a-class-template-parameter

Definition at line 87 of file RelBind.hpp.

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
constexpr int SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::boundPos
staticprivate
Initial value:
=
posOfType<_BoundType,typename NestedTk::types>

Position inside the reference of the TensKind got by the bounder.

Definition at line 75 of file RelBind.hpp.

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
constexpr int SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::boundToPos
staticprivate
Initial value:
=
posOfType<_BoundToType,typename NestedTk::types>

Position inside the reference of the TensKind to which to bind.

Definition at line 79 of file RelBind.hpp.

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
constexpr int SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::extBoundToPos
static
Initial value:
=
posOfType<_BoundToType,typename Tk::types>

Position inside the external TensKind to which to bind.

Definition at line 110 of file RelBind.hpp.

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
constexpr bool SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::isAssignable = Unqualified<Ref< 0 >>::isAssignable
static

Returns whether this SmET can be the left hand of an assignement

As assignable as ref 0

Definition at line 103 of file RelBind.hpp.

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
constexpr bool SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::isStoring = false
static

Returns whether this SmET is storing

This SmET is not storing

Definition at line 101 of file RelBind.hpp.

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
constexpr int SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::NSmET = 1
static

Number or SmET to act upon

Definition at line 48 of file RelBind.hpp.

template<typename _BoundType , typename _BoundToType , typename _Ad , typename... _Refs>
Tuple<Reference<_Refs>...> SUNphi::RelBinder< _BoundType, _BoundToType, _Ad, _Refs >::refs

Reference to the 1 object

Definition at line 48 of file RelBind.hpp.


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