summaryrefslogtreecommitdiffstats
path: root/libcxx/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/get_param.pass.cpp
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2010-05-25 00:27:34 +0000
committerHoward Hinnant <hhinnant@apple.com>2010-05-25 00:27:34 +0000
commitb4d2fd2f0f2e089f29084e9a88e9e050a8b11540 (patch)
treebd3c8c8e9dd4eb1f6518b506d42cf9068bd0fa11 /libcxx/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/get_param.pass.cpp
parentadff18518ab912e4ab7eeb46dea3ab121ee677ea (diff)
downloadbcm5719-llvm-b4d2fd2f0f2e089f29084e9a88e9e050a8b11540.tar.gz
bcm5719-llvm-b4d2fd2f0f2e089f29084e9a88e9e050a8b11540.zip
[rand.dist.samp.plinear]. This means we've got a fully tested and functional <random>! 489 tests over 48 sections are passing. :-) The only thing still on my plate in this area is to back-port some of this technology to random_shuffle/shuffle in <algorithm>. That will involve shuffling header bits around (<random> depepends on <algorithm>), but it won't entail that much development (compared to what has been required for <random>).
llvm-svn: 104575
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.cpp32
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);
+ }
+}
OpenPOWER on IntegriCloud