#include <DiscreteDistribution.h>
|
using | my_map_t = typename std::conditional< std::is_same< T, double >::value or std::is_same< T, float >::value, std::map< T, double, floating_point_compare< double > >, std::map< T, double > >::type |
|
template<typename T>
class DiscreteDistribution< T >
- Author
- steven piantadosi
- Date
- 03/02/20
◆ my_map_t
◆ DiscreteDistribution()
◆ addmass()
Add log probability v to type x
- Parameters
-
◆ argmax()
◆ at()
◆ begin()
◆ best()
Get the N best from this distribution
- Parameters
-
N | - how many to get |
include_equal | - should we include ones that are equal to the best (potentially giving more than N)? |
- Returns
◆ contains()
◆ count()
◆ end()
◆ erase()
◆ get()
◆ lp()
Retun the log probability of x, including the normalizing term (NOTE: This makes this O(N) to compute theo normalizer. So this is bad to use if you have to iterate over the set – you shoul call Z() separately then
- Parameters
-
- Returns
◆ operator()
This compares using just a standard ordering on keys – mainly here so we can put DiscreteDistributions in maps.
- Parameters
-
- Returns
◆ operator<<()
◆ operator==()
◆ operator[]()
◆ show() [1/2]
◆ show() [2/2]
◆ size()
◆ sorted()
template<typename T>
std::vector<std::pair<T,double> > DiscreteDistribution< T >::sorted |
( |
bool |
decreasing = false | ) |
const |
|
inline |
Get this distribution as a sorted vector of pairs
- Parameters
-
◆ string()
Convert this distribution into a string, printing at most nprint
- Parameters
-
- Returns
◆ values()
Get all of the values in this distribution
- Returns
◆ Z()
The documentation for this class was generated from the following file: