Home | Develop | Download | Contact
Congruential.hpp
1/*
2 * Congruential.hpp
3 *
4 * Copyright 2018 Fernando Pujaico Rivera <fernando.pujaico.rivera@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 * MA 02110-1301, USA.
20 *
21 */
22
32#ifndef __PDS_CONGRUENTIAL_HPP__
33#define __PDS_CONGRUENTIAL_HPP__
34
35
36
37
54#define PDS_CONGRUENTIAL_MAX 2147483648UL
55
60#define LN_PDS_CONGRUENTIAL_MAX 21.487562597
61
66#define _2LN_PDS_CONGRUENTIAL_MAX 42.975125195
67
68namespace Pds{
69
70
79{
80
81public:
82
86 unsigned long int xn;
87
90 unsigned long int x0;
91
97 unsigned long int a;
98
102 unsigned long int c;
103
104public:
105
121
132 Congruential(unsigned long int xinit);
133
135
140public:
141
152 unsigned long int GetValue(void);
153
158public:
159
170 unsigned long int GetA(void) const;
171
177 unsigned long int GetC(void) const;
178
179
184public:
185
196 bool Init(unsigned long int xinit);
197
203}; // Class Congruential
204
205} // namespace Pds
206
211#endif
212
La clase tipo Pds::Congruential . Esta clase genera un objeto con dos parametros Nlin y Ncol....
unsigned long int x0
unsigned long int c
unsigned long int a
unsigned long int xn
unsigned long int GetC(void) const
Retorna el parámetro .
Congruential(unsigned long int xinit)
Crea un objeto de tipo Pds::Congruential (una variable discreta uniformemente distribuida entre 0 y P...
unsigned long int GetA(void) const
Retorna el parámetro .
bool Init(unsigned long int xinit)
Inicializa la variable aleatória.
Congruential(void)
Crea un objeto de tipo Pds::Congruential (una variable discreta uniformemente distribuida entre 0 y P...
unsigned long int GetValue(void)
Pide una muestra de la Random Variable.
Nombre de espacio para Pds (Procesamiento Digital de Senales)
Definition: AbstractRV.hpp:42

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed