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

Represents an operator with two arguments in the expression tree. More...

#include <binaryExpression.hpp>

Inheritance diagram for codi::BinaryExpression< T_Real, T_ArgA, T_ArgB, T_Operation >:

Public Types

using ArgA = T_ArgA
 See BinaryExpression.
 
using ArgB = T_ArgB
 See BinaryExpression.
 
using Operation = T_Operation< Real >
 See BinaryExpression.
 
using Real = T_Real
 See BinaryExpression.
 
- Public Types inherited from codi::ExpressionInterface< T_Real, BinaryExpression< T_Real, T_ArgA, T_ArgB, T_Operation > >
using ActiveResult = void
 Type into which the expression can be converted. Usually also the type from which it is constructed.
 
using Impl = BinaryExpression< T_Real, T_ArgA, T_ArgB, 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 RealA , typename RealB >
 BinaryExpression (ExpressionInterface< RealA, ArgA > const &argA, ExpressionInterface< RealB, ArgB > const &argB)
 Constructor.
 
- Public Member Functions inherited from codi::ExpressionInterface< T_Real, BinaryExpression< T_Real, T_ArgA, T_ArgB, 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

ArgA::StoreAs argA
 First argument of the expression.
 
ArgB::StoreAs argB
 Second argument of the expression.
 
Real result
 Precomputed result.
 

Implementation of ExpressionInterface

using StoreAs = BinaryExpression
 " Defines how this expression is stored in an expression tree. "
 
using ActiveResult = typename ExpressionTraits::ValidateResult< typename ArgA::ActiveResult, typename ArgB::ActiveResult >::ActiveResult
 Type into which the expression can be converted. Usually also the type from which it is constructed.
 
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_ArgA, typename T_ArgB, template< typename > class T_Operation>
struct codi::BinaryExpression< T_Real, T_ArgA, T_ArgB, T_Operation >

Represents an operator with two arguments 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_ArgAThe ExpressionInterface type of the first argument.
T_ArgBThe ExpressionInterface type of the second argument.
T_OperationThe logic for computing the primal value and Jacobians. Must implement BinaryOperation.

Member Typedef Documentation

◆ ActiveResult

template<typename T_Real , typename T_ArgA , typename T_ArgB , template< typename > class T_Operation>
using codi::BinaryExpression< T_Real, T_ArgA, T_ArgB, T_Operation >::ActiveResult = typename ExpressionTraits::ValidateResult<typename ArgA::ActiveResult, typename ArgB::ActiveResult>:: ActiveResult

Type into which the expression can be converted. Usually also the type from which it is constructed.

◆ StoreAs

template<typename T_Real , typename T_ArgA , typename T_ArgB , template< typename > class T_Operation>
using codi::BinaryExpression< T_Real, T_ArgA, T_ArgB, T_Operation >::StoreAs = BinaryExpression

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

" "

Member Function Documentation

◆ forEachLink()

template<typename T_Real , typename T_ArgA , typename T_ArgB , template< typename > class T_Operation>
template<typename Logic , typename... Args>
void codi::BinaryExpression< T_Real, T_ArgA, T_ArgB, 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_ArgA , typename T_ArgB , template< typename > class T_Operation>
template<typename CompileTimeLogic , typename... Args>
static CompileTimeLogic::ResultType constexpr codi::BinaryExpression< T_Real, T_ArgA, T_ArgB, 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_ArgA , typename T_ArgB , template< typename > class T_Operation>
template<size_t argNumber>
Real codi::BinaryExpression< T_Real, T_ArgA, T_ArgB, 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_ArgA , typename T_ArgB , template< typename > class T_Operation>
Real const & codi::BinaryExpression< T_Real, T_ArgA, T_ArgB, 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_ArgA , typename T_ArgB , template< typename > class T_Operation>
bool constexpr codi::BinaryExpression< T_Real, T_ArgA, T_ArgB, 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: