Home | Develop | Download | Contact
pdsuniform.h
1 /*
2  * pdsuniform.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 __PDSUNIFORM_H__
34 #define __PDSUNIFORM_H__
35 
36 #include <stdio.h>
37 #include <pds/pdsrvglobal.h>
38 #include <pds/pdscongruential.h>
39 #include <pds/pdsvector.h>
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
56 #define PDS_MIN_UNIFORM_PROB 1.0/PDS_RAND_MAX
57 
58 
69 typedef struct
70 {
75 
80 
83 
86 }PdsUniform;
87 
97 
98 
107 
108 
119 
120 
131 
132 
142 int pds_uniform_get_vector(PdsUniform *X, PdsVector *x);
143 
144 
152 
153 
154 
162 
167 #ifdef __cplusplus
168 }
169 #endif
170 
171 #endif /* __PDSUNIFORM_H__ */
172 
PdsCongruential * X1
Definition: pdsuniform.h:74
PdsRvReal x
Definition: pdsuniform.h:79
PdsRvReal A
Definition: pdsuniform.h:82
int pds_uniform_get_vector(PdsUniform *X, PdsVector *x)
Retorna un vector con valores pseudo aleatorio y uniforme entre [A,B), con PDS_RAND_MAX divisiones de...
PdsUniform * pds_uniform_new(PdsRvReal A, PdsRvReal B)
Crea una variable aleatoria de tipo PdsUniform.
int pds_uniform_get_last_value(PdsUniform *X, PdsRvReal *x)
Retorna el último número pseudo aleatorio entregado por la R.V. uniforme entre [A,B), con PDS_RAND_MAX divisiones de resolución.
float PdsRvReal
Definition: pdsrvglobal.h:59
La estructura tipo PdsCongruential. Esta estructura genera una secuencia aleatoria congruential...
void pds_uniform_destroy(PdsUniform **X)
Libera la variable aleatoria de tipo puntero PdsUniform, y la carga con NULL.
int pds_uniform_init(PdsUniform *X, PdsRvReal x0)
Inicializa la variable pseudo aleatorio y uniforme entre [A,B).
PdsRvReal B
Definition: pdsuniform.h:85
La estructura tipo PdsUniform. Esta estructura genera una variable aleatoria uniformemente distribuid...
Definition: pdsuniform.h:69
void pds_uniform_free(PdsUniform *X)
Libera la variable aleatoria de tipo puntero PdsUniform.
int pds_uniform_get_value(PdsUniform *X, PdsRvReal *x)
Retorna un número pseudo aleatorio y uniforme entre [A,B), con PDS_RAND_MAX divisiones de resolución...

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed