141 iterator_first_t bfirst,
142 const iterator_first_t efirst,
143 iterator_second_t bsecond,
144 [[maybe_unused]]
const iterator_second_t esecond,
154 if constexpr (second_set_empty) {
156 auto [total_Q, total_R] = values(*bfirst);
157 std::size_t amount = 1;
160 for (; bfirst != efirst; ++bfirst, ++amount) {
161 const auto [Qi, Ri] = values(*bfirst);
166 return avg(avgQ(total_Q, amount), avgR(total_R, amount));
171 assert(std::distance(bfirst, efirst) == std::distance(bsecond, esecond));
174 auto [total_Q, total_R] = values(*bfirst, *bsecond);
175 std::size_t amount = 1;
178 for (; bfirst != efirst; ++bfirst, ++bsecond, ++amount) {
179 const auto [Qi, Ri] = values(*bfirst, *bsecond);
184 return avg(avgQ(total_Q, amount), avgR(total_R, amount));
264 iterator_first_t bfirst,
265 const iterator_first_t efirst,
266 iterator_second_t bsecond,
267 [[maybe_unused]]
const iterator_second_t esecond,
270 accumulate acc_values,
275 if constexpr (second_set_empty) {
277 auto total = comb_values(values(*bfirst));
278 std::size_t amount = 1;
281 for (; bfirst != efirst; ++bfirst, ++amount) {
282 acc_values(total, comb_values(values(*bfirst)));
284 return avg(total, amount);
289 assert(std::distance(bfirst, efirst) == std::distance(bsecond, esecond));
291 auto total = comb_values(values(*bfirst, *bsecond));
292 std::size_t amount = 1;
295 for (; bfirst != efirst; ++bfirst, ++bsecond, ++amount) {
296 acc_values(total, comb_values(values(*bfirst, *bsecond)));
298 return avg(total, amount);