Main Page   Namespace List   Compound List   File List   Compound Members   File Members  

Alias Class Reference

Aliasing data. More...

#include <alias.h>

List of all members.

Public Methods

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...


Private Types

typedef AliasStruct stock

Private Attributes

vector< stockS


Detailed Description

Aliasing data.

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


Member Typedef Documentation

typedef struct AliasStruct Alias::stock [private]
 

Type stock to manipulate AliasStruct in PSI processes.


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:
d  an 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:
d  an integer corresponding to the matrix width.

int Alias::read const string    path
 

Reading of aliasing data for simulation step.

Parameters:
file  a 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:
d  an 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:
rand  a double value according to uniform law on [0;1].
j  an integer corresponding to a random choice of column index.
n  an integer corresponding to the space state dimension.
d  an integer corresponding to the matrix width.
i  an 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:
namefile  a string corresponding to the name of the output file '.simu'.
d  an integer corresponding to the matrix width.


Member Data Documentation

vector<stock> Alias::S [private]
 

Storage of aliasing arrays.


The documentation for this class was generated from the following files:
Generated on Tue Dec 10 12:44:34 2002 for PSI_ALIAS by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002