re PR libstdc++/58098 (wrong return value of normal_distribution::min())

2013-08-07  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/58098
	* include/bits/random.h (cauchy_distribution<>::min,
	extreme_value_distribution<>::min, normal_distribution<>::min,
	student_t_distribution<>::min): Fix.
	* include/ext/random (normal_mv_distribution<>::min): Likewise.
	* testsuite/26_numerics/random/cauchy_distribution/cons/parms.cc:
	Adjust.
	testsuite/26_numerics/random/cauchy_distribution/cons/default.cc:
	Likewise.
	* testsuite/26_numerics/random/extreme_value_distribution/cons/
	parms.cc: Likewise.
	testsuite/26_numerics/random/extreme_value_distribution/cons/
	default.cc: Likewise.
	* testsuite/26_numerics/random/normal_distribution/cons/parms.cc:
	Likewise.
	* testsuite/26_numerics/random/normal_distribution/cons/default.cc:
	Likewise.
	* testsuite/26_numerics/random/student_t_distribution/cons/parms.cc:
	Likewise.
	* testsuite/26_numerics/random/student_t_distribution/cons/default.cc:
	Likewise.
	* testsuite/ext/random/normal_mv_distribution/cons/parms.cc: Likewise.
	* testsuite/ext/random/normal_mv_distribution/cons/default.cc: Likewise.

	* testsuite/26_numerics/random/exponential_distribution/cons/parms.cc:
	Minor tweak.
	* testsuite/26_numerics/random/exponential_distribution/cons/default.cc:
	Likewise.

	* testsuite/ext/von_mises_distribution/*: Move to...
	* testsuite/ext/random/von_mises_distribution/*: ... here.
	* testsuite/ext/triangular_distribution/*: Move to...
	* testsuite/ext/random/triangular_distribution/*: ... here.

From-SVN: r201562
This commit is contained in:
Paolo Carlini 2013-08-07 11:41:30 +00:00 committed by Paolo Carlini
parent dd81965b76
commit a803975d9c
29 changed files with 55 additions and 19 deletions

View File

@ -1,3 +1,39 @@
2013-08-07 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/58098
* include/bits/random.h (cauchy_distribution<>::min,
extreme_value_distribution<>::min, normal_distribution<>::min,
student_t_distribution<>::min): Fix.
* include/ext/random (normal_mv_distribution<>::min): Likewise.
* testsuite/26_numerics/random/cauchy_distribution/cons/parms.cc:
Adjust.
testsuite/26_numerics/random/cauchy_distribution/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/extreme_value_distribution/cons/
parms.cc: Likewise.
testsuite/26_numerics/random/extreme_value_distribution/cons/
default.cc: Likewise.
* testsuite/26_numerics/random/normal_distribution/cons/parms.cc:
Likewise.
* testsuite/26_numerics/random/normal_distribution/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/student_t_distribution/cons/parms.cc:
Likewise.
* testsuite/26_numerics/random/student_t_distribution/cons/default.cc:
Likewise.
* testsuite/ext/random/normal_mv_distribution/cons/parms.cc: Likewise.
* testsuite/ext/random/normal_mv_distribution/cons/default.cc: Likewise.
* testsuite/26_numerics/random/exponential_distribution/cons/parms.cc:
Minor tweak.
* testsuite/26_numerics/random/exponential_distribution/cons/default.cc:
Likewise.
* testsuite/ext/von_mises_distribution/*: Move to...
* testsuite/ext/random/von_mises_distribution/*: ... here.
* testsuite/ext/triangular_distribution/*: Move to...
* testsuite/ext/random/triangular_distribution/*: ... here.
2013-08-06 Caroline Tice <cmtice@google.com>
* fragment.am: Add XTEMPLATE_FLAGS.

View File

@ -2178,7 +2178,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
*/
result_type
min() const
{ return std::numeric_limits<result_type>::min(); }
{ return std::numeric_limits<result_type>::lowest(); }
/**
* @brief Returns the least upper bound value of the distribution.
@ -3011,7 +3011,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
*/
result_type
min() const
{ return std::numeric_limits<result_type>::min(); }
{ return std::numeric_limits<result_type>::lowest(); }
/**
* @brief Returns the least upper bound value of the distribution.
@ -3428,7 +3428,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
*/
result_type
min() const
{ return std::numeric_limits<result_type>::min(); }
{ return std::numeric_limits<result_type>::lowest(); }
/**
* @brief Returns the least upper bound value of the distribution.
@ -5136,7 +5136,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
*/
result_type
min() const
{ return std::numeric_limits<result_type>::min(); }
{ return std::numeric_limits<result_type>::lowest(); }
/**
* @brief Returns the least upper bound value of the distribution.

View File

@ -791,7 +791,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
result_type
min() const
{ result_type __res;
__res.fill(std::numeric_limits<_RealType>::min());
__res.fill(std::numeric_limits<_RealType>::lowest());
return __res; }
/**

View File

@ -35,7 +35,7 @@ test01()
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.min() == std::numeric_limits<result_type>::lowest() );
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}

View File

@ -35,7 +35,7 @@ test01()
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.min() == std::numeric_limits<result_type>::lowest() );
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}

View File

@ -34,7 +34,7 @@ test01()
std::exponential_distribution<> u;
VERIFY( u.lambda() == 1.0 );
typedef std::exponential_distribution<>::result_type result_type;
VERIFY( u.min() == 0 );
VERIFY( u.min() == 0.0 );
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}

View File

@ -34,7 +34,7 @@ test01()
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.min() == 0.0 );
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}

View File

@ -35,7 +35,7 @@ test01()
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.min() == std::numeric_limits<result_type>::lowest() );
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}

View File

@ -35,7 +35,7 @@ test01()
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.min() == std::numeric_limits<result_type>::lowest() );
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}

View File

@ -35,7 +35,7 @@ test01()
VERIFY( u.mean() == 0.0 );
VERIFY( u.stddev() == 1.0 );
typedef std::normal_distribution<>::result_type result_type;
VERIFY( u.min() == std::numeric_limits<result_type>::min() );
VERIFY( u.min() == std::numeric_limits<result_type>::lowest() );
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}

View File

@ -35,7 +35,7 @@ test01()
VERIFY( u.mean() == 5.0 );
VERIFY( u.stddev() == 2.0 );
typedef std::normal_distribution<>::result_type result_type;
VERIFY( u.min() == std::numeric_limits<result_type>::min() );
VERIFY( u.min() == std::numeric_limits<result_type>::lowest() );
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}

View File

@ -34,7 +34,7 @@ test01()
std::student_t_distribution<> u;
VERIFY( u.n() == 1.0 );
typedef std::student_t_distribution<>::result_type result_type;
VERIFY( u.min() == std::numeric_limits<result_type>::min() );
VERIFY( u.min() == std::numeric_limits<result_type>::lowest() );
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}

View File

@ -34,7 +34,7 @@ test01()
std::student_t_distribution<> u(1.5);
VERIFY( u.n() == 1.5 );
typedef std::student_t_distribution<>::result_type result_type;
VERIFY( u.min() == std::numeric_limits<result_type>::min() );
VERIFY( u.min() == std::numeric_limits<result_type>::lowest() );
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}

View File

@ -36,9 +36,9 @@ test01()
VERIFY( u.varcov()[1] == 0.0 );
VERIFY( u.varcov()[2] == 1.0 );
typedef __gnu_cxx::normal_mv_distribution<2>::result_type result_type;
VERIFY( u.min()[0] == std::numeric_limits<result_type::value_type>::min() );
VERIFY( u.min()[0] == std::numeric_limits<result_type::value_type>::lowest() );
VERIFY( u.max()[0] == std::numeric_limits<result_type::value_type>::max() );
VERIFY( u.min()[1] == std::numeric_limits<result_type::value_type>::min() );
VERIFY( u.min()[1] == std::numeric_limits<result_type::value_type>::lowest() );
VERIFY( u.max()[1] == std::numeric_limits<result_type::value_type>::max() );
}

View File

@ -36,9 +36,9 @@ test01()
VERIFY( u.varcov()[1] == 0.0 );
VERIFY( u.varcov()[2] == 3.0 );
typedef __gnu_cxx::normal_mv_distribution<2>::result_type result_type;
VERIFY( u.min()[0] == std::numeric_limits<result_type::value_type>::min() );
VERIFY( u.min()[0] == std::numeric_limits<result_type::value_type>::lowest() );
VERIFY( u.max()[0] == std::numeric_limits<result_type::value_type>::max() );
VERIFY( u.min()[1] == std::numeric_limits<result_type::value_type>::min() );
VERIFY( u.min()[1] == std::numeric_limits<result_type::value_type>::lowest() );
VERIFY( u.max()[1] == std::numeric_limits<result_type::value_type>::max() );
}