21 map<size_t, size_t> counts;
22 for (
size_t i = 0; i < classes.size(); i++)
29 map<double, double> distribution;
30 for (
auto& i : counts)
32 distribution[rDist->getCategory(i.first)] =
static_cast<double>(i.second) /
static_cast<double>(classes.size());
36 return make_unique<SimpleDiscreteDistribution>(distribution);
Interface for rate across sites (RAS) implementation.
virtual std::shared_ptr< const DiscreteDistributionInterface > getRateDistribution() const =0
Get the rate distribution used for the computation.
virtual std::vector< size_t > getRateClassWithMaxPostProbPerSite() const =0
Get the posterior rate class (the one with maximum posterior probability) for each site.
Defines the basic types of data flow nodes.