#include <TopN.h>
|
static const size_t | MAX_N = SIZE_MAX |
|
template<class T>
class TopN< T >
- Author
- steven piantadosi
- Date
- 03/02/20
◆ TopN() [1/3]
◆ TopN() [2/3]
◆ TopN() [3/3]
◆ add() [1/3]
template<class T>
bool TopN< T >::add |
( |
const T & |
x | ) |
|
|
inline |
Adds x to the TopN. This will return true if we added (false otherwise)
- Parameters
-
- Returns
Add x. NOTE that we do not add objects x such that x.posterior == -infinity or NaN
- Parameters
-
◆ add() [2/3]
template<class T>
void TopN< T >::add |
( |
const TopN< T > & |
x | ) |
|
|
inline |
Add everything in x to this one.
- Parameters
-
◆ add() [3/3]
Add everything in x to this one.
- Parameters
-
◆ best()
template<class T>
const T& TopN< T >::best |
( |
| ) |
const |
|
inline |
Returns a reference to the best element currently stored
- Returns
◆ clear()
template<class T>
void TopN< T >::clear |
( |
| ) |
|
|
inline |
◆ compute_posterior()
template<class T>
template<typename data_t >
TopN TopN< T >::compute_posterior |
( |
data_t & |
data | ) |
|
|
inline |
Returns a NEW TopN where each current hypothesis is evaluated on the data. NOTE: If a hypothesis has a new posterior of -inf or NaN, it won't be added.
- Parameters
-
- Returns
◆ contains()
template<class T>
bool TopN< T >::contains |
( |
const T & |
x | ) |
const |
|
inline |
Does this contain x?
- Parameters
-
- Returns
◆ deserialize()
template<class T>
static TopN<T> TopN< T >::deserialize |
( |
const std::string & |
s | ) |
|
|
inlinestatic |
◆ empty()
template<class T>
bool TopN< T >::empty |
( |
| ) |
const |
|
inline |
◆ operator<<() [1/2]
template<class T>
bool TopN< T >::operator<< |
( |
const T & |
x | ) |
|
|
inline |
Friendlier syntax for adding.
- Parameters
-
◆ operator<<() [2/2]
template<class T>
void TopN< T >::operator<< |
( |
const TopN< T > & |
x | ) |
|
|
inline |
◆ operator=() [1/2]
template<class T>
void TopN< T >::operator= |
( |
const TopN< T > & |
x | ) |
|
|
inline |
◆ operator=() [2/2]
template<class T>
void TopN< T >::operator= |
( |
TopN< T > && |
x | ) |
|
|
inline |
◆ pop()
Pops off the top – you usually won't want to do this and it's not efficient.
◆ print()
template<class T>
void TopN< T >::print |
( |
std::string |
prefix = "" | ) |
|
|
inline |
Sort and print from worst to best
- Parameters
-
prefix | - an optional prefix to print before each line |
◆ serialize()
template<class T>
virtual std::string TopN< T >::serialize |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ set_print_best()
template<class T>
void TopN< T >::set_print_best |
( |
bool |
b | ) |
|
|
inline |
As I add things, should I print the best I've seen so far?
- Parameters
-
◆ set_size()
template<class T>
void TopN< T >::set_size |
( |
size_t |
n | ) |
|
|
inline |
Set the size of n that I cna have. NOTE: this does not resize the existing data.
- Parameters
-
◆ size()
template<class T>
size_t TopN< T >::size |
( |
| ) |
const |
|
inline |
How many are currently in the set? (NOT the total number allowed)
- Returns
◆ sorted()
template<class T>
std::vector<T> TopN< T >::sorted |
( |
bool |
increasing = true | ) |
const |
|
inline |
Sorted values.
- Parameters
-
increasing | – do we sort increasing or decreasing? |
◆ values()
Return a multiset of all the values in TopN
- Returns
◆ worst()
template<class T>
const T& TopN< T >::worst |
( |
| ) |
const |
|
inline |
Returns a reference to the worst element currently stored
- Returns
◆ Z()
template<class T>
double TopN< T >::Z |
( |
double |
temp = 1.0 | ) |
|
|
inline |
Compute the logsumexp of all of the elements stored at temperature T
- Returns
◆ MAX_N
template<class T>
const size_t TopN< T >::MAX_N = SIZE_MAX |
|
static |
template<class T>
std::atomic<size_t> TopN< T >::N |
◆ print_best
template<class T>
bool TopN< T >::print_best |
The documentation for this class was generated from the following file: