minimc 0.5.1
Loading...
Searching...
No Matches
CDF< T > Class Template Reference

Like Map, but stores elements as the CDF of some random variable. Stores CDF values as keys so that std::map::upper_bound() can be used. More...

#include <ContinuousMap.hpp>

Inheritance diagram for CDF< T >:
Collaboration diagram for CDF< T >:

Public Member Functions

 CDF (typename ContinuousMap< Real, T >::elements_type &&other)
 Constructs a CDF from a std::map.
 
const T & Sample (RNG &rng) const noexcept
 Samples a value from the CDF and returns the sampled key.
 
- Public Member Functions inherited from ContinuousMap< Real, T >
at (const Real k, Args... inner_keys) const noexcept
 Returns a linearly interpolated value at the given key. More...
 
T & operator[] (const Real &k)
 Returns a reference to the value at a given key.
 

Additional Inherited Members

- Public Types inherited from ContinuousMap< Real, T >
using elements_type = std::map< Real, T >
 Type used to store elements internally.
 
- Protected Attributes inherited from ContinuousMap< Real, T >
elements_type elements
 This class essentially wraps an STL container.
 

Detailed Description

template<typename T>
class CDF< T >

Like Map, but stores elements as the CDF of some random variable. Stores CDF values as keys so that std::map::upper_bound() can be used.

Template Parameters
TThe type of the random variable

The documentation for this class was generated from the following file: