1 //===----------------------------------------------------------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 // <random> 10 11 // template <class UIntType, size_t w, size_t n, size_t m, size_t r, 12 // UIntType a, size_t u, UIntType d, size_t s, 13 // UIntType b, size_t t, UIntType c, size_t l, UIntType f> 14 // class mersenne_twister_engine; 15 16 // explicit mersenne_twister_engine(); 17 18 #include <random> 19 #include <sstream> 20 #include <cassert> 21 22 void 23 test1() 24 { 25 std::mt19937 e1; 26 std::mt19937 e2(std::mt19937::default_seed); 27 assert(e1 == e2); 28 assert(e1() == 3499211612u); 29 } 30 31 void 32 test2() 33 { 34 std::mt19937_64 e1; 35 std::mt19937_64 e2(std::mt19937_64::default_seed); 36 assert(e1 == e2); 37 assert(e1() == 14514284786278117030ull); 38 } 39 40 int main() 41 { 42 test1(); 43 test2(); 44 } 45