Developer Documentation
OpenMesh::RandomNumberGenerator Class Reference

#include <OpenFlipper/libs_required/OpenMesh/src/OpenMesh/Core/Utils/RandomNumberGenerator.hh>

Public Member Functions

 RandomNumberGenerator (const size_t _resolution)
 Constructor. More...
 
double getRand () const
 returns a random double between 0.0 and 1.0 with a guaranteed resolution More...
 
double resolution () const
 

Private Attributes

const size_t resolution_
 desired resolution More...
 
size_t iterations_
 number of "blocks" of RAND_MAX that make up the desired _resolution More...
 
double maxNum_
 maximum random number generated, which is used for normalization More...
 

Detailed Description

Generate a random number between 0.0 and 1.0 with a guaranteed resolution ( Number of possible values )

Especially useful on windows, as there MAX_RAND is often only 32k which is not enough resolution for a lot of applications

Definition at line 77 of file RandomNumberGenerator.hh.

Constructor & Destructor Documentation

◆ RandomNumberGenerator()

OpenMesh::RandomNumberGenerator::RandomNumberGenerator ( const size_t  _resolution)
explicit

Constructor.

Parameters
_resolutionspecifies the desired resolution for the random number generated

Definition at line 64 of file RandomNumberGenerator.cc.

Member Function Documentation

◆ getRand()

double OpenMesh::RandomNumberGenerator::getRand ( ) const

returns a random double between 0.0 and 1.0 with a guaranteed resolution

Definition at line 82 of file RandomNumberGenerator.cc.

◆ resolution()

double OpenMesh::RandomNumberGenerator::resolution ( ) const

Definition at line 92 of file RandomNumberGenerator.cc.

Member Data Documentation

◆ iterations_

size_t OpenMesh::RandomNumberGenerator::iterations_
private

number of "blocks" of RAND_MAX that make up the desired _resolution

Definition at line 98 of file RandomNumberGenerator.hh.

◆ maxNum_

double OpenMesh::RandomNumberGenerator::maxNum_
private

maximum random number generated, which is used for normalization

Definition at line 101 of file RandomNumberGenerator.hh.

◆ resolution_

const size_t OpenMesh::RandomNumberGenerator::resolution_
private

desired resolution

Definition at line 95 of file RandomNumberGenerator.hh.


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