https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
CompileTimeDerivatives::CTArrayRef< tag, T, I > Class Template Reference

Array variable value, referencing an entry in an indexable container of T types. More...

#include <CompileTimeDerivatives.h>

Inheritance diagram for CompileTimeDerivatives::CTArrayRef< tag, T, I >:
[legend]

Public Types

typedef CTCleanType< decltype((static_cast< T >0))[0])> ResultType
 

Public Member Functions

 CTArrayRef (const T &arr, const I &idx)
 
auto operator() () const
 
std::string print () const
 
template<CTTag dtag>
auto D () const
 

Static Public Member Functions

static constexpr int precedence ()
 precedence should reflect C++ operator precedence exactly (higher is binding tighter) More...
 
static constexpr bool leftAssociative ()
 left/right associative property should reflect C++ operator properties exactly More...
 

Protected Attributes

const T & _arr
 
const I & _idx
 

Detailed Description

template<CTTag tag, typename T, typename I>
class CompileTimeDerivatives::CTArrayRef< tag, T, I >

Array variable value, referencing an entry in an indexable container of T types.

The index of type I is also stored as a reference. This object is tagged with a CTTag to enable taking symbolic derivatives.

Definition at line 399 of file CompileTimeDerivatives.h.

Member Typedef Documentation

◆ ResultType

template<CTTag tag, typename T, typename I>
typedef CTCleanType<decltype((static_cast<T>0))[0])> CompileTimeDerivatives::CTArrayRef< tag, T, I >::ResultType

Definition at line 416 of file CompileTimeDerivatives.h.

Constructor & Destructor Documentation

◆ CTArrayRef()

template<CTTag tag, typename T, typename I>
CompileTimeDerivatives::CTArrayRef< tag, T, I >::CTArrayRef ( const T &  arr,
const I &  idx 
)
inline

Member Function Documentation

◆ D()

template<CTTag tag, typename T, typename I>
template<CTTag dtag>
auto CompileTimeDerivatives::CTArrayRef< tag, T, I >::D ( ) const
inline

Definition at line 407 of file CompileTimeDerivatives.h.

408  {
409  if constexpr (tag == dtag)
410  return CTOne<ResultType>();
411  else
412  return CTNull<ResultType>();
413  }

◆ leftAssociative()

static constexpr bool CompileTimeDerivatives::CTBase::leftAssociative ( )
inlinestaticinherited

left/right associative property should reflect C++ operator properties exactly

Definition at line 31 of file CompileTimeDerivatives.h.

31 { return false; }

◆ operator()()

template<CTTag tag, typename T, typename I>
auto CompileTimeDerivatives::CTArrayRef< tag, T, I >::operator() ( ) const
inline

◆ precedence()

static constexpr int CompileTimeDerivatives::CTBase::precedence ( )
inlinestaticinherited

precedence should reflect C++ operator precedence exactly (higher is binding tighter)

Definition at line 29 of file CompileTimeDerivatives.h.

29 { return 0; }

◆ print()

template<CTTag tag, typename T, typename I>
std::string CompileTimeDerivatives::CTArrayRef< tag, T, I >::print ( ) const
inline

Definition at line 404 of file CompileTimeDerivatives.h.

404 { return "[a" + printTag<tag>() + "[" + Moose::stringify(_idx) + "]]"; }
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:64

Member Data Documentation

◆ _arr

template<CTTag tag, typename T, typename I>
const T& CompileTimeDerivatives::CTArrayRef< tag, T, I >::_arr
protected

◆ _idx

template<CTTag tag, typename T, typename I>
const I& CompileTimeDerivatives::CTArrayRef< tag, T, I >::_idx
protected

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