Represents a concrete aggregated lvalue int the CoDiPack expression tree. More...
#include <aggregatedActiveType.hpp>
Public Types | |
using | Base |
Abbreviation for base class. | |
using | Impl = T_Impl |
See AggregatedActiveType. | |
using | InnerActiveType = T_InnerActiveType |
See AggregatedActiveType. | |
using | PassiveReal = RealTraits::PassiveReal<Real> |
Passive value type of the real. | |
using | Real = T_Real |
See AggregatedActiveType. | |
using | Traits = RealTraits::AggregatedTypeTraits<Real> |
The traits for the aggregated type. | |
![]() | |
using | ADLogic |
AD logic that governs the expression. Needs to be the same for all inputs of the expression. | |
using | Impl |
See AggregatedActiveTypeBase. | |
using | InnerActiveType |
See AggregatedActiveTypeBase. | |
using | InnerIdentifier |
Identifier of the underlying tape. | |
using | InnerReal |
Inner real type of the active type. | |
using | Real |
See AggregatedActiveTypeBase. | |
using | StoreAs |
Implementation of ExpressionInterface. | |
using | Tape |
The tape of the inner active type. | |
using | Traits |
The traits for the aggregated type. | |
![]() | |
using | ADLogic = char |
AD logic that governs the expression. Needs to be the same for all inputs of the expression. | |
using | Impl = T_Impl |
See ExpressionInterface. | |
using | Real = T_Real |
See ExpressionInterface. | |
using | StoreAs = ExpressionInterface |
Defines how this expression is stored in an expression tree. | |
![]() | |
using | Impl = T_Impl |
See NodeInterface. | |
![]() | |
using | Impl = T_Impl |
See ExpressionMemberOperations. | |
using | Real = T_Real |
See ExpressionMemberOperations. | |
Public Member Functions | |
inlineAggregatedActiveType (AggregatedActiveType const &expr) | |
Constructor. | |
template<typename Expr> | |
inlineAggregatedActiveType (ExpressionInterface< Real, Expr > const &expr) | |
Constructor. | |
inlineAggregatedActiveType (PassiveReal const &expr) | |
Constructor. | |
inlineImpl & | operator= (AggregatedActiveType const &expr) |
Assign operation. | |
template<typename Expr> | |
inlineImpl & | operator= (ExpressionInterface< Real, Expr > const &expr) |
Assign operation. | |
inlineImpl & | operator= (PassiveReal const &expr) |
Assign operation. | |
inline | ~AggregatedActiveType ()=default |
< Use base constructors. | |
![]() | |
inlineInnerReal | applyAdjoint (Real const &adjoint) const |
inlineInnerReal | applyAdjoint (Real const &adjoint) const |
inlineReal | applyTangent (InnerReal const &tangent) const |
inlineReal | applyTangent (InnerReal const &tangent) const |
inlineInnerActiveType const & | getLink () const |
an expression. | |
inlineInnerActiveType const & | getLink () const |
an expression. | |
inlineReal const | getValue () const |
Compute the primal value that is usually evaluated by the statement/expression. | |
inlineReal const | getValue () const |
Compute the primal value that is usually evaluated by the statement/expression. | |
inlineAggregatedActiveTypeBase ()=default | |
Constructor. | |
inlineAggregatedActiveTypeBase ()=default | |
Constructor. | |
inlineAggregatedActiveTypeBase (AggregatedActiveTypeBase const &)=default | |
Constructor. | |
inlineAggregatedActiveTypeBase (AggregatedActiveTypeBase const &)=default | |
Constructor. | |
inline | ~AggregatedActiveTypeBase ()=default |
Destructor. | |
inline | ~AggregatedActiveTypeBase ()=default |
Destructor. | |
![]() | |
inlineImpl const & | cast () const |
Cast to the implementation. | |
ExpressionInterface ()=default | |
Constructor. | |
ExpressionInterface (ExpressionInterface const &)=default | |
Constructor. | |
inlineReal const | getValue () const |
Compute the primal value that is usually evaluated by the statement/expression. | |
template<size_t argNumber, typename Tangent> | |
inlineauto | applyTangent (Tangent const &tangent) const |
template<size_t argNumber, typename Adjoint> | |
inlineauto | applyAdjoint (Adjoint const &adjoint) const |
![]() | |
inlineImpl const & | cast () const |
Cast to the implementation. | |
template<size_t argNumber> | |
char const & | getLink () const |
an expression. | |
Protected Member Functions | |
template<typename Rhs> | |
inlinevoid | store (ExpressionInterface< Real, Rhs > const &rhs, EventHints::Statement const &eventType) |
Has to be called by an AD variable every time it is assigned. | |
![]() | |
inlineImpl & | cast () |
Cast to implementation. | |
inlineImpl & | cast () |
Cast to implementation. | |
inlineImpl const & | cast () const |
Cast to implementation. | |
inlineImpl const & | cast () const |
Cast to implementation. | |
![]() | |
inlineImpl const & | cast () const |
Cast to implementation. | |
Additional Inherited Members | |
![]() | |
static inlinestd::string | getMathRep () |
Get the math symbol of the operation. E.g. + for operators and pow() for functions. | |
static inlinestd::string | getMathRep () |
Get the math symbol of the operation. E.g. + for operators and pow() for functions. | |
![]() | |
InnerActiveType | values [Elements] |
Array representation. | |
InnerActiveType | values [Elements] |
Array representation. | |
![]() | |
static int constexpr | Elements |
The number of elements in the aggregated type. | |
static int constexpr | Elements |
The number of elements in the aggregated type. | |
static bool constexpr | isStatic |
See AggregatedActiveTypeBase. | |
static bool constexpr | isStatic |
See AggregatedActiveTypeBase. | |
static size_t constexpr | LinkCount |
Implementation of NodeInterface. | |
static size_t constexpr | LinkCount |
Implementation of NodeInterface. | |
static size_t constexpr | LinkCount = false |
handle the expression as a leaf node. | |
Represents a concrete aggregated lvalue int the CoDiPack expression tree.
An aggregated type, in the sense of CoDiPack, is a structure that can be expressed by a set of double values. E.g. std::complex<double> can be represented by two double values. The use case of this class is to be able to add such types to the CoDiPack expression tree. If you use std::complex<codi::RealReverse>, then the expression tree for operations on the complex number is usually quite short. When a and b are complex numbers with a CoDiPack type, then c = sin(a) + cos(b)
would record at least 6 statements. If complex numbers are integrated into the expression tree, then only one or two statements are recorded.
In order to add an aggregated type to the CoDiPack expression tree, the traits codi::RealTraits::AggregatedTypeTraits need to be specialized for the aggregated type. The helper codi::RealTraits::ArrayAggregatedTypeTraitsBase can be used if the aggregated type can be interpreted as an array of values. In addition this class needs to be extended and special constructors and assignment operators need to be implemented.
An example is described in Tutorial 7 - Aggregated type implementation.
T_Real | Real value of the aggregated type. (E.g. std::complex<double>) |
T_InnerActiveType | CoDiPack type that composes the aggregated type. (E.g. codi::RealReverse) |
T_Impl | The final implementation of the aggregated type. |
using codi::AggregatedActiveType< T_Real, T_InnerActiveType, T_Impl >::Base |
Abbreviation for base class.
|
default |
< Use base constructors.
Destructor.
|
inlineprotected |
Has to be called by an AD variable every time it is assigned.
Update of the value is performed by the tape. The tape will additionally store information, e.g., for the reversal of the statement.
Lhs | Has to implement LhsExpressionInterface. |
Rhs | Has to implement ExpressionInterface. |