2
0
mirror of https://github.com/boostorg/random.git synced 2026-01-23 05:42:31 +00:00
Commit Graph

126 Commits

Author SHA1 Message Date
jzmaddock
4239d93dad Update multiprecision_float_test.cpp to not overflow type double.
Previously the max value for uint1024_t could just squeeze into a double because truncation occurred during the conversion, now that cpp_int performs correctly rounded conversions, overflow occurs, and the computation fails.  Changed the problem distribution to use a multiprecision weight type, rather than double.
2022-06-01 19:35:36 +01:00
jzmaddock
7561690135 Update multiprecision_int_test.cpp to not accidentality overflow type double.
Multiprecision now performs correct rounding when converting to double - previously the max value for uint1024_t would just fit in a double if it was truncated.  But now that it's correctly rounded it overflows and breaks the calculation.
2022-06-01 19:32:55 +01:00
jzmaddock
c3ada7a1b2 Add missing #includes. 2021-03-16 10:47:16 +00:00
kotika
1ff8087a0c Passed through a C++ Beautifier on October 29 2019-10-29 14:04:02 +02:00
Kostas Savvidis
d565c034aa Update Jamfile.v2 2019-10-29 12:06:07 +02:00
Kostas Savvidis
d1bca7b57f Add files via upload 2019-10-29 12:05:09 +02:00
Steven Watanabe
ed7ab807e6 Make engine min/max constexpr. 2019-03-28 14:22:45 -06:00
Justinas V. Daugmaudis
b14d592873 Quick fixes
Fix warnings
low_bits_mask_t
use high_bit_mask_t
Moved qrng details to namespace qrng_detail
Removed unnecessary function
Simplify gray code size check & readability
Disallow negative seeds
2018-03-10 12:54:04 +02:00
Justinas V. Daugmaudis
9786f4f481 Aggregated review fixes
Check discard overflows
Check comparison overflows
Exception messages
Add missing docs and fix typedef ugliness
Better template param name
2018-03-04 00:02:58 +02:00
Justinas V. Daugmaudis
3db2d7cb71 Initial QRNG commit 2018-02-18 10:49:14 +02:00
Steven Watanabe
f3a83d0497 Remove duplicate test which is now detected by Boost.Test. 2018-01-23 13:12:48 -07:00
Steven Watanabe
c2fba24fbf Adjust the condition on brace initializers test to help some versions of gcc. 2018-01-10 14:54:32 -07:00
Steven Watanabe
122386c345 Merge remote-tracking branch 'jeking3/fix-warn' into develop 2018-01-02 17:38:13 -07:00
Steven Watanabe
244b59abb6 Remove bind1st. 2017-12-07 15:17:23 -07:00
James E. King III
9c82aad413 fix some warnings reported by clang 2017-12-05 11:21:56 -05:00
Steven Watanabe
e4b0b2f5c0 Merge remote-tracking branch 'DanielaE/feature/replace-deprecated-c++98-stuff' into develop 2017-11-06 13:14:00 -07:00
Steven Watanabe
2b4779fd5b If we're going to the trouble of fixing up the input, then reading should be considered successful. Also, make hyperexponential tests match the implementation. 2017-11-03 19:21:54 -06:00
Steven Watanabe
85ffca64e6 Fix typo in seed_seq which caused the wrong result when the output sequence is shorter than the input sequence. 2017-10-09 09:54:10 -06:00
Daniela Engert
e75d0b99b9 Replace deprecated/removed C++98 std::bind2nd by a custom function object, and ignore tests focussing on std::random_shuffle.
Signed-off-by: Daniela Engert <dani@ngrt.de>
2017-05-13 19:24:05 +02:00
Steven Watanabe
18099e4a11 Suppress conversion warning. 2016-02-19 10:45:05 -07:00
Steven Watanabe
fdd3073448 Suppress warning. 2016-02-18 12:57:06 -07:00
Steven Watanabe
29e8bd59a2 Add a missing break for one dimensional case of uniform_on_sphere. Fixes #11454. 2016-02-13 13:55:27 -07:00
Steven Watanabe
89174b6ca3 Add hyperexponential_distribution. Contributed by Marco Guazzone. 2015-04-01 10:08:06 -06:00
jzmaddock
839acad329 Get multiprecision floating point support working, and add test case. 2015-03-14 18:06:14 +00:00
jzmaddock
d4514f1e07 Fix integer distributions for multiprecision support, and add support for one multiprecision generator (independent_bits_engine).
Added test case for multiprecision integers.
2015-03-14 18:05:23 +00:00
Steven Watanabe
a8aed49f29 Use the right upper bound for the exponent. 2014-04-12 11:26:16 -07:00
Steven Watanabe
25cef713f9 Add non-central chi-squared distribution contributed by Thijs van den Berg. 2014-04-08 17:47:01 -07:00
Steven Watanabe
39d05f0161 Optimized algorithm for mersenne_twister_engine::discard. Fixes #6706. 2014-04-05 11:22:01 -07:00
Steven Watanabe
2edb377b13 Add laplace_distribution. Refs #6804. 2014-03-13 17:06:52 -07:00
Steven Watanabe
b7fae47331 Add beta_distribution. Refs #6804. 2014-03-13 16:13:35 -07:00
Steven Watanabe
c0a694e8d9 Avoid overflow. Fixes #8351. 2014-03-13 14:50:17 -07:00
Steven Watanabe
dbb7b3cfaa Handle integer weights in discrete_distribution. FIxes #6022. 2014-03-13 13:17:28 -07:00
Steven Watanabe
16b73cb3a7 Optimize uniform_on_sphere for dims <= 3. Fixes #1059. 2014-03-12 17:31:23 -07:00
Steven Watanabe
5b3f1c7fe6 Avoid generating NaNs. Fixes #7779.
[SVN r82936]
2013-02-16 20:30:51 +00:00
Marshall Clow
ae12937978 Fix behavior with zero seed re: '26.5.3.3 [rand.eng.sub]/7'; thanks to stl@microsoft for the report; Refs #7951
[SVN r82664]
2013-01-30 06:42:36 +00:00
Marshall Clow
caf462a816 Switch from deprecated macros to new shiny ones; no functionality change
[SVN r79389]
2012-07-09 19:50:17 +00:00
Steven Watanabe
030fe2f938 Remove unnecessary #include. Fixes #6344.
[SVN r78511]
2012-05-19 13:14:28 +00:00
Marshall Clow
1bcaa72324 Updated Boost.Random to use BOOST_NO_0X_HDR_INITIALIZER_LIST instead of (soon to be deprecated) BOOST_NO_INITIALIZER_LISTS
[SVN r77152]
2012-03-02 16:16:45 +00:00
Steven Watanabe
ceddb09af4 Update seed_seq to match the final draft.
[SVN r74482]
2011-09-20 22:59:42 +00:00
Steven Watanabe
db825889d8 Use the right variable. Fixes #5767.
[SVN r74169]
2011-08-30 21:14:01 +00:00
Steven Watanabe
56e40890ca geometric_distribution::min should be 0. Fixes #5704.
[SVN r74168]
2011-08-30 19:31:43 +00:00
Steven Watanabe
7b6a46822b Replace the precision() member for floating point generators with a traits class. This function was intended to be an implementation detail, but user defined generators had to implement it.
[SVN r72826]
2011-06-30 22:27:53 +00:00
Steven Watanabe
cb6b4f1ffb Warning patrol
[SVN r70017]
2011-03-16 03:24:42 +00:00
Steven Watanabe
544fc7e4e1 Make sure that the type of the seed argument is consistent with the standard for all generators. Eliminate the odd rand48 seeding rules.
[SVN r69995]
2011-03-15 00:47:25 +00:00
Steven Watanabe
96113f9e2c Update the last tests left in random_test.cpp and move them to the appropriate places.
[SVN r69991]
2011-03-14 23:37:39 +00:00
Steven Watanabe
0a430d620a Move random_number_generator into namespace random, tweak the implementation a bit, and add a test case.
[SVN r69978]
2011-03-14 20:38:12 +00:00
Steven Watanabe
d096eb569f Make seeding more consistent and add some tests to lock down the algorithms.
[SVN r69912]
2011-03-13 04:49:34 +00:00
Steven Watanabe
21d66a0a2c Fix problems reported by inspect.
[SVN r68817]
2011-02-12 20:03:17 +00:00
Steven Watanabe
6858fa9514 Update random_device.
[SVN r68814]
2011-02-12 18:41:28 +00:00
Steven Watanabe
6962916b79 Implement generate_canonical.
[SVN r68813]
2011-02-12 18:06:40 +00:00