Class binned_powerlaw_distribution

Inheritance Relationships

Base Type

Class Documentation

class binned_powerlaw_distribution : public rcppsw::math::powerlaw_distribution

A power law distribution (duh) of x^pwr where x is in [lb, ub], where the outputs are rounded to the nearest power of pwr. For example, instead of sampling and getting 3.78, with pwr=2 you would get 4.

Public Functions

inline binned_powerlaw_distribution(size_t lb, size_t ub, size_t pwr)

Initialize distribution.

Parameters:
  • lb – Lower bound for distribution. Assumed to be a multiple of pwr.

  • ub – Upper bound for distribution. Assumed to be a multiple of pwr.

  • pwr – Power for distribution.

inline size_t operator()(rng *const rng)