GraphLab: Distributed Graph-Parallel API  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Random Number Generators

Namespaces

namespace  graphlab::random

Functions

void graphlab::random::seed ()
void graphlab::random::seed (const size_t seed_value)
void graphlab::random::nondet_seed ()
void graphlab::random::time_seed ()
generator & graphlab::random::get_source ()
template<typename NumType >
NumType graphlab::random::uniform (const NumType min, const NumType max)
template<typename NumType >
NumType graphlab::random::fast_uniform (const NumType min, const NumType max)
double graphlab::random::rand01 ()
int graphlab::random::rand ()
double graphlab::random::gamma (const double alpha=double(1))
double graphlab::random::gaussian (const double mean=double(0), const double stdev=double(1))
double graphlab::random::normal (const double mean=double(0), const double stdev=double(1))
bool graphlab::random::bernoulli (const double p=double(0.5))
bool graphlab::random::fast_bernoulli (const double p=double(0.5))
template<typename Double >
size_t graphlab::random::multinomial (const std::vector< Double > &prb)
template<typename Double >
size_t graphlab::random::multinomial_cdf (const std::vector< Double > &cdf)
template<typename T >
std::vector< T > graphlab::random::permutation (const size_t nelems)
template<typename T >
void graphlab::random::shuffle (std::vector< T > &vec)
template<typename Iterator >
void graphlab::random::shuffle (Iterator begin, Iterator end)

Detailed Description


Function Documentation

bool graphlab::random::bernoulli ( const double  p = double(0.5))
inline

Draw a sample from a bernoulli distribution

Definition at line 428 of file random.hpp.

bool graphlab::random::fast_bernoulli ( const double  p = double(0.5))
inline

Draw a sample form a bernoulli distribution using the faster generator

Definition at line 436 of file random.hpp.

template<typename NumType >
NumType graphlab::random::fast_uniform ( const NumType  min,
const NumType  max 
)
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 376 of file random.hpp.

double graphlab::random::gamma ( const double  alpha = double(1))
inline

Generate a random number from a gamma distribution.

Definition at line 398 of file random.hpp.

double graphlab::random::gaussian ( const double  mean = double(0),
const double  stdev = double(1) 
)
inline

Generate a gaussian random variable with zero mean and unit standard deviation.

Definition at line 409 of file random.hpp.

generator & graphlab::random::get_source ( )

Get the local generator

Definition at line 242 of file random.cpp.

template<typename Double >
size_t graphlab::random::multinomial ( const std::vector< Double > &  prb)
inline

Generate a draw from a multinomial. This function automatically normalizes as well.

Definition at line 446 of file random.hpp.

template<typename Double >
size_t graphlab::random::multinomial_cdf ( const std::vector< Double > &  cdf)
inline

Generate a draw from a cdf;

Definition at line 456 of file random.hpp.

void graphlab::random::nondet_seed ( )

Seed all generators using a nondeterministic source

Definition at line 264 of file random.cpp.

double graphlab::random::normal ( const double  mean = double(0),
const double  stdev = double(1) 
)
inline

Generate a gaussian random variable with zero mean and unit standard deviation.

Definition at line 419 of file random.hpp.

template<typename T >
std::vector<T> graphlab::random::permutation ( const size_t  nelems)
inline

Construct a random permutation

Definition at line 467 of file random.hpp.

int graphlab::random::rand ( )
inline

Simulates the standard rand function as defined in cstdlib

Definition at line 391 of file random.hpp.

double graphlab::random::rand01 ( )
inline

Generate a random number between 0 and 1

Definition at line 385 of file random.hpp.

void graphlab::random::seed ( )

Seed all generators using the default seed

Definition at line 262 of file random.cpp.

void graphlab::random::seed ( size_t  seed_value)

Seed all generators using an integer

Definition at line 268 of file random.cpp.

template<typename T >
void graphlab::random::shuffle ( std::vector< T > &  vec)
inline

Shuffle a standard vector

Definition at line 477 of file random.hpp.

template<typename Iterator >
void graphlab::random::shuffle ( Iterator  begin,
Iterator  end 
)
inline

Shuffle a range using the begin and end iterators

Definition at line 486 of file random.hpp.

void graphlab::random::time_seed ( )

Seed all generators using the current time in microseconds

Definition at line 266 of file random.cpp.

template<typename NumType >
NumType graphlab::random::uniform ( const NumType  min,
const NumType  max 
)
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 365 of file random.hpp.