blob: 08a5a2236267deff322f424208ee843f06387978 [file] [log] [blame]
Howard Hinnant3e519522010-05-11 19:42:16 +00001//===----------------------------------------------------------------------===//
2//
Howard Hinnant5b08a8a2010-05-11 21:36:01 +00003// The LLVM Compiler Infrastructure
Howard Hinnant3e519522010-05-11 19:42:16 +00004//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// <random>
11
12// template <class UIntType, size_t w, size_t n, size_t m, size_t r,
13// UIntType a, size_t u, UIntType d, size_t s,
14// UIntType b, size_t t, UIntType c, size_t l, UIntType f>
15// class mersenne_twister_engine;
16
17// result_type operator()();
18
19#include <random>
20#include <sstream>
21#include <cassert>
22
23void
24test1()
25{
26 std::mt19937 e;
27 assert(e() == 3499211612u);
28 assert(e() == 581869302u);
29 assert(e() == 3890346734u);
30}
31
32void
33test2()
34{
35 std::mt19937_64 e;
36 assert(e() == 14514284786278117030ull);
37 assert(e() == 4620546740167642908ull);
38 assert(e() == 13109570281517897720ull);
39}
40
41int main()
42{
43 test1();
44 test2();
45}