template<class T, class InvokeCombine, class InvokeFinal = funcl::Identity, class InvokeFinalExtraArgsIndices = std::index_sequence<>>
struct Parallel::ReductionDatum< T, InvokeCombine, InvokeFinal, InvokeFinalExtraArgsIndices >
The data to be reduced, and invokables to be called whenever two reduction messages are combined and after the reduction has been completed.
InvokeCombine is a binary invokable that maps (T current_state, T element) -> T, where the current_state is the result of reductions so far. The InvokeFinal is an n-ary that takes as its first argument a T result_of_reduction and is invoked once after the reduction is completed. The additional arguments correspond to the resultant data of earlier ReductionDatum template parameters in the ReductionData, and are identified via the InvokeFinalExtraArgsIndices, which must be a std::index_sequence. Specifically, say you want the third ReductionDatum's InvokeFinal to be passed the first ReductionDatum then std::index_sequence<0> would be passed for InvokeFinalExtraArgsIndices. Here is an example of computing the RMS error of the evolved variables u and v: