API Reference > Other Classes > OdRandom Class
OdRandom Class
OdRandom
Syntax
C++
class OdRandom;

OdRandom.h

Random number generator with support for uniform distributions. 

A few important facts:

  1. The state is stored internally (no global state like in rand).
  2. The generated integer numbers are exactly the same on every platform on every run.
  3. Ideally, the same should apply to real numbers: they should be same on every platform on every run. Even if they are different, the deviation should be negligible (~ DBL_EPSILON) relative to distribution range.
 

Sample usage: OdRandom rnd; for (int i = 0; i < 1000; i++) samples.push_back(rnd.genDouble(0, OdaPI));

 
Name 
Description 
 
This is ~OdRandom, a member of class OdRandom. 
 
This is the overview for the OdRandom constructor overload. 
 
Name 
Description 
 
This is genBool, a member of class OdRandom. 
 
This is the overview for the genDouble method overload. 
 
This is the overview for the generator method overload. 
 
This is genInt, a member of class OdRandom. 
 
This is genInt64, a member of class OdRandom. 
 
This is genUInt, a member of class OdRandom. 
 
 
 
This is randomOf, a member of class OdRandom. 
 
Name 
Description 
 
= 
This is =, a member of class OdRandom. 
Copyright © 2002–2020. Open Design Alliance. All rights reserved.