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

Unary minus. More...

#include <CompileTimeDerivatives.h>

Inheritance diagram for CompileTimeDerivatives::CTUnaryMinus< T >:
[legend]

Public Types

typedef T::ResultType ResultType
 

Public Member Functions

 CTUnaryMinus (T arg)
 
ResultType operator() () const
 
std::string print () const
 
template<CTTag dtag>
auto D () const
 
template<typename Self >
std::string printParens (const Self *, const std::string &op) const
 

Static Public Member Functions

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

Protected Attributes

const T _arg
 

Detailed Description

template<typename T>
class CompileTimeDerivatives::CTUnaryMinus< T >

Unary minus.

Definition at line 162 of file CompileTimeDerivatives.h.

Member Typedef Documentation

◆ ResultType

template<typename T>
typedef T::ResultType CompileTimeDerivatives::CTUnary< T >::ResultType
inherited

Definition at line 152 of file CompileTimeDerivatives.h.

Constructor & Destructor Documentation

◆ CTUnaryMinus()

template<typename T >
CompileTimeDerivatives::CTUnaryMinus< T >::CTUnaryMinus ( arg)
inline

Definition at line 165 of file CompileTimeDerivatives.h.

165 : CTUnary<T>(arg) {}

Member Function Documentation

◆ D()

template<typename T >
template<CTTag dtag>
auto CompileTimeDerivatives::CTUnaryMinus< T >::D ( ) const
inline

Definition at line 173 of file CompileTimeDerivatives.h.

174  {
175  return -_arg.template D<dtag>();
176  }
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template D< dtag >()/_arg) CT_SIMPLE_UNARY_FUNCTION(sin

◆ 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<typename T >
ResultType CompileTimeDerivatives::CTUnaryMinus< T >::operator() ( ) const
inline

Definition at line 168 of file CompileTimeDerivatives.h.

168 { return -_arg(); }

◆ precedence()

template<typename T >
static constexpr int CompileTimeDerivatives::CTUnaryMinus< T >::precedence ( )
inlinestatic

Definition at line 170 of file CompileTimeDerivatives.h.

170 { return 3; }

◆ print()

template<typename T >
std::string CompileTimeDerivatives::CTUnaryMinus< T >::print ( ) const
inline

Definition at line 169 of file CompileTimeDerivatives.h.

169 { return this->printParens(this, "-"); }
std::string printParens(const Self *, const std::string &op) const

◆ printParens()

template<typename T>
template<typename Self >
std::string CompileTimeDerivatives::CTUnary< T >::printParens ( const Self *  ,
const std::string &  op 
) const
inlineinherited

Definition at line 141 of file CompileTimeDerivatives.h.

Referenced by CompileTimeDerivatives::CTUnaryMinus< T >::print().

142  {
143  std::string out = op;
144  if constexpr (T::precedence() > Self::precedence())
145  out += "(" + _arg.print() + ")";
146  else
147  out += _arg.print();
148 
149  return out;
150  }
OStreamProxy out

Member Data Documentation

◆ _arg

template<typename T>
const T CompileTimeDerivatives::CTUnary< T >::_arg
protectedinherited

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