CoDiPack  3.0.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
codi::AggregatedActiveTypeBase< T_Real, T_InnerActiveType, T_Impl, T_isStatic > Struct Template Reference

Defines an aggregated type via an array and implements the ExpressionInterface. More...

#include <aggregatedActiveType.hpp>

Inheritance diagram for codi::AggregatedActiveTypeBase< T_Real, T_InnerActiveType, T_Impl, T_isStatic >:

Public Types

using ADLogic = Tape
 AD logic that governs the expression. Needs to be the same for all inputs of the expression.
 
using Impl = T_Impl
 See AggregatedActiveTypeBase.
 
using InnerActiveType
 See AggregatedActiveTypeBase.
 
using InnerIdentifier = typename Tape::Identifier
 Identifier of the underlying tape.
 
using InnerReal = typename Traits::InnerType
 Inner real type of the active type.
 
using Real = T_Real
 See AggregatedActiveTypeBase.
 
using StoreAs = typename std::conditional<isStatic, Impl, Impl const&>::type
 Implementation of ExpressionInterface.
 
using Tape = typename InnerActiveType::Tape
 The tape of the inner active type.
 
using Traits = RealTraits::AggregatedTypeTraits<Real>
 The traits for the aggregated type.
 
- Public Types inherited from codi::ExpressionInterface< T_Real, T_Impl >
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.
 
- Public Types inherited from codi::NodeInterface< T_Impl >
using Impl = T_Impl
 See NodeInterface.
 
- Public Types inherited from codi::ExpressionMemberOperations< T_Real, T_Impl, typename >
using Impl = T_Impl
 See ExpressionMemberOperations.
 
using Real = T_Real
 See ExpressionMemberOperations.
 

Public Member Functions

template<size_t argNumber>
inlineInnerReal applyAdjoint (Real const &adjoint) const
 
template<size_t argNumber>
inlineReal applyTangent (InnerReal const &tangent) const
 
template<size_t argNumber>
inlineInnerActiveType const & getLink () const
 an expression.
 
inlineReal const getValue () const
 Compute the primal value that is usually evaluated by the statement/expression.
 
 inlineAggregatedActiveTypeBase ()=default
 Constructor.
 
 inlineAggregatedActiveTypeBase (AggregatedActiveTypeBase const &)=default
 Constructor.
 
inline ~AggregatedActiveTypeBase ()=default
 Destructor.
 
- Public Member Functions inherited from codi::ExpressionInterface< T_Real, T_Impl >
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
 
- Public Member Functions inherited from codi::NodeInterface< T_Impl >
inlineImpl const & cast () const
 Cast to the implementation.
 
template<size_t argNumber>
char const & getLink () const
 an expression.
 

Static Public Member Functions

static inlinestd::string getMathRep ()
 Get the math symbol of the operation. E.g. + for operators and pow() for functions.
 

Public Attributes

InnerActiveType values [Elements]
 Array representation.
 

Static Public Attributes

static int constexpr Elements = Traits::Elements
 The number of elements in the aggregated type.
 
static bool constexpr isStatic = T_isStatic
 See AggregatedActiveTypeBase.
 
static size_t constexpr LinkCount = Elements
 Implementation of NodeInterface.
 
static size_t constexpr LinkCount = false
 handle the expression as a leaf node.
 

Protected Member Functions

inlineImpl & cast ()
 Cast to implementation.
 
inlineImpl const & cast () const
 Cast to implementation.
 
- Protected Member Functions inherited from codi::ExpressionMemberOperations< T_Real, T_Impl, typename >
inlineImpl const & cast () const
 Cast to implementation.
 

Detailed Description

template<typename T_Real, typename T_InnerActiveType, typename T_Impl, bool T_isStatic>
struct codi::AggregatedActiveTypeBase< T_Real, T_InnerActiveType, T_Impl, T_isStatic >

Defines an aggregated type via an array and implements the ExpressionInterface.

See AggregatedActiveType for details.

Template Parameters
T_RealReal value of the aggregated type.
T_InnerActiveTypeCoDiPack type that composes the aggregated type.
T_ImplThe final implementation of the aggregated type.
T_isStaticIf the aggregated type is created in a static context.

Member Typedef Documentation

◆ ADLogic

template<typename T_Real, typename T_InnerActiveType, typename T_Impl, bool T_isStatic>
using codi::AggregatedActiveTypeBase< T_Real, T_InnerActiveType, T_Impl, T_isStatic >::ADLogic = Tape

AD logic that governs the expression. Needs to be the same for all inputs of the expression.

◆ InnerActiveType

template<typename T_Real, typename T_InnerActiveType, typename T_Impl, bool T_isStatic>
using codi::AggregatedActiveTypeBase< T_Real, T_InnerActiveType, T_Impl, T_isStatic >::InnerActiveType
Initial value:
T_InnerActiveType

See AggregatedActiveTypeBase.

◆ StoreAs

template<typename T_Real, typename T_InnerActiveType, typename T_Impl, bool T_isStatic>
using codi::AggregatedActiveTypeBase< T_Real, T_InnerActiveType, T_Impl, T_isStatic >::StoreAs = typename std::conditional<isStatic, Impl, Impl const&>::type

Implementation of ExpressionInterface.

Defines how this expression is stored in an expression tree.

Member Function Documentation

◆ applyAdjoint()

template<typename T_Real, typename T_InnerActiveType, typename T_Impl, bool T_isStatic>
template<size_t argNumber>
inlineInnerReal codi::AggregatedActiveTypeBase< T_Real, T_InnerActiveType, T_Impl, T_isStatic >::applyAdjoint ( Real const & adjoint) const
inline

Apply the AD reverse mode on the expression with respect to the given parameter.

This is just the local reverse mode application and not the one for the whole expression tree.

Does not need to be implemented for expressions with NodeInterface::LinkCount = 0 .

Returns
The type is the Real type of the selected argument or a compatible vector type. E.g. for Real f(complex<Real>, Real) the type with argNumber=0 is complex<Real> or Direction<complex<Real>> , with argNumber=1 it is Real or Direction<Real> .
Template Parameters
AdjointThe type of the result or a compatible vector type. E.g. Real or Direction<Real>.

Calls Traits::adjointOfConstructor.

◆ applyTangent()

template<typename T_Real, typename T_InnerActiveType, typename T_Impl, bool T_isStatic>
template<size_t argNumber>
inlineReal codi::AggregatedActiveTypeBase< T_Real, T_InnerActiveType, T_Impl, T_isStatic >::applyTangent ( InnerReal const & tangent) const
inline

Apply the AD forward mode on the expression with respect to the given parameter.

This is just the local forward mode application and not the one for the whole expression tree.

Does not need to be implemented for expressions with NodeInterface::LinkCount = 0 .

Returns
The type of the result or a compatible vector type. E.g. Real or Direction<Real>.
Template Parameters
TangentThe type is the Real type of the selected argument or a compatible vector type. E.g. for Real f(complex<Real>, Real) the type with argNumber=0 is complex<Real> or Direction<complex<Real>> , with argNumber=1 it is Real or Direction<Real> .

◆ getLink()

template<typename T_Real, typename T_InnerActiveType, typename T_Impl, bool T_isStatic>
template<size_t argNumber>
inlineInnerActiveType const & codi::AggregatedActiveTypeBase< T_Real, T_InnerActiveType, T_Impl, T_isStatic >::getLink ( ) const
inline

an expression.

Get the argument for the specific link. Usually

◆ getMathRep()

template<typename T_Real, typename T_InnerActiveType, typename T_Impl, bool T_isStatic>
static inlinestd::string codi::AggregatedActiveTypeBase< T_Real, T_InnerActiveType, T_Impl, T_isStatic >::getMathRep ( )
inlinestatic

Get the math symbol of the operation. E.g. + for operators and pow() for functions.

◆ getValue()

template<typename T_Real, typename T_InnerActiveType, typename T_Impl, bool T_isStatic>
inlineReal const codi::AggregatedActiveTypeBase< T_Real, T_InnerActiveType, T_Impl, T_isStatic >::getValue ( ) const
inline

Compute the primal value that is usually evaluated by the statement/expression.

Member Data Documentation

◆ LinkCount

template<typename T_Real, typename T_InnerActiveType, typename T_Impl, bool T_isStatic>
size_t constexpr codi::AggregatedActiveTypeBase< T_Real, T_InnerActiveType, T_Impl, T_isStatic >::LinkCount = Elements
staticconstexpr

Implementation of NodeInterface.

handle the expression as a leaf node.

Number of links the expression has. Zero will


The documentation for this struct was generated from the following file: