ElfPSP_ParallelABC
Protein Structure Prediction using Parallel Artificial Bee Colony Optimization
random.h
Go to the documentation of this file.
1 #ifndef RANDOM_H
2 #define RANDOM_H
3 
6 #undef MT_GENERATE_CODE_IN_HEADER
7 #define MT_GENERATE_CODE_IN_HEADER 0
8 #include "mtwist/mtwist.h"
9 
10 #ifndef RANDOM_SOURCE_CODE
11  #define RANDOM_INLINE inline
12 #else
13  #define RANDOM_INLINE extern inline
14 #endif
15 
17 RANDOM_INLINE
18 double drandom_x(){
19  return mt_drand();
20 }
21 
23 RANDOM_INLINE
24 unsigned int urandom_max(unsigned int max){
25  return drandom_x() * max;
26 }
27 
28 #endif // RANDOM_H
RANDOM_INLINE double drandom_x()
Returns a random double within [0,1)
Definition: random.h:18
RANDOM_INLINE unsigned int urandom_max(unsigned int max)
Returns an unsigned integer within [0,max)
Definition: random.h:24