Turi Create
4.0
|
Namespaces | |
turi::random | |
Classes | |
class | turi::random::alias_sampler |
Functions | |
void | turi::random::seed () |
void | turi::random::seed (size_t seed_value) |
void | turi::random::nondet_seed () |
void | turi::random::time_seed () |
generator & | turi::random::get_source () |
template<typename NumType > | |
NumType | turi::random::uniform (const NumType min, const NumType max) |
template<typename NumType > | |
NumType | turi::random::fast_uniform (const NumType min, const NumType max) |
double | turi::random::rand01 () |
int | turi::random::rand () |
double | turi::random::gamma (const double alpha=double(1)) |
double | turi::random::gaussian (const double mean=double(0), const double stdev=double(1)) |
double | turi::random::normal (const double mean=double(0), const double stdev=double(1)) |
double | turi::random::cauchy (const double location=double(0), const double scale=double(1)) |
bool | turi::random::bernoulli (const double p=double(0.5)) |
bool | turi::random::fast_bernoulli (const double p=double(0.5)) |
template<typename Double > | |
size_t | turi::random::multinomial (const std::vector< Double > &prb) |
template<typename VecLike , typename Double > | |
size_t | turi::random::multinomial (const VecLike &prb, Double norm) |
template<typename Double > | |
size_t | turi::random::multinomial_cdf (const std::vector< Double > &cdf) |
template<typename T > | |
std::vector< T > | turi::random::permutation (const size_t nelems) |
template<typename T > | |
void | turi::random::shuffle (std::vector< T > &vec) |
template<typename Iterator > | |
void | turi::random::shuffle (Iterator begin, Iterator end) |
|
inline |
Draw a sample from a bernoulli distribution
Definition at line 478 of file random.hpp.
|
inline |
Generate a cauchy random variable with zero location and unit scale.
Definition at line 469 of file random.hpp.
|
inline |
Draw a sample form a bernoulli distribution using the faster generator
Definition at line 486 of file random.hpp.
|
inline |
Generate a random number in the uniform real with range [min, max) or [min, max] if the number type is discrete.
Definition at line 416 of file random.hpp.
|
inline |
Generate a random number from a gamma distribution.
Definition at line 438 of file random.hpp.
|
inline |
Generate a gaussian random variable with zero mean and unit standard deviation.
Definition at line 449 of file random.hpp.
generator& turi::random::get_source | ( | ) |
Get the local generator
|
inline |
Generate a draw from a multinomial. This function automatically normalizes as well.
Definition at line 496 of file random.hpp.
|
inline |
Generate a draw from a multinomial, with preknown normalization This function automatically normalizes as well.
Definition at line 506 of file random.hpp.
|
inline |
Generate a draw from a cdf;
Definition at line 515 of file random.hpp.
void turi::random::nondet_seed | ( | ) |
Seed all generators using a nondeterministic source
|
inline |
Generate a gaussian random variable with zero mean and unit standard deviation.
Definition at line 459 of file random.hpp.
|
inline |
Construct a random permutation
Definition at line 526 of file random.hpp.
|
inline |
Simulates the standard rand function as defined in cstdlib
Definition at line 431 of file random.hpp.
|
inline |
Generate a random number between 0 and 1
Definition at line 425 of file random.hpp.
void turi::random::seed | ( | ) |
Seed all generators using the default seed
void turi::random::seed | ( | size_t | seed_value | ) |
Seed all generators using an integer
|
inline |
Shuffle a standard vector
Definition at line 536 of file random.hpp.
|
inline |
Shuffle a range using the begin and end iterators
Definition at line 545 of file random.hpp.
void turi::random::time_seed | ( | ) |
Seed all generators using the current time in microseconds
|
inline |
Generate a random number in the uniform real with range [min, max) or [min, max] if the number type is discrete.
Definition at line 405 of file random.hpp.