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>
64 template<
typename T_Real>
67 template<
typename T_Real,
template<
typename>
class T_Operation,
typename... T_ArgExprs>
83 template<
typename... Logic>
96 template<
typename Logic>
105 template<
typename LogicA,
typename LogicB>
108 static bool constexpr isAVoid = std::is_same<void, LogicA>::value;
109 static bool constexpr isBVoid = std::is_same<void, LogicB>::value;
110 static bool constexpr isBothVoid = isAVoid & isBVoid;
111 static bool constexpr isBothSame = std::is_same<LogicA, LogicB>::value;
114 CODI_STATIC_ASSERT((!isBothVoid) & (!isAVoid | !isBVoid | isBothSame),
"AD logic types need to be the same.");
119 using ADLogic =
typename std::conditional<isBVoid, LogicA, LogicB>::type;
123 template<
typename LogicA,
typename... LogicOther>
133 template<
typename... Results>
141 template<
typename T_Real,
typename T_Tape,
bool T_isStatic = false,
typename =
void>
151 template<
typename Real,
typename Tape,
bool isStatic = false>
160 template<
typename Expr,
typename =
void>
163#ifndef DOXYGEN_DISABLE
164 template<
typename Expr>
170 template<
typename Expr>
174 template<
typename Expr,
typename T =
void>
178 template<
typename Expr,
typename =
void>
181#ifndef DOXYGEN_DISABLE
182 template<
typename Expr>
186 Expr>::type> : std::true_type {};
188 template<
typename Tape>
193 template<
typename Expr>
197 template<
typename Expr,
typename T =
void>
201 template<
typename Expr>
204#ifndef DOXYGEN_DISABLE
205 template<
typename Real,
template<
typename>
class ConversionOperator>
209 template<
typename Expr>
214 template<
typename Expr,
typename T =
void>
218 template<
typename Expr>
221#ifndef DOXYGEN_DISABLE
222 template<
typename Real>
226 template<
typename Expr>
231 template<
typename Expr,
typename T =
void>
235 template<
typename Expr>
238#ifndef DOXYGEN_DISABLE
239 template<
typename Tape>
244 template<
typename Expr>
248 template<
typename Expr,
typename T =
void>
257 template<
typename Expr>
265 template<
typename Node,
typename = ExpressionTraits::EnableIfLhsExpression<Node>>
276 template<
typename Expr>
280 template<
typename Expr>
289 template<
typename Node,
typename = EnableIfConstantExpression<Node>>
291 return ::codi::RealTraits::AggregatedTypeTraits<typename Node::Real, void>::Elements;
300 template<
typename Expr>
304 template<
typename Expr>
309 template<
typename Node>
319 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:97
#define CODI_ANY
Used in default declarations of expression templates.
Definition macros.hpp:101
#define CODI_STATIC_ASSERT(cond, message)
Static assert definition for CoDiPack. Not evaluated in IDE mode.
Definition macros.hpp:130
Traits for everything that can be an expression e.g. codi::RealReverse, a + b, etc....
Definition expressionTraits.hpp:71
ValidateADLogicImpl< Results... > ValidateADLogic
Validates if the AD logic of an arbitrary amount of expressions are the same or compatible....
Definition expressionTraits.hpp:134
bool constexpr numberOfConstantTypeArguments
Value entry of NumberOfConstantTypeArguments.
Definition expressionTraits.hpp:301
typename std::enable_if< IsStaticContextActiveType< Expr >::value, T >::type EnableIfStaticContextActiveType
Enable if wrapper for IsStaticContextActiveType.
Definition expressionTraits.hpp:249
bool constexpr isEmptyExpression
Value entry of IsEmptyExpression.
Definition expressionTraits.hpp:228
bool constexpr numberOfOperations
Value entry of NumberOfOperations.
Definition expressionTraits.hpp:320
bool constexpr isConstantExpression
Value entry of IsConstantExpression.
Definition expressionTraits.hpp:211
typename std::enable_if< IsEmptyExpression< Expr >::value, T >::type EnableIfEmptyExpression
Enable if wrapper for IsEmptyExpression.
Definition expressionTraits.hpp:232
typename std::enable_if< IsExpression< Expr >::value, T >::type EnableIfExpression
Enable if wrapper for IsExpression.
Definition expressionTraits.hpp:175
bool constexpr numberOfActiveTypeArguments
Value entry of NumberOfActiveTypeArguments.
Definition expressionTraits.hpp:277
bool constexpr isLhsExpression
Value entry of IsLhsExpression.
Definition expressionTraits.hpp:194
typename std::enable_if< IsLhsExpression< Expr >::value, T >::type EnableIfLhsExpression
Enable if wrapper for IsLhsExpression.
Definition expressionTraits.hpp:198
bool constexpr isExpression
Value entry of IsExpression.
Definition expressionTraits.hpp:171
typename std::enable_if< IsConstantExpression< Expr >::value, T >::type EnableIfConstantExpression
Enable if wrapper for IsConstantExpression.
Definition expressionTraits.hpp:215
typename ActiveResultImpl< Real, Tape, isStatic >::ActiveResult ActiveResult
Definition expressionTraits.hpp:152
bool constexpr isStaticContextActiveType
Value entry of IsStaticContextActiveType.
Definition expressionTraits.hpp:245
Traits for values that can be used as real values, e.g. double, float, codi::RealReverse etc....
Definition stdComplex.hpp:242
CoDiPack - Code Differentiation Package.
Definition codi.hpp:97
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 an operator or function with an arbitrary number of arguments in the expression tree.
Definition computeExpression.hpp:371
Represents constant values in the expression tree.
Definition constantExpression.hpp:78
Operation for empty expression.
Definition emptyExpression.hpp:52
Base class for all CoDiPack expressions.
Definition expressionInterface.hpp:60
Definition expressionTraits.hpp:142
int ActiveResult
The resulting active type of an expression.
Definition expressionTraits.hpp:147
T_Tape Tape
See ActiveResultImpl.
Definition expressionTraits.hpp:144
T_Real Real
See ActiveResultImpl.
Definition expressionTraits.hpp:143
If the expression inherits from ConstantExpression. Is either std::false_type or std::true_type.
Definition expressionTraits.hpp:202
If the expression inherits from EmptyExpression. Is either std::false_type or std::true_type.
Definition expressionTraits.hpp:219
If the expression inherits from ExpressionInterface. Is either std::false_type or std::true_type.
Definition expressionTraits.hpp:161
If the expression inherits from LhsExpressionInterface. Is either std::false_type or std::true_type.
Definition expressionTraits.hpp:179
If the expression inherits from StaticContextActiveType. Is either std::false_type or std::true_type.
Definition expressionTraits.hpp:236
Counts the number of nodes that inherit from LhsExpressionInterface in the expression.
Definition expressionTraits.hpp:258
static size_t constexpr value
See NumberOfActiveTypeArguments.
Definition expressionTraits.hpp:272
CompileTimeTraversalLogic< size_t, NumberOfActiveTypeArguments< Expr > > Base
Abbreviation for the base class type.
Definition expressionTraits.hpp:262
inlinestatic size_t constexpr leaf()
Called for all leaf nodes in the expression.
Definition expressionTraits.hpp:266
Counts the number of types that inherit from ConstantExpression in the expression.
Definition expressionTraits.hpp:282
static size_t constexpr value
See NumberOfConstantTypeArguments.
Definition expressionTraits.hpp:296
CompileTimeTraversalLogic< size_t, NumberOfConstantTypeArguments< Expr > > Base
Abbreviation for the base class type.
Definition expressionTraits.hpp:286
inlinestatic size_t constexpr leaf()
Called for all leaf nodes in the expression.
Definition expressionTraits.hpp:290
Counts the number of nodes in the expression.
Definition expressionTraits.hpp:305
inlinestatic size_t constexpr node()
Called for each node in the expression.
Definition expressionTraits.hpp:310
static size_t constexpr value
See NumberOfOperations.
Definition expressionTraits.hpp:315
typename std::conditional< isBVoid, LogicA, LogicB >::type ADLogic
The resulting AD logic type of an expression.
Definition expressionTraits.hpp:119
typename ValidateADLogicImpl< LogicA, typename ValidateADLogicImpl< LogicOther... >::ADLogic >::ADLogic ADLogic
The resulting AD logic type of an expression.
Definition expressionTraits.hpp:128
Logic ADLogic
The resulting AD logic type of an expression.
Definition expressionTraits.hpp:101
void ADLogic
The resulting AD logic type of an expression.
Definition expressionTraits.hpp:92
Validates if the AD logic of an arbitrary amount of expressions are the same or compatible....
Definition expressionTraits.hpp:84
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:233
Replacement type of LhsExpressionInterface types in ConstructStaticContext.
Definition staticContextActiveType.hpp:56