SimpleNonRepeatRandomNG Class Reference

#include <SimpleNonRepeatRandomNG.h>

Collaboration diagram for SimpleNonRepeatRandomNG:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 SimpleNonRepeatRandomNG ()
 SimpleNonRepeatRandomNG (int low, int high)
virtual ~SimpleNonRepeatRandomNG ()
void reset (int numElem)
void rewind ()
void reset (int low, int high, int numElem)
int operator() (RandomEngine &eng)

Protected Attributes

intseq_array
std::vector< intgenerated_numbers
int low
int high
int range
int cursor
int num_elem
UniformDistribution unidist
bool reseted


Detailed Description

Simple approach to generate non-repeating integer random numbers in a given range. Uses O(range) memory, generates non-repeating random number in constant time. Reuses the same index array for subsequent sequence generation.

This could be replaced by a more memory efficient algorithm, if found in literature. To see: "http://www.usenix.org/event/usenix99/full_papers/deraadt/deraadt_html/node17.html".

Definition at line 20 of file SimpleNonRepeatRandomNG.h.


Constructor & Destructor Documentation

SimpleNonRepeatRandomNG::SimpleNonRepeatRandomNG (  ) 

Definition at line 11 of file SimpleNonRepeatRandomNG.cpp.

SimpleNonRepeatRandomNG::SimpleNonRepeatRandomNG ( int  low,
int  high 
)

Definition at line 17 of file SimpleNonRepeatRandomNG.cpp.

References range, and seq_array.

SimpleNonRepeatRandomNG::~SimpleNonRepeatRandomNG (  )  [virtual]

Definition at line 26 of file SimpleNonRepeatRandomNG.cpp.

References seq_array.


Member Function Documentation

void SimpleNonRepeatRandomNG::reset ( int  numElem  )  [inline]

Definition at line 39 of file SimpleNonRepeatRandomNG.h.

References cursor, generated_numbers, num_elem, and rewind().

Referenced by DegreeDistributionConnections::next(), reset(), and DegreeDistributionConnections::reset().

Here is the call graph for this function:

void SimpleNonRepeatRandomNG::rewind (  )  [inline]

Definition at line 50 of file SimpleNonRepeatRandomNG.h.

References cursor, generated_numbers, and seq_array.

Referenced by reset().

void SimpleNonRepeatRandomNG::reset ( int  low,
int  high,
int  numElem 
) [inline]

Definition at line 59 of file SimpleNonRepeatRandomNG.h.

References num_elem, range, reset(), and seq_array.

Here is the call graph for this function:

int SimpleNonRepeatRandomNG::operator() ( RandomEngine eng  ) 

Definition at line 32 of file SimpleNonRepeatRandomNG.cpp.

References cursor, generated_numbers, low, num_elem, range, seq_array, and unidist.


Member Data Documentation

std::vector< int > SimpleNonRepeatRandomNG::generated_numbers [protected]

Definition at line 79 of file SimpleNonRepeatRandomNG.h.

Referenced by operator()(), reset(), and rewind().

Definition at line 81 of file SimpleNonRepeatRandomNG.h.

Referenced by operator()().

Definition at line 83 of file SimpleNonRepeatRandomNG.h.

Definition at line 85 of file SimpleNonRepeatRandomNG.h.

Referenced by operator()(), reset(), and SimpleNonRepeatRandomNG().

Definition at line 87 of file SimpleNonRepeatRandomNG.h.

Referenced by operator()(), reset(), and rewind().

Definition at line 89 of file SimpleNonRepeatRandomNG.h.

Referenced by operator()(), and reset().

Definition at line 91 of file SimpleNonRepeatRandomNG.h.

Referenced by operator()().

Definition at line 93 of file SimpleNonRepeatRandomNG.h.


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

Generated on Wed Jul 9 16:34:53 2008 for PCSIM by  doxygen 1.5.5