A random number generator, normal distribution. More...
#include <yarp/math/RandnScalar.h>
Public Member Functions | |
RandnScalar () | |
Constructor. More... | |
~RandnScalar () | |
RandnScalar (int seed) | |
Constructor, initialize the generator. More... | |
void | init () |
Initialize the generator. More... | |
void | init (int seed) |
Initialize the generator. More... | |
long | getSeed () |
double | get (double u=0.0, double sigma=1.0) |
Generate a randomly generated number, drawn from a normal distribution. More... | |
A random number generator, normal distribution.
Uses the RandScalar class and the Box-Muller algorithm.
Definition at line 26 of file RandnScalar.h.
RandnScalar::RandnScalar | ( | ) |
Constructor.
Definition at line 25 of file RandnScalar.cpp.
RandnScalar::~RandnScalar | ( | ) |
Definition at line 37 of file RandnScalar.cpp.
RandnScalar::RandnScalar | ( | int | seed | ) |
Constructor, initialize the generator.
seed,seed | for the rnd generator. |
Definition at line 31 of file RandnScalar.cpp.
double RandnScalar::get | ( | double | u = 0.0 , |
double | sigma = 1.0 |
||
) |
Generate a randomly generated number, drawn from a normal distribution.
u | mean of the distribution, default 0.0 |
sigma | sigma of the distribution, default 1.0 |
Definition at line 58 of file RandnScalar.cpp.
|
inline |
Definition at line 68 of file RandnScalar.h.
void RandnScalar::init | ( | ) |
Initialize the generator.
Uses current time for the seed.
Definition at line 43 of file RandnScalar.cpp.
void RandnScalar::init | ( | int | seed | ) |
Initialize the generator.
Provide a seed.
seed | the seed |
Definition at line 50 of file RandnScalar.cpp.