CoDiPack  2.2.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
codi::TraversalLogic< T_Impl > Struct Template Reference

Traversal of CoDiPack expressions. More...

#include <traversalLogic.hpp>

Inheritance diagram for codi::TraversalLogic< T_Impl >:

Public Types

using Impl = T_Impl
 See TraversalLogic.
 

Public Member Functions

Implcast ()
 Cast to the implementation.
 
template<typename Node , typename... Args>
void eval (NodeInterface< Node > const &node, Args &&... args)
 Start the evaluation of the logic on the given expression.
 
Interface definition
template<typename Node , typename... Args>
void node (Node const &node, Args &&... args)
 Called for each node in the expression.
 
template<typename Node , typename... Args>
void leaf (Node const &node, Args &&... args)
 Called for all leaf nodes in the expression.
 
template<size_t ChildNumber, typename Child , typename Root , typename... Args>
void link (Child const &child, Root const &root, Args &&... args)
 Called for all links in the expression.
 

Protected Member Functions

template<typename Node , typename... Args>
void toLinks (Node const &node, Args &&... args)
 Helper method which calls forEachLink on the node.
 
template<typename Node , typename... Args>
void toNode (Node const &node, Args &&... args)
 Helper method to distinguish between leaf nodes and normal nodes.
 

Detailed Description

template<typename T_Impl>
struct codi::TraversalLogic< T_Impl >

Traversal of CoDiPack expressions.

For a detailed explanation of the traversal structure please see Expression traversal.

Implementing classes can have members which store information required for the traversal.

Template Parameters
T_ImplClass implementing this interface.

Member Function Documentation

◆ leaf()

template<typename T_Impl >
template<typename Node , typename... Args>
void codi::TraversalLogic< T_Impl >::leaf ( Node const & node,
Args &&... args )
inline

Called for all leaf nodes in the expression.

Default: Does nothing.

◆ link()

template<typename T_Impl >
template<size_t ChildNumber, typename Child , typename Root , typename... Args>
void codi::TraversalLogic< T_Impl >::link ( Child const & child,
Root const & root,
Args &&... args )
inline

Called for all links in the expression.

Implementations can call the toNode method in order to evaluate either leaf or node depending on the child.

Default: Call the child node and forward all arguments.

◆ node()

template<typename T_Impl >
template<typename Node , typename... Args>
void codi::TraversalLogic< T_Impl >::node ( Node const & node,
Args &&... args )
inline

Called for each node in the expression.

Implementations can call the toLinks method in order to evaluate all links of the node.

Default: Call each link of the node and forward all arguments.


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