FreeTensor
Loading...
Searching...
No Matches
random.h
Go to the documentation of this file.
1#ifndef FREE_TENSOR_RANDOM_H
2#define FREE_TENSOR_RANDOM_H
3
4#include <random>
5#include <vector>
6
7namespace freetensor {
8
23 typedef std::default_random_engine RNG;
24
25 std::vector<RNG> rngs_;
26
27 public:
28 typedef RNG::result_type
31
32 OpenMPRandomEngine(RNG::result_type seed);
33
45
46 RNG::result_type operator()();
47
48 static constexpr RNG::result_type min() { return RNG::min(); }
49 static constexpr RNG::result_type max() { return RNG::max(); }
50};
51
52static_assert(std::uniform_random_bit_generator<OpenMPRandomEngine>);
53
54} // namespace freetensor
55
56#endif // FREE_TENSOR_RANDOM_H
Definition: random.h:22
static constexpr RNG::result_type max()
Definition: random.h:49
OpenMPRandomEngine & operator=(const OpenMPRandomEngine &)=delete
RNG::result_type result_type
sub-engines for each thread
Definition: random.h:29
OpenMPRandomEngine & operator=(OpenMPRandomEngine &&)=default
static constexpr RNG::result_type min()
Definition: random.h:48
OpenMPRandomEngine(OpenMPRandomEngine &&)=default
OpenMPRandomEngine(const OpenMPRandomEngine &)=delete
RNG::result_type operator()()
Definition: random.cc:22
Definition: allocator.h:9