Developer documentation
Version 3.0.3-105-gd3941f44
MR::Math::RNG Class Reference

random number generator More...

#include "math/rng.h"

Inheritance diagram for MR::Math::RNG:

Classes

class  Integer
 
class  Normal
 
class  Uniform
 

Public Member Functions

 RNG ()
 
 RNG (std::mt19937::result_type seed)
 
 RNG (const RNG &)
 

Static Public Member Functions

static std::mt19937::result_type get_seed ()
 

Detailed Description

random number generator

this is a thin wrapper around the standard C++11 std::mt19937 random number generator. It can be used in combination with the standard C++11 distributions. It differs from the standard in its constructors: the default constructor will seed using std::random_device, unless a seed has been expicitly passed using the MRTRIX_RNG_SEED environment variable. The copy constructor will seed itself using 1 + the last seed used - this ensures the seeds are unique across instances in multi-threading.

Definition at line 44 of file rng.h.

Constructor & Destructor Documentation

◆ RNG() [1/3]

MR::Math::RNG::RNG ( )
inline

Definition at line 47 of file rng.h.

◆ RNG() [2/3]

MR::Math::RNG::RNG ( std::mt19937::result_type  seed)
inline

Definition at line 48 of file rng.h.

◆ RNG() [3/3]

MR::Math::RNG::RNG ( const RNG )
inline

Definition at line 49 of file rng.h.

Member Function Documentation

◆ get_seed()

static std::mt19937::result_type MR::Math::RNG::get_seed ( )
inlinestatic

Definition at line 54 of file rng.h.


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