Debian Codegraph @

contrib/ms-sbvar/utilities_dw/include/dw_rand.h

raw
1 /*
2 * Copyright (C) 1996-2011 Daniel Waggoner
3 *
4 * This free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * It is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * If you did not received a copy of the GNU General Public License
15 * with this software, see <http://www.gnu.org/licenses/>.
16 */
17
18 #ifndef __DW_RANDOM__
19 #define __DW_RANDOM__
20
21 #ifdef __cplusplus
22 extern "C"
23 {
24 #endif
25
26 #include "prcsn.h"
27 #include <stdio.h>
28
29 void dw_initialize_generator(int init);
30
31 void dw_print_generator_state(FILE *f);
32
33 PRECISION dw_uniform_rnd(void);
34 PRECISION dw_gaussian_rnd(void);
35 PRECISION dw_lognormal_rnd(PRECISION mean, PRECISION standard_deviation);
36 PRECISION dw_gamma_rnd(PRECISION a);
37 PRECISION dw_truncated_gaussian_rnd(PRECISION a, PRECISION b);
38
39 PRECISION dw_chi_square_cdf(PRECISION x, int df);
40 PRECISION dw_chi_square_invcdf(PRECISION p, int df);
41
42 PRECISION dw_log_gamma(PRECISION x);
43
44 #ifdef __cplusplus
45 }
46 #endif
47
48 #endif