The R Project SVN R

Rev

Rev 24322 | Rev 42308 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
7727 ripley 1
/*
2
 *  R : A Computer Language for Statistical Data Analysis
20253 ripley 3
 *  Copyright (C) 1998-2002    Robert Gentleman, Ross Ihaka 
7727 ripley 4
 *                             and the R Development Core Team
5
 *
6
 *  This program is free software; you can redistribute it and/or modify
12778 pd 7
 *  it under the terms of the GNU Lesser General Public License as published by
8
 *  the Free Software Foundation; either version 2.1 of the License, or
7727 ripley 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
12778 pd 14
 *  GNU Lesser General Public License for more details.
7727 ripley 15
 *
12778 pd 16
 *  You should have received a copy of the GNU Lesser General Public License
7727 ripley 17
 *  along with this program; if not, write to the Free Software
18
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
 */
20
 
7790 ripley 21
#ifndef R_RANDOM_H
22
#define R_RANDOM_H
7727 ripley 23
 
11211 ripley 24
#ifdef  __cplusplus
25
extern "C" {
26
#endif
27
 
7727 ripley 28
typedef enum {
29
    WICHMANN_HILL,
30
    MARSAGLIA_MULTICARRY,
31
    SUPER_DUPER,
7790 ripley 32
    MERSENNE_TWISTER,
7842 ripley 33
    KNUTH_TAOCP,
18519 ripley 34
    USER_UNIF,
35
    KNUTH_TAOCP2
7727 ripley 36
} RNGtype;
37
 
7766 ripley 38
/* Different kinds of "N(0,1)" generators :*/
7727 ripley 39
typedef enum {
24322 ripley 40
    BUGGY_KINDERMAN_RAMAGE,
7727 ripley 41
    AHRENS_DIETER,
8438 ripley 42
    BOX_MULLER,
20253 ripley 43
    USER_NORM,
24322 ripley 44
    INVERSION,
45
    KINDERMAN_RAMAGE
7727 ripley 46
} N01type;
47
 
48
 
7842 ripley 49
void GetRNGstate(void);
50
void PutRNGstate(void);
7727 ripley 51
 
52
double unif_rand(void);
25960 ripley 53
/* These are also defined in Rmath.h */
7727 ripley 54
double norm_rand(void);
55
double exp_rand(void);
56
 
7842 ripley 57
typedef unsigned int Int32;
58
double * user_unif_rand();
59
void user_unif_init(Int32);
7850 ripley 60
int * user_unif_nseed();
7842 ripley 61
int * user_unif_seedloc();
62
 
8438 ripley 63
double * user_norm_rand();
11211 ripley 64
 
65
#ifdef  __cplusplus
66
}
7727 ripley 67
#endif
11211 ripley 68
 
69
#endif /* R_RANDOM_H */