Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations
Classes | Public Member Functions | List of all members
Alias Class Reference

Aliasing data. More...

#include <alias.h>

Public Member Functions

int size () const
 Give the size of aliasing array. More...
 
double threshold (const int i) const
 Give the threshold corresponding to the ith aliasing array index. More...
 
int col (const int i) const
 Give the column index corresponding to the ith aliasing array index. More...
 
int alias (const int i) const
 Give the alias index corresponding to the ith aliasing array index. More...
 
void init (const int d)
 Initialization of aliasing tables. More...
 
void mk_walker (const int d)
 Construction of Walker array. More...
 
void transpose (const int d)
 Transposition of Walker array. More...
 
int read (const string path)
 Reading of aliasing data for simulation step. More...
 
void write_construct (const string file_name, const int d)
 Writing of definitive Walker array (stored by column). More...
 
int walk (const double rand, const int j, const int n, const int d, const int i)
 Walker's algorithm for discrete distributions. More...
 

Detailed Description

Aliasing data.

Walker's algorithm is used to generate internal transitions in the simulation kernel.

Member Function Documentation

int Alias::alias ( const int  i) const
inline

Give the alias index corresponding to the ith aliasing array index.

int Alias::col ( const int  i) const
inline

Give the column index corresponding to the ith aliasing array index.

void Alias::init ( const int  d)

Initialization of aliasing tables.

Parameters
dan integer corresponding to the matrix width.
void Alias::mk_walker ( const int  d)

Construction of Walker array.

This array is built by rows and provides a representetion of the Markov chain to simulate.

Parameters
dan integer corresponding to the matrix width.
int Alias::read ( const string  file)

Reading of aliasing data for simulation step.

Parameters
filea string corresponding to the name of the input file '.simu'.
int Alias::size ( ) const
inline

Give the size of aliasing array.

double Alias::threshold ( const int  i) const
inline

Give the threshold corresponding to the ith aliasing array index.

void Alias::transpose ( const int  d)

Transposition of Walker array.

Parameters
dan integer corresponding to the matrix width. We obtain by this way a contiguous representation for the simulation step.
int Alias::walk ( const double  rand,
const int  j,
const int  n,
const int  d,
const int  i 
)

Walker's algorithm for discrete distributions.

Parameters
randa double value according to uniform law on [0;1].
jan integer corresponding to a random choice of column index.
nan integer corresponding to the space state dimension.
dan integer corresponding to the matrix width.
ian integer between 0 and N-1 ( where N:= matrix dimension) being the current cursor.
void Alias::write_construct ( const string  file_name,
const int  d 
)

Writing of definitive Walker array (stored by column).

Parameters
namefilea string corresponding to the name of the output file '.simu'.
dan integer corresponding to the matrix width.

The documentation for this class was generated from the following files: