Timothy  0.9
Tissue Modelling Framework
 All Data Structures Files Functions Variables Typedefs Macros
random.c File Reference

contains functions which handle the RNG More...

#include <stdlib.h>
#include <sprng.h>
#include "global.h"
Include dependency graph for random.c:

Go to the source code of this file.

Functions

void randomStreamInit ()
 
void randomStreamFree ()
 

Detailed Description

contains functions which handle the RNG

Definition in file random.c.

Function Documentation

void randomStreamFree ( )

This function deallocates memory used by the RNG.

Definition at line 45 of file random.c.

References stream.

46 {
47  free_sprng(stream);
48 }
int * stream
Definition: global.h:275

Here is the caller graph for this function:

void randomStreamInit ( )

This function initializes the RNG.

Definition at line 35 of file random.c.

References MPIrank, MPIsize, SEED, and stream.

36 {
37  int gtype; // RNG type: DEFAULT_RNG_TYPE, SPRNG_LFG, SPRNG_LCG, SPRNG_LCG64, SPRNG_CMRG, SPRNG_MLFG, SPRNG_PMLCG
38  gtype = DEFAULT_RNG_TYPE;
39  stream = init_sprng(gtype, MPIrank, MPIsize, SEED, SPRNG_DEFAULT);
40 }
int MPIrank
Definition: global.h:134
int MPIsize
Definition: global.h:135
#define SEED
Definition: global.h:274
int * stream
Definition: global.h:275

Here is the caller graph for this function: