Statistics
| Revision:

root / tmp / org.txm.statsengine.r.core.win32 / res / win32 / include / R_ext / Random.h @ 2486

History | View | Annotate | Download (1.7 kB)

1
/*
2
 *  R : A Computer Language for Statistical Data Analysis
3
 *  Copyright (C) 1998-2011    The R Core Team
4
 *
5
 *  This program is free software; you can redistribute it and/or modify
6
 *  it under the terms of the GNU Lesser General Public License as published by
7
 *  the Free Software Foundation; either version 2.1 of the License, or
8
 *  (at your option) any later version.
9
 *
10
 *  This program is distributed in the hope that it will be useful,
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 *  GNU Lesser General Public License for more details.
14
 *
15
 *  You should have received a copy of the GNU Lesser General Public License
16
 *  along with this program; if not, a copy is available at
17
 *  http://www.r-project.org/Licenses/
18
 */
19

    
20
/* Included by R.h: API */
21

    
22
#ifndef R_RANDOM_H
23
#define R_RANDOM_H
24

    
25
#ifdef  __cplusplus
26
extern "C" {
27
#endif
28

    
29
#include <R_ext/Boolean.h>
30

    
31
typedef enum {
32
    WICHMANN_HILL,
33
    MARSAGLIA_MULTICARRY,
34
    SUPER_DUPER,
35
    MERSENNE_TWISTER,
36
    KNUTH_TAOCP,
37
    USER_UNIF,
38
    KNUTH_TAOCP2,
39
    LECUYER_CMRG
40
} RNGtype;
41

    
42
/* Different kinds of "N(0,1)" generators :*/
43
typedef enum {
44
    BUGGY_KINDERMAN_RAMAGE,
45
    AHRENS_DIETER,
46
    BOX_MULLER,
47
    USER_NORM,
48
    INVERSION,
49
    KINDERMAN_RAMAGE
50
} N01type;
51

    
52

    
53
void GetRNGstate(void);
54
void PutRNGstate(void);
55

    
56
double unif_rand(void);
57
/* These are also defined in Rmath.h */
58
double norm_rand(void);
59
double exp_rand(void);
60

    
61
typedef unsigned int Int32;
62
double * user_unif_rand(void);
63
void user_unif_init(Int32);
64
int * user_unif_nseed(void);
65
int * user_unif_seedloc(void);
66

    
67
double * user_norm_rand(void);
68

    
69
void FixupProb(double *, int, int, Rboolean);
70

    
71
#ifdef  __cplusplus
72
}
73
#endif
74

    
75
#endif /* R_RANDOM_H */