-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathacak.h
37 lines (28 loc) · 791 Bytes
/
acak.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef Acak_H
#define Acak_H
#include <cstdlib>
#include <ctime>
#include <chrono>
// #include <random>
#include <cstdint>
#include <cmath>
#include "ziggurat.hpp"
#define pi acos(-1)
using namespace std;
extern double beta;
extern double gam; /* Stepsize of Levy distribution */
/* Used on Unix */
// static random_device rd;
// static mt19937 gen(rd());
/* Used on Windows */
// static mt19937 gen(static_cast<unsigned int>(time(NULL)));
void init_acak();
/* Return random sampling following uniform distribution */
double uniform();
/* Return discrete random sampling following uniform distribution */
int uniform_int(int begin, int end);
/* Return random sampling following normal distribution */
double normal();
/* Draw n Levy flight sample */
double* levy(int n);
#endif