about summary refs log tree commit diff homepage
path: root/include/klee/ADT/RNG.h
blob: fc08e3b800998171a9b13cd05e412693ec911ffd (plain) (blame)
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
//===-- RNG.h ---------------------------------------------------*- C++ -*-===//
//
//                     The KLEE Symbolic Virtual Machine
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef KLEE_RNG_H
#define KLEE_RNG_H

#include <random>

namespace klee {
  struct RNG : std::mt19937 {
    RNG();
    explicit RNG(RNG::result_type seed);

    /* generates a random number on [0,0xffffffff]-interval */
    unsigned int getInt32();
    /* generates a random number on [0,0x7fffffff]-interval */
    int getInt31();
    /* generates a random number on [0,1]-real-interval */
    double getDoubleLR();
    float getFloatLR();
    /* generates a random number on [0,1)-real-interval */
    double getDoubleL();
    float getFloatL();
    /* generates a random number on (0,1)-real-interval */
    double getDouble();
    float getFloat();
    /* generators a random flop */
    bool getBool();
  };
}

#endif /* KLEE_RNG_H */