40#include "../expressions/logic/compileTimeTraversalLogic.hpp"
42#include "misc/enableIfHelpers.hpp"
47 template<
typename T_Real,
typename T_Impl>
50 template<
typename T_Real,
typename T_Gradient,
typename T_Tape,
typename T_Impl>
53 template<
typename T_Real,
template<
typename>
class T_ConversionOperator>
56 template<
typename T_Tape>
60 template<
typename T_Real,
typename>
77 template<
typename... Logic>
81 template<
typename Logic>
90 template<
typename LogicA,
typename LogicB>
93 static bool constexpr isAVoid = std::is_same<void, LogicA>::value;
94 static bool constexpr isBVoid = std::is_same<void, LogicB>::value;
95 static bool constexpr isBothVoid = isAVoid & isBVoid;
96 static bool constexpr isBothSame = std::is_same<LogicA, LogicB>::value;
99 CODI_STATIC_ASSERT((!isBothVoid) & (!isAVoid | !isBVoid | isBothSame),
"AD logic types need to be the same.");
104 using ADLogic =
typename std::conditional<isBVoid, LogicA, LogicB>::type;
108 template<
typename LogicA,
typename... LogicOther>
118 template<
typename... Results>
126 template<
typename T_Real,
typename T_Tape,
bool T_isStatic = false,
typename =
void>
136 template<
typename Real,
typename Tape,
bool isStatic = false>
145 template<
typename Expr,
typename =
void>
148#ifndef DOXYGEN_DISABLE
149 template<
typename Expr>
155 template<
typename Expr>
159 template<
typename Expr,
typename T =
void>
163 template<
typename Expr,
typename =
void>
166#ifndef DOXYGEN_DISABLE
167 template<
typename Expr>
171 Expr>::type> : std::true_type {};
173 template<
typename Tape>
178 template<
typename Expr>
182 template<
typename Expr,
typename T =
void>
186 template<
typename Expr>
189#ifndef DOXYGEN_DISABLE
190 template<
typename Real,
template<
typename>
class ConversionOperator>
194 template<
typename Expr>
199 template<
typename Expr,
typename T =
void>
203 template<
typename Expr>
206#ifndef DOXYGEN_DISABLE
207 template<
typename Tape>
212 template<
typename Expr>
216 template<
typename Expr,
typename T =
void>
225 template<
typename Expr>
233 template<
typename Node,
typename = ExpressionTraits::EnableIfLhsExpression<Node>>
244 template<
typename Expr>
248 template<
typename Expr>
257 template<
typename Node,
typename = EnableIfConstantExpression<Node>>
259 return ::codi::RealTraits::AggregatedTypeTraits<typename Node::Real, void>::Elements;
268 template<
typename Expr>
272 template<
typename Expr>
277 template<
typename Node>
287 template<
typename Expr>
#define CODI_INLINE
See codi::Config::ForcedInlines.
Definition config.h:469
#define CODI_DD(Type, Default)
Abbreviation for CODI_DECLARE_DEFAULT.
Definition macros.hpp:96
#define CODI_ANY
Used in default declarations of expression templates.
Definition macros.hpp:100
#define CODI_STATIC_ASSERT(cond, message)
Static assert definition for CoDiPack. Not evaluated in IDE mode.
Definition macros.hpp:129
Traits for everything that can be an expression e.g. codi::RealReverse, a + b, etc....
Definition expressionTraits.hpp:65
ValidateADLogicImpl< Results... > ValidateADLogic
Validates if the AD logic of an arbitrary amount of expressions are the same or compatible....
Definition expressionTraits.hpp:119
bool constexpr numberOfConstantTypeArguments
Value entry of NumberOfConstantTypeArguments.
Definition expressionTraits.hpp:269
typename std::enable_if< IsStaticContextActiveType< Expr >::value, T >::type EnableIfStaticContextActiveType
Enable if wrapper for IsStaticContextActiveType.
Definition expressionTraits.hpp:217
bool constexpr numberOfOperations
Value entry of NumberOfOperations.
Definition expressionTraits.hpp:288
bool constexpr isConstantExpression
Value entry of IsConstantExpression.
Definition expressionTraits.hpp:196
typename std::enable_if< IsExpression< Expr >::value, T >::type EnableIfExpression
Enable if wrapper for IsExpression.
Definition expressionTraits.hpp:160
bool constexpr numberOfActiveTypeArguments
Value entry of NumberOfActiveTypeArguments.
Definition expressionTraits.hpp:245
bool constexpr isLhsExpression
Value entry of IsLhsExpression.
Definition expressionTraits.hpp:179
typename std::enable_if< IsLhsExpression< Expr >::value, T >::type EnableIfLhsExpression
Enable if wrapper for IsLhsExpression.
Definition expressionTraits.hpp:183
bool constexpr isExpression
Value entry of IsExpression.
Definition expressionTraits.hpp:156
typename std::enable_if< IsConstantExpression< Expr >::value, T >::type EnableIfConstantExpression
Enable if wrapper for IsConstantExpression.
Definition expressionTraits.hpp:200
typename ActiveResultImpl< Real, Tape, isStatic >::ActiveResult ActiveResult
Definition expressionTraits.hpp:137
bool constexpr isStaticContextActiveType
Value entry of IsStaticContextActiveType.
Definition expressionTraits.hpp:213
Traits for values that can be used as real values, e.g. double, float, codi::RealReverse etc....
Definition stdComplex.hpp:204
CoDiPack - Code Differentiation Package.
Definition codi.hpp:94
std::enable_if< std::is_base_of< Base, Impl >::value, R > enable_if_base_of
Enable if abbreviation for std::is_base_of.
Definition enableIfHelpers.hpp:47
Traversal of CoDiPack expressions during compile time.
Definition compileTimeTraversalLogic.hpp:59
inlinestatic ResultType constexpr eval(Args &&... args)
Definition compileTimeTraversalLogic.hpp:71
inlinestatic ResultType constexpr toLinks(Args &&... args)
Definition compileTimeTraversalLogic.hpp:191
Represents constant values in the expression tree.
Definition constantExpression.hpp:78
Base class for all CoDiPack expressions.
Definition expressionInterface.hpp:60
Definition expressionTraits.hpp:127
int ActiveResult
The resulting active type of an expression.
Definition expressionTraits.hpp:132
T_Tape Tape
See ActiveResultImpl.
Definition expressionTraits.hpp:129
T_Real Real
See ActiveResultImpl.
Definition expressionTraits.hpp:128
If the expression inherits from ConstantExpression. Is either std::false_type or std::true_type.
Definition expressionTraits.hpp:187
If the expression inherits from ExpressionInterface. Is either std::false_type or std::true_type.
Definition expressionTraits.hpp:146
If the expression inherits from LhsExpressionInterface. Is either std::false_type or std::true_type.
Definition expressionTraits.hpp:164
If the expression inherits from StaticContextActiveType. Is either std::false_type or std::true_type.
Definition expressionTraits.hpp:204
Counts the number of nodes that inherit from LhsExpressionInterface in the expression.
Definition expressionTraits.hpp:226
static size_t constexpr value
See NumberOfActiveTypeArguments.
Definition expressionTraits.hpp:240
CompileTimeTraversalLogic< size_t, NumberOfActiveTypeArguments< Expr > > Base
Abbreviation for the base class type.
Definition expressionTraits.hpp:230
inlinestatic size_t constexpr leaf()
Called for all leaf nodes in the expression.
Definition expressionTraits.hpp:234
Counts the number of types that inherit from ConstantExpression in the expression.
Definition expressionTraits.hpp:250
static size_t constexpr value
See NumberOfConstantTypeArguments.
Definition expressionTraits.hpp:264
CompileTimeTraversalLogic< size_t, NumberOfConstantTypeArguments< Expr > > Base
Abbreviation for the base class type.
Definition expressionTraits.hpp:254
inlinestatic size_t constexpr leaf()
Called for all leaf nodes in the expression.
Definition expressionTraits.hpp:258
Counts the number of nodes in the expression.
Definition expressionTraits.hpp:273
inlinestatic size_t constexpr node()
Called for each node in the expression.
Definition expressionTraits.hpp:278
static size_t constexpr value
See NumberOfOperations.
Definition expressionTraits.hpp:283
typename std::conditional< isBVoid, LogicA, LogicB >::type ADLogic
The resulting AD logic type of an expression.
Definition expressionTraits.hpp:104
typename ValidateADLogicImpl< LogicA, typename ValidateADLogicImpl< LogicOther... >::ADLogic >::ADLogic ADLogic
The resulting AD logic type of an expression.
Definition expressionTraits.hpp:113
Logic ADLogic
The resulting AD logic type of an expression.
Definition expressionTraits.hpp:86
Validates if the AD logic of an arbitrary amount of expressions are the same or compatible....
Definition expressionTraits.hpp:78
Base class for all CoDiPack lvalue expression.
Definition lhsExpressionInterface.hpp:63
Methods that access inner values of aggregated types that contain CoDiPack active types.
Definition realTraits.hpp:226
Replacement type of LhsExpressionInterface types in ConstructStaticContext.
Definition staticContextActiveType.hpp:56