Represents an operator or function with an arbitrary number of arguments in the expression tree.
More...
|
inlineexplicit | ComputeExpression (ExpressionInterface< typename T_ArgExprs::Real, T_ArgExprs > const &... args) |
| Constructor.
|
|
| inlineComputeExpression (ComputeExpression const &v)=default |
| Constructor.
|
|
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.
|
|
inlineauto | applyTangent (Tangent const &tangent) const |
|
inlineauto | applyAdjoint (Adjoint const &adjoint) const |
|
inlineImpl const & | cast () const |
| Cast to the implementation.
|
|
char const & | getLink () const |
| an expression.
|
|
template<typename T_Real, template< typename > class T_Operation, typename... T_ArgExprs>
struct codi::ComputeExpression< T_Real, T_Operation, T_ArgExprs >
Represents an operator or function with an arbitrary number of arguments in the expression tree.
See Expression design documentation for details about the expression system in CoDiPack.
- Template Parameters
-
T_Real | Original primal value of the statement/expression. |
T_Operation | The logic for computing the primal value and Jacobians. Must implement BinaryOperation. |
T_ArgExprs | The ExpressionInterface types of the arguments. |
template<typename T_Real, template< typename > class T_Operation, typename... T_ArgExprs>
template<size_t argNumber, typename Adjoint>
inlineauto codi::ComputeExpression< T_Real, T_Operation, T_ArgExprs >::applyAdjoint |
( |
Adjoint 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
-
Forwards to the operator implementation.
template<typename T_Real, template< typename > class T_Operation, typename... T_ArgExprs>
template<size_t argNumber, typename Tangent>
inlineReal codi::ComputeExpression< T_Real, T_Operation, T_ArgExprs >::applyTangent |
( |
Tangent 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
-
Forwards to the operator implementation.