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

Represents constant values in the expression tree. More...

#include <constantExpression.hpp>

Inheritance diagram for codi::ConstantExpression< T_Real, T_ConversionOperator >:

Public Types

template<typename T >
using ConversionOperator = T_ConversionOperator< T >
 See ConstantExpression.
 
using Real = T_Real
 See ConstantExpression.
 
- Public Types inherited from codi::ExpressionInterface< T_Real, T_Impl >
using ActiveResult = void
 Type into which the expression can be converted. Usually also the type from which it is constructed.
 
using Impl = T_Impl
 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

 ConstantExpression (Real const &v)
 Constructor.
 
- Public Member Functions inherited from codi::ExpressionInterface< T_Real, T_Impl >
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.
 
template<size_t argNumber>
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
 

Implementation of ExpressionInterface

using StoreAs = ConstantExpression
 " Defines how this expression is stored in an expression tree. "
 
using ActiveResult = void
 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 = true
 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 Logic , typename... Args>
static Logic::ResultType constexpr forEachLinkConstExpr (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, template< typename > class T_ConversionOperator = ConstantDataConversion>
struct codi::ConstantExpression< T_Real, T_ConversionOperator >

Represents constant values in the expression tree.

All values that are not a CoDiPack type are considered constant, for example values like 4.0 or double a.

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

Template Parameters
T_RealOriginal primal value of the statement/expression.
T_ConversionOperatorFunctions for the conversion of the constant data for primal value tape stores.

Member Typedef Documentation

◆ ActiveResult

template<typename T_Real , template< typename > class T_ConversionOperator = ConstantDataConversion>
using codi::ConstantExpression< T_Real, T_ConversionOperator >::ActiveResult = void

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

◆ StoreAs

template<typename T_Real , template< typename > class T_ConversionOperator = ConstantDataConversion>
using codi::ConstantExpression< T_Real, T_ConversionOperator >::StoreAs = ConstantExpression

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

" "

Member Function Documentation

◆ forEachLink()

template<typename T_Real , template< typename > class T_ConversionOperator = ConstantDataConversion>
template<typename Logic , typename... Args>
void codi::ConstantExpression< T_Real, T_ConversionOperator >::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 , template< typename > class T_ConversionOperator = ConstantDataConversion>
template<typename Logic , typename... Args>
static Logic::ResultType constexpr codi::ConstantExpression< T_Real, T_ConversionOperator >::forEachLinkConstExpr ( 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 , template< typename > class T_ConversionOperator = ConstantDataConversion>
template<size_t argNumber>
Real codi::ConstantExpression< T_Real, T_ConversionOperator >::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 , template< typename > class T_ConversionOperator = ConstantDataConversion>
Real const & codi::ConstantExpression< T_Real, T_ConversionOperator >::getValue ( ) const
inline

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

Member Data Documentation

◆ EndPoint

template<typename T_Real , template< typename > class T_ConversionOperator = ConstantDataConversion>
bool constexpr codi::ConstantExpression< T_Real, T_ConversionOperator >::EndPoint = true
staticconstexpr

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


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