User-defined evaluation functions for the taping process. More...
#include <externalFunction.hpp>

Public Types | |
| using | CallFunction |
| Call function definition. | |
| using | DeleteFunction = void (*)(Tape* tape, void* data) |
| Delete function definition. | |
| using | Identifier = typename Tape::Identifier |
| See FullTapeInterface. | |
| using | IterateIdsFunction |
| Iterate ids function definition. | |
| using | IterCallback |
| Callback for iterate ids function. | |
| using | Real = typename Tape::Real |
| See FullTapeInterface. | |
| using | Tape |
| See ExternalFunction. | |
| using | VectorAccess = VectorAccessInterface<Real, Identifier> |
Public Member Functions | |
| void | deleteData (Tape *tape) |
| Calls the delete function if not nullptr. | |
| void | evaluateForward (Tape *tape, VectorAccess *adjointInterface) const |
| Calls the forward function if not nullptr, otherwise throws a CODI_EXCEPTION. | |
| void | evaluatePrimal (Tape *tape, VectorAccess *adjointInterface) const |
| Calls the primal function if not nullptr, otherwise throws a CODI_EXCEPTION. | |
| void | evaluateReverse (Tape *tape, VectorAccess *adjointInterface) const |
| Calls the reverse function if not nullptr, otherwise throws a CODI_EXCEPTION. | |
| ExternalFunction (CallFunction funcReverse, CallFunction funcForward, CallFunction funcPrimal, void *data, DeleteFunction funcDelete, IterateIdsFunction funcIterIn, IterateIdsFunction funcIterOut) | |
| Any arguments can be nullptr if not required. | |
| void | iterateInputs (Tape *tape, IterCallback func, void *userData) const |
| Calls the iterate inputs function if not nullptr, otherwise throws a CODI_EXCEPTION. | |
| void | iterateOutputs (Tape *tape, IterCallback func, void *userData) const |
| Calls the iterate inputs function if not nullptr, otherwise throws a CODI_EXCEPTION. | |
Public Member Functions inherited from codi::ExternalFunctionInternalData | |
| ExternalFunctionInternalData () | |
| Constructor. | |
Static Public Member Functions | |
| static ExternalFunction | create (CallFunction funcReverse, void *data, DeleteFunction funcDelete, CallFunction funcForward=nullptr, CallFunction funcPrimal=nullptr, IterateIdsFunction funcIterIn=nullptr, IterateIdsFunction funcIterOut=nullptr) |
| Helper function for the creation of an ExternalFunction object. | |
Additional Inherited Members | |
Protected Types inherited from codi::ExternalFunctionInternalData | |
| using | CallFunctionUntyped |
| Call function definition. | |
| using | DeleteFunctionUntyped = void (*)(void* tape, void* data) |
| Delete function definition. | |
| using | IterateIdsFunctionUntyped |
| Iterate ids function definition. | |
| using | IterCallbackUntyped = void (*)(void* id, void* userData) |
| Untyped callback function for id iteration. | |
Protected Member Functions inherited from codi::ExternalFunctionInternalData | |
| ExternalFunctionInternalData (CallFunctionUntyped funcReverse, CallFunctionUntyped funcForward, CallFunctionUntyped funcPrimal, DeleteFunctionUntyped funcDelete, IterateIdsFunctionUntyped funcIterIn, IterateIdsFunctionUntyped funcIterOut, void *data) | |
| Constructor. | |
Protected Attributes inherited from codi::ExternalFunctionInternalData | |
| void * | data |
| User data pointer. | |
| DeleteFunctionUntyped | funcDelete |
| User data deletion function pointer. | |
| CallFunctionUntyped | funcForward |
| Forward evaluation function pointer. | |
| IterateIdsFunctionUntyped | funcIterIn |
| Iterate over inputs. | |
| IterateIdsFunctionUntyped | funcIterOut |
| Iterate over outputs. | |
| CallFunctionUntyped | funcPrimal |
| Primal evaluation function pointer. | |
| CallFunctionUntyped | funcReverse |
| Reverse evaluation function pointer. | |
User-defined evaluation functions for the taping process.
See ExternalFunctionTapeInterface for details.
The user can provide call functions for the reverse, forward and primal evaluation of a tape. These need to be of the type CallFunction which has the tree arguments:
registerExternalFunction (ExternalFunctionTapeInterface)The tape pointer can be used for general access to the tape. For each access to the gradient data, the adjointInterface should be used. If no custom adjoint vectors are used in the application, then the tape pointer can also be used for the gradient data access.
The delete function is called when the entry of the tape for the external function is deleted.
| T_Tape | The associated tape type. |
| using codi::ExternalFunction< T_Tape >::CallFunction |
Call function definition.
| using codi::ExternalFunction< T_Tape >::IterateIdsFunction |
Iterate ids function definition.
| using codi::ExternalFunction< T_Tape >::IterCallback |
Callback for iterate ids function.
| using codi::ExternalFunction< T_Tape >::Tape |
See ExternalFunction.
| using codi::ExternalFunction< T_Tape >::VectorAccess = VectorAccessInterface<Real, Identifier> |
Shortcut for VectorAccessInterface.