|
A library for working with phylogenetic and population genetic data.
v0.32.0
|
|
Go to the documentation of this file. 1 #ifndef GENESIS_SEQUENCE_FUNCTIONS_ENTROPY_H_
2 #define GENESIS_SEQUENCE_FUNCTIONS_ENTROPY_H_
35 #include <type_traits>
151 using T = std::underlying_type< SiteEntropyOptions >::type;
153 static_cast< T
>( lhs ) |
static_cast< T
>( rhs )
170 using T = std::underlying_type< SiteEntropyOptions >::type;
172 static_cast< T
>( lhs ) |
static_cast< T
>( rhs )
192 using T = std::underlying_type< SiteEntropyOptions >::type;
193 return static_cast< T
>( lhs ) &
static_cast< T
>( rhs );
212 SiteCounts
const& counts,
237 SiteCounts
const& counts,
239 bool use_small_sample_correction =
false,
255 SiteCounts
const& counts,
277 SiteCounts
const& counts,
278 bool only_determined_sites =
false,
292 SiteCounts
const& counts,
293 bool use_small_sample_correction =
false,
315 SiteCounts
const& counts,
316 bool only_determined_sites =
false,
317 bool use_small_sample_correction =
false,
324 #endif // include guard
@ kWeighted
Weight the entropy using the summed relative frequencies of the characters.
SiteEntropyOptions & operator|=(SiteEntropyOptions &lhs, SiteEntropyOptions rhs)
Or-assignment-operator to combine two SiteEntropyOptionss.
double absolute_entropy(SiteCounts const &counts, SiteEntropyOptions per_site_options)
Return the sum of all site entropies.
double average_information(SiteCounts const &counts, bool only_determined_sites, bool use_small_sample_correction, SiteEntropyOptions per_site_options)
Calculate the information content across all sites of a SiteCounts object.
bool operator&(SiteEntropyOptions lhs, SiteEntropyOptions rhs)
And-operator to check whether a SiteEntropyOptions is set.
@ kNormalized
Normalize the resulting entropy using the maximum entropy possible.
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
double site_entropy(SiteCounts const &counts, size_t site_idx, SiteEntropyOptions options)
Calculate the entropy at one site of a SiteCounts object.
SiteEntropyOptions
Option flags to refine the calculation of site_entropy().
double site_information(SiteCounts const &counts, size_t site_index, bool use_small_sample_correction, SiteEntropyOptions options)
Calculate the information content at one site of a SiteCounts object.
double average_entropy(SiteCounts const &counts, bool only_determined_sites, SiteEntropyOptions per_site_options)
Return the average sum of all site entropies.
double absolute_information(SiteCounts const &counts, bool use_small_sample_correction, SiteEntropyOptions per_site_options)
Calculate the information content across all sites of a SiteCounts object.
@ kIncludeGaps
In addition to the characters of the SiteCounts object, use the undetermined and gap characters.
SiteEntropyOptions operator|(SiteEntropyOptions lhs, SiteEntropyOptions rhs)
Or-operator to combine two SiteEntropyOptionss.
@ kDefault
Default option, simply calculate the site entropy using the characters used in the SiteCounts object.