SCM

SCM Repository

[rmetrics] Annotation of /pkg/randtoolbox/src/randtoolbox.h
ViewVC logotype

Annotation of /pkg/randtoolbox/src/randtoolbox.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6136 - (view) (download) (as text)

1 : dutangc 4229 /**
2 :     * @file randtoolbox.h
3 :     * @brief header file for all RNGs
4 :     *
5 :     * @author Christophe Dutang
6 :     * @author Petr Savicky
7 :     *
8 : dutangc 6136 * Copyright (C) 2019, Christophe Dutang,
9 : dutangc 4229 * Petr Savicky, Academy of Sciences of the Czech Republic.
10 : dutangc 6136 * Christophe Dutang, see http://dutangc.free.fr
11 : dutangc 4229 * All rights reserved.
12 :     *
13 :     * The new BSD License is applied to this software.
14 : dutangc 6136 * Copyright (c) 2019 Christophe Dutang, Petr Savicky.
15 : dutangc 4229 * All rights reserved.
16 :     *
17 :     * Redistribution and use in source and binary forms, with or without
18 :     * modification, are permitted provided that the following conditions are
19 :     * met:
20 :     *
21 :     * - Redistributions of source code must retain the above copyright
22 :     * notice, this list of conditions and the following disclaimer.
23 :     * - Redistributions in binary form must reproduce the above
24 :     * copyright notice, this list of conditions and the following
25 :     * disclaimer in the documentation and/or other materials provided
26 :     * with the distribution.
27 :     * - Neither the name of the Academy of Sciences of the Czech Republic
28 :     * nor the names of its contributors may be used to endorse or promote
29 :     * products derived from this software without specific prior written
30 :     * permission.
31 :     *
32 :     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33 :     * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34 :     * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
35 :     * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36 :     * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
37 :     * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38 :     * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
39 :     * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
40 :     * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
41 :     * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
42 :     * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43 :     *
44 :     */
45 : dutangc 4236 /*****************************************************************************
46 : dutangc 4229 * Random number generators algorithms
47 : dutangc 3644 *
48 :     * header file
49 :     *
50 :     */
51 :    
52 : dutangc 3955 //R header files
53 : dutangc 3644 #include <R.h>
54 :     #include <Rinternals.h>
55 :     #include <Rdefines.h>
56 :     #include <Rmath.h>
57 :     #include <R_ext/Error.h>
58 :    
59 :     #include "config.h"
60 :     #include "locale.h"
61 :    
62 : dutangc 6018 //Halton
63 :     #include "LowDiscrepancy-halton.h"
64 :    
65 : dutangc 6026 //Sobol
66 :     #include "LowDiscrepancy-sobol.h"
67 :    
68 : savicky 3973 //congruRand
69 :     #include "congruRand.h"
70 : dutangc 3644
71 :     //SFMT
72 :     #include "SFMT.h"
73 :    
74 :     //Knuth TAOCP
75 :     #include "knuthTAOCP2002.h"
76 :    
77 : dutangc 4393 //WELL RNGs
78 :     #include "wellrng.h"
79 : dutangc 3644
80 : dutangc 6018 //the first 100 000 prime numbers taken from http://primes.utm.edu/ is included
81 :     //in randtoolbox.c by #include "primes.h"
82 : dutangc 4393
83 : dutangc 6018
84 :    
85 :    
86 :    
87 : dutangc 3955 //time header files
88 : dutangc 3644 #if HAVE_TIME_H
89 :     # include <time.h>
90 :     #endif
91 :    
92 :     #if HAVE_SYS_TIME_H
93 :     # include <sys/time.h>
94 :     #endif
95 :    
96 :     #if HAVE_WINDOWS_H
97 :     # include <windows.h>
98 :     #endif
99 :    
100 :     #if defined(HAVE_SSE2)
101 :     # include <emmintrin.h>
102 :     #endif
103 :    
104 :    
105 :     /* Functions accessed from .Call() */
106 : dutangc 6028 SEXP doTorus(SEXP n, SEXP d, SEXP p, SEXP offset, SEXP ismixed, SEXP timedseed, SEXP mersexpo);
107 :     SEXP doHalton(SEXP n, SEXP d, SEXP offset, SEXP ismixed, SEXP timedseed, SEXP mersexpo);
108 :     SEXP doSobol(SEXP n, SEXP d, SEXP offset, SEXP ismixed, SEXP timedseed, SEXP mersexpo);
109 : dutangc 3644 SEXP doSetSeed(SEXP s);
110 :     SEXP doCongruRand(SEXP n, SEXP d, SEXP modulus, SEXP multiplier, SEXP increment, SEXP echo);
111 :     SEXP doSFMersenneTwister(SEXP n, SEXP d, SEXP mersexpo, SEXP paramset);
112 :     SEXP doWELL(SEXP n, SEXP d, SEXP order, SEXP tempering, SEXP version);
113 :     SEXP doKnuthTAOCP(SEXP n, SEXP d);
114 :    
115 :     /* utility functions */
116 : dutangc 6028 void torus(double *u, int nb, int dim, int *prime, int offset, int ismixed, int usetime, int mexp);
117 : dutangc 6033 void halton_c(double *u, int nb, int dim, int offset, int ismixed, int usetime, int mexp);
118 :     void sobol_c(double *u, int nb, int dim, int offset, int ismixed, int usetime, int mexp);
119 : dutangc 6115 void congruRand(double *u, int nb, int dim, uint64_t mod, uint64_t mult, uint64_t incr, uint64_t mask, int show);
120 : dutangc 3644 void SFmersennetwister(double *u, int nb, int dim, int mexp, int usepset);
121 :     void knuthTAOCP(double *u, int nb, int dim);
122 :    
123 :     void setSeed(long s);
124 :     void randSeedByArray(int length);
125 :     void randSeed();
126 :    
127 : savicky 3905 void reconstruct_primes();
128 : dutangc 6033
129 :     /* Functions accessed from .C() */
130 : savicky 3909 void get_primes(int *n, int *pri);
131 : savicky 3905

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge