3#ifndef cMHN_UTILITY_COMBINE_PDS_H
4#define cMHN_UTILITY_COMBINE_PDS_H
21 template<
class T,
class S>
22 static inline auto combinePDs(std::vector<std::map<S, T>>
const &pDs,
23 std::vector<pRC::Index>
const &lengths)
25 std::map<S, T> res_pD;
31 auto const pD = pDs[i];
32 auto const length = lengths[i];
33 for(
auto const &[k, v] : pD)
36 res_pD[k] +=
T(length) * v;
41 for(
auto &[k, v] : res_pD)
pRC::Float<> T
Definition externs_nonTT.hpp:1
Definition calculate_pTheta.hpp:16
static auto combinePDs(std::vector< std::map< S, T > > const &pDs, std::vector< pRC::Index > const &lengths)
Combines multiple data distributions into a single distribution.
Definition combine_pDs.hpp:22
static constexpr auto makeConstantSequence()
Definition sequence.hpp:402
Size Index
Definition type_traits.hpp:21