-
Notifications
You must be signed in to change notification settings - Fork 0
/
Random.h
43 lines (34 loc) · 936 Bytes
/
Random.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
38
39
40
41
42
43
/*
* Random.h
*
* Created on: Oct 20, 2017
* Author: simon
*/
#ifndef RANDOM_H_
#define RANDOM_H_
/* -----------------------------------------------------------------------
* Name : rngs.h (header file for the library file rngs.c)
* Author : Steve Park & Dave Geyer
* Language : ANSI C
* Latest Revision : 09-22-98
* -----------------------------------------------------------------------
*/
#if !defined( _RNGS_ )
#define _RNGS_
#include <cstdlib>
#include <ctype.h>
#include <iostream>
#include <numeric>
#include <assert.h>
#include <cfloat>
#include <cmath>
double Random(void);
void PlantSeeds(long x);
void GetSeed(long *x);
void PutSeed(long x);
void SelectStream(int index);
void TestRandom(void);
#endif
int RandInt(int begin,int end);
inline double RandDouble(double Low, double High) { return Low + (fabs(High - Low) * Random()); }
#endif /* RANDOM_H_ */