• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 RealType = double>
13 // class piecewise_linear_distribution
14 
15 // bool operator=(const piecewise_linear_distribution& x,
16 //                const piecewise_linear_distribution& y);
17 // bool operator!(const piecewise_linear_distribution& x,
18 //                const piecewise_linear_distribution& y);
19 
20 #include <random>
21 #include <cassert>
22 
main()23 int main()
24 {
25     {
26         typedef std::piecewise_linear_distribution<> D;
27         D d1;
28         D d2;
29         assert(d1 == d2);
30     }
31     {
32         typedef std::piecewise_linear_distribution<> D;
33         double b[] = {10, 14, 16, 17};
34         double p[] = {25, 62.5, 12.5, 1};
35         D d1(b, b+4, p);
36         D d2(b, b+4, p);
37         assert(d1 == d2);
38     }
39     {
40         typedef std::piecewise_linear_distribution<> D;
41         double b[] = {10, 14, 16, 17};
42         double p[] = {25, 62.5, 12.5, 0};
43         D d1(b, b+4, p);
44         D d2;
45         assert(d1 != d2);
46     }
47 }
48