RAPI
|
00001 /* 00002 * R : A Computer Language for Statistical Data Analysis 00003 * Copyright (C) 1998-2016 The R Core Team 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU Lesser General Public License as published by 00007 * the Free Software Foundation; either version 2.1 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public License 00016 * along with this program; if not, a copy is available at 00017 * https://www.R-project.org/Licenses/ 00018 */ 00019 00020 /* Included by R.h: API */ 00021 00022 #ifndef R_RANDOM_H 00023 #define R_RANDOM_H 00024 00025 #include <R_ext/Boolean.h> 00026 00027 #ifdef __cplusplus 00028 extern "C" { 00029 #endif 00030 00031 typedef enum { 00032 WICHMANN_HILL, 00033 MARSAGLIA_MULTICARRY, 00034 SUPER_DUPER, 00035 MERSENNE_TWISTER, 00036 KNUTH_TAOCP, 00037 USER_UNIF, 00038 KNUTH_TAOCP2, 00039 LECUYER_CMRG 00040 } RNGtype; 00041 00042 /* Different kinds of "N(0,1)" generators :*/ 00043 typedef enum { 00044 BUGGY_KINDERMAN_RAMAGE, 00045 AHRENS_DIETER, 00046 BOX_MULLER, 00047 USER_NORM, 00048 INVERSION, 00049 KINDERMAN_RAMAGE 00050 } N01type; 00051 00052 00053 void GetRNGstate(void); 00054 void PutRNGstate(void); 00055 00056 double unif_rand(void); 00057 /* These are also defined in Rmath.h */ 00058 double norm_rand(void); 00059 double exp_rand(void); 00060 00061 typedef unsigned int Int32; 00062 double * user_unif_rand(void); 00063 void user_unif_init(Int32); 00064 int * user_unif_nseed(void); 00065 int * user_unif_seedloc(void); 00066 00067 double * user_norm_rand(void); 00068 00069 #ifdef __cplusplus 00070 } 00071 #endif 00072 00073 #endif /* R_RANDOM_H */