1//===----------------------------------------------------------------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is dual licensed under the MIT and the University of Illinois Open 6// Source Licenses. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9 10// <random> 11 12// template <class UIntType, UIntType a, UIntType c, UIntType m> 13// class linear_congruential_engine; 14 15// template<class Sseq> void seed(Sseq& q); 16 17#include <random> 18#include <cassert> 19 20int main() 21{ 22 { 23 unsigned a[] = {3, 5, 7}; 24 std::seed_seq sseq(a, a+3); 25 std::linear_congruential_engine<unsigned, 5, 7, 11> e1; 26 std::linear_congruential_engine<unsigned, 5, 7, 11> e2(4); 27 assert(e1 != e2); 28 e1.seed(sseq); 29 assert(e1 == e2); 30 } 31 { 32 unsigned a[] = {3, 5, 7, 9, 11}; 33 std::seed_seq sseq(a, a+5); 34 typedef std::linear_congruential_engine<unsigned long long, 1, 1, 0x200000001ULL> E; 35 E e1(4309005589); 36 E e2(sseq); 37 assert(e1 == e2); 38 } 39} 40