41#include <R_ext/Random.h>
43#include <Rcpp/sugar/undoRmath.h>
67 Real s = Rf_runif(0, 1);
82 Real s = Rf_rnorm(mu, sigma);
89 Real s = Rf_runif(0, n);
141 ,
Real const&
gvol = 9.91256303526217e-3
152 ,
Real const&
gvol = 9.91256303526217e-3
162 template<
class TContainer1D>
165 ,
Real const&
gvol = 9.91256303526217e-3
290 if (std::abs(
u) <
wn[
i])
return mu + sigma *
u *
kn[
i];
297 while ( 2.0 *
randExp() < x * x);
306 {
return mu + sigma * x;}
This file include all the header files of the project STKernel.
Generate unsigner 32 bits random number using the Merdsenne Twister Algorithm.
unsigned long uint32
unsigned integer type, at least 32 bits
double randDblExc()
real number in (0,1)
double rand()
real number in [0,1]
uint32 randInt()
integer in [0,2^32-1]
double operator()()
same as rand().
void seed()
Re-seeding functions with same behavior as initializers.
double randExc()
real number in [0,1)
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
class for the Base random generator.
RandBase(TContainer1D const &bigSeed, Real const &glimit=3.442619855899, Real const &gvol=9.91256303526217e-3, int gsize=128)
Initialize with a seed Array.
Real randGauss(Real const &mu=0, Real const &sigma=1)
Pseudo-random gaussian generator of the gaussian probability law:
int randDiscreteUnif()
Pseudo-random int uniform generator.
Real * kn
kn holds coordinates, such that each rectangle has same area.
Real randExc()
real number in [0,1)
Real randExp()
Pseudo-random exponential generator.
Real randUnif()
pseudo-random uniform generator.
Real rand(Real const &n)
real number in [0,n]
Real rand()
real number in [0,1]
Real randExc(Real const &n)
real number in [0,n)
Real const glimit_
limit of the bottom box.
const int gsize_
Number of box for the gaussian ziggourat method.
Real const gvol_
volume of each box and of the remaining tail.
Real randDblExc(Real const &n)
real number in (0,n)
RandBase(Real const &glimit=3.442619855899, Real const &gvol=9.91256303526217e-3, int gsize=128)
Default constructor.
void gaussInit()
Initialization of the Zigourrat method.
Real randDblExc()
real number in (0,1)
Type sign(Type const &x, Type const &y=Type(1))
template sign value sign(x) * y: Type should be an integral type
double Real
STK fundamental type of Real values.
The namespace STK is the main domain space of the Statistical ToolKit project.