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

Detailed Description

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

Definition at line 112 of file random.h.

Constructor & Destructor Documentation

◆ UniqueRandom()

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

Constructor.

Parameters
nSize of the interval from which to generate
Returns

Definition at line 124 of file random.h.

Member Function Documentation

◆ init()

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 133 of file random.h.

◆ next()

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 153 of file random.h.

Member Data Documentation

◆ counter_

int rtflann::UniqueRandom::counter_
private

Definition at line 116 of file random.h.

◆ size_

int rtflann::UniqueRandom::size_
private

Definition at line 115 of file random.h.

◆ vals_

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

Definition at line 114 of file random.h.


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


rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:29