CoDiPack  2.2.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
codi::PointerStore< T_ChunkData > Struct Template Reference

Inserts data pointers at the back of all arguments in the nested call hierarchy. More...

#include <pointerStore.hpp>

Public Types

using ChunkData = T_ChunkData
 See PointerStore.
 

Public Member Functions

template<typename FuncObj , typename... Args>
void call (FuncObj &func, Args &&... args)
 Calls func(pointers, args...);.
 
template<typename FuncObj , typename... Args>
void callAndAppend (FuncObj &func, Args &&... args)
 Calls func(args..., pointers);.
 
template<int selectedDepth, typename Nested , typename... Args>
void callNestedForward (Nested *nested, size_t &start, size_t const &end, Args &&... args)
 Calls nested->template evaluateForward<selectedDepth>(args..., start, end, pointers);.
 
template<int selectedDepth, typename Nested , typename... Args>
void callNestedReverse (Nested *nested, size_t &start, size_t const &end, Args &&... args)
 Calls nested->template evaluateReverse<selectedDepth>(args..., start, end, pointers);.
 
void setPointers (const size_t &dataPos, ChunkData *chunk)
 Sets the internal pointers to the data of the chunk. Afterwards on of the call functions can be called.
 

Detailed Description

template<typename T_ChunkData>
struct codi::PointerStore< T_ChunkData >

Inserts data pointers at the back of all arguments in the nested call hierarchy.

Used in DataInterface implementations for the generalized call to object functions. This class is mainly used in the evaluate and forEach method implementations of these classes. They have to call the evaluation functions on the nested DataInterfaces but they do not know about the data layout in the chunks. This class is the bridge for this call. It stores the data pointers to the chunks and inserts these data pointers in the call to the nested objects.

First a call to setPointers has to made and then either call(), callNestedForward() or callNestedReverse().

ps.setPointers(0, data);
// One of:
ps.call(func, user); // Will call func(p1 (double*), p2 (int*), user);
// Will call nested->evaluateForward<selectedDepth>(0, 10, func, user, p1 (double*), p2 (int*));
ps.template callNestedForward<selectedDepth>(nested, 0, 10, func, user);
// Will call nested->template evaluateReverse<selectedDepth>(10, 0, func, user, p1 (double*), p2 (int*));
ps.template callNestedReverse<selectedDepth>(nested, 10, 0, func, user);
Definition: chunk.hpp:283
Inserts data pointers at the back of all arguments in the nested call hierarchy.
Definition: pointerStore.hpp:72
void call(FuncObj &func, Args &&... args)
Calls func(pointers, args...);.
void setPointers(const size_t &dataPos, ChunkData *chunk)
Sets the internal pointers to the data of the chunk. Afterwards on of the call functions can be calle...
Template Parameters
T_ChunkDataImplementation of ChunkBase.

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