A library for working with phylogenetic and population genetic data.
v0.27.0
sequence/functions/entropy.hpp File Reference
#include <cstddef>
#include <type_traits>
#include <string>

Go to the source code of this file.

Namespaces

 genesis
 Container namespace for all symbols of genesis in order to keep them separate when used as a library.
 
 genesis::sequence
 

Enumerations

enum  SiteEntropyOptions : unsigned char { kDefault = 0, kIncludeGaps = 1, kWeighted = 2, kNormalized = 4 }
 Option flags to refine the calculation of site_entropy(). More...
 

Functions

double absolute_entropy (SiteCounts const &counts, SiteEntropyOptions per_site_options=SiteEntropyOptions::kDefault)
 Return the sum of all site entropies. More...
 
double absolute_information (SiteCounts const &counts, bool use_small_sample_correction=false, SiteEntropyOptions per_site_options=SiteEntropyOptions::kDefault)
 Calculate the information content across all sites of a SiteCounts object. More...
 
double average_entropy (SiteCounts const &counts, bool only_determined_sites=false, SiteEntropyOptions per_site_options=SiteEntropyOptions::kDefault)
 Return the average sum of all site entropies. More...
 
double average_information (SiteCounts const &counts, bool only_determined_sites=false, bool use_small_sample_correction=false, SiteEntropyOptions per_site_options=SiteEntropyOptions::kDefault)
 Calculate the information content across all sites of a SiteCounts object. More...
 
bool operator& (SiteEntropyOptions lhs, SiteEntropyOptions rhs)
 And-operator to check whether a SiteEntropyOptions is set. More...
 
SiteEntropyOptions operator| (SiteEntropyOptions lhs, SiteEntropyOptions rhs)
 Or-operator to combine two SiteEntropyOptionss. More...
 
SiteEntropyOptions & operator|= (SiteEntropyOptions &lhs, SiteEntropyOptions rhs)
 Or-assignment-operator to combine two SiteEntropyOptionss. More...
 
double site_entropy (SiteCounts const &counts, size_t site_index, SiteEntropyOptions options=SiteEntropyOptions::kDefault)
 Calculate the entropy at one site of a SiteCounts object. More...
 
double site_information (SiteCounts const &counts, size_t site_index, bool use_small_sample_correction=false, SiteEntropyOptions options=SiteEntropyOptions::kDefault)
 Calculate the information content at one site of a SiteCounts object. More...