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

A truncated zipfian distribution over [0, N - 1], where all items with probability smaller than a threshold in the original zipfian distribution are uniformly sampled with the same probability, while all others are sampled with the same probabilities as in the zipfian. More...

#include <utils/TruncatedZipfian.h>

Public Types

using result_type = uint32_t
 

Public Member Functions

 TruncatedZipfian ()
 Default constructs truncated zipfian in an invalid state. More...
 
 TruncatedZipfian (uint32_t N, double s, double prob_to_truncate)
 Constructs a truncated zipfian(s) distribution over all the integers in [0, N - 1], with all items with probabilities smaller than prob_to_truncate in the zipfian are sampled with the same probabilty, while the remaining are sampled with the probabilities in the zipfian. More...
 
template<typename RNG >
uint32_t operator() (RNG &rng)
 
constexpr uint32_t GetMinTruncatedItem () const
 
double GetProbability (uint32_t x) const
 
constexpr double GetTotalTruncatedProbability () const
 

Private Attributes

uint32_t m_N
 
uint32_t m_min_in_unif
 
double m_s
 
double m_H
 
double m_total_prob_trunc
 
Walker m_walker
 
std::uniform_int_distribution< uint32_t > m_unif_rem
 

Detailed Description

A truncated zipfian distribution over [0, N - 1], where all items with probability smaller than a threshold in the original zipfian distribution are uniformly sampled with the same probability, while all others are sampled with the same probabilities as in the zipfian.

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

Member Typedef Documentation

◆ result_type

Constructor & Destructor Documentation

◆ TruncatedZipfian() [1/2]

taco::TruncatedZipfian::TruncatedZipfian ( )
inline

Default constructs truncated zipfian in an invalid state.

◆ TruncatedZipfian() [2/2]

taco::TruncatedZipfian::TruncatedZipfian ( uint32_t  N,
double  s,
double  prob_to_truncate 
)

Constructs a truncated zipfian(s) distribution over all the integers in [0, N - 1], with all items with probabilities smaller than prob_to_truncate in the zipfian are sampled with the same probabilty, while the remaining are sampled with the probabilities in the zipfian.

Member Function Documentation

◆ GetMinTruncatedItem()

constexpr uint32_t taco::TruncatedZipfian::GetMinTruncatedItem ( ) const
inlineconstexpr

◆ GetProbability()

double taco::TruncatedZipfian::GetProbability ( uint32_t  x) const

◆ GetTotalTruncatedProbability()

constexpr double taco::TruncatedZipfian::GetTotalTruncatedProbability ( ) const
inlineconstexpr

◆ operator()()

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

Member Data Documentation

◆ m_H

double taco::TruncatedZipfian::m_H
private

◆ m_min_in_unif

uint32_t taco::TruncatedZipfian::m_min_in_unif
private

◆ m_N

uint32_t taco::TruncatedZipfian::m_N
private

◆ m_s

double taco::TruncatedZipfian::m_s
private

◆ m_total_prob_trunc

double taco::TruncatedZipfian::m_total_prob_trunc
private

◆ m_unif_rem

std::uniform_int_distribution<uint32_t> taco::TruncatedZipfian::m_unif_rem
private

◆ m_walker

Walker taco::TruncatedZipfian::m_walker
private

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