next up previous contents
Next: void Alias::write_construct (const string Up: Member Function Documentation Previous: void Alias::transpose (const int   Contents

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.


Florent Morata 2002-12-11