//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // class linear_congruential_engine; // result_type operator()(); #include #include template void randu() { typedef std::linear_congruential_engine E; E e(1); assert(e() == 65539); assert(e() == 393225); assert(e() == 1769499); assert(e() == 7077969); assert(e() == 26542323); assert(e() == 95552217); assert(e() == 334432395); assert(e() == 1146624417); assert(e() == 1722371299); assert(e() == 14608041); assert(e() == 1766175739); assert(e() == 1875647473); } template void minstd() { typedef std::linear_congruential_engine E; E e(1); assert(e() == 16807); assert(e() == 282475249); assert(e() == 1622650073); assert(e() == 984943658); assert(e() == 1144108930); assert(e() == 470211272); assert(e() == 101027544); assert(e() == 1457850878); assert(e() == 1458777923); assert(e() == 2007237709); assert(e() == 823564440); assert(e() == 1115438165); } template void Haldir() { typedef std::linear_congruential_engine E; E e(207560540); assert(e() == 956631177); assert(e() == 2037688522); assert(e() == 1509348670); assert(e() == 1546336451); assert(e() == 429714088); assert(e() == 217250280); } int main() { randu(); randu(); randu(); minstd(); minstd(); minstd(); Haldir(); Haldir(); Haldir(); }