[multiple changes]

2009-04-02  Benjamin Kosnik  <bkoz@redhat.com>

	* testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc:
	Change to mersenne_twister_engine, add same defaults as
	mersenne_twister_engine/cons/default.cc.
	* testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc: Same.

	* include/bits/random.tcc (seed_seq::seed_seq): Uglify parameter
	to __il.
	* include/bits/random.h (mersenne_twister_engine): Qualify
	_ShiftMin1 with namespace __detail.
	(__detail::_ShiftMin1): Use __gnu_cxx::__numeric_traits::max until
	constexpr std::numeric_limits::max() can be used.
	(mersenne_twister_engine): Split apart static asserts into one
	assert per message. Temporarily disable the last three.

2009-04-02  Edward Smith-Rowland  <3dw4rd@verizon.net>

	* include/Makefile.am: Update to N2836. Modified for new random headers.
	* include/Makefile.in: Ditto.
	* include/tr1_impl/random: Moved to tr1/random.h
	* include/tr1_impl/random.tcc: Moved to tr1
	* include/tr1/random: Just point to moved tr1 random headers.
	* include/tr1/random.tcc: Moved from tr1_impl.
	* include/tr1/random.h: Moved from tr1_impl/random.
	* include/std/random: Modified to point to std random headers.
	* include/bits/random.tcc: New implementation of std random facilities.
	* include/bits/random.h: Ditto.
	* testsuite/26_numerics/headers/random/std_c++0x_neg.cc: Changed.
	* testsuite/26_numerics/random/linear_congruential_engine/cons/
	seed1.cc: New.
	* testsuite/26_numerics/random/linear_congruential_engine/cons/
	seed2.cc: New.
	* testsuite/26_numerics/random/linear_congruential_engine/cons/
	default.cc: New.
	* testsuite/26_numerics/random/linear_congruential_engine/requirements/
	non_uint_neg.cc: New.
	* testsuite/26_numerics/random/linear_congruential_engine/requirements/
	typedefs.cc: New.
	* testsuite/26_numerics/random/linear_congruential_engine/operators/
	equal.cc: New.
	* testsuite/26_numerics/random/linear_congruential_engine/operators/
	serialize.cc: New.
	* testsuite/26_numerics/random/mersenne_twister_engine/cons/
	seed1.cc: New.
	* testsuite/26_numerics/random/mersenne_twister_engine/cons/
	seed2.cc: New.
	* testsuite/26_numerics/random/mersenne_twister_engine/cons/
	default.cc: New.
	* testsuite/26_numerics/random/mersenne_twister_engine/requirements/
	typedefs.cc: New.
	* testsuite/26_numerics/random/mersenne_twister_engine/operators/
	equal.cc: New.
	* testsuite/26_numerics/random/mersenne_twister_engine/operators/
	serialize.cc: New.
	* testsuite/26_numerics/random/subtract_with_carry_engine/cons/
	seed1.cc: New.
	* testsuite/26_numerics/random/subtract_with_carry_engine/cons/
	seed2.cc: New.
	* testsuite/26_numerics/random/subtract_with_carry_engine/cons/
	default.cc: New.
	* testsuite/26_numerics/random/subtract_with_carry_engine/requirements/
	typedefs.cc: New.
	* testsuite/26_numerics/random/subtract_with_carry_engine/operators/
	equal.cc: New.
	* testsuite/26_numerics/random/subtract_with_carry_engine/operators/
	serialize.cc: New.
	* testsuite/26_numerics/random/discard_block_engine/cons/
	base_move.cc: New.
	* testsuite/26_numerics/random/discard_block_engine/cons/
	seed1.cc: New.
	* testsuite/26_numerics/random/discard_block_engine/cons/
	seed2.cc: New.
	* testsuite/26_numerics/random/discard_block_engine/cons/
	base_copy.cc: New.
	* testsuite/26_numerics/random/discard_block_engine/cons/
	default.cc: New.
	* testsuite/26_numerics/random/discard_block_engine/cons/
	seed_seq.cc: New.
	* testsuite/26_numerics/random/discard_block_engine/requirements/
	typedefs.cc: New.
	* testsuite/26_numerics/random/discard_block_engine/operators/
	equal.cc: New.
	* testsuite/26_numerics/random/discard_block_engine/operators/
	serialize.cc: New.
	* testsuite/26_numerics/random/independent_bits_engine/cons/
	base_move.cc: New.
	* testsuite/26_numerics/random/independent_bits_engine/cons/
	seed1.cc: New.
	* testsuite/26_numerics/random/independent_bits_engine/cons/
	seed2.cc: New.
	* testsuite/26_numerics/random/independent_bits_engine/cons/
	base_copy.cc: New.
	* testsuite/26_numerics/random/independent_bits_engine/cons/
	default.cc: New.
	* testsuite/26_numerics/random/independent_bits_engine/cons/
	seed_seq.cc: New.
	* testsuite/26_numerics/random/independent_bits_engine/requirements/
	typedefs.cc: New.
	* testsuite/26_numerics/random/independent_bits_engine/operators/
	equal.cc: New.
	* testsuite/26_numerics/random/independent_bits_engine/operators/
	serialize.cc: New.
	* testsuite/26_numerics/random/shuffle_order_engine/cons/
	base_move.cc: New.
	* testsuite/26_numerics/random/shuffle_order_engine/cons/
	seed1.cc: New.
	* testsuite/26_numerics/random/shuffle_order_engine/cons/
	seed2.cc: New.
	* testsuite/26_numerics/random/shuffle_order_engine/cons/
	base_copy.cc: New.
	* testsuite/26_numerics/random/shuffle_order_engine/cons/
	default.cc: New.
	* testsuite/26_numerics/random/shuffle_order_engine/cons/
	seed_seq.cc: New.
	* testsuite/26_numerics/random/shuffle_order_engine/requirements/
	typedefs.cc: New.
	* testsuite/26_numerics/random/shuffle_order_engine/operators/
	equal.cc: New.
	* testsuite/26_numerics/random/shuffle_order_engine/operators/
	serialize.cc
	* testsuite/26_numerics/random/mt19937.cc: New.
	* testsuite/26_numerics/random/mt19937_64.cc: New.
	* testsuite/26_numerics/random/minstd_rand.cc: New.
	* testsuite/26_numerics/random/minstd_rand0.cc: New.
	* testsuite/26_numerics/random/ranlux24_base.cc: New.
	* testsuite/26_numerics/random/ranlux48_base.cc: New.
	* testsuite/26_numerics/random/ranlux24.cc: New.
	* testsuite/26_numerics/random/ranlux48.cc: New.
	* testsuite/26_numerics/random/knuth_b.cc: New.
	* testsuite/26_numerics/random/default_random_engine.cc: New.
	* testsuite/26_numerics/random/chi_squared_distribution/cons/
	parms.cc: New.
	* testsuite/26_numerics/random/chi_squared_distribution/cons/
	default.cc: New.
	* testsuite/26_numerics/random/chi_squared_distribution/requirements/
	typedefs.cc: New.
	* testsuite/26_numerics/random/chi_squared_distribution/operators/
	serialize.cc: New.
	* testsuite/26_numerics/random/normal_distribution/cons/
	parms.cc: New.
	* testsuite/26_numerics/random/normal_distribution/cons/
	default.cc: New.
	* testsuite/26_numerics/random/normal_distribution/requirements/
	typedefs.cc: New.
	* testsuite/26_numerics/random/normal_distribution/operators/
	serialize.cc: New.
	* testsuite/26_numerics/random/seed_seq/cons/range.cc: New.
	* testsuite/26_numerics/random/seed_seq/cons/default.cc: New.
	* testsuite/26_numerics/random/seed_seq/requirements/typedefs.cc: New.
	* testsuite/26_numerics/random/uniform_int_distribution/cons/
	parms_neg.cc: New.
	* testsuite/26_numerics/random/uniform_int_distribution/cons/
	parms.cc: New.
	* testsuite/26_numerics/random/uniform_int_distribution/cons/
	default.cc: New.
	* testsuite/26_numerics/random/uniform_int_distribution/requirements/
	typedefs.cc: New.
	* testsuite/26_numerics/random/uniform_int_distribution/operators/
	serialize.cc: New.
	* testsuite/26_numerics/random/uniform_real_distribution/cons/
	parms_neg.cc: New.
	* testsuite/26_numerics/random/uniform_real_distribution/cons/
	parms.cc: New.
	* testsuite/26_numerics/random/uniform_real_distribution/cons/
	default.cc: New.
	* testsuite/26_numerics/random/uniform_real_distribution/requirements/
	typedefs.cc: New.
	* testsuite/26_numerics/random/uniform_real_distribution/operators/
	serialize.cc: New.
	* testsuite/26_numerics/random/poisson_distribution/cons/
	parms.cc: New.
	* testsuite/26_numerics/random/poisson_distribution/cons/
	default.cc: New.
	* testsuite/26_numerics/random/poisson_distribution/requirements/
	typedefs.cc
	* testsuite/26_numerics/random/poisson_distribution/operators/
	serialize.cc: New.
	* testsuite/26_numerics/random/bernoulli_distribution/cons/
	parms.cc: New.
	* testsuite/26_numerics/random/bernoulli_distribution/cons/
	default.cc: New.
	* testsuite/26_numerics/random/bernoulli_distribution/requirements/
	typedefs.cc: New.
	* testsuite/26_numerics/random/bernoulli_distribution/operators/
	serialize.cc: New.
	* testsuite/26_numerics/random/discrete_distribution/cons/
	range.cc: New.
	* testsuite/26_numerics/random/discrete_distribution/cons/
	initlist.cc: New.
	* testsuite/26_numerics/random/discrete_distribution/cons/
	default.cc: New.
	* testsuite/26_numerics/random/discrete_distribution/cons/
	num_xbound_fun.cc: New.
	* testsuite/26_numerics/random/discrete_distribution/requirements/
	typedefs.cc: New.
	* testsuite/26_numerics/random/discrete_distribution/operators/
	serialize.cc: New.
	* testsuite/26_numerics/random/weibull_distribution/cons/
	parms.cc: New.
	* testsuite/26_numerics/random/weibull_distribution/cons/
	default.cc: New.
	* testsuite/26_numerics/random/weibull_distribution/requirements/
	typedefs.cc: New.
	* testsuite/26_numerics/random/weibull_distribution/operators/
	serialize.cc: New.
	* testsuite/26_numerics/random/negative_binomial_distribution/cons/
	parms.cc: New.
	* testsuite/26_numerics/random/negative_binomial_distribution/cons/
	default.cc: New.
	* testsuite/26_numerics/random/negative_binomial_distribution/
	requirements/typedefs.cc: New.
	* testsuite/26_numerics/random/negative_binomial_distribution/
	operators/serialize.cc: New.
	* testsuite/26_numerics/random/cauchy_distribution/cons/
	parms.cc: New.
	* testsuite/26_numerics/random/cauchy_distribution/cons/
	default.cc: New.
	* testsuite/26_numerics/random/cauchy_distribution/requirements/
	typedefs.cc: New.
	* testsuite/26_numerics/random/cauchy_distribution/operators/
	serialize.cc: New.
	* testsuite/26_numerics/random/gamma_distribution/cons/
	parms.cc: New.
	* testsuite/26_numerics/random/gamma_distribution/cons/
	default.cc: New.
	* testsuite/26_numerics/random/gamma_distribution/requirements/
	typedefs.cc: New.
	* testsuite/26_numerics/random/gamma_distribution/operators/
	serialize.cc: New.
	* testsuite/26_numerics/random/fisher_f_distribution/cons/
	parms.cc: New.
	* testsuite/26_numerics/random/fisher_f_distribution/cons/
	default.cc: New.
	* testsuite/26_numerics/random/fisher_f_distribution/requirements/
	typedefs.cc: New.
	* testsuite/26_numerics/random/fisher_f_distribution/operators/
	serialize.cc: New.

	* testsuite/26_numerics/random/exponential_distribution/cons/
	parms.cc: New.
	* testsuite/26_numerics/random/exponential_distribution/cons/
	default.cc: New.
	* testsuite/26_numerics/random/exponential_distribution/requirements/
	typedefs.cc: New.
	* testsuite/26_numerics/random/exponential_distribution/operators/
	serialize.cc: New.
	* testsuite/26_numerics/random/lognormal_distribution/cons/
	parms.cc: New.
	* testsuite/26_numerics/random/lognormal_distribution/cons/
	default.cc: New.
	* testsuite/26_numerics/random/lognormal_distribution/requirements/
	typedefs.cc: New.
	* testsuite/26_numerics/random/lognormal_distribution/operators/
	serialize.cc: New.
	* testsuite/26_numerics/random/binomial_distribution/cons/
	parms.cc: New.
	* testsuite/26_numerics/random/binomial_distribution/cons/
	default.cc: New.
	* testsuite/26_numerics/random/binomial_distribution/requirements/
	typedefs.cc: New.
	* testsuite/26_numerics/random/binomial_distribution/operators/
	serialize.cc: New.
	* testsuite/26_numerics/random/random_device/cons/
	token.cc: New.
	* testsuite/26_numerics/random/random_device/cons/
	default.cc: New.
	* testsuite/26_numerics/random/random_device/requirements/
	typedefs.cc: New.
	* testsuite/26_numerics/random/extreme_value_distribution/cons/
	parms.cc: New.
	* testsuite/26_numerics/random/extreme_value_distribution/cons/
	default.cc: New.
	* testsuite/26_numerics/random/extreme_value_distribution/requirements/
	typedefs.cc: New.
	* testsuite/26_numerics/random/extreme_value_distribution/operators/
	serialize.cc: New.
	* testsuite/26_numerics/random/piecewise_linear_distribution/cons/
	range.cc: New.
	* testsuite/26_numerics/random/piecewise_linear_distribution/cons/
	default.cc: New.
	* testsuite/26_numerics/random/piecewise_linear_distribution/cons/
	num_xbound_fun.cc: New.
	* testsuite/26_numerics/random/piecewise_linear_distribution/cons/
	initlist_fun.cc: New.
	* testsuite/26_numerics/random/piecewise_linear_distribution/
	requirements/typedefs.cc: New.
	* testsuite/26_numerics/random/piecewise_linear_distribution/operators/
	serialize.cc: New.
	* testsuite/26_numerics/random/student_t_distribution/cons/
	parms.cc: New.
	* testsuite/26_numerics/random/student_t_distribution/cons/
	default.cc: New.
	* testsuite/26_numerics/random/student_t_distribution/requirements/
	typedefs.cc: New.
	* testsuite/26_numerics/random/student_t_distribution/operators/
	serialize.cc: New.
	* testsuite/26_numerics/random/geometric_distribution/cons/
	parms.cc: New.
	* testsuite/26_numerics/random/geometric_distribution/cons/
	default.cc: New.
	* testsuite/26_numerics/random/geometric_distribution/requirements/
	typedefs.cc: New.
	* testsuite/26_numerics/random/geometric_distribution/operators/
	serialize.cc: New.
	* testsuite/26_numerics/random/piecewise_constant_distribution/cons/
	range.cc: New.
	* testsuite/26_numerics/random/piecewise_constant_distribution/cons/
	default.cc: New.
	* testsuite/26_numerics/random/piecewise_constant_distribution/cons/
	num_xbound_fun.cc: New.
	* testsuite/26_numerics/random/piecewise_constant_distribution/cons/
	initlist_fun.cc: New.
	* testsuite/26_numerics/random/piecewise_constant_distribution/
	requirements/typedefs.cc: New.
	* testsuite/26_numerics/random/piecewise_constant_distribution/
	operators/serialize.cc: New.

From-SVN: r145483
This commit is contained in:
Benjamin Kosnik 2009-04-02 23:45:56 +00:00
parent e97d7fa9f9
commit 8e79468d01
165 changed files with 19014 additions and 4033 deletions

View File

@ -1,6 +1,324 @@
2009-04-02 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc:
Change to mersenne_twister_engine, add same defaults as
mersenne_twister_engine/cons/default.cc.
* testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc: Same.
* include/bits/random.tcc (seed_seq::seed_seq): Uglify parameter
to __il.
* include/bits/random.h (mersenne_twister_engine): Qualify
_ShiftMin1 with namespace __detail.
(__detail::_ShiftMin1): Use __gnu_cxx::__numeric_traits::max until
constexpr std::numeric_limits::max() can be used.
(mersenne_twister_engine): Split apart static asserts into one
assert per message. Temporarily disable the last three.
2009-04-02 Edward Smith-Rowland <3dw4rd@verizon.net>
* include/Makefile.am: Update to N2836. Modified for new random headers.
* include/Makefile.in: Ditto.
* include/tr1_impl/random: Moved to tr1/random.h
* include/tr1_impl/random.tcc: Moved to tr1
* include/tr1/random: Just point to moved tr1 random headers.
* include/tr1/random.tcc: Moved from tr1_impl.
* include/tr1/random.h: Moved from tr1_impl/random.
* include/std/random: Modified to point to std random headers.
* include/bits/random.tcc: New implementation of std random facilities.
* include/bits/random.h: Ditto.
* testsuite/26_numerics/headers/random/std_c++0x_neg.cc: Changed.
* testsuite/26_numerics/random/linear_congruential_engine/cons/
seed1.cc: New.
* testsuite/26_numerics/random/linear_congruential_engine/cons/
seed2.cc: New.
* testsuite/26_numerics/random/linear_congruential_engine/cons/
default.cc: New.
* testsuite/26_numerics/random/linear_congruential_engine/requirements/
non_uint_neg.cc: New.
* testsuite/26_numerics/random/linear_congruential_engine/requirements/
typedefs.cc: New.
* testsuite/26_numerics/random/linear_congruential_engine/operators/
equal.cc: New.
* testsuite/26_numerics/random/linear_congruential_engine/operators/
serialize.cc: New.
* testsuite/26_numerics/random/mersenne_twister_engine/cons/
seed1.cc: New.
* testsuite/26_numerics/random/mersenne_twister_engine/cons/
seed2.cc: New.
* testsuite/26_numerics/random/mersenne_twister_engine/cons/
default.cc: New.
* testsuite/26_numerics/random/mersenne_twister_engine/requirements/
typedefs.cc: New.
* testsuite/26_numerics/random/mersenne_twister_engine/operators/
equal.cc: New.
* testsuite/26_numerics/random/mersenne_twister_engine/operators/
serialize.cc: New.
* testsuite/26_numerics/random/subtract_with_carry_engine/cons/
seed1.cc: New.
* testsuite/26_numerics/random/subtract_with_carry_engine/cons/
seed2.cc: New.
* testsuite/26_numerics/random/subtract_with_carry_engine/cons/
default.cc: New.
* testsuite/26_numerics/random/subtract_with_carry_engine/requirements/
typedefs.cc: New.
* testsuite/26_numerics/random/subtract_with_carry_engine/operators/
equal.cc: New.
* testsuite/26_numerics/random/subtract_with_carry_engine/operators/
serialize.cc: New.
* testsuite/26_numerics/random/discard_block_engine/cons/
base_move.cc: New.
* testsuite/26_numerics/random/discard_block_engine/cons/
seed1.cc: New.
* testsuite/26_numerics/random/discard_block_engine/cons/
seed2.cc: New.
* testsuite/26_numerics/random/discard_block_engine/cons/
base_copy.cc: New.
* testsuite/26_numerics/random/discard_block_engine/cons/
default.cc: New.
* testsuite/26_numerics/random/discard_block_engine/cons/
seed_seq.cc: New.
* testsuite/26_numerics/random/discard_block_engine/requirements/
typedefs.cc: New.
* testsuite/26_numerics/random/discard_block_engine/operators/
equal.cc: New.
* testsuite/26_numerics/random/discard_block_engine/operators/
serialize.cc: New.
* testsuite/26_numerics/random/independent_bits_engine/cons/
base_move.cc: New.
* testsuite/26_numerics/random/independent_bits_engine/cons/
seed1.cc: New.
* testsuite/26_numerics/random/independent_bits_engine/cons/
seed2.cc: New.
* testsuite/26_numerics/random/independent_bits_engine/cons/
base_copy.cc: New.
* testsuite/26_numerics/random/independent_bits_engine/cons/
default.cc: New.
* testsuite/26_numerics/random/independent_bits_engine/cons/
seed_seq.cc: New.
* testsuite/26_numerics/random/independent_bits_engine/requirements/
typedefs.cc: New.
* testsuite/26_numerics/random/independent_bits_engine/operators/
equal.cc: New.
* testsuite/26_numerics/random/independent_bits_engine/operators/
serialize.cc: New.
* testsuite/26_numerics/random/shuffle_order_engine/cons/
base_move.cc: New.
* testsuite/26_numerics/random/shuffle_order_engine/cons/
seed1.cc: New.
* testsuite/26_numerics/random/shuffle_order_engine/cons/
seed2.cc: New.
* testsuite/26_numerics/random/shuffle_order_engine/cons/
base_copy.cc: New.
* testsuite/26_numerics/random/shuffle_order_engine/cons/
default.cc: New.
* testsuite/26_numerics/random/shuffle_order_engine/cons/
seed_seq.cc: New.
* testsuite/26_numerics/random/shuffle_order_engine/requirements/
typedefs.cc: New.
* testsuite/26_numerics/random/shuffle_order_engine/operators/
equal.cc: New.
* testsuite/26_numerics/random/shuffle_order_engine/operators/
serialize.cc
* testsuite/26_numerics/random/mt19937.cc: New.
* testsuite/26_numerics/random/mt19937_64.cc: New.
* testsuite/26_numerics/random/minstd_rand.cc: New.
* testsuite/26_numerics/random/minstd_rand0.cc: New.
* testsuite/26_numerics/random/ranlux24_base.cc: New.
* testsuite/26_numerics/random/ranlux48_base.cc: New.
* testsuite/26_numerics/random/ranlux24.cc: New.
* testsuite/26_numerics/random/ranlux48.cc: New.
* testsuite/26_numerics/random/knuth_b.cc: New.
* testsuite/26_numerics/random/default_random_engine.cc: New.
* testsuite/26_numerics/random/chi_squared_distribution/cons/
parms.cc: New.
* testsuite/26_numerics/random/chi_squared_distribution/cons/
default.cc: New.
* testsuite/26_numerics/random/chi_squared_distribution/requirements/
typedefs.cc: New.
* testsuite/26_numerics/random/chi_squared_distribution/operators/
serialize.cc: New.
* testsuite/26_numerics/random/normal_distribution/cons/
parms.cc: New.
* testsuite/26_numerics/random/normal_distribution/cons/
default.cc: New.
* testsuite/26_numerics/random/normal_distribution/requirements/
typedefs.cc: New.
* testsuite/26_numerics/random/normal_distribution/operators/
serialize.cc: New.
* testsuite/26_numerics/random/seed_seq/cons/range.cc: New.
* testsuite/26_numerics/random/seed_seq/cons/default.cc: New.
* testsuite/26_numerics/random/seed_seq/requirements/typedefs.cc: New.
* testsuite/26_numerics/random/uniform_int_distribution/cons/
parms_neg.cc: New.
* testsuite/26_numerics/random/uniform_int_distribution/cons/
parms.cc: New.
* testsuite/26_numerics/random/uniform_int_distribution/cons/
default.cc: New.
* testsuite/26_numerics/random/uniform_int_distribution/requirements/
typedefs.cc: New.
* testsuite/26_numerics/random/uniform_int_distribution/operators/
serialize.cc: New.
* testsuite/26_numerics/random/uniform_real_distribution/cons/
parms_neg.cc: New.
* testsuite/26_numerics/random/uniform_real_distribution/cons/
parms.cc: New.
* testsuite/26_numerics/random/uniform_real_distribution/cons/
default.cc: New.
* testsuite/26_numerics/random/uniform_real_distribution/requirements/
typedefs.cc: New.
* testsuite/26_numerics/random/uniform_real_distribution/operators/
serialize.cc: New.
* testsuite/26_numerics/random/poisson_distribution/cons/
parms.cc: New.
* testsuite/26_numerics/random/poisson_distribution/cons/
default.cc: New.
* testsuite/26_numerics/random/poisson_distribution/requirements/
typedefs.cc
* testsuite/26_numerics/random/poisson_distribution/operators/
serialize.cc: New.
* testsuite/26_numerics/random/bernoulli_distribution/cons/
parms.cc: New.
* testsuite/26_numerics/random/bernoulli_distribution/cons/
default.cc: New.
* testsuite/26_numerics/random/bernoulli_distribution/requirements/
typedefs.cc: New.
* testsuite/26_numerics/random/bernoulli_distribution/operators/
serialize.cc: New.
* testsuite/26_numerics/random/discrete_distribution/cons/
range.cc: New.
* testsuite/26_numerics/random/discrete_distribution/cons/
initlist.cc: New.
* testsuite/26_numerics/random/discrete_distribution/cons/
default.cc: New.
* testsuite/26_numerics/random/discrete_distribution/cons/
num_xbound_fun.cc: New.
* testsuite/26_numerics/random/discrete_distribution/requirements/
typedefs.cc: New.
* testsuite/26_numerics/random/discrete_distribution/operators/
serialize.cc: New.
* testsuite/26_numerics/random/weibull_distribution/cons/
parms.cc: New.
* testsuite/26_numerics/random/weibull_distribution/cons/
default.cc: New.
* testsuite/26_numerics/random/weibull_distribution/requirements/
typedefs.cc: New.
* testsuite/26_numerics/random/weibull_distribution/operators/
serialize.cc: New.
* testsuite/26_numerics/random/negative_binomial_distribution/cons/
parms.cc: New.
* testsuite/26_numerics/random/negative_binomial_distribution/cons/
default.cc: New.
* testsuite/26_numerics/random/negative_binomial_distribution/
requirements/typedefs.cc: New.
* testsuite/26_numerics/random/negative_binomial_distribution/
operators/serialize.cc: New.
* testsuite/26_numerics/random/cauchy_distribution/cons/
parms.cc: New.
* testsuite/26_numerics/random/cauchy_distribution/cons/
default.cc: New.
* testsuite/26_numerics/random/cauchy_distribution/requirements/
typedefs.cc: New.
* testsuite/26_numerics/random/cauchy_distribution/operators/
serialize.cc: New.
* testsuite/26_numerics/random/gamma_distribution/cons/
parms.cc: New.
* testsuite/26_numerics/random/gamma_distribution/cons/
default.cc: New.
* testsuite/26_numerics/random/gamma_distribution/requirements/
typedefs.cc: New.
* testsuite/26_numerics/random/gamma_distribution/operators/
serialize.cc: New.
* testsuite/26_numerics/random/fisher_f_distribution/cons/
parms.cc: New.
* testsuite/26_numerics/random/fisher_f_distribution/cons/
default.cc: New.
* testsuite/26_numerics/random/fisher_f_distribution/requirements/
typedefs.cc: New.
* testsuite/26_numerics/random/fisher_f_distribution/operators/
serialize.cc: New.
* testsuite/26_numerics/random/exponential_distribution/cons/
parms.cc: New.
* testsuite/26_numerics/random/exponential_distribution/cons/
default.cc: New.
* testsuite/26_numerics/random/exponential_distribution/requirements/
typedefs.cc: New.
* testsuite/26_numerics/random/exponential_distribution/operators/
serialize.cc: New.
* testsuite/26_numerics/random/lognormal_distribution/cons/
parms.cc: New.
* testsuite/26_numerics/random/lognormal_distribution/cons/
default.cc: New.
* testsuite/26_numerics/random/lognormal_distribution/requirements/
typedefs.cc: New.
* testsuite/26_numerics/random/lognormal_distribution/operators/
serialize.cc: New.
* testsuite/26_numerics/random/binomial_distribution/cons/
parms.cc: New.
* testsuite/26_numerics/random/binomial_distribution/cons/
default.cc: New.
* testsuite/26_numerics/random/binomial_distribution/requirements/
typedefs.cc: New.
* testsuite/26_numerics/random/binomial_distribution/operators/
serialize.cc: New.
* testsuite/26_numerics/random/random_device/cons/
token.cc: New.
* testsuite/26_numerics/random/random_device/cons/
default.cc: New.
* testsuite/26_numerics/random/random_device/requirements/
typedefs.cc: New.
* testsuite/26_numerics/random/extreme_value_distribution/cons/
parms.cc: New.
* testsuite/26_numerics/random/extreme_value_distribution/cons/
default.cc: New.
* testsuite/26_numerics/random/extreme_value_distribution/requirements/
typedefs.cc: New.
* testsuite/26_numerics/random/extreme_value_distribution/operators/
serialize.cc: New.
* testsuite/26_numerics/random/piecewise_linear_distribution/cons/
range.cc: New.
* testsuite/26_numerics/random/piecewise_linear_distribution/cons/
default.cc: New.
* testsuite/26_numerics/random/piecewise_linear_distribution/cons/
num_xbound_fun.cc: New.
* testsuite/26_numerics/random/piecewise_linear_distribution/cons/
initlist_fun.cc: New.
* testsuite/26_numerics/random/piecewise_linear_distribution/
requirements/typedefs.cc: New.
* testsuite/26_numerics/random/piecewise_linear_distribution/operators/
serialize.cc: New.
* testsuite/26_numerics/random/student_t_distribution/cons/
parms.cc: New.
* testsuite/26_numerics/random/student_t_distribution/cons/
default.cc: New.
* testsuite/26_numerics/random/student_t_distribution/requirements/
typedefs.cc: New.
* testsuite/26_numerics/random/student_t_distribution/operators/
serialize.cc: New.
* testsuite/26_numerics/random/geometric_distribution/cons/
parms.cc: New.
* testsuite/26_numerics/random/geometric_distribution/cons/
default.cc: New.
* testsuite/26_numerics/random/geometric_distribution/requirements/
typedefs.cc: New.
* testsuite/26_numerics/random/geometric_distribution/operators/
serialize.cc: New.
* testsuite/26_numerics/random/piecewise_constant_distribution/cons/
range.cc: New.
* testsuite/26_numerics/random/piecewise_constant_distribution/cons/
default.cc: New.
* testsuite/26_numerics/random/piecewise_constant_distribution/cons/
num_xbound_fun.cc: New.
* testsuite/26_numerics/random/piecewise_constant_distribution/cons/
initlist_fun.cc: New.
* testsuite/26_numerics/random/piecewise_constant_distribution/
requirements/typedefs.cc: New.
* testsuite/26_numerics/random/piecewise_constant_distribution/
operators/serialize.cc: New.
2009-04-02 Dodji Seketeli <dodji@redhat.com>
* include/ext/bitmap_allocator.h: the typedefs should be made public
* include/ext/bitmap_allocator.h: The typedefs should be made public
if we want them to be accessible. This has been revealed by the patch
that fixes PR c++/26693 in g++.

View File

@ -116,6 +116,8 @@ bits_headers = \
${bits_srcdir}/ostream.tcc \
${bits_srcdir}/ostream_insert.h \
${bits_srcdir}/postypes.h \
${bits_srcdir}/random.h \
${bits_srcdir}/random.tcc \
${bits_srcdir}/stream_iterator.h \
${bits_srcdir}/streambuf_iterator.h \
${bits_srcdir}/shared_ptr.h \
@ -570,6 +572,8 @@ tr1_headers = \
${tr1_srcdir}/poly_laguerre.tcc \
${tr1_srcdir}/legendre_function.tcc \
${tr1_srcdir}/random \
${tr1_srcdir}/random.h \
${tr1_srcdir}/random.tcc \
${tr1_srcdir}/regex \
${tr1_srcdir}/riemann_zeta.tcc \
${tr1_srcdir}/shared_ptr.h \
@ -608,8 +612,6 @@ tr1_impl_headers = \
${tr1_impl_srcdir}/functional_hash.h \
${tr1_impl_srcdir}/hashtable \
${tr1_impl_srcdir}/hashtable_policy.h \
${tr1_impl_srcdir}/random \
${tr1_impl_srcdir}/random.tcc \
${tr1_impl_srcdir}/regex \
${tr1_impl_srcdir}/type_traits \
${tr1_impl_srcdir}/unordered_map \

View File

@ -381,6 +381,8 @@ bits_headers = \
${bits_srcdir}/ostream.tcc \
${bits_srcdir}/ostream_insert.h \
${bits_srcdir}/postypes.h \
${bits_srcdir}/random.h \
${bits_srcdir}/random.tcc \
${bits_srcdir}/stream_iterator.h \
${bits_srcdir}/streambuf_iterator.h \
${bits_srcdir}/shared_ptr.h \
@ -833,6 +835,8 @@ tr1_headers = \
${tr1_srcdir}/poly_laguerre.tcc \
${tr1_srcdir}/legendre_function.tcc \
${tr1_srcdir}/random \
${tr1_srcdir}/random.h \
${tr1_srcdir}/random.tcc \
${tr1_srcdir}/regex \
${tr1_srcdir}/riemann_zeta.tcc \
${tr1_srcdir}/shared_ptr.h \
@ -870,8 +874,6 @@ tr1_impl_headers = \
${tr1_impl_srcdir}/functional_hash.h \
${tr1_impl_srcdir}/hashtable \
${tr1_impl_srcdir}/hashtable_policy.h \
${tr1_impl_srcdir}/random \
${tr1_impl_srcdir}/random.tcc \
${tr1_impl_srcdir}/regex \
${tr1_impl_srcdir}/type_traits \
${tr1_impl_srcdir}/unordered_map \

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -56,18 +56,10 @@
#include <debug/debug.h>
#include <type_traits>
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/random>
#else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/random>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
#include <bits/random.h>
#ifndef _GLIBCXX_EXPORT_TEMPLATE
# include <bits/random.tcc>
#endif
#endif // __GXX_EXPERIMENTAL_CXX0X__

View File

@ -55,16 +55,12 @@
#include <tr1/cmath>
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# include <tr1_impl/random>
# include <tr1/random.h>
#else
# define _GLIBCXX_INCLUDE_AS_TR1
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
# define _GLIBCXX_END_NAMESPACE_TR1 }
# define _GLIBCXX_TR1 tr1::
# include <tr1_impl/random>
# include <tr1/random.h>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_TR1
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
// Copyright (C) 2006, 2007, 2008 Free Software Foundation
// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@ -85,11 +85,12 @@ void* thread_hammer_and_kill(void* opaque_pools)
{
shared_and_weak_pools& pools = *static_cast<shared_and_weak_pools*>(opaque_pools);
// Using the same parameters as in the RNG test cases.
std::mersenne_twister<
std::mersenne_twister_engine<
unsigned long, 32, 624, 397, 31,
0x9908b0dful, 11, 7,
0x9908b0dful, 11,
0xfffffffful, 7,
0x9d2c5680ul, 15,
0xefc60000ul, 18> rng;
0xefc60000ul, 18, 1812433253ul> rng;
sp_vector_t::iterator cur_shared = pools.shared_pool.begin();
wp_vector_t::iterator cur_weak = pools.weak_pool.begin();
@ -120,11 +121,13 @@ void* thread_hammer(void* opaque_weak)
{
wp_vector_t& weak_pool = *static_cast<wp_vector_t*>(opaque_weak);
// Using the same parameters as in the RNG test cases.
std::mersenne_twister<
std::mersenne_twister_engine<
unsigned long, 32, 624, 397, 31,
0x9908b0dful, 11, 7,
0x9908b0dful, 11,
0xfffffffful, 7,
0x9d2c5680ul, 15,
0xefc60000ul, 18> rng;
0xefc60000ul, 18, 1812433253ul> rng;
wp_vector_t::iterator cur_weak = weak_pool.begin();
for (unsigned int i = 0; i < HAMMER_REPEAT; ++i)

View File

@ -1,4 +1,4 @@
// Copyright (C) 2006, 2007, 2008 Free Software Foundation
// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@ -87,12 +87,13 @@ void* thread_hammer_and_kill(void* opaque_pools)
{
shared_and_weak_pools& pools = *static_cast<shared_and_weak_pools*>(opaque_pools);
// Using the same parameters as in the RNG test cases.
std::mersenne_twister<
std::mersenne_twister_engine<
unsigned long, 32, 624, 397, 31,
0x9908b0dful, 11, 7,
0x9908b0dful, 11,
0xfffffffful, 7,
0x9d2c5680ul, 15,
0xefc60000ul, 18> rng;
0xefc60000ul, 18, 1812433253ul> rng;
sp_vector_t::iterator cur_shared = pools.shared_pool.begin();
wp_vector_t::iterator cur_weak = pools.weak_pool.begin();
@ -122,11 +123,13 @@ void* thread_hammer(void* opaque_weak)
{
wp_vector_t& weak_pool = *static_cast<wp_vector_t*>(opaque_weak);
// Using the same parameters as in the RNG test cases.
std::mersenne_twister<
std::mersenne_twister_engine<
unsigned long, 32, 624, 397, 31,
0x9908b0dful, 11, 7,
0x9908b0dful, 11,
0xfffffffful, 7,
0x9d2c5680ul, 15,
0xefc60000ul, 18> rng;
0xefc60000ul, 18, 1812433253ul> rng;
wp_vector_t::iterator cur_weak = weak_pool.begin();
for (unsigned int i = 0; i < HAMMER_REPEAT; ++i)

View File

@ -19,7 +19,7 @@
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
#include <tuple> // { dg-excess-errors "In file included from" }
#include <random> // { dg-excess-errors "In file included from" }
// { dg-error "upcoming ISO" "" { target *-*-* } 36 }

View File

@ -0,0 +1,44 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.2.1 Class template bernoulli_distribution [rand.dist.bern.bernoulli]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::bernoulli_distribution u;
VERIFY( u.p() == 0.5 );
VERIFY( u.min() == std::numeric_limits<bool>::min() );
VERIFY( u.max() == std::numeric_limits<bool>::max() );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,44 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.2.1 Class template bernoulli_distribution [rand.dist.bern.bernoulli]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::bernoulli_distribution u(0.75);
VERIFY( u.p() == 0.75 );
VERIFY( u.min() == std::numeric_limits<bool>::min() );
VERIFY( u.max() == std::numeric_limits<bool>::max() );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,52 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.2.1 Class template bernoulli_distribution [rand.dist.bern.bernoulli]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <sstream>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::stringstream str;
std::bernoulli_distribution u(0.75), v;
std::minstd_rand0 rng;
u(rng); // advance
str << u;
VERIFY( !(u == v) );
str >> v;
VERIFY( u == v );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,35 @@
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.2.1 Class template bernoulli_distribution [rand.dist.bern.bernoulli]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
void
test01()
{
typedef std::bernoulli_distribution test_type;
typedef test_type::result_type result_type;
}

View File

@ -0,0 +1,45 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.2.2 Class template binomial_distribution [rand.dist.bern.bin]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::binomial_distribution<> u;
VERIFY( u.t() == 1 );
VERIFY( u.p() == 0.5 );
VERIFY( u.min() == 0 );
VERIFY( u.max() == u.t() );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,45 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.2.2 Class template binomial_distribution [rand.dist.bern.bin]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::binomial_distribution<> u(3, 0.75);
VERIFY( u.t() == 3 );
VERIFY( u.p() == 0.75 );
VERIFY( u.min() == 0 );
VERIFY( u.max() == u.t() );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,52 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.2.2 Class template binomial_distribution [rand.dist.bern.bin]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <sstream>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::stringstream str;
std::binomial_distribution<int> u(3, 0.75), v;
std::minstd_rand0 rng;
u(rng); // advance
str << u;
VERIFY( !(u == v) );
str >> v;
VERIFY( u == v );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,35 @@
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.2.2 Class template binomial_distribution [rand.dist.bern.bin]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
void
test01()
{
typedef std::binomial_distribution<int> test_type;
typedef test_type::result_type result_type;
}

View File

@ -0,0 +1,46 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.4.4 Class template cauchy_distribution [rand.dist.norm.cauchy]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::cauchy_distribution<> u;
VERIFY( u.a() == 0.0 );
VERIFY( u.b() == 1.0 );
typedef std::cauchy_distribution<>::result_type result_type;
VERIFY( u.min() == std::numeric_limits<result_type>::min() );
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,46 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.4.4 Class template cauchy_distribution [rand.dist.norm.cauchy]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::cauchy_distribution<> u(5.0, 2.0);
VERIFY( u.a() == 5.0 );
VERIFY( u.b() == 2.0 );
typedef std::cauchy_distribution<>::result_type result_type;
VERIFY( u.min() == std::numeric_limits<result_type>::min() );
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,52 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.4.1 class template discard_block_engine [rand.adapt.disc]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random>
#include <sstream>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::stringstream str;
std::cauchy_distribution<double> u(5.0, 2.0), v;
std::minstd_rand0 rng;
u(rng); // advance
str << u;
VERIFY( !(u == v) );
str >> v;
VERIFY( u == v );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,35 @@
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.4.4 Class template cauchy_distribution [rand.dist.norm.cauchy]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
void
test01()
{
typedef std::cauchy_distribution<double> test_type;
typedef test_type::result_type result_type;
}

View File

@ -0,0 +1,45 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.4.3 Class template chi_squared_distribution [rand.dist.norm.chisq]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::chi_squared_distribution<> u;
VERIFY( u.n() == 1 );
typedef std::chi_squared_distribution<>::result_type result_type;
VERIFY( u.min() == 0.0 );
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,45 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.4.3 Class template chi_squared_distribution [rand.dist.norm.chisq]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::chi_squared_distribution<> u(1.5);
VERIFY( u.n() == 1.5 );
typedef std::chi_squared_distribution<>::result_type result_type;
VERIFY( u.min() == 0.0 );
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,52 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.4.3 Class template chi_squared_distribution [rand.dist.norm.chisq]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <sstream>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::stringstream str;
std::chi_squared_distribution<double> u(1.5), v;
std::minstd_rand0 rng;
u(rng); // advance
str << u;
VERIFY( !(u == v) );
str >> v;
VERIFY( u == v );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,35 @@
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.4.3 Class template chi_squared_distribution [rand.dist.norm.chisq]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
void
test01()
{
typedef std::chi_squared_distribution<double> test_type;
typedef test_type::result_type result_type;
}

View File

@ -0,0 +1,48 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-18 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.5 Engines and egine adaptors with predefined parameters [rand.predef]
// 26.4.5 [10]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::default_random_engine a;
a.discard(9999);
// This is our choice for now.
std::minstd_rand0 b;
b.discard(9999);
assert( a() == b() );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,46 @@
// { dg-options "-std=c++0x" }
//
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.4.1 class template discard_block_engine [rand.adapt.disc]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
typedef std::subtract_with_carry_engine<long, 24, 10, 24>
base_engine;
base_engine b;
std::discard_block_engine<base_engine, 389, 24> e(b);
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,45 @@
// { dg-options "-std=c++0x" }
//
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.4.1 class template discard_block_engine [rand.adapt.disc]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
typedef std::subtract_with_carry_engine<long, 24, 10, 24>
base_engine;
std::discard_block_engine<base_engine, 389, 24>
e(std::move(base_engine()));
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,45 @@
// { dg-options "-std=c++0x" }
//
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.4.1 class template discard_block_engine [rand.adapt.disc]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::discard_block_engine
<
std::subtract_with_carry_engine<long, 24, 10, 24>,
389, 24
> e;
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,47 @@
// { dg-options "-std=c++0x" }
//
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.4.1 class template discard_block_engine [rand.adapt.disc]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
unsigned long seed = 2;
std::discard_block_engine
<
std::subtract_with_carry_engine<long, 24, 10, 24>,
389, 24
> e(seed);
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,47 @@
// { dg-options "-std=c++0x" }
//
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.4.1 class template discard_block_engine [rand.adapt.disc]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
double seed = 2.0;
std::discard_block_engine
<
std::subtract_with_carry_engine<long, 24, 10, 24>,
389, 24
> e(seed);
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,47 @@
// { dg-options "-std=c++0x" }
//
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.4.1 class template discard_block_engine [rand.adapt.disc]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::seed_seq seq;
std::discard_block_engine
<
std::subtract_with_carry_engine<long, 24, 10, 24>,
389, 24
> e(seq);
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,52 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.4.1 class template discard_block_engine [rand.adapt.disc]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::discard_block_engine
<
std::subtract_with_carry_engine<long, 24, 10, 24>,
389, 24
> u, v;
VERIFY( u == v );
u.discard(100);
v.discard(100);
VERIFY( u == v );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,55 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.4.1 class template discard_block_engine [rand.adapt.disc]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random>
#include <sstream>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::stringstream str;
std::discard_block_engine
<
std::subtract_with_carry_engine<long, 24, 10, 24>,
389, 24
> u, v;
u(); // advance
str << u;
VERIFY( !(u == v) );
str >> v;
VERIFY( u == v );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,39 @@
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.4.1 Class template discard_blockl_engine [rand.adapt.disc]
// 26.4.2.3 Concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random>
void
test01()
{
typedef std::discard_block_engine
<
std::subtract_with_carry_engine<long, 24, 10, 24>,
389, 24
> test_type;
typedef test_type::result_type result_type;
}

View File

@ -0,0 +1,44 @@
// { dg-options "-std=c++0x" }
//
// 2008-12-03 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.5.1 Class template discrete_distribution [rand.dist.samp.discrete]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::discrete_distribution<> u;
std::vector<double> probablility = u.probabilities();
VERIFY( probablility.size() == 1 );
VERIFY( probablility[0] == 1.0 );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
//
// 2008-12-03 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.5.1 Class template discrete_distribution [rand.dist.samp.discrete]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::discrete_distribution<> u({0.0, 2.0, 4.0, 3.0, 4.0, 0.0});
std::vector<double> probablility = u.probabilities();
VERIFY( probablility.size() == 6 );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,67 @@
// { dg-options "-std=c++0x" }
//
// 2008-12-03 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.5.1 Class template discrete_distribution [rand.dist.samp.discrete]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <cmath>
#include <testsuite_hooks.h>
struct cosine_distribution
{
cosine_distribution(double x0, double lambda)
: _M_x0(x0), _M_lambda(lambda)
{ }
double
operator()(double x)
{
if (x - _M_x0 < -_M_lambda / 4)
return 0.0;
else if (x - _M_x0 > _M_lambda / 4)
return 0.0;
else
return std::cos(2 * M_PI * (x - _M_x0) / _M_lambda);
}
private:
double _M_x0;
double _M_lambda;
};
void
test01()
{
bool test __attribute__((unused)) = true;
cosine_distribution cd(1.5, 3.0);
std::discrete_distribution<> u(21, -10.0, 10.0, cd);
std::vector<double> probablility = u.probabilities();
VERIFY( probablility.size() == 21 );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,46 @@
// { dg-options "-std=c++0x" }
//
// 2008-12-03 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.5.1 Class template discrete_distribution [rand.dist.samp.discrete]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::vector<double> wt = {0.5, 1.0, 2.5, 1.5, 0.5};
std::discrete_distribution<> u(wt.begin(), wt.end());
std::vector<double> probablility = u.probabilities();
VERIFY( probablility.size() == 5 );
VERIFY( probablility[0] == 0.5 / 6.0 );
VERIFY( probablility[2] == 2.5 / 6.0 );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,53 @@
// { dg-options "-std=c++0x" }
//
// 2008-12-05 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.5.1 Class template discrete_distribution [rand.dist.samp.discrete]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <sstream>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::stringstream str;
std::vector<double> wt = {0.5, 1.0, 2.5, 1.5, 0.5};
std::discrete_distribution<int> u(wt.begin(), wt.end()), v;
std::minstd_rand0 rng;
u(rng); // advance
str << u;
VERIFY( !(u == v) );
str >> v;
VERIFY( u == v );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,35 @@
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2008-12-03 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.5.1 Class template discrete_distribution [rand.dist.samp.discrete]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
void
test01()
{
typedef std::discrete_distribution<> test_type;
typedef test_type::result_type result_type;
}

View File

@ -0,0 +1,45 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.3.2 Class template exponential_distribution [rand.dist.pois.exp]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::exponential_distribution<> u;
VERIFY( u.lambda() == 1.0 );
typedef std::exponential_distribution<>::result_type result_type;
VERIFY( u.min() == 0 );
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,45 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.3.2 Class template exponential_distribution [rand.dist.pois.exp]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::exponential_distribution<> u(0.5);
VERIFY( u.lambda() == 0.5 );
typedef std::exponential_distribution<>::result_type result_type;
VERIFY( u.min() == 0 );
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,52 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.3.2 Class template exponential_distribution [rand.dist.pois.exp]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <sstream>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::stringstream str;
std::exponential_distribution<double> u(0.5), v;
std::minstd_rand0 rng;
u(rng); // advance
str << u;
VERIFY( !(u == v) );
str >> v;
VERIFY( u == v );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,35 @@
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.3.2 Class template exponential_distribution [rand.dist.pois.exp]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
void
test01()
{
typedef std::exponential_distribution<double> test_type;
typedef test_type::result_type result_type;
}

View File

@ -0,0 +1,46 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.3.5 Class template extreme_value_distribution [rand.dist.pois.extreme]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::extreme_value_distribution<> u;
VERIFY( u.a() == 0.0 );
VERIFY( u.b() == 1.0 );
typedef std::extreme_value_distribution<>::result_type result_type;
VERIFY( u.min() == std::numeric_limits<result_type>::min() );
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,46 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.3.5 Class template extreme_value_distribution [rand.dist.pois.extreme]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::extreme_value_distribution<> u(5.0, 2.0);
VERIFY( u.a() == 5.0 );
VERIFY( u.b() == 2.0 );
typedef std::extreme_value_distribution<>::result_type result_type;
VERIFY( u.min() == std::numeric_limits<result_type>::min() );
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,52 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.3.5 Class template extreme_value_distribution [rand.dist.pois.extreme]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <sstream>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::stringstream str;
std::extreme_value_distribution<double> u, v(5.0, 2.0);
std::minstd_rand0 rng;
u(rng); // advance
str << u;
VERIFY( !(u == v) );
str >> v;
VERIFY( u == v );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,35 @@
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.3.5 Class template extreme_value_distribution [rand.dist.pois.extreme]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
void
test01()
{
typedef std::extreme_value_distribution<double> test_type;
typedef test_type::result_type result_type;
}

View File

@ -0,0 +1,46 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.4.5 Class template fisher_f_distribution [rand.dist.norm.f]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::fisher_f_distribution<> u;
VERIFY( u.m() == 1.0 );
VERIFY( u.n() == 1.0 );
typedef std::fisher_f_distribution<>::result_type result_type;
VERIFY( u.min() == 0.0 );
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,46 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.4.5 Class template fisher_f_distribution [rand.dist.norm.f]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::fisher_f_distribution<> u(2.0, 3.0);
VERIFY( u.m() == 2.0 );
VERIFY( u.n() == 3.0 );
typedef std::fisher_f_distribution<>::result_type result_type;
VERIFY( u.min() == 0.0 );
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,52 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.4.5 Class template fisher_f_distribution [rand.dist.norm.f]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <sstream>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::stringstream str;
std::fisher_f_distribution<double> u(2.0, 3.0), v;
std::minstd_rand0 rng;
u(rng); // advance
str << u;
VERIFY( !(u == v) );
str >> v;
VERIFY( u == v );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,35 @@
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.4.5 Class template fisher_f_distribution [rand.dist.norm.f]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
void
test01()
{
typedef std::fisher_f_distribution<double> test_type;
typedef test_type::result_type result_type;
}

View File

@ -0,0 +1,46 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.3.3 Class template gamma_distribution [rand.dist.pois.gamma]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::gamma_distribution<> u;
VERIFY( u.alpha() == 1.0 );
VERIFY( u.beta() == 1.0 );
VERIFY( u.min() == 0.0 );
typedef std::gamma_distribution<>::result_type result_type;
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,46 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.3.3 Class template gamma_distribution [rand.dist.pois.gamma]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::gamma_distribution<> u(1.5, 3.0);
VERIFY( u.alpha() == 1.5 );
VERIFY( u.beta() == 3.0 );
VERIFY( u.min() == 0.0 );
typedef std::gamma_distribution<>::result_type result_type;
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,52 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.3.3 Class template gamma_distribution [rand.dist.pois.gamma]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <sstream>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::stringstream str;
std::gamma_distribution<double> u(1.5, 3.0), v;
std::minstd_rand0 rng;
u(rng); // advance
str << u;
VERIFY( !(u == v) );
str >> v;
VERIFY( u == v );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,35 @@
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.3.3 Class template gamma_distribution [rand.dist.pois.gamma]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
void
test01()
{
typedef std::gamma_distribution<double> test_type;
typedef test_type::result_type result_type;
}

View File

@ -0,0 +1,45 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.2.3 Class template geometric_distribution [rand.dist.bern.geo]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::geometric_distribution<> u;
VERIFY( u.p() == 0.5 );
VERIFY( u.min() == 0 );
typedef std::geometric_distribution<>::result_type result_type;
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,45 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.2.3 Class template geometric_distribution [rand.dist.bern.geo]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::geometric_distribution<> u(0.75);
VERIFY( u.p() == 0.75 );
VERIFY( u.min() == 0 );
typedef std::geometric_distribution<>::result_type result_type;
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,52 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.2.3 Class template geometric_distribution [rand.dist.bern.geom]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <sstream>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::stringstream str;
std::geometric_distribution<int> u(0.75), v;
std::minstd_rand0 rng;
u(rng); // advance
str << u;
VERIFY( !(u == v) );
str >> v;
VERIFY( u == v );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,35 @@
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.2.3 Class template geometric_distribution [rand.dist.bern.geom]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
void
test01()
{
typedef std::geometric_distribution<int> test_type;
typedef test_type::result_type result_type;
}

View File

@ -0,0 +1,46 @@
// { dg-options "-std=c++0x" }
//
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
typedef std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>
base_engine;
base_engine b;
std::independent_bits_engine<base_engine, 48, unsigned long> e(b);
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,45 @@
// { dg-options "-std=c++0x" }
//
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
typedef std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>
base_engine;
std::independent_bits_engine<base_engine, 48, unsigned long>
e(std::move(base_engine()));
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,46 @@
// { dg-options "-std=c++0x" }
//
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::independent_bits_engine
<
std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>,
48,
unsigned long
> e;
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,48 @@
// { dg-options "-std=c++0x" }
//
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
unsigned long seed = 2;
std::independent_bits_engine
<
std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>,
48,
unsigned long
> e(seed);
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,48 @@
// { dg-options "-std=c++0x" }
//
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
double seed = 2.0;
std::independent_bits_engine
<
std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>,
48,
unsigned long
> e(seed);
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,48 @@
// { dg-options "-std=c++0x" }
//
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::seed_seq seq;
std::independent_bits_engine
<
std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>,
48,
unsigned long
> e(seq);
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,50 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.4.1 class template discard_block_engine [rand.adapt.disc]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::independent_bits_engine
<std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>,
48, unsigned long> u, v;
VERIFY( u == v );
u.discard(100);
v.discard(100);
VERIFY( u == v );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,53 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.4.1 class template discard_block_engine [rand.adapt.disc]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random>
#include <sstream>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::stringstream str;
std::independent_bits_engine
<std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>,
48, unsigned long> u, v;
u(); // advance
str << u;
VERIFY( !(u == v) );
str >> v;
VERIFY( u == v );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,42 @@
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits]
// 26.4.2.3 Concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random>
void
test01()
{
typedef std::independent_bits_engine
<
std::subtract_with_carry_engine
<
uint_fast64_t, 48, 5, 12
>,
48, unsigned long
> test_type;
typedef test_type::result_type result_type;
}

View File

@ -0,0 +1,44 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-18 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.5 Engines and egine adaptors with predefined parameters [rand.predef]
// 26.4.5 [9]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::knuth_b a;
a.discard(9999);
VERIFY( a() == 1112339016 );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,44 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.3.1 class template linear_congruential_engine [rand.eng.lcong]
// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::linear_congruential_engine<unsigned long, 48271, 0, 2147483647> x;
VERIFY( x.min() == 1 );
VERIFY( x.max() == 2147483647-1 );
VERIFY( x() == 48271 );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,40 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.3.1 class template linear_congruential_engine [rand.eng.lcong]
// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
unsigned long seed = 2;
std::linear_congruential_engine<unsigned long, 48271, 0, 2147483647> x(seed);
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,40 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.3.1 class template linear_congruential_engine [rand.eng.lcong]
// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
double seed = 2.0;
std::linear_congruential_engine<unsigned long, 48271, 0, 2147483647> x(seed);
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,46 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.3.1 class template linear_congruential_engine [rand.eng.lcong]
// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::minstd_rand0 a;
std::minstd_rand0 b;
std::minstd_rand0 c(120);
VERIFY( a == b );
VERIFY( !(a == c) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,51 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.3.1 class template linear_congruential_engine [rand.eng.lcong]
// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
#include <random>
#include <sstream>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::stringstream str;
std::minstd_rand0 a;
std::minstd_rand0 b;
a(); // advance
str << a;
VERIFY( !(a == b) );
str >> b;
VERIFY( a == b );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,33 @@
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// { dg-do compile }
// { dg-options "-std=c++0x -D_GLIBCXX_CONCEPT_CHECKS" }
// { dg-error "not a valid type" "" { target *-*-* } 32 }
// { dg-error "invalid type" "" { target *-*-* } 32 }
// 26.4.3.1 class template linear_congruential_engine [rand.eng.lcong]
// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
#include <random>
std::linear_congruential_engine<double, 48271, 0, 2147483647> x;

View File

@ -0,0 +1,35 @@
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.3.1 class template linear_congruential_engine [rand.eng.lcong]
// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
#include <random>
void
test01()
{
typedef std::linear_congruential_engine<unsigned long, 2, 0, 4> test_type;
typedef test_type::result_type result_type;
}

View File

@ -0,0 +1,46 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.4.2 Class template lognormal_distribution [rand.dist.norm.lognormal]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::lognormal_distribution<> u;
VERIFY( u.m() == 0.0 );
VERIFY( u.s() == 1.0 );
typedef std::lognormal_distribution<>::result_type result_type;
VERIFY( u.min() == 0.0 );
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,46 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.4.2 Class template lognormal_distribution [rand.dist.norm.lognormal]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::lognormal_distribution<> u(5.0, 2.0);
VERIFY( u.m() == 5.0 );
VERIFY( u.s() == 2.0 );
typedef std::lognormal_distribution<>::result_type result_type;
VERIFY( u.min() == 0.0 );
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,52 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.4.2 Class template lognormal_distribution [rand.dist.norm.lognormal]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <sstream>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::stringstream str;
std::lognormal_distribution<double> u(5.0, 2.0), v;
std::minstd_rand0 rng;
u(rng); // advance
str << u;
VERIFY( !(u == v) );
str >> v;
VERIFY( u == v );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,35 @@
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.4.2 Class template lognormal_distribution [rand.dist.norm.lognormal]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
void
test01()
{
typedef std::lognormal_distribution<double> test_type;
typedef test_type::result_type result_type;
}

View File

@ -0,0 +1,51 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.3.2 Class template mersenne_twister_engine [rand.eng.mers]
// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
typedef unsigned long value_type;
std::mersenne_twister_engine<
value_type, 32, 624, 397, 31,
0x9908b0dful, 11,
0xfffffffful, 7,
0x9d2c5680ul, 15,
0xefc60000ul, 18, 1812433253ul> x;
VERIFY( x.min() == 0 );
// XXX VERIFY( x.max() == 4294967295ul);
VERIFY( x() == 3499211612ul );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,45 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.3.2 Class template mersenne_twister_engine [rand.eng.mers]
// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
unsigned long seed = 2;
std::mersenne_twister_engine<
unsigned long, 32, 624, 397, 31,
0x9908b0dful, 11,
0xfffffffful, 7,
0x9d2c5680ul, 15,
0xefc60000ul, 18, 1812433253ul> x(seed);
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,45 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.3.2 Class template mersenne_twister_engine [rand.eng.mers]
// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
double seed = 2.0;
std::mersenne_twister_engine<
unsigned long, 32, 624, 397, 31,
0x9908b0dful, 11,
0xfffffffful, 7,
0x9d2c5680ul, 15,
0xefc60000ul, 18, 1812433253ul> x(seed);
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,53 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.3.2 Class template mersenne_twister_engine [rand.eng.mers]
// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::mersenne_twister_engine<
unsigned long, 32, 624, 397, 31,
0x9908b0dful, 11,
0xfffffffful, 7,
0x9d2c5680ul, 15,
0xefc60000ul, 18, 1812433253ul> u, v;
VERIFY( u == v );
u.discard(100);
v.discard(100);
VERIFY( u == v );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,56 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.3.2 Class template mersenne_twister_engine [rand.eng.mers]
// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
#include <sstream>
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::stringstream str;
std::mersenne_twister_engine<
unsigned long, 32, 624, 397, 31,
0x9908b0dful, 11,
0xfffffffful, 7,
0x9d2c5680ul, 15,
0xefc60000ul, 18, 1812433253ul> u, v;
u(); // advance
str << u;
VERIFY( !(u == v) );
str >> v;
VERIFY( u == v );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,40 @@
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.3.2 Class template mersenne_twister_engine [rand.eng.mers]
// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
#include <random>
void
test01()
{
typedef std::mersenne_twister_engine<unsigned long,
32, 624, 397, 31,
0x9908b0df, 11,
0xfffffffful, 7,
0x9d2c5680, 15,
0xefc60000, 18, 1812433253ul> test_type;
typedef test_type::result_type result_type;
}

View File

@ -0,0 +1,44 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-18 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.5 Engines with predefined parameters
// 26.4.5 [2]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::minstd_rand a;
a.discard(9999);
VERIFY( a() == 399268537 );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,44 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.5 Engines and egine adaptors with predefined parameters [rand.predef]
// 26.4.5 [1]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::minstd_rand0 a;
a.discard(9999);
VERIFY( a() == 1043618065 );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,44 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-18 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.5 Engines and egine adaptors with predefined parameters [rand.predef]
// 26.4.5 [3]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::mt19937 a;
a.discard(9999);
VERIFY( a() == 4123659995ul );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,44 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-18 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.5 Engines and egine adaptors with predefined parameters [rand.predef]
// 26.4.5 [4]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::mt19937_64 a;
a.discard(9999);
VERIFY( a() == 9981545732273789042ul );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,46 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.2.4 Class template negative_binomial_distribution [rand.dist.bern.negbin]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::negative_binomial_distribution<> u;
VERIFY( u.k() == 1 );
VERIFY( u.p() == 0.5 );
typedef std::negative_binomial_distribution<>::result_type result_type;
VERIFY( u.min() == 0 );
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,46 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.2.4 Class template negative_binomial_distribution [rand.dist.bern.negbin]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::negative_binomial_distribution<> u(3, 0.75);
VERIFY( u.k() == 3 );
VERIFY( u.p() == 0.75 );
typedef std::negative_binomial_distribution<>::result_type result_type;
VERIFY( u.min() == 0 );
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,52 @@
// { dg-options "-std=c++0x" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 26.4.8.2.4 Class template negative_binomial_distribution [rand.dist.bern.negbin]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
#include <sstream>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::stringstream str;
std::negative_binomial_distribution<int> u(3, 0.75), v;
std::minstd_rand0 rng;
u(rng); // advance
str << u;
VERIFY( !(u == v) );
str >> v;
VERIFY( u == v );
}
int main()
{
test01();
return 0;
}

Some files were not shown because too many files have changed in this diff Show More