CoDiPack  3.0.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
codi::ExpressionTraits Namespace Reference

Traits for everything that can be an expression e.g. codi::RealReverse, a + b, etc.. More...

Classes

struct  ActiveResultImpl
 
struct  ActiveResultImpl< std::complex< T_InnerReal >, T_Tape, false >
 Specialization of ActiveResultImpl for std::complex. More...
 
struct  ActiveResultImpl< T_Real, T_Tape, false >
 Specialization of ActiveResultImpl for active types in a static context. More...
 
struct  ActiveResultImpl< T_Real, T_Tape, true >
 Specialization of ActiveResultImpl for active types in a static context. More...
 
struct  IsConstantExpression
 If the expression inherits from ConstantExpression. Is either std::false_type or std::true_type. More...
 
struct  IsExpression
 If the expression inherits from ExpressionInterface. Is either std::false_type or std::true_type. More...
 
struct  IsLhsExpression
 If the expression inherits from LhsExpressionInterface. Is either std::false_type or std::true_type. More...
 
struct  IsStaticContextActiveType
 If the expression inherits from StaticContextActiveType. Is either std::false_type or std::true_type. More...
 
struct  NumberOfActiveTypeArguments
 Counts the number of nodes that inherit from LhsExpressionInterface in the expression. More...
 
struct  NumberOfActiveTypeArguments< JacobianExpression< size > >
 Specialization for manual statement pushes of the used expression type. More...
 
struct  NumberOfConstantTypeArguments
 Counts the number of types that inherit from ConstantExpression in the expression. More...
 
struct  NumberOfConstantTypeArguments< JacobianExpression< size > >
 Specialization for manual statement pushes of the used expression type. More...
 
struct  NumberOfOperations
 Counts the number of nodes in the expression. More...
 
struct  ValidateADLogicImpl
 Validates if the AD logic of an arbitrary amount of expressions are the same or compatible. void results are interpreted as the AD logic of a constant expression. More...
 
struct  ValidateADLogicImpl< Logic >
 Validation for one arguments just defines the input logic as the valid one. More...
 
struct  ValidateADLogicImpl< LogicA, LogicB >
 Validation for two arguments. Validates if one of the two is void or both are the same. More...
 
struct  ValidateADLogicImpl< LogicA, LogicOther... >
 Validation for an arbitrary number of arguments. Gets the logic of the remainder and validates this with LogicA. More...
 

Typedefs

Expression traits.
template<typename... Results>
using ValidateADLogic = ValidateADLogicImpl<Results...>
 Validates if the AD logic of an arbitrary amount of expressions are the same or compatible. void results are interpreted as the AD logic of a constant expression.
 
template<typename Real, typename Tape, bool isStatic = false>
using ActiveResult = typename ActiveResultImpl<Real, Tape, isStatic>::ActiveResult
 

Variables

Static values on expressions
template<typename Expr>
bool constexpr numberOfActiveTypeArguments = NumberOfActiveTypeArguments<Expr>::value
 Value entry of NumberOfActiveTypeArguments.
 
template<typename Expr>
bool constexpr numberOfConstantTypeArguments = NumberOfConstantTypeArguments<Expr>::value
 Value entry of NumberOfConstantTypeArguments.
 
template<typename Expr>
bool constexpr numberOfOperations = NumberOfOperations<Expr>::value
 Value entry of NumberOfOperations.
 

Detection of specific node types

template<typename Expr, typename T = void>
using EnableIfExpression = typename std::enable_if<IsExpression<Expr>::value, T>::type
 Enable if wrapper for IsExpression.
 
template<typename Expr, typename T = void>
using EnableIfLhsExpression = typename std::enable_if<IsLhsExpression<Expr>::value, T>::type
 Enable if wrapper for IsLhsExpression.
 
template<typename Expr, typename T = void>
using EnableIfConstantExpression = typename std::enable_if<IsConstantExpression<Expr>::value, T>::type
 Enable if wrapper for IsConstantExpression.
 
template<typename Expr, typename T = void>
using EnableIfStaticContextActiveType = typename std::enable_if<IsStaticContextActiveType<Expr>::value, T>::type
 Enable if wrapper for IsStaticContextActiveType.
 
template<typename Expr>
bool constexpr isExpression = IsExpression<Expr>::value
 Value entry of IsExpression.
 
template<typename Expr>
bool constexpr isLhsExpression = IsLhsExpression<Expr>::value
 Value entry of IsLhsExpression.
 
template<typename Expr>
bool constexpr isConstantExpression = IsConstantExpression<Expr>::value
 Value entry of IsConstantExpression.
 
template<typename Expr>
bool constexpr isStaticContextActiveType = IsStaticContextActiveType<Expr>::value
 Value entry of IsStaticContextActiveType.
 

Detailed Description

Traits for everything that can be an expression e.g. codi::RealReverse, a + b, etc..

Typedef Documentation

◆ ActiveResult

template<typename Real, typename Tape, bool isStatic = false>
using codi::ExpressionTraits::ActiveResult = typename ActiveResultImpl<Real, Tape, isStatic>::ActiveResult

Create a CoDiPack active type that can capture an expression result. The ADLogic type definition in the expression is usually the tape type.

Template Parameters
T_RealReal value of the expression.
T_TapeADLogic of the expression.
T_isStaticIf a static context active type should be used.