random.h (operator==(const uniform_int_distribution<>&, const uniform_int_distribution<>&), [...]): Add, likewise for operator!=.

2010-03-16  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/random.h (operator==(const uniform_int_distribution<>&,
	const uniform_int_distribution<>&), operator==(const
	uniform_real_distribution<>&, const uniform_real_distribution<>&),
	operator==(const lognormal_distribution<>&,
	const lognormal_distribution<>&), operator==(const
	chi_squared_distribution<>&, const chi_squared_distribution<>&),
	operator==(const cauchy_distribution<>&, const cauchy_distribution<>&),
	operator==(const fisher_distribution<>&, const fisher_distribution<>&),
	operator==(const student_t_distribution<>&,
	const student_t_distribution<>&), operator==(const
	bernoulli_distribution<>&, const bernoulli_distribution<>&),
	operator==(const binomial_distribution<>&, const
	binomial_distribution<>&), operator==(const geometric_distribution<>&,
	const geometric_distribution<>&), operator==(const
	negative_binomial_distribution<>&, const
	negative_binomial_distribution<>&), operator==(const
	poisson_distribution<>&, const poisson_distribution<>&),
	operator==(const exponential_distribution<>&,
	const exponential_distribution<>&), operator==(const
	gamma_distribution<>&, const gamma_distribution<>&), operator==(const
	weibull_distribution<>&, const weibull_distribution<>&),
	operator==(const extreme_value_distribution<>&,
	const extreme_value_distribution<>&), operator==(const
	discrete_distribution<>&, const discrete_distribution<>&),
	operator==(const piecewise_constant_distribution<>&,
	const piecewise_constant_distribution<>&), operator==(const
	piecewise_linear_distribution<>&, const
	piecewise_linear_distribution<>&)): Add, likewise for operator!=.
	(operator!=(const independent_bits_engine<>&, const
	independent_bits_engine<>&), operator!=(const
	subtract_with_carry_engine<>&, const subtract_with_carry_engine<>&),
	operator!=(const discard_block_engine<>&, const
	discard_block_engine<>&), operator!=(const mersenne_twister_engine<>&,
	const mersenne_twister_engine<>&), operator!=(const
	linear_congruential_engine<>&, const linear_congruential_engine<>&),
	operator!=(const shuffle_order_engine<>&, const
	shuffle_order_engine<>&): Add.
	* include/bits/random.tcc (operator==(const normal_distribution<>&,
	const normal_distribution<>&)): Add.
	* testsuite/26_numerics/random/uniform_real_distribution/operators/
	inequal.cc: New.
	* testsuite/26_numerics/random/uniform_real_distribution/operators/
	equal.cc: Likewise.
	* testsuite/26_numerics/random/piecewise_constant_distribution/
	operators/inequal.cc: Likewise.
	* testsuite/26_numerics/random/piecewise_constant_distribution/
	operators/equal.cc: Likewise.
	* testsuite/26_numerics/random/chi_squared_distribution/operators/
	inequal.cc: Likewise.
	* testsuite/26_numerics/random/chi_squared_distribution/operators/
	equal.cc: Likewise.
	* testsuite/26_numerics/random/normal_distribution/operators/
	inequal.cc: Likewise.
	* testsuite/26_numerics/random/normal_distribution/operators/
	equal.cc: Likewise.
	* testsuite/26_numerics/random/uniform_int_distribution/operators/
	inequal.cc: Likewise.
	* testsuite/26_numerics/random/uniform_int_distribution/operators/
	equal.cc: Likewise.
	* testsuite/26_numerics/random/poisson_distribution/operators/
	inequal.cc: Likewise.
	* testsuite/26_numerics/random/poisson_distribution/operators/
	equal.cc: Likewise.
	* testsuite/26_numerics/random/bernoulli_distribution/operators/
	inequal.cc: Likewise.
	* testsuite/26_numerics/random/bernoulli_distribution/operators/
	equal.cc: Likewise.
	* testsuite/26_numerics/random/discrete_distribution/operators/
	inequal.cc: Likewise.
	* testsuite/26_numerics/random/discrete_distribution/operators/
	equal.cc: Likewise.
	* testsuite/26_numerics/random/weibull_distribution/operators/
	inequal.cc: Likewise.
	* testsuite/26_numerics/random/weibull_distribution/operators/
	equal.cc: Likewise.
	* testsuite/26_numerics/random/independent_bits_engine/operators/
	inequal.cc: Likewise.
	* testsuite/26_numerics/random/subtract_with_carry_engine/operators/
	inequal.cc: Likewise.
	* testsuite/26_numerics/random/discard_block_engine/operators/
	inequal.cc: Likewise.
	* testsuite/26_numerics/random/cauchy_distribution/operators/
	inequal.cc: Likewise.
	* testsuite/26_numerics/random/cauchy_distribution/operators/
	equal.cc: Likewise.
	* testsuite/26_numerics/random/negative_binomial_distribution/
	operators/inequal.cc: Likewise.
	* testsuite/26_numerics/random/negative_binomial_distribution/
	operators/equal.cc: Likewise.
	* testsuite/26_numerics/random/gamma_distribution/operators/
	inequal.cc: Likewise.
	* testsuite/26_numerics/random/gamma_distribution/operators/
	equal.cc: Likewise.
	* testsuite/26_numerics/random/mersenne_twister_engine/operators/
	inequal.cc: Likewise.
	* testsuite/26_numerics/random/fisher_f_distribution/operators/
	inequal.cc: Likewise.
	* testsuite/26_numerics/random/fisher_f_distribution/operators/
	equal.cc: Likewise.
	* testsuite/26_numerics/random/exponential_distribution/operators/
	inequal.cc: Likewise.
	* testsuite/26_numerics/random/exponential_distribution/operators/
	equal.cc: Likewise.
	* testsuite/26_numerics/random/binomial_distribution/operators/
	inequal.cc: Likewise.
	* testsuite/26_numerics/random/binomial_distribution/operators/
	equal.cc: Likewise.
	* testsuite/26_numerics/random/lognormal_distribution/operators/
	inequal.cc: Likewise.
	* testsuite/26_numerics/random/lognormal_distribution/operators/
	equal.cc: Likewise.
	* testsuite/26_numerics/random/extreme_value_distribution/operators/
	inequal.cc: Likewise.
	* testsuite/26_numerics/random/extreme_value_distribution/operators/
	equal.cc: Likewise.
	* testsuite/26_numerics/random/piecewise_linear_distribution/
	operators/inequal.cc: Likewise.
	* testsuite/26_numerics/random/piecewise_linear_distribution/
	operators/equal.cc: Likewise.
	* testsuite/26_numerics/random/student_t_distribution/operators/
	inequal.cc: Likewise.
	* testsuite/26_numerics/random/student_t_distribution/operators/
	equal.cc: Likewise.
	* testsuite/26_numerics/random/linear_congruential_engine/operators/
	inequal.cc: Likewise.
	* testsuite/26_numerics/random/shuffle_order_engine/operators/
	inequal.cc: Likewise.
	* testsuite/26_numerics/random/geometric_distribution/operators/
	inequal.cc: Likewise.
	* testsuite/26_numerics/random/geometric_distribution/operators/
	equal.cc: Likewise.

From-SVN: r157489
This commit is contained in:
Paolo Carlini 2010-03-16 16:14:00 +00:00 committed by Paolo Carlini
parent db5c4b8b91
commit fc05e1ba76
49 changed files with 2827 additions and 10 deletions

View File

@ -1,3 +1,137 @@
2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/random.h (operator==(const uniform_int_distribution<>&,
const uniform_int_distribution<>&), operator==(const
uniform_real_distribution<>&, const uniform_real_distribution<>&),
operator==(const lognormal_distribution<>&,
const lognormal_distribution<>&), operator==(const
chi_squared_distribution<>&, const chi_squared_distribution<>&),
operator==(const cauchy_distribution<>&, const cauchy_distribution<>&),
operator==(const fisher_distribution<>&, const fisher_distribution<>&),
operator==(const student_t_distribution<>&,
const student_t_distribution<>&), operator==(const
bernoulli_distribution<>&, const bernoulli_distribution<>&),
operator==(const binomial_distribution<>&, const
binomial_distribution<>&), operator==(const geometric_distribution<>&,
const geometric_distribution<>&), operator==(const
negative_binomial_distribution<>&, const
negative_binomial_distribution<>&), operator==(const
poisson_distribution<>&, const poisson_distribution<>&),
operator==(const exponential_distribution<>&,
const exponential_distribution<>&), operator==(const
gamma_distribution<>&, const gamma_distribution<>&), operator==(const
weibull_distribution<>&, const weibull_distribution<>&),
operator==(const extreme_value_distribution<>&,
const extreme_value_distribution<>&), operator==(const
discrete_distribution<>&, const discrete_distribution<>&),
operator==(const piecewise_constant_distribution<>&,
const piecewise_constant_distribution<>&), operator==(const
piecewise_linear_distribution<>&, const
piecewise_linear_distribution<>&)): Add, likewise for operator!=.
(operator!=(const independent_bits_engine<>&, const
independent_bits_engine<>&), operator!=(const
subtract_with_carry_engine<>&, const subtract_with_carry_engine<>&),
operator!=(const discard_block_engine<>&, const
discard_block_engine<>&), operator!=(const mersenne_twister_engine<>&,
const mersenne_twister_engine<>&), operator!=(const
linear_congruential_engine<>&, const linear_congruential_engine<>&),
operator!=(const shuffle_order_engine<>&, const
shuffle_order_engine<>&): Add.
* include/bits/random.tcc (operator==(const normal_distribution<>&,
const normal_distribution<>&)): Add.
* testsuite/26_numerics/random/uniform_real_distribution/operators/
inequal.cc: New.
* testsuite/26_numerics/random/uniform_real_distribution/operators/
equal.cc: Likewise.
* testsuite/26_numerics/random/piecewise_constant_distribution/
operators/inequal.cc: Likewise.
* testsuite/26_numerics/random/piecewise_constant_distribution/
operators/equal.cc: Likewise.
* testsuite/26_numerics/random/chi_squared_distribution/operators/
inequal.cc: Likewise.
* testsuite/26_numerics/random/chi_squared_distribution/operators/
equal.cc: Likewise.
* testsuite/26_numerics/random/normal_distribution/operators/
inequal.cc: Likewise.
* testsuite/26_numerics/random/normal_distribution/operators/
equal.cc: Likewise.
* testsuite/26_numerics/random/uniform_int_distribution/operators/
inequal.cc: Likewise.
* testsuite/26_numerics/random/uniform_int_distribution/operators/
equal.cc: Likewise.
* testsuite/26_numerics/random/poisson_distribution/operators/
inequal.cc: Likewise.
* testsuite/26_numerics/random/poisson_distribution/operators/
equal.cc: Likewise.
* testsuite/26_numerics/random/bernoulli_distribution/operators/
inequal.cc: Likewise.
* testsuite/26_numerics/random/bernoulli_distribution/operators/
equal.cc: Likewise.
* testsuite/26_numerics/random/discrete_distribution/operators/
inequal.cc: Likewise.
* testsuite/26_numerics/random/discrete_distribution/operators/
equal.cc: Likewise.
* testsuite/26_numerics/random/weibull_distribution/operators/
inequal.cc: Likewise.
* testsuite/26_numerics/random/weibull_distribution/operators/
equal.cc: Likewise.
* testsuite/26_numerics/random/independent_bits_engine/operators/
inequal.cc: Likewise.
* testsuite/26_numerics/random/subtract_with_carry_engine/operators/
inequal.cc: Likewise.
* testsuite/26_numerics/random/discard_block_engine/operators/
inequal.cc: Likewise.
* testsuite/26_numerics/random/cauchy_distribution/operators/
inequal.cc: Likewise.
* testsuite/26_numerics/random/cauchy_distribution/operators/
equal.cc: Likewise.
* testsuite/26_numerics/random/negative_binomial_distribution/
operators/inequal.cc: Likewise.
* testsuite/26_numerics/random/negative_binomial_distribution/
operators/equal.cc: Likewise.
* testsuite/26_numerics/random/gamma_distribution/operators/
inequal.cc: Likewise.
* testsuite/26_numerics/random/gamma_distribution/operators/
equal.cc: Likewise.
* testsuite/26_numerics/random/mersenne_twister_engine/operators/
inequal.cc: Likewise.
* testsuite/26_numerics/random/fisher_f_distribution/operators/
inequal.cc: Likewise.
* testsuite/26_numerics/random/fisher_f_distribution/operators/
equal.cc: Likewise.
* testsuite/26_numerics/random/exponential_distribution/operators/
inequal.cc: Likewise.
* testsuite/26_numerics/random/exponential_distribution/operators/
equal.cc: Likewise.
* testsuite/26_numerics/random/binomial_distribution/operators/
inequal.cc: Likewise.
* testsuite/26_numerics/random/binomial_distribution/operators/
equal.cc: Likewise.
* testsuite/26_numerics/random/lognormal_distribution/operators/
inequal.cc: Likewise.
* testsuite/26_numerics/random/lognormal_distribution/operators/
equal.cc: Likewise.
* testsuite/26_numerics/random/extreme_value_distribution/operators/
inequal.cc: Likewise.
* testsuite/26_numerics/random/extreme_value_distribution/operators/
equal.cc: Likewise.
* testsuite/26_numerics/random/piecewise_linear_distribution/
operators/inequal.cc: Likewise.
* testsuite/26_numerics/random/piecewise_linear_distribution/
operators/equal.cc: Likewise.
* testsuite/26_numerics/random/student_t_distribution/operators/
inequal.cc: Likewise.
* testsuite/26_numerics/random/student_t_distribution/operators/
equal.cc: Likewise.
* testsuite/26_numerics/random/linear_congruential_engine/operators/
inequal.cc: Likewise.
* testsuite/26_numerics/random/shuffle_order_engine/operators/
inequal.cc: Likewise.
* testsuite/26_numerics/random/geometric_distribution/operators/
inequal.cc: Likewise.
* testsuite/26_numerics/random/geometric_distribution/operators/
equal.cc: Likewise.
2010-03-15 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/forward_list.tcc (_Fwd_list_node_base::

File diff suppressed because it is too large Load Diff

View File

@ -1627,6 +1627,26 @@ namespace std
return __ret;
}
template<typename _RealType>
bool
operator==(const std::normal_distribution<_RealType>& __d1,
const std::normal_distribution<_RealType>& __d2)
{
if (__d1._M_param == __d2._M_param
&& __d1._M_saved_available == __d2._M_saved_available)
{
if (__d1._M_saved_available
&& __d1._M_saved == __d2._M_saved)
return true;
else if(!__d1._M_saved_available)
return true;
else
return false;
}
else
return false;
}
template<typename _RealType, typename _CharT, typename _Traits>
std::basic_ostream<_CharT, _Traits>&
operator<<(std::basic_ostream<_CharT, _Traits>& __os,

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.2.1 Class template bernoulli_distribution [rand.dist.bern.bernoulli]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::bernoulli_distribution u(0.75), v, w;
VERIFY( v == w );
VERIFY( !(u == v) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.2.1 Class template bernoulli_distribution [rand.dist.bern.bernoulli]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::bernoulli_distribution u(0.75), v, w;
VERIFY( u != v );
VERIFY( !(v != w) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.2.2 Class template binomial_distribution [rand.dist.bern.bin]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::binomial_distribution<int> u(3, 0.75), v, w;
VERIFY( v == w );
VERIFY( !(u == v) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.2.2 Class template binomial_distribution [rand.dist.bern.bin]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::binomial_distribution<int> u(3, 0.75), v, w;
VERIFY( u != v );
VERIFY( !(v != w) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.4.4 class template cauchy_distribution [rand.dist.norm.cauchy]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::cauchy_distribution<double> u(5.0, 2.0), v, w;
VERIFY( v == w );
VERIFY( !(u == v) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.4.4 class template cauchy_distribution [rand.dist.norm.cauchy]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::cauchy_distribution<double> u(5.0, 2.0), v, w;
VERIFY( u != v );
VERIFY( !(v != w) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.4.3 Class template chi_squared_distribution [rand.dist.norm.chisq]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::chi_squared_distribution<double> u(1.5), v, w;
VERIFY( v == w );
VERIFY( !(u == v) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.4.3 Class template chi_squared_distribution [rand.dist.norm.chisq]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::chi_squared_distribution<double> u(1.5), v, w;
VERIFY( u != v );
VERIFY( !(v != w) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,51 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.4.1 class template discard_block_engine [rand.adapt.disc]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::discard_block_engine
<
std::subtract_with_carry_engine<unsigned 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,44 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.5.1 Class template discrete_distribution [rand.dist.samp.discrete]
#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<int> u(wt.begin(), wt.end()), v, w;
VERIFY( v == w );
VERIFY( !(u == v) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,44 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.5.1 Class template discrete_distribution [rand.dist.samp.discrete]
#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<int> u(wt.begin(), wt.end()), v, w;
VERIFY( u != v );
VERIFY( !(v != w) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.3.2 Class template exponential_distribution [rand.dist.pois.exp]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::exponential_distribution<double> u(0.5), v, w;
VERIFY( v == w );
VERIFY( !(u == v) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.3.2 Class template exponential_distribution [rand.dist.pois.exp]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::exponential_distribution<double> u(0.5), v, w;
VERIFY( u != v );
VERIFY( !(v != w) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.3.5 Class template extreme_value_distribution [rand.dist.pois.extreme]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::extreme_value_distribution<double> u(5.0, 2.0), v, w;
VERIFY( v == w );
VERIFY( !(u == v) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.3.5 Class template extreme_value_distribution [rand.dist.pois.extreme]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::extreme_value_distribution<double> u(5.0, 2.0), v, w;
VERIFY( u != v );
VERIFY( !(v != w) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.4.5 Class template fisher_f_distribution [rand.dist.norm.f]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::fisher_f_distribution<double> u(2.0, 3.0), v, w;
VERIFY( v == w );
VERIFY( !(u == v) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.4.5 Class template fisher_f_distribution [rand.dist.norm.f]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::fisher_f_distribution<double> u(2.0, 3.0), v, w;
VERIFY( u != v );
VERIFY( !(v != w) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.3.3 Class template gamma_distribution [rand.dist.pois.gamma]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::gamma_distribution<double> u(1.5, 3.0), v, w;
VERIFY( v == w );
VERIFY( !(u == v) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.3.3 Class template gamma_distribution [rand.dist.pois.gamma]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::gamma_distribution<double> u(1.5, 3.0), v, w;
VERIFY( u != v );
VERIFY( !(v != w) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.2.3 Class template geometric_distribution [rand.dist.bern.geom]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::geometric_distribution<int> u(0.75), v, w;
VERIFY( v == w );
VERIFY( !(u == v) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.2.3 Class template geometric_distribution [rand.dist.bern.geom]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::geometric_distribution<int> u(0.75), v, w;
VERIFY( u != v );
VERIFY( !(v != w) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,49 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.4.2 class template independent_bits_engine [rand.adapt.bits]
#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, uint_fast64_t> u, v;
VERIFY( !(u != v) );
u.discard(100);
v.discard(100);
VERIFY( !(u != v) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,45 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.3.1 class template linear_congruential_engine [rand.eng.lcong]
#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 != c );
VERIFY( !(a != b) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.4.2 Class template lognormal_distribution [rand.dist.norm.lognormal]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::lognormal_distribution<double> u(5.0, 2.0), v, w;
VERIFY( v == w );
VERIFY( !(u == v) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.4.2 Class template lognormal_distribution [rand.dist.norm.lognormal]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::lognormal_distribution<double> u(5.0, 2.0), v, w;
VERIFY( u != v );
VERIFY( !(v != w) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,52 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.3.2 Class template mersenne_twister_engine [rand.eng.mers]
#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,44 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.2.4 Class template negative_binomial_distribution
// [rand.dist.bern.negbin]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::negative_binomial_distribution<int> u(3, 0.75), v, w;
VERIFY( v == w );
VERIFY( !(u == v) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,44 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.2.4 Class template negative_binomial_distribution
// [rand.dist.bern.negbin]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::negative_binomial_distribution<int> u(3, 0.75), v, w;
VERIFY( u != v );
VERIFY( !(v != w) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.4.1 Class template normal_distribution [rand.dist.norm.normal]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::normal_distribution<double> u(5.0, 2.0), v, w;
VERIFY( v == w );
VERIFY( !(u == v) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.4.1 Class template normal_distribution [rand.dist.norm.normal]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::normal_distribution<double> u(5.0, 2.0), v, w;
VERIFY( u != v );
VERIFY( !(v != w) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,47 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.5.2 Class template piecewise_constant_distribution
// [rand.dist.samp.pconst]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::vector<double> x = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 };
std::vector<double> wt = { 0.5, 1.0, 2.5, 1.5, 0.5 };
std::piecewise_constant_distribution<double>
u(x.begin(), x.end(), wt.begin()), v, w;
VERIFY( v == w );
VERIFY( !(u == v) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,47 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.5.2 Class template piecewise_constant_distribution
// [rand.dist.samp.pconst]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::vector<double> x = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 };
std::vector<double> wt = { 0.5, 1.0, 2.5, 1.5, 0.5 };
std::piecewise_constant_distribution<double>
u(x.begin(), x.end(), wt.begin()), v, w;
VERIFY( u != v );
VERIFY( !(v != w) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,47 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.5.3 Class template piecewise_linear_distribution
// [rand.dist.samp.plinear]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::vector<double> x = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 };
std::vector<double> wt = { 0.0, 1.0, 2.5, 1.5, 0.5, 0.0 };
std::piecewise_linear_distribution<double>
u(x.begin(), x.end(), wt.begin()), v, w;
VERIFY( v == w );
VERIFY( !(u == v) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,47 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.5.3 Class template piecewise_linear_distribution
// [rand.dist.samp.plinear]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::vector<double> x = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 };
std::vector<double> wt = { 0.0, 1.0, 2.5, 1.5, 0.5, 0.0 };
std::piecewise_linear_distribution<double>
u(x.begin(), x.end(), wt.begin()), v, w;
VERIFY( u != v );
VERIFY( !(v != w) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.3.1 Class template poisson_distribution [rand.dist.pois.poisson]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::poisson_distribution<int> u(5.0), v, w;
VERIFY( v == w );
VERIFY( !(u == v) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.3.1 Class template poisson_distribution [rand.dist.pois.poisson]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::poisson_distribution<int> u(5.0), v, w;
VERIFY( u != v );
VERIFY( !(v != w) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,51 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.4.1 class template discard_block_engine [rand.adapt.disc]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::shuffle_order_engine
<
std::linear_congruential_engine<uint_fast32_t,16807UL, 0UL, 2147483647UL>,
256
> u, v;
VERIFY( !(u != v) );
u.discard(100);
v.discard(100);
VERIFY( !(u != v) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.4.6 Class template student_t_distribution [rand.dist.norm.t]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::student_t_distribution<double> u(1.5), v, w;
VERIFY( v == w );
VERIFY( !(u == v) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.4.6 Class template student_t_distribution [rand.dist.norm.t]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::student_t_distribution<double> u(1.5), v, w;
VERIFY( u != v );
VERIFY( !(v != w) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,48 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.3.3 Class template subtract_with_carry_engine [rand.eng.sub]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::subtract_with_carry_engine<unsigned long, 24, 10, 24> u;
std::subtract_with_carry_engine<unsigned long, 24, 10, 24> v;
VERIFY( !(u != v) );
u.discard(100);
v.discard(100);
VERIFY( !(u != v) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.1.1 Class template uniform_int_distribution [rand.dist_uni]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::uniform_int_distribution<int> u(1, 20), v, w;
VERIFY( v == w );
VERIFY( !(u == v) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.1.1 Class template uniform_int_distribution [rand.dist_uni]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::uniform_int_distribution<int> u(1, 20), v, w;
VERIFY( u != v );
VERIFY( !(v != w) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.1.2 Class template uniform_real_distribution [rand.dist.uni.real]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::uniform_real_distribution<double> u(-5.0, 5.0), v, w;
VERIFY( v == w );
VERIFY( !(u == v) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.1.2 Class template uniform_real_distribution [rand.dist.uni.real]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::uniform_real_distribution<double> u(-5.0, 5.0), v, w;
VERIFY( u != v );
VERIFY( !(v != w) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.3.4 Class template weibull_distribution [rand.dist.pois.weibull]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::weibull_distribution<double> u(2.0, 3.5), v, w;
VERIFY( v == w );
VERIFY( !(u == v) );
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,43 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 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 3, 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 COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.5.8.3.4 Class template weibull_distribution [rand.dist.pois.weibull]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::weibull_distribution<double> u(2.0, 3.5), v, w;
VERIFY( u != v );
VERIFY( !(v != w) );
}
int main()
{
test01();
return 0;
}