KIDS  ver-0.0.1
KIDS : Kernel Integrated Dynamics Simulator
Loading...
Searching...
No Matches
Kernel_Random.h
Go to the documentation of this file.
1#ifndef Kernel_Random_H
2#define Kernel_Random_H
3
4#include <random>
5
6#include "kids/Kernel.h"
7
8namespace PROJECT_NS {
12class Kernel_Random : public Kernel {
13 public:
14 using rng_t = std::mt19937;
15 using uid_range = std::uniform_int_distribution<int>::param_type;
16 using pd_range = std::poisson_distribution<int>::param_type;
17
19
20 static std::uniform_int_distribution<int> rand_uid;
21 static std::uniform_real_distribution<kids_real> rand_udd;
22 static std::normal_distribution<kids_real> rand_nd;
23 static std::poisson_distribution<int> rand_pd;
24
25 virtual const std::string getName();
26
27 virtual int getType() const;
28
29 static int rand_catalog(int* res_arr, int N = 1, bool reset = false, int begin = 0, int end = 1);
30
31 static int rand_uniform(kids_real* res_arr, int N = 1, kids_real sigma = 1.0);
32
33 static int rand_gaussian(kids_real* res_arr, int N = 1, kids_real sigma = 1.0, kids_real mu = 0.0);
34
35 static int rand_exponent(kids_real* res_arr, int N = 1);
36
37 static int rand_poisson(int* res_arr, int N = 1, kids_real lambda = 1.0f);
38
39 static int rand_simplex(kids_real* res_arr, int N = 1, kids_real constr = 1.0f);
40
41 static int rand_sphere(kids_real* res_arr, int N = 1, kids_real constr = 1.0f);
42
43 private:
44 int* seed;
45 bool restart;
46
47 virtual void setInputDataSet_impl(std::shared_ptr<DataSet>& DS);
48
49 virtual Status& initializeKernel_impl(Status& stat);
50};
51
52}; // namespace PROJECT_NS
53
54
55#endif // Kernel_Random_H
this file provide Kernel class
Kernel_Random manipulation of random engine and numbers.
static int rand_simplex(kids_real *res_arr, int N=1, kids_real constr=1.0f)
static std::normal_distribution< kids_real > rand_nd
normal distribution
static int rand_uniform(kids_real *res_arr, int N=1, kids_real sigma=1.0)
static int rand_gaussian(kids_real *res_arr, int N=1, kids_real sigma=1.0, kids_real mu=0.0)
static int rand_catalog(int *res_arr, int N=1, bool reset=false, int begin=0, int end=1)
std::poisson_distribution< int >::param_type pd_range
static std::poisson_distribution< int > rand_pd
possion distribution
static std::uniform_int_distribution< int > rand_uid
catalog distribution
static int rand_exponent(kids_real *res_arr, int N=1)
virtual void setInputDataSet_impl(std::shared_ptr< DataSet > &DS)
Virtual function to set input data set for the kernel implementation.
virtual int getType() const
Get the type of the kernel.
static std::uniform_real_distribution< kids_real > rand_udd
uniform distribution
virtual const std::string getName()
Get the name of the kernel.
std::uniform_int_distribution< int >::param_type uid_range
virtual Status & initializeKernel_impl(Status &stat)
Virtual function to initialize the kernel implementation.
std::mt19937 rng_t
random number generator type
static int rand_poisson(int *res_arr, int N=1, kids_real lambda=1.0f)
static int rand_sphere(kids_real *res_arr, int N=1, kids_real constr=1.0f)
this class provides the container and implementation of algorithms
Definition Kernel.h:60
< http://warp.povusers.org/FunctionParser/fparser.html
Definition Context.h:39
double kids_real
Alias for real number type.
Definition Types.h:59