-
Notifications
You must be signed in to change notification settings - Fork 1
/
Random.h
51 lines (43 loc) · 1.37 KB
/
Random.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*! \file Random.h
* \brief Archivo de cabecera para la clase RNG
* \author Luciana Luque <[email protected]>
* \version 1.0
* \date 2020.06.09
*/
#ifndef __RANDOM_H__
#define __RANDOM_H__
#include <iostream>
#include <random>
class RNG {
private:
double n_max;
int seed;
double media;
double std_desv;
std::mt19937 generator;
std::uniform_real_distribution<double> dist;
std::uniform_real_distribution<double> dist2;
std::normal_distribution<double> d;
std::normal_distribution<double> d2;
public:
/** Constructor
* Inicializa el constructor con parámetros por defecto:
* n_max = 1.0, seed = 13
*/
RNG();
/** Constructor
* \param double NM : límite superior de la distribución.
* \param int SD : semilla del generador.
*/
RNG(double NM, int SD, double med, double desv);
/** \fn RandomNumber
* \brief Devuelve un número aleatorio en [0.0, NM).
* \return double
*/
double RandomNumber();
double NormalRandom();
double NormalRandom_CM( double mean, double standard_deviation );
double RandomNumber( double min, double max );
//double NormalRandom( double mean, double standard_deviation );
};
#endif