25 template<
typename TYPE>
28 size_t nElemsPerGroup = 1);
38 std::vector<ArrayPushInput<TYPE>>
input;
48 size_t _nElemsPerGroup;
68 template<
typename TYPE>
71 size_t nElemsPerGroup = 1);
81 std::vector<ArrayOutput<TYPE>>
output;
91 size_t _nElemsPerGroup;
97 template<
typename TYPE>
99 const std::string& description,
size_t nGroups,
size_t nElemsPerGroup)
100 :
ApplicationModule(owner, name, description), output(this,
"output",
"", nGroups * nElemsPerGroup,
"Output array"),
101 _nGroups(nGroups), _nElemsPerGroup(nElemsPerGroup) {
102 for(
size_t i = 0; i < _nGroups; ++i) {
104 if(_nElemsPerGroup == 1) {
105 comment =
"The element " + std::to_string(i) +
" of the output array";
108 comment =
"The elements " + std::to_string(i * _nElemsPerGroup) +
" to " +
109 std::to_string((i + 1) * _nElemsPerGroup - 1) +
" of the output array";
117 template<
typename TYPE>
119 auto readGroup = readAnyGroup();
122 for(
size_t i = 0; i < _nGroups; ++i) {
123 for(
size_t k = 0; k < _nElemsPerGroup; ++k) {
124 output[i * _nElemsPerGroup + k] = input[i][k];
137 template<
typename TYPE>
139 const std::string& description,
size_t nGroups,
size_t nElemsPerGroup)
140 :
ApplicationModule(owner, name, description), input(this,
"input",
"", nGroups * nElemsPerGroup,
"Input array"),
141 _nGroups(nGroups), _nElemsPerGroup(nElemsPerGroup) {
142 for(
size_t i = 0; i < _nGroups; ++i) {
144 if(_nElemsPerGroup == 1) {
145 comment =
"The element " + std::to_string(i) +
" of the input array";
148 comment =
"The elements " + std::to_string(i * _nElemsPerGroup) +
" to " +
149 std::to_string((i + 1) * _nElemsPerGroup - 1) +
" of the input array";
157 template<
typename TYPE>
161 for(
size_t i = 0; i < _nGroups; ++i) {
162 for(
size_t k = 0; k < _nElemsPerGroup; ++k) {
163 input[i][k] = output[i * _nElemsPerGroup + k];
Convenience class for output array accessors (always UpdateMode::push)
Base class for owners of other EntityOwners (e.g.
InvalidityTracer application module.
Split an array of the data type TYPE into nGroups with each nElemsPerGroup elements.
void mainLoop()
To be implemented by the user: function called in a separate thread executing the main loop of the mo...
std::vector< ArrayOutput< TYPE > > output
Vector of output arrays, each with a length of nElemsPerGroup.
ArrayPushInput< TYPE > input
Input array.
Split an array of the data type TYPE into nGroups with each nElemsPerGroup elements.
void mainLoop()
To be implemented by the user: function called in a separate thread executing the main loop of the mo...
std::vector< ArrayPushInput< TYPE > > input
Vector of input arrays, each with a length of nElemsPerGroup.
ArrayOutput< TYPE > output
Output array.