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>
85 template<
typename T_Real,
typename T_Arg,
template<
typename>
class T_Operation>
95 typename Arg::StoreAs
arg;
99 template<
typename RealArg>
115 template<
size_t argNumber>
117 return Operation::gradient(
arg.getValue(),
result);
128 template<
typename Logic,
typename... Args>
130 logic.
cast().template link<0>(
arg, *
this, std::forward<Args>(args)...);
135 return Operation::getMathRep();
139 template<
typename CompileTimeLogic,
typename... Args>
141 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:91
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:86
std::string getMathRep() const
Get the math symbol of the unary operation. E.g. sin() for functions.
Definition unaryExpression.hpp:134
void forEachLink(TraversalLogic< Logic > &logic, Args &&... args) const
Definition unaryExpression.hpp:129
T_Arg Arg
See UnaryExpression.
Definition unaryExpression.hpp:90
Real getJacobian() const
Definition unaryExpression.hpp:116
T_Operation< Real > Operation
See UnaryExpression.
Definition unaryExpression.hpp:91
UnaryExpression(ExpressionInterface< RealArg, Arg > const &arg)
Constructor.
Definition unaryExpression.hpp:100
static CompileTimeLogic::ResultType constexpr forEachLinkConstExpr(Args &&... args)
Definition unaryExpression.hpp:140
static bool constexpr EndPoint
If this expression is handled as a leaf in the tree.
Definition unaryExpression.hpp:125
typename Arg::ActiveResult ActiveResult
See ExpressionInterface.
Definition unaryExpression.hpp:93
Arg::StoreAs arg
Argument of the expression.
Definition unaryExpression.hpp:95
Real result
Precomputed result.
Definition unaryExpression.hpp:96
Real const & getValue() const
Compute the primal value that is usually evaluated by the statement/expression.
Definition unaryExpression.hpp:110
T_Real Real
See UnaryExpression.
Definition unaryExpression.hpp:89
Interface for implementing the logic for a UnaryExpression.
Definition unaryExpression.hpp:55
static Real primal(Arg const &arg)
static std::string getMathRep()
Get the math symbol of the unary operation. E.g. sin() for functions.
T_Real Real
See UnaryOperation.
Definition unaryExpression.hpp:58
static Real gradient(Arg const &arg, Real const &result)