ROSS
Macros | Typedefs | Functions
ross-random.h File Reference

Go to the source code of this file.

Macros

#define tw_opi   6.28318530718
 
#define tw_rand_unif(G)   rng_gen_val(G)
 
#define tw_rand_reverse_unif(G)   rng_gen_reverse_val(G)
 

Typedefs

typedef struct tw_rng tw_rng
 
typedef struct tw_rng_stream tw_rng_stream
 

Functions

tw_rngtw_rand_init (uint32_t v, uint32_t w)
 
void tw_rand_initial_seed (tw_rng_stream *g, tw_lpid id)
 
long tw_rand_integer (tw_rng_stream *g, long low, long high)
 
unsigned long tw_rand_ulong (tw_rng_stream *g, unsigned long low, unsigned long high)
 
long tw_rand_binomial (tw_rng_stream *g, long N, double P)
 
double tw_rand_exponential (tw_rng_stream *g, double Lambda)
 
double tw_rand_pareto (tw_rng_stream *g, double scale, double shape)
 
double tw_rand_gamma (tw_rng_stream *g, double shape, double scale)
 
long tw_rand_geometric (tw_rng_stream *g, double P)
 
double tw_rand_normal01 (tw_rng_stream *g, unsigned int *rng_calls)
 
double tw_rand_normal_sd (tw_rng_stream *g, double Mu, double Sd, unsigned int *rng_calls)
 
long tw_rand_poisson (tw_rng_stream *g, double Lambda)
 
double tw_rand_weibull (tw_rng_stream *g, double mean, double shape)
 

Macro Definition Documentation

#define tw_opi   6.28318530718

Definition at line 4 of file ross-random.h.

Referenced by tw_rand_normal01().

#define tw_rand_reverse_unif (   G)    rng_gen_reverse_val(G)

Definition at line 6 of file ross-random.h.

Referenced by phold_event_handler_rc().

#define tw_rand_unif (   G)    rng_gen_val(G)

Typedef Documentation

typedef struct tw_rng tw_rng

Definition at line 8 of file ross-random.h.

typedef struct tw_rng_stream tw_rng_stream

Definition at line 9 of file ross-random.h.

Function Documentation

long tw_rand_binomial ( tw_rng_stream g,
long  N,
double  P 
)

Definition at line 53 of file ross-random.c.

References tw_rand_unif.

double tw_rand_exponential ( tw_rng_stream g,
double  Lambda 
)

Definition at line 69 of file ross-random.c.

References tw_rand_unif.

Referenced by phold_event_handler(), phold_init(), phold_pre_run(), and tw_rand_gamma().

Here is the caller graph for this function:

double tw_rand_gamma ( tw_rng_stream g,
double  shape,
double  scale 
)

Definition at line 81 of file ross-random.c.

References tw_rand_exponential(), and tw_rand_unif.

Here is the call graph for this function:

long tw_rand_geometric ( tw_rng_stream g,
double  P 
)

Definition at line 141 of file ross-random.c.

References tw_rand_unif.

tw_rng* tw_rand_init ( uint32_t  v,
uint32_t  w 
)

Definition at line 7 of file ross-random.c.

References rng_init().

Referenced by tw_pe_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void tw_rand_initial_seed ( tw_rng_stream g,
tw_lpid  id 
)

Definition at line 265 of file rand-clcg4.c.

References tw_rng::avw, tw_rng_stream::count, tw_rng::m, MultModM(), and tw_rng::seed.

Referenced by tw_rand_init_streams().

Here is the call graph for this function:

Here is the caller graph for this function:

long tw_rand_integer ( tw_rng_stream g,
long  low,
long  high 
)

NOTE: Don't pass negative values to low!

Definition at line 21 of file ross-random.c.

References tw_rand_unif.

Referenced by phold_event_handler(), and phold_pre_run().

Here is the caller graph for this function:

double tw_rand_normal01 ( tw_rng_stream g,
unsigned int *  rng_calls 
)

Definition at line 152 of file ross-random.c.

References tw_error(), TW_LOC, tw_rng_stream::tw_normal_flipflop, tw_rng_stream::tw_normal_u1, tw_rng_stream::tw_normal_u2, tw_opi, and tw_rand_unif.

Referenced by tw_rand_lognormal(), and tw_rand_normal_sd().

Here is the call graph for this function:

Here is the caller graph for this function:

double tw_rand_normal_sd ( tw_rng_stream g,
double  Mu,
double  Sd,
unsigned int *  rng_calls 
)

Definition at line 182 of file ross-random.c.

References tw_rand_normal01().

Here is the call graph for this function:

double tw_rand_pareto ( tw_rng_stream g,
double  scale,
double  shape 
)

Definition at line 75 of file ross-random.c.

References tw_rand_unif.

long tw_rand_poisson ( tw_rng_stream g,
double  Lambda 
)

Definition at line 188 of file ross-random.c.

References tw_rand_unif.

unsigned long tw_rand_ulong ( tw_rng_stream g,
unsigned long  low,
unsigned long  high 
)

Definition at line 37 of file ross-random.c.

References tw_rand_unif.

double tw_rand_weibull ( tw_rng_stream g,
double  mean,
double  shape 
)

Definition at line 215 of file ross-random.c.

References tw_rand_unif.