rng.hpp File Reference
#include <stdio.h>
#include <ert/util/type_macros.hpp>
Include dependency graph for rng.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef unsigned int() rng_forward_ftype(void *)
 
typedef void() rng_set_state_ftype(void *, const char *)
 
typedef void() rng_get_state_ftype(void *, char *)
 
typedef void *() rng_alloc_ftype(void)
 
typedef void() rng_free_ftype(void *)
 
typedef void() rng_fscanf_ftype(void *, FILE *)
 
typedef void() rng_fprintf_ftype(const void *, FILE *)
 
typedef struct rng_struct rng_type
 

Enumerations

enum  rng_init_mode { INIT_DEFAULT = 0 , INIT_CLOCK = 1 , INIT_DEV_RANDOM = 2 , INIT_DEV_URANDOM = 3 }
 
enum  rng_alg_type { MZRAN = 1 }
 

Functions

rng_typerng_alloc (rng_alg_type type, rng_init_mode init_mode)
 
void rng_free (rng_type *rng)
 
unsigned int rng_forward (rng_type *rng)
 
double rng_get_double (rng_type *rng)
 
void rng_rng_init (rng_type *rng, rng_type *seed_src)
 
void rng_init (rng_type *rng, rng_init_mode init_mode)
 
rng_alg_type rng_get_type (const rng_type *rng)
 
void rng_fprintf_state (rng_type *rng, FILE *stream)
 
void rng_fscanf_state (rng_type *rng, FILE *stream)
 
int rng_state_size (const rng_type *rng)
 
void rng_save_state (rng_type *rng, const char *filename)
 
void rng_load_state (rng_type *rng, const char *filename)
 
void rng_set_state (rng_type *rng, const char *state)
 
void rng_get_state (const rng_type *rng, char *state)
 
int rng_get_int (rng_type *rng, int max_value)
 
unsigned int rng_get_max_int (const rng_type *rng)
 
double rng_std_normal (rng_type *rng)
 
void rng_shuffle_int (rng_type *rng, int *data, size_t num_elements)
 
void rng_shuffle (rng_type *rng, char *data, size_t element_size, size_t num_elements)
 
void rng_free__ (void *arg)
 
 UTIL_SAFE_CAST_HEADER (rng)
 

Typedef Documentation

◆ rng_alloc_ftype

typedef void *() rng_alloc_ftype(void)

◆ rng_forward_ftype

typedef unsigned int() rng_forward_ftype(void *)

◆ rng_fprintf_ftype

typedef void() rng_fprintf_ftype(const void *, FILE *)

◆ rng_free_ftype

typedef void() rng_free_ftype(void *)

◆ rng_fscanf_ftype

typedef void() rng_fscanf_ftype(void *, FILE *)

◆ rng_get_state_ftype

typedef void() rng_get_state_ftype(void *, char *)

◆ rng_set_state_ftype

typedef void() rng_set_state_ftype(void *, const char *)

◆ rng_type

typedef struct rng_struct rng_type

Enumeration Type Documentation

◆ rng_alg_type

Enumerator
MZRAN 

◆ rng_init_mode

Enumerator
INIT_DEFAULT 
INIT_CLOCK 
INIT_DEV_RANDOM 
INIT_DEV_URANDOM 

Function Documentation

◆ rng_alloc()

rng_type * rng_alloc ( rng_alg_type  type,
rng_init_mode  init_mode 
)

◆ rng_forward()

unsigned int rng_forward ( rng_type rng)

◆ rng_fprintf_state()

void rng_fprintf_state ( rng_type rng,
FILE *  stream 
)

◆ rng_free()

void rng_free ( rng_type rng)

◆ rng_free__()

void rng_free__ ( void *  arg)

◆ rng_fscanf_state()

void rng_fscanf_state ( rng_type rng,
FILE *  stream 
)

◆ rng_get_double()

double rng_get_double ( rng_type rng)

◆ rng_get_int()

int rng_get_int ( rng_type rng,
int  max_value 
)

◆ rng_get_max_int()

unsigned int rng_get_max_int ( const rng_type rng)

◆ rng_get_state()

void rng_get_state ( const rng_type rng,
char *  state 
)

◆ rng_get_type()

rng_alg_type rng_get_type ( const rng_type rng)

◆ rng_init()

void rng_init ( rng_type rng,
rng_init_mode  init_mode 
)

◆ rng_load_state()

void rng_load_state ( rng_type rng,
const char *  filename 
)

◆ rng_rng_init()

void rng_rng_init ( rng_type rng,
rng_type seed_src 
)

◆ rng_save_state()

void rng_save_state ( rng_type rng,
const char *  filename 
)

◆ rng_set_state()

void rng_set_state ( rng_type rng,
const char *  state 
)

◆ rng_shuffle()

void rng_shuffle ( rng_type rng,
char *  data,
size_t  element_size,
size_t  num_elements 
)

◆ rng_shuffle_int()

void rng_shuffle_int ( rng_type rng,
int *  data,
size_t  num_elements 
)

◆ rng_state_size()

int rng_state_size ( const rng_type rng)

◆ rng_std_normal()

double rng_std_normal ( rng_type rng)

◆ UTIL_SAFE_CAST_HEADER()

UTIL_SAFE_CAST_HEADER ( rng  )