Traversal of CoDiPack expressions during compile time. More...
#include <compileTimeTraversalLogic.hpp>
Public Types | |
using | Impl = T_Impl |
See CompileTimeTraversalLogic. | |
using | ResultType = T_ResultType |
See CompileTimeTraversalLogic. | |
Static Public Member Functions | |
template<typename Node , typename... Args> | |
static ResultType constexpr | eval (Args &&... args) |
Start the evaluation of the logic on the given expression. | |
Interface definition | |
static ResultType constexpr | reduce (ResultType a, ResultType b) |
Reduction operation for the results of two links. | |
template<typename Node , typename... Args> | |
static ResultType constexpr | node (Args &&... args) |
Called for each node in the expression. | |
template<typename Node , typename... Args> | |
static ResultType constexpr | leaf (Args &&...) |
Called for all leaf nodes in the expression. | |
template<size_t ChildNumber, typename Child , typename Root , typename... Args> | |
static ResultType constexpr | link (Args &&... args) |
Called for all links in the expression. | |
Static Public Attributes | |
static ResultType constexpr | NeutralElement = {} |
Neutral element of the reduction. | |
Static Protected Member Functions | |
template<typename Node , typename... Args> | |
static ResultType constexpr | toLinks (Args &&... args) |
Helper method which calls forEachLinkConstExpr on the node. | |
template<typename Node , typename... Args> | |
static ResultType constexpr | toNode (Args &&... args) |
Helper method to distinguish between leaf nodes and normal nodes. | |
Traversal of CoDiPack expressions during compile time.
For a detailed explanation of the traversal structure please see Expression traversal.
All information must be provided as arguments and all computations must be constexpr.
T_ResultType | Type of the computed result. |
T_Impl | Class implementing this interface. |
|
inlinestaticconstexpr |
Called for all leaf nodes in the expression.
Must be a constexpr.
Default: Returns NeutralElement.
|
inlinestaticconstexpr |
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.
Must be a constexpr.
Default: Call the child node and forward all arguments.
|
inlinestaticconstexpr |
Called for each node in the expression.
Implementations can call the toLinks method in order to evaluate all links of the node.
Must be a constexpr.
Default: Call each link of the node and forward all arguments.
|
inlinestaticconstexpr |
Reduction operation for the results of two links.
Must be a constexpr.
Default: summation.