diff options
Diffstat (limited to 'libcxx/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/get_param.pass.cpp')
| -rw-r--r-- | libcxx/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/get_param.pass.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/get_param.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/get_param.pass.cpp new file mode 100644 index 00000000000..b04b8512f6a --- /dev/null +++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/get_param.pass.cpp @@ -0,0 +1,32 @@ +//===----------------------------------------------------------------------===// +// +// 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_linear_distribution + +// param_type param() const; + +#include <random> +#include <cassert> + +int main() +{ + { + typedef std::piecewise_linear_distribution<> D; + typedef D::param_type P; + double b[] = {10, 14, 16, 17}; + double p[] = {25, 62.5, 12.5, 10}; + const size_t Np = sizeof(p) / sizeof(p[0]); + P pa(b, b+Np+1, p); + D d(pa); + assert(d.param() == pa); + } +} |

