41#include "nodeInterface.hpp"
56 template<
typename T_ResultType,
typename T_Impl>
68 template<
typename Node,
typename... Args>
70 return toNode<Node>(std::forward<Args>(args)...);
97 template<
typename Node,
typename... Args>
100 return toLinks<Node>(std::forward<Args>(args)...);
110 template<
typename Node,
typename... Args>
113 return Impl::NeutralElement;
125 template<
size_t ChildNumber,
typename Child,
typename Root,
typename... Args>
128 return toNode<Child>(std::forward<Args>(args)...);
135#ifndef DOXYGEN_DISABLE
136 template<
typename TraversalImpl,
bool endPo
int = false>
139 template<
typename Node,
typename... Args>
140 CODI_INLINE static ResultType
constexpr call(Args&&... args) {
141 return TraversalImpl::template node<Node>(std::forward<Args>(args)...);
145 template<
typename TraversalImpl>
146 struct CallSwitch<TraversalImpl, true> {
148 template<
typename Node,
typename... Args>
149 CODI_INLINE static ResultType
constexpr call(Args&&... args) {
150 return TraversalImpl::template leaf<Node>(std::forward<Args>(args)...);
156 template<
typename Node,
typename... Args>
158 return CallSwitch<Impl, Node::EndPoint>::template call<Node>(std::forward<Args>(args)...);
162 template<
typename Node,
typename... Args>
164 return Node::template forEachLinkConstExpr<Impl>(std::forward<Args>(args)...);
#define CODI_INLINE
See codi::Config::ForcedInlines.
Definition config.h:457
#define CODI_DD(Type, Default)
Abbreviation for CODI_DECLARE_DEFAULT.
Definition macros.hpp:94
#define CODI_UNUSED_ARG(arg)
Used in a constexpr context, where using CODI_UNUSED spoils the constexpr.
Definition macros.hpp:49
CoDiPack - Code Differentiation Package.
Definition codi.hpp:91
Traversal of CoDiPack expressions during compile time.
Definition compileTimeTraversalLogic.hpp:57
static ResultType constexpr NeutralElement
Neutral element of the reduction.
Definition compileTimeTraversalLogic.hpp:63
static ResultType constexpr link(Args &&... args)
Called for all links in the expression.
Definition compileTimeTraversalLogic.hpp:126
static ResultType constexpr toLinks(Args &&... args)
Helper method which calls forEachLinkConstExpr on the node.
Definition compileTimeTraversalLogic.hpp:163
T_Impl Impl
See CompileTimeTraversalLogic.
Definition compileTimeTraversalLogic.hpp:61
static ResultType constexpr reduce(ResultType a, ResultType b)
Reduction operation for the results of two links.
Definition compileTimeTraversalLogic.hpp:84
T_ResultType ResultType
See CompileTimeTraversalLogic.
Definition compileTimeTraversalLogic.hpp:60
static ResultType constexpr leaf(Args &&...)
Called for all leaf nodes in the expression.
Definition compileTimeTraversalLogic.hpp:111
static ResultType constexpr eval(Args &&... args)
Start the evaluation of the logic on the given expression.
Definition compileTimeTraversalLogic.hpp:69
static ResultType constexpr toNode(Args &&... args)
Helper method to distinguish between leaf nodes and normal nodes.
Definition compileTimeTraversalLogic.hpp:157
static ResultType constexpr node(Args &&... args)
Called for each node in the expression.
Definition compileTimeTraversalLogic.hpp:98