2010-05-19 01:53:57 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2010-11-16 22:09:02 +00:00
|
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
|
|
// Source Licenses. See LICENSE.TXT for details.
|
2010-05-19 01:53:57 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
// <random>
|
|
|
|
|
|
|
|
// template<class IntType = int>
|
|
|
|
// class discrete_distribution
|
|
|
|
|
2012-04-02 15:00:14 +00:00
|
|
|
// discrete_distribution();
|
2010-05-19 01:53:57 +00:00
|
|
|
|
|
|
|
#include <random>
|
|
|
|
#include <cassert>
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
typedef std::discrete_distribution<> D;
|
2012-04-02 15:00:14 +00:00
|
|
|
D d;
|
2010-05-19 01:53:57 +00:00
|
|
|
std::vector<double> p = d.probabilities();
|
2012-04-02 15:00:14 +00:00
|
|
|
assert(p.size() == 1);
|
2010-05-19 01:53:57 +00:00
|
|
|
assert(p[0] == 1);
|
|
|
|
}
|
|
|
|
}
|