taco-db  0.1.0
Public Types | Public Member Functions | Private Attributes | List of all members
taco::Walker Class Reference

A discrete distribution over non-negative integer set [n] for some n over a given probability distribution. More...

#include <utils/Walker.h>

Public Types

using result_type = uint32_t
 

Public Member Functions

 Walker ()
 Default constructs walker in an invalid state. More...
 
 Walker (const std::vector< double > &prob)
 Constructs a discrete distribution over the integer set [0, prob.size()- 1] with the specified distribution. More...
 
 Walker (const Walker &)=default
 
 Walker (Walker &&other)
 
Walkeroperator= (const Walker &)=default
 
Walkeroperator= (Walker &&other)
 
template<typename RNG >
uint32_t operator() (RNG &rng)
 

Private Attributes

uint32_t m_N
 
std::vector< uint32_t > m_IA
 
std::vector< double > m_F
 
std::uniform_int_distribution< uint32_t > m_unif_a
 
std::uniform_real_distribution< double > m_unif_b
 

Detailed Description

A discrete distribution over non-negative integer set [n] for some n over a given probability distribution.

Note that this class does not satisfy RandomNumberDistribution requirement due to missing many required interfaces.

Member Typedef Documentation

◆ result_type

using taco::Walker::result_type = uint32_t

Constructor & Destructor Documentation

◆ Walker() [1/4]

taco::Walker::Walker ( )
inline

Default constructs walker in an invalid state.

◆ Walker() [2/4]

taco::Walker::Walker ( const std::vector< double > &  prob)

Constructs a discrete distribution over the integer set [0, prob.size()- 1] with the specified distribution.

prob needs to be normalized. Otherwise it is undefined.

◆ Walker() [3/4]

taco::Walker::Walker ( const Walker )
default

◆ Walker() [4/4]

taco::Walker::Walker ( Walker &&  other)
inline

Member Function Documentation

◆ operator()()

template<typename RNG >
uint32_t taco::Walker::operator() ( RNG &  rng)
inline

◆ operator=() [1/2]

Walker& taco::Walker::operator= ( const Walker )
default

◆ operator=() [2/2]

Walker& taco::Walker::operator= ( Walker &&  other)
inline

Member Data Documentation

◆ m_F

std::vector<double> taco::Walker::m_F
private

◆ m_IA

std::vector<uint32_t> taco::Walker::m_IA
private

◆ m_N

uint32_t taco::Walker::m_N
private

◆ m_unif_a

std::uniform_int_distribution<uint32_t> taco::Walker::m_unif_a
private

◆ m_unif_b

std::uniform_real_distribution<double> taco::Walker::m_unif_b
private

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