ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
flann::UniqueRandom Class Reference

#include <random.h>

Public Member Functions

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

Detailed Description

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

Definition at line 91 of file random.h.

Constructor & Destructor Documentation

◆ UniqueRandom()

flann::UniqueRandom::UniqueRandom ( int  n)
inline

Constructor.

Parameters
nSize of the interval from which to generate
Returns

Definition at line 103 of file random.h.

References init().

Member Function Documentation

◆ init()

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

Initializes the number generator.

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

Definition at line 112 of file random.h.

References size_.

Referenced by UniqueRandom().

◆ next()

int flann::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 132 of file random.h.

References size_.

Referenced by flann::RandomCenterChooser< Distance >::operator()(), and flann::random_sample().


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