Home | Develop | Download | Contact
pdscongruential.h
1 /*
2  * pdscongruential.h
3  *
4  * Copyright 2011 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 
33 #ifndef __PDSCONGRUENTIAL_H__
34 #define __PDSCONGRUENTIAL_H__
35 
36 #include <stdio.h>
37 #include <pds/pdsrvglobal.h>
38 #include <pds/pdsvector.h>
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
55 #define PDS_RAND_MAX 2147483648UL
56 
61 #define LN_PDS_RAND_MAX 21.487562597
62 
67 #define _2LN_PDS_RAND_MAX 42.975125195
68 
69 
78 typedef struct
79 {
83 
90 
95 
101 
109 
118 
128 
129 
139 
140 
148 
149 
150 
158 
163 #ifdef __cplusplus
164 }
165 #endif
166 
167 #endif /* __PDSCONGRUENTIAL_H__ */
168 
int pds_congruential_get_last_value(PdsCongruential *X, PdsRvNaturalD *x)
Retorna el último número entregado por la secuencia pseudo aleatorio entre [0,PDS_RAND_MAX).
PdsRvNaturalD xn
unsigned long PdsRvNaturalD
Definition: pdsrvglobal.h:81
void pds_congruential_destroy(PdsCongruential **X)
Libera la variable secuencia aleatoria de tipo puntero PdsCongruential, y la carga con NULL...
La estructura tipo PdsCongruential. Esta estructura genera una secuencia aleatoria congruential...
PdsCongruential * pds_congruential_new(void)
Crea una secuencia aleatoria de tipo PdsCongruential.
int pds_congruential_get_value(PdsCongruential *X, PdsRvNaturalD *x)
Retorna un número de la secuencia pseudo aleatorio entre [0,PDS_RAND_MAX).
void pds_congruential_free(PdsCongruential *X)
Libera la variable secuencia aleatoria de tipo puntero PdsCongruential.
int pds_congruential_init(PdsCongruential *X, PdsRvNaturalD x0)
Inicializa la secuencia aleatoria de tipo PdsCongruential con x0.
PdsRvNaturalD c
PdsRvNaturalD a
PdsRvNaturalD x0

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed