JF Bastien
57148cbcbd
libc++: add NaCl and PNaCl support for std::random_device
...
Summary:
The NaCl sandbox doesn't allow opening files under /dev, but it offers an API which provides the same capabilities. This is the same random device emulation that nacl_io performs for POSIX support, but nacl_io is an optional library so libc++ can't assume that device emulation will be performed. Note that NaCl only supports /dev/urandom, not /dev/random.
This patch also cleans up some of the preprocessor #endif, and fixes the test for Win32 (it accepts any token, and would therefore never throw regardless of the token provided).
Test Plan: ninja check-libcxx
Reviewers: dschuff, mclow.lists, danalbert
Subscribers: jfb, cfe-commits
Differential Revision: http://reviews.llvm.org/D6442
llvm-svn: 223068
2014-12-01 19:19:55 +00:00
Marshall Clow
3c71bff667
Fix PR#20843: binomial_distribution<unsigned> is broken. Add test to ensure that signed and unsigned verstions produce the same sequence.
...
llvm-svn: 217976
2014-09-17 18:33:58 +00:00
Marshall Clow
07c28fe026
Mark seed_seq default constructor and size() as noexcept. This is implied, but not required by LWG issue 2180
...
llvm-svn: 193227
2013-10-23 05:56:47 +00:00
Marshall Clow
0354b92992
patch by Yaron: Uses rand_s() from stdlib.h (when building for Windows)
...
llvm-svn: 192325
2013-10-09 21:49:03 +00:00
Howard Hinnant
5d1a701d6d
Xing Xue: port to IBM XLC++/AIX.
...
llvm-svn: 188396
2013-08-14 18:00:20 +00:00
Howard Hinnant
f0544c2086
Nico Rieck: this patch series fixes visibility issues on Windows as explained in < http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-August/031214.html >.
...
llvm-svn: 188192
2013-08-12 18:38:34 +00:00
Marshall Clow
8e1cb5adb3
move __save_flags from <random> to <ios> in preparation for reuse; no functionality change
...
llvm-svn: 185968
2013-07-09 20:34:14 +00:00
Howard Hinnant
9d3ccc700f
Neglected to remove a debugging comment from last commit.
...
llvm-svn: 182422
2013-05-21 21:19:35 +00:00
Howard Hinnant
849821cffb
Fix a couple of bugs in linear_congruential_engine::seed. Regression test added.
...
llvm-svn: 182421
2013-05-21 21:05:12 +00:00
Howard Hinnant
6e41256f68
No functionality change at this time. I've split _LIBCPP_VISIBLE up into two flags: _LIBCPP_TYPE_VIS and _LIBCPP_FUNC_VIS. This is in preparation for taking advantage of clang's new __type_visibility__ attribute.
...
llvm-svn: 176593
2013-03-06 23:30:19 +00:00
Howard Hinnant
16694b5df5
Zhang Xiongpang: Add definitions for const data members. Fixes http://llvm.org/bugs/show_bug.cgi?id=14585 .
...
llvm-svn: 170026
2012-12-12 21:14:28 +00:00
Howard Hinnant
54d333a601
Rename uses of _ and __ because these are getting stepped on by macros from other system code.
...
llvm-svn: 167038
2012-10-30 19:06:59 +00:00
Howard Hinnant
aeb85680fb
Dimitry Andric: many visibility fixes. Howard: Much appreciated. Can you send me a patch to CREDITS.TXT?
...
llvm-svn: 163862
2012-09-14 00:39:16 +00:00
Howard Hinnant
00586de436
noexcept applied to <random>.
...
llvm-svn: 160579
2012-07-20 21:44:27 +00:00
Howard Hinnant
e386b7b360
Update <random> with constexpr support. Patch contributed by Jonathan Sauer.
...
llvm-svn: 153896
2012-04-02 21:00:45 +00:00
Howard Hinnant
788c9979d9
This is an initial commit of constexpr support as proposed by Richard Smith. This by no means completes constexpr support. Indeed, it hardly scratches the surface. All it does is lay the foundation in <__config> and changes those few places in the library that are already using that foundation.
...
llvm-svn: 153856
2012-04-02 00:40:41 +00:00
Howard Hinnant
c206366fd7
Quash a whole bunch of warnings
...
llvm-svn: 145624
2011-12-01 20:21:04 +00:00
Howard Hinnant
c003db1fca
Further macro protection by replacing _[A-Z] with _[A-Z]p
...
llvm-svn: 145410
2011-11-29 18:15:50 +00:00
Howard Hinnant
ab4f438239
Add protection from min/max macros
...
llvm-svn: 145407
2011-11-29 16:45:27 +00:00
Howard Hinnant
073458b1ab
Windows support by Ruben Van Boxem.
...
llvm-svn: 142235
2011-10-17 20:05:10 +00:00
Howard Hinnant
052fd9349f
Fix needle-in-haystack bug found by Walter Brown
...
llvm-svn: 137617
2011-08-15 17:22:22 +00:00
Howard Hinnant
54976f2619
Fixed PR10574: http://llvm.org/bugs/show_bug.cgi?id=10574
...
llvm-svn: 137522
2011-08-12 21:56:02 +00:00
Howard Hinnant
ce48a1137d
_STD -> _VSTD to avoid macro clash on windows
...
llvm-svn: 134190
2011-06-30 21:18:19 +00:00
Howard Hinnant
866d73c7b4
Think-o in poisson_distribution at mean == 10
...
llvm-svn: 129520
2011-04-14 15:59:22 +00:00
Howard Hinnant
a23551cad4
Fix bug in Sseq constraints found by Seth Cantrell
...
llvm-svn: 129285
2011-04-11 18:22:12 +00:00
Howard Hinnant
d518d1c807
LWG 1522
...
llvm-svn: 119710
2010-11-18 17:34:48 +00:00
Howard Hinnant
908484b147
LWG 1439
...
llvm-svn: 119703
2010-11-18 17:01:36 +00:00
Howard Hinnant
412dbebe1b
license change
...
llvm-svn: 119395
2010-11-16 22:09:02 +00:00
Howard Hinnant
e79d71e2e3
Patch by Marshall Clow to make the assignment operators of piecewise_constant_distribution and piecewise_linear_distribution exception safe.
...
llvm-svn: 116404
2010-10-13 14:37:09 +00:00
Howard Hinnant
392183f99d
visibility-decoration.
...
llvm-svn: 114559
2010-09-22 18:02:38 +00:00
Howard Hinnant
7609c9b665
Changed __config to react to all of clang's currently documented has_feature flags, and renamed _LIBCPP_MOVE to _LIBCPP_HAS_NO_RVALUE_REFERENCES to be more consistent with the rest of the libc++'s flags, and with clang's nomenclature.
...
llvm-svn: 113086
2010-09-04 23:28:19 +00:00
Howard Hinnant
b3371f6f49
Fixing whitespace problems
...
llvm-svn: 111750
2010-08-22 00:02:43 +00:00
Howard Hinnant
03ec83e9e8
Implemented some adaptor constructors which I had missed.
...
llvm-svn: 104946
2010-05-28 15:49:54 +00:00
Howard Hinnant
f9d540b062
Completed [alg.random.shuffle].
...
llvm-svn: 104708
2010-05-26 17:49:34 +00:00
Howard Hinnant
b4d2fd2f0f
[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
2010-05-25 00:27:34 +00:00
Howard Hinnant
5d6a2e509f
Optimized [rand.dist.samp.pconst] and several bug fixes in other distributions
...
llvm-svn: 104478
2010-05-24 00:35:40 +00:00
Howard Hinnant
e302eab415
[rand.dist.samp.pconst] plus some bug fixes in the tests of the other distributions
...
llvm-svn: 104224
2010-05-20 15:11:46 +00:00
Howard Hinnant
fb0e5ec825
[rand.dist.samp.discrete]
...
llvm-svn: 104103
2010-05-19 01:53:57 +00:00
Howard Hinnant
ecbb921cbf
[rand.dist.norm.t]
...
llvm-svn: 104052
2010-05-18 20:08:04 +00:00
Howard Hinnant
e31e36f910
[rand.dist.norm.f]
...
llvm-svn: 104035
2010-05-18 17:32:30 +00:00
Howard Hinnant
6692b261d8
[rand.dist.norm.cauchy]. I'm having trouble testing the output as all statistical properties are undefined. They do not converge upon any one value as the number of samples increases. Suggestions for tests welcome.
...
llvm-svn: 103983
2010-05-17 21:55:46 +00:00
Howard Hinnant
fd5c3a34e3
[rand.dist.norm.lognormal]
...
llvm-svn: 103957
2010-05-17 18:31:53 +00:00
Howard Hinnant
c675d983f6
[rand.dist.pois.extreme]
...
llvm-svn: 103942
2010-05-17 16:21:56 +00:00
Howard Hinnant
05fa30d595
[rand.dist.bern.geo]
...
llvm-svn: 103937
2010-05-17 13:44:27 +00:00
Howard Hinnant
89eaea24bc
[rand.dist.bern.negbin]
...
llvm-svn: 103916
2010-05-17 00:09:38 +00:00
Howard Hinnant
45a999719b
Beefed up the tests for all of the distributions to include checks against the expected skewness and kurtosis
...
llvm-svn: 103910
2010-05-16 17:56:20 +00:00
Howard Hinnant
b8829825f1
[rand.dist.pois.weibull]
...
llvm-svn: 103891
2010-05-16 01:09:02 +00:00
Howard Hinnant
e3900731f6
[rand.dist.norm.chisq]
...
llvm-svn: 103888
2010-05-15 23:36:00 +00:00
Howard Hinnant
932ce81fe9
Revisited [rand.dist.bern.bin] and [rand.dist.pois.poisson] with better algorithms
...
llvm-svn: 103886
2010-05-15 21:36:23 +00:00
Howard Hinnant
0e675818f1
[rand.dist.pois.poisson]
...
llvm-svn: 103814
2010-05-14 21:38:54 +00:00