39#include "expressionInterface.hpp"
40#include "logic/compileTimeTraversalLogic.hpp"
41#include "logic/nodeInterface.hpp"
42#include "logic/traversalLogic.hpp"
54 template<
typename T_Real>
63 template<
typename Arg>
69 template<
typename Arg>
82 template<
typename T_Real,
typename T_Arg,
template<
typename>
class T_Operation>
92 typename Arg::StoreAs
arg;
96 template<
typename RealArg>
112 template<
size_t argNumber>
114 return Operation::gradient(
arg.getValue(),
result);
125 template<
typename Logic,
typename... Args>
127 logic.
cast().template link<0>(
arg, *
this, std::forward<Args>(args)...);
131 template<
typename CompileTimeLogic,
typename... Args>
133 return CompileTimeLogic::template link<0, Arg, UnaryExpression>(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_T(...)
Abbreviation for CODI_TEMPLATE.
Definition macros.hpp:111
CoDiPack - Code Differentiation Package.
Definition codi.hpp:90
Base class for all CoDiPack expressions.
Definition expressionInterface.hpp:59
Impl const & cast() const
Cast to the implementation.
Definition expressionInterface.hpp:75
Traversal of CoDiPack expressions.
Definition traversalLogic.hpp:56
Impl & cast()
Cast to the implementation.
Definition traversalLogic.hpp:62
Represents an operator with one argument in the expression tree.
Definition unaryExpression.hpp:83
void forEachLink(TraversalLogic< Logic > &logic, Args &&... args) const
Definition unaryExpression.hpp:126
T_Arg Arg
See UnaryExpression.
Definition unaryExpression.hpp:87
Real getJacobian() const
Definition unaryExpression.hpp:113
T_Operation< Real > Operation
See UnaryExpression.
Definition unaryExpression.hpp:88
UnaryExpression(ExpressionInterface< RealArg, Arg > const &arg)
Constructor.
Definition unaryExpression.hpp:97
static CompileTimeLogic::ResultType constexpr forEachLinkConstExpr(Args &&... args)
Definition unaryExpression.hpp:132
static bool constexpr EndPoint
If this expression is handled as a leaf in the tree.
Definition unaryExpression.hpp:122
typename Arg::ActiveResult ActiveResult
See ExpressionInterface.
Definition unaryExpression.hpp:90
Arg::StoreAs arg
Argument of the expression.
Definition unaryExpression.hpp:92
Real result
Precomputed result.
Definition unaryExpression.hpp:93
Real const & getValue() const
Compute the primal value that is usually evaluated by the statement/expression.
Definition unaryExpression.hpp:107
T_Real Real
See UnaryExpression.
Definition unaryExpression.hpp:86
Interface for implementing the logic for a UnaryExpression.
Definition unaryExpression.hpp:55
static Real primal(Arg const &arg)
T_Real Real
See UnaryOperation.
Definition unaryExpression.hpp:58
static Real gradient(Arg const &arg, Real const &result)