Chi-Tech
random_number_generator.cc
Go to the documentation of this file.
1
#include "
random_number_generator.h
"
2
3
/**Default constructor. Seeds the generator with a zero.*/
4
chi_math::RandomNumberGenerator::RandomNumberGenerator
() :
5
distribution_(0.0, 1.0)
6
{
7
mt1993764_generator_
.seed(0);
8
}
9
10
/**Constructor where a seed is supplied.*/
11
chi_math::RandomNumberGenerator::RandomNumberGenerator
(
int
seed) :
12
distribution_(0.0, 1.0)
13
{
14
mt1993764_generator_
.seed(seed);
15
}
16
17
/**Generates a random number with the default distribution.*/
18
double
chi_math::RandomNumberGenerator::Rand
()
19
{
20
return
distribution_(mt1993764_generator_);
21
}
chi_math::RandomNumberGenerator::mt1993764_generator_
std::mt19937_64 mt1993764_generator_
Definition:
random_number_generator.h:13
chi_math::RandomNumberGenerator::Rand
double Rand()
Definition:
random_number_generator.cc:18
chi_math::RandomNumberGenerator::RandomNumberGenerator
RandomNumberGenerator()
Definition:
random_number_generator.cc:4
random_number_generator.h
framework
math
RandomNumberGeneration
random_number_generator.cc
Generated by
1.9.3