SUNphi  1.0
SUNphi::ScalarWrapper< _Fund, _Refs > Class Template Reference

#include <ScalarWrap.hpp>

Inheritance diagram for SUNphi::ScalarWrapper< _Fund, _Refs >:
SUNphi::BaseScalarWrapper SUNphi::NnarySmET< ScalarWrapper< _Fund, _Refs... > > SUNphi::SmET< ScalarWrapper< _Fund, _Refs... > > SUNphi::BaseNnarySmET SUNphi::BaseSmET SUNphi::BaseSmET

Public Types

using Tk = TensKind<>
 Empty TensorKind.
 
using Fund = _Fund
 Fundamental type.
 
using Refs = Tuple< _Refs... >
 
template<int I>
using Ref = TupleElementType< I, Tuple< _Refs... >>
 
using ScRef = RefIf< isLvalue< _Fund >, RemRef< Fund >>
 
using MergeableComps = IntSeq< 0 >
 

Public Member Functions

int compSize () const
 Returns the size of a component, which is always 1.
 
template<typename Tref >
bool isAliasing (const Tref &alias) const
 
template<typename Is >
decltype(auto) getMergedCompsView () const
 Returns a component-merged version. More...
 
template<typename... Ts>
decltype(auto) getMergedCompsView (Ts &&...ts)
 
decltype(auto) getMaximallyMergedCompsView ()
 
template<typename Oth >
ScalarWrapperoperator= (Oth &&oth)
 Assignement operator. More...
 
template<typename... Args>
auto & eval (Args &&...args) const
 Provides either the const or non-const evaluator. More...
 
template<typename... Ts>
decltype(auto) eval (Ts &&...ts)
 
template<typename T , typename = EnableIf<isSame<Unqualified<T>,Unqualified<_Fund>>>>
 ScalarWrapper (T &&val)
 Constructor taking universal reference.
 
ScalarWrapper< _Fund, _Refs... > & operator~ ()
 
const ScalarWrapper< _Fund, _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 T >
static decltype(auto) representativeFunction (T &&t)
 
template<typename Is , typename = EnableIf<isIntSeq<Is>>>
static constexpr void assertMergeableWith ()
 

Public Attributes

Tuple< Reference< _Refs >... > refs
 
ScRef scRef
 Provides a reference or a value, depending on _Fund.
 

Static Public Attributes

static constexpr int NSmET = 0
 
static constexpr bool isStoring = true
 
static constexpr bool isAssignable = isLvalue<_Fund> and (not isConst<_Fund>)
 

Detailed Description

template<typename _Fund, typename... _Refs>
class SUNphi::ScalarWrapper< _Fund, _Refs >

Class to hold a scalar promoting it into a SmET

Todo:
Check what happens if called with a SmET

Definition at line 23 of file ScalarWrap.hpp.

Member Typedef Documentation

template<typename _Fund , typename... _Refs>
using SUNphi::ScalarWrapper< _Fund, _Refs >::MergeableComps = IntSeq<0>

List of points where the TensKind can be split

Definition at line 67 of file ScalarWrap.hpp.

template<typename _Fund , typename... _Refs>
template<int I>
using SUNphi::ScalarWrapper< _Fund, _Refs >::Ref = TupleElementType<I,Tuple<_Refs...>>

Type of I-th SmET

Definition at line 44 of file ScalarWrap.hpp.

template<typename _Fund , typename... _Refs>
using SUNphi::ScalarWrapper< _Fund, _Refs >::Refs = Tuple<_Refs...>

Type of the binding references

Definition at line 44 of file ScalarWrap.hpp.

template<typename _Fund , typename... _Refs>
using SUNphi::ScalarWrapper< _Fund, _Refs >::ScRef = RefIf<isLvalue<_Fund>,RemRef<Fund>>

Type of the scalar ref, reference or not depending on _Fund

Todo:
explain

Definition at line 50 of file ScalarWrap.hpp.

Member Function Documentation

decltype(auto) SUNphi::NnarySmET< ScalarWrapper< _Fund, _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< ScalarWrapper< _Fund, _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 _Fund , typename... _Refs>
template<typename Is , typename = EnableIf<isIntSeq<Is>>>
static constexpr void SUNphi::ScalarWrapper< _Fund, _Refs >::assertMergeableWith ( )
inlinestatic

Assert that a given merging condition is valid

Definition at line 67 of file ScalarWrap.hpp.

template<typename _Fund , typename... _Refs>
template<typename... Args>
auto& SUNphi::ScalarWrapper< _Fund, _Refs >::eval ( Args &&...  args) const
inline

Provides either the const or non-const evaluator.

Arguments (need to be empty)

Definition at line 78 of file ScalarWrap.hpp.

template<typename _Fund , typename... _Refs>
template<typename... Ts>
decltype(auto) SUNphi::ScalarWrapper< _Fund, _Refs >::eval ( Ts &&...  ts)
inline

Overload the eval const method passing all args

Parameters
tsArguments

Definition at line 87 of file ScalarWrap.hpp.

decltype(auto) SUNphi::NnarySmET< ScalarWrapper< _Fund, _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< ScalarWrapper< _Fund, _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 _Fund , typename... _Refs>
decltype(auto) SUNphi::ScalarWrapper< _Fund, _Refs >::getMaximallyMergedCompsView ( )
inline

Returns the maximal possible merged comps view

Definition at line 67 of file ScalarWrap.hpp.

template<typename _Fund , typename... _Refs>
template<typename Is >
decltype(auto) SUNphi::ScalarWrapper< _Fund, _Refs >::getMergedCompsView ( ) const
inline

Returns a component-merged version.

Returns the ScalarWrap itself

Definition at line 64 of file ScalarWrap.hpp.

template<typename _Fund , typename... _Refs>
template<typename... Ts>
decltype(auto) SUNphi::ScalarWrapper< _Fund, _Refs >::getMergedCompsView ( Ts &&...  ts)
inline

Overload the getMergedCompsView const method passing all args

Parameters
tsArguments

Definition at line 64 of file ScalarWrap.hpp.

template<typename _Fund , typename... _Refs>
template<typename Tref >
bool SUNphi::ScalarWrapper< _Fund, _Refs >::isAliasing ( const Tref &  alias) const
inline

Check with storage

Definition at line 60 of file ScalarWrap.hpp.

decltype(auto) SUNphi::SmET< ScalarWrapper< _Fund, _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< ScalarWrapper< _Fund, _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 _Fund , typename... _Refs>
template<typename Oth >
ScalarWrapper& SUNphi::ScalarWrapper< _Fund, _Refs >::operator= ( Oth &&  oth)
inline

Assignement operator.

Parameters
othOther object

Definition at line 71 of file ScalarWrap.hpp.

ScalarWrapper< _Fund, _Refs... > & SUNphi::NnarySmET< ScalarWrapper< _Fund, _Refs... > >::operator~ ( )
inlineinherited

Cast operator to class T

Definition at line 46 of file NnarySmET.hpp.

const ScalarWrapper< _Fund, _Refs... > & SUNphi::NnarySmET< ScalarWrapper< _Fund, _Refs... > >::operator~ ( ) const
inlineinherited

Constant cast operator to class T

Definition at line 46 of file NnarySmET.hpp.

decltype(auto) SUNphi::NnarySmET< ScalarWrapper< _Fund, _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< ScalarWrapper< _Fund, _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 _Fund , typename... _Refs>
template<typename T >
static decltype(auto) SUNphi::ScalarWrapper< _Fund, _Refs >::representativeFunction ( T &&  t)
inlinestatic

Returns the argument

Parameters
tArgument

Definition at line 30 of file ScalarWrap.hpp.

Member Data Documentation

template<typename _Fund , typename... _Refs>
constexpr bool SUNphi::ScalarWrapper< _Fund, _Refs >::isAssignable = isLvalue<_Fund> and (not isConst<_Fund>)
static

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

The SmET is assignable if ref is

Definition at line 58 of file ScalarWrap.hpp.

template<typename _Fund , typename... _Refs>
constexpr bool SUNphi::ScalarWrapper< _Fund, _Refs >::isStoring = true
static

Returns whether this SmET is storing

This SmET is storing

Definition at line 56 of file ScalarWrap.hpp.

template<typename _Fund , typename... _Refs>
constexpr int SUNphi::ScalarWrapper< _Fund, _Refs >::NSmET = 0
static

Number or SmET to act upon

Definition at line 44 of file ScalarWrap.hpp.

template<typename _Fund , typename... _Refs>
Tuple<Reference<_Refs>...> SUNphi::ScalarWrapper< _Fund, _Refs >::refs

Reference to the 0 object

Definition at line 44 of file ScalarWrap.hpp.


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