[rand.dist.samp.pconst] plus some bug fixes in the tests of the other distributions

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@104224 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant
2010-05-20 15:11:46 +00:00
parent 551d8e4ddb
commit d6d1171f2c
56 changed files with 2593 additions and 393 deletions

View File

@@ -0,0 +1,41 @@
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <random>
// template<class RealType = double>
// class piecewise_constant_distribution
// {
// class param_type;
#include <random>
#include <limits>
#include <cassert>
int main()
{
{
typedef std::piecewise_constant_distribution<> D;
typedef D::param_type P;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5};
P p1(b, b+4, p);
P p2(b, b+4, p);
assert(p1 == p2);
}
{
typedef std::piecewise_constant_distribution<> D;
typedef D::param_type P;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5};
P p1(b, b+3, p);
P p2(b, b+4, p);
assert(p1 != p2);
}
}