Public Member Functions | Private Attributes | List of all members
rtflann::UniqueRandom Class Reference

#include <random.h>

Public Member Functions

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

Private Attributes

int counter_
 
int size_
 
std::vector< int > vals_
 

Detailed Description

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

Definition at line 90 of file random.h.

Constructor & Destructor Documentation

rtflann::UniqueRandom::UniqueRandom ( int  n)
inline

Constructor.

Parameters
nSize of the interval from which to generate
Returns

Definition at line 102 of file random.h.

Member Function Documentation

void rtflann::UniqueRandom::init ( int  n)
inline

Initializes the number generator.

Parameters
nthe size of the interval from which to generate random numbers.

Definition at line 111 of file random.h.

int rtflann::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 130 of file random.h.

Member Data Documentation

int rtflann::UniqueRandom::counter_
private

Definition at line 94 of file random.h.

int rtflann::UniqueRandom::size_
private

Definition at line 93 of file random.h.

std::vector<int> rtflann::UniqueRandom::vals_
private

Definition at line 92 of file random.h.


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


rtabmap
Author(s): Mathieu Labbe
autogenerated on Wed Jun 5 2019 22:43:43