cvflann::UniqueRandom Class Reference

#include <random.h>

List of all members.

Public Member Functions

void init (int n)
int next ()
 UniqueRandom (int n)
 ~UniqueRandom ()

Private Attributes

int counter
int size
int * vals

Detailed Description

Random number generator that returns a distinct number from the [0,n) interval each time.

TODO: improve on this to use a generator function instead of an array of randomly permuted numbers

Definition at line 66 of file random.h.


Constructor & Destructor Documentation

cvflann::UniqueRandom::UniqueRandom ( int  n  )  [inline]

Constructor. Params: n = the size of the interval from which to generate random numbers.

Definition at line 79 of file random.h.

cvflann::UniqueRandom::~UniqueRandom (  )  [inline]

Definition at line 83 of file random.h.


Member Function Documentation

void cvflann::UniqueRandom::init ( int  n  )  [inline]

Initializes the number generator. Params: n = the size of the interval from which to generate random numbers.

Definition at line 94 of file random.h.

int cvflann::UniqueRandom::next (  )  [inline]

Return a distinct random integer in greater or equal to 0 and less than 'n' on each call. It should be called maximum 'n' times. Returns: a random integer

Definition at line 123 of file random.h.


Member Data Documentation

Definition at line 70 of file random.h.

Definition at line 69 of file random.h.

Definition at line 68 of file random.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines


opencv2
Author(s): Gary Bradski and many others. See web page for a full contributor list. ROS package maintained by James Bowman.
autogenerated on Fri Jan 11 10:00:49 2013