pr60037.cc 455 B

123456789101112131415161718192021222324
  1. // { dg-options "-O0" }
  2. // { dg-do run { target c++11 } }
  3. // { dg-require-cstdint "" }
  4. // { dg-require-cmath "" }
  5. #include <ext/random>
  6. #include <functional>
  7. void
  8. hyperplot(unsigned int N, unsigned int K, unsigned int n)
  9. {
  10. std::mt19937 re; // the default engine
  11. __gnu_cxx::hypergeometric_distribution<> hd(N, K, n);
  12. auto gen = std::bind(hd, re);
  13. gen();
  14. }
  15. int
  16. main()
  17. {
  18. hyperplot(15, 3, 2);
  19. hyperplot(500, 50, 30);
  20. hyperplot(100, 20, 5);
  21. }