CoDiPack  2.2.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
codi::UnaryExpression< T_Real, T_Arg, T_Operation > Struct Template Reference

Represents an operator with one argument in the expression tree. More...

#include <unaryExpression.hpp>

Inheritance diagram for codi::UnaryExpression< T_Real, T_Arg, T_Operation >:

Public Types

using ActiveResult = typename Arg::ActiveResult
 See ExpressionInterface.
 
using Arg = T_Arg
 See UnaryExpression.
 
using Operation = T_Operation< Real >
 See UnaryExpression.
 
using Real = T_Real
 See UnaryExpression.
 
- Public Types inherited from codi::ExpressionInterface< T_Real, UnaryExpression< T_Real, T_Arg, T_Operation > >
using ActiveResult = void
 Type into which the expression can be converted. Usually also the type from which it is constructed.
 
using Impl = UnaryExpression< T_Real, T_Arg, T_Operation >
 See ExpressionInterface.
 
using Real = T_Real
 See ExpressionInterface.
 
using StoreAs = ExpressionInterface
 Defines how this expression is stored in an expression tree.
 
- Public Types inherited from codi::NodeInterface< T_Impl >
using Impl = T_Impl
 See NodeInterface.
 

Public Member Functions

template<typename RealArg >
 UnaryExpression (ExpressionInterface< RealArg, Arg > const &arg)
 Constructor.
 
- Public Member Functions inherited from codi::ExpressionInterface< T_Real, UnaryExpression< T_Real, T_Arg, T_Operation > >
Impl const & cast () const
 Cast to the implementation.
 
 ExpressionInterface ()=default
 Constructor.
 
 ExpressionInterface (ExpressionInterface const &)=default
 Constructor.
 
Real const getValue () const
 Compute the primal value that is usually evaluated by the statement/expression.
 
Real getJacobian () const
 
- Public Member Functions inherited from codi::NodeInterface< T_Impl >
Impl const & cast () const
 Cast to the implementation.
 
template<typename Logic , typename... Args>
void forEachLink (TraversalLogic< Logic > &logic, Args &&... args) const
 

Public Attributes

Arg::StoreAs arg
 Argument of the expression.
 
Real result
 Precomputed result.
 

Implementation of ExpressionInterface

using StoreAs = UnaryExpression
 " Defines how this expression is stored in an expression tree. "
 
Real const & getValue () const
 Compute the primal value that is usually evaluated by the statement/expression.
 
template<size_t argNumber>
Real getJacobian () const
 

Implementation of NodeInterface

static bool constexpr EndPoint = false
 If this expression is handled as a leaf in the tree.
 
template<typename Logic , typename... Args>
void forEachLink (TraversalLogic< Logic > &logic, Args &&... args) const
 
template<typename CompileTimeLogic , typename... Args>
static CompileTimeLogic::ResultType constexpr forEachLinkConstExpr (Args &&... args)
 

Additional Inherited Members

- Static Public Member Functions inherited from codi::NodeInterface< T_Impl >
template<typename Logic , typename... Args>
static Logic::ResultType constexpr forEachLinkConstExpr (Args &&... args)
 
- Static Public Attributes inherited from codi::NodeInterface< T_Impl >
static bool constexpr EndPoint = false
 If this expression is handled as a leaf in the tree.
 

Detailed Description

template<typename T_Real, typename T_Arg, template< typename > class T_Operation>
struct codi::UnaryExpression< T_Real, T_Arg, T_Operation >

Represents an operator with one argument in the expression tree.

See Expression design documentation for details about the expression system in CoDiPack.

Template Parameters
T_RealOriginal primal value of the statement/expression.
T_ArgThe ExpressionInterface type of the argument.
T_OperationThe logic for computing the primal value and Jacobian. Must implement UnaryOperation.

Member Typedef Documentation

◆ StoreAs

template<typename T_Real , typename T_Arg , template< typename > class T_Operation>
using codi::UnaryExpression< T_Real, T_Arg, T_Operation >::StoreAs = UnaryExpression

" Defines how this expression is stored in an expression tree. "

" "

Member Function Documentation

◆ forEachLink()

template<typename T_Real , typename T_Arg , template< typename > class T_Operation>
template<typename Logic , typename... Args>
void codi::UnaryExpression< T_Real, T_Arg, T_Operation >::forEachLink ( TraversalLogic< Logic > &  logic,
Args &&...  args 
) const
inline

Call the link method of the given logic for all arguments (links) of this node (not to be confused with args). Pass args to each call.

◆ forEachLinkConstExpr()

template<typename T_Real , typename T_Arg , template< typename > class T_Operation>
template<typename CompileTimeLogic , typename... Args>
static CompileTimeLogic::ResultType constexpr codi::UnaryExpression< T_Real, T_Arg, T_Operation >::forEachLinkConstExpr ( Args &&...  args)
inlinestaticconstexpr

Call the link method of the given logic for all arguments (links) of this node (not to be confused with args). Pass args to each call.

◆ getJacobian()

template<typename T_Real , typename T_Arg , template< typename > class T_Operation>
template<size_t argNumber>
Real codi::UnaryExpression< T_Real, T_Arg, T_Operation >::getJacobian ( ) const
inline

Get the Jacobian with respect to the given argument.

This is just the local Jacobian and not the one for the whole expression tree.

◆ getValue()

template<typename T_Real , typename T_Arg , template< typename > class T_Operation>
Real const & codi::UnaryExpression< T_Real, T_Arg, T_Operation >::getValue ( ) const
inline

Compute the primal value that is usually evaluated by the statement/expression.

Member Data Documentation

◆ EndPoint

template<typename T_Real , typename T_Arg , template< typename > class T_Operation>
bool constexpr codi::UnaryExpression< T_Real, T_Arg, T_Operation >::EndPoint = false
staticconstexpr

If this expression is handled as a leaf in the tree.


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