2017-01-20 Jonathan Wakely <jwakely@redhat.com>
+ PR libstdc++/69240
+ * include/bits/random.h (uniform_real_distribution::param_type)
+ (normal_distribution::param_type, lognormal_distribution::param_type)
+ (gamma_distribution::param_type, chi_squared_distribution::param_type)
+ (cauchy_distribution::param_type, fisher_f_distribution::param_type)
+ (student_t_distribution::param_type)
+ (bernoulli_distribution::param_type, binomial_distribution::param_type)
+ (geometric_distribution::param_type)
+ (negative_binomial_distribution::param_type)
+ (poisson_distribution::param_type)
+ (exponential_distribution::param_type)
+ (weibull_distribution::param_type)
+ (extreme_value_distribution::param_type)
+ (discrete_distribution::param_type)
+ (piecewise_constant_distribution::param_type)
+ (piecewise_linear_distribution::param_type): Define operator!=.
+ * include/bits/uniform_int_dist.h
+ (uniform_int_distribution::param_type): Likewise.
+ * include/ext/random (beta_distribution::param_type)
+ (rice_distribution::param_type, nakagami_distribution::param_type)
+ (pareto_distribution::param_type, k_distribution::param_type)
+ (arcsine_distribution::param_type, hoyt_distribution::param_type)
+ (triangular_distribution::param_type)
+ (von_mises_distribution::param_type)
+ (hypergeometric_distribution::param_type)
+ (logistic_distribution::param_type)
+ (uniform_on_sphere_distribution::param_type)
+ (uniform_inside_sphere_distribution::param_type): Likewise.
+ * testsuite/26_numerics/random/bernoulli_distribution/cons/parms.cc:
+ Test construction with param_type.
+ * testsuite/26_numerics/random/binomial_distribution/cons/parms.cc:
+ Likewise.
+ * testsuite/26_numerics/random/cauchy_distribution/cons/parms.cc:
+ Likewise.
+ * testsuite/26_numerics/random/chi_squared_distribution/cons/parms.cc:
+ Likewise.
+ * testsuite/26_numerics/random/exponential_distribution/cons/parms.cc:
+ Likewise.
+ * testsuite/26_numerics/random/extreme_value_distribution/cons/
+ parms.cc: Likewise.
+ * testsuite/26_numerics/random/fisher_f_distribution/cons/parms.cc:
+ Likewise.
+ * testsuite/26_numerics/random/gamma_distribution/cons/parms.cc:
+ Likewise.
+ * testsuite/26_numerics/random/geometric_distribution/cons/parms.cc:
+ Likewise.
+ * testsuite/26_numerics/random/lognormal_distribution/cons/parms.cc:
+ Likewise.
+ * testsuite/26_numerics/random/negative_binomial_distribution/cons/
+ parms.cc: Likewise.
+ * testsuite/26_numerics/random/normal_distribution/cons/parms.cc:
+ Likewise.
+ * testsuite/26_numerics/random/poisson_distribution/cons/parms.cc:
+ Likewise.
+ * testsuite/26_numerics/random/student_t_distribution/cons/parms.cc:
+ Likewise.
+ * testsuite/26_numerics/random/uniform_int_distribution/cons/parms.cc:
+ Likewise.
+ * testsuite/26_numerics/random/uniform_real_distribution/cons/parms.cc:
+ Likewise.
+ * testsuite/26_numerics/random/weibull_distribution/cons/parms.cc:
+ Likewise.
+ * testsuite/ext/random/arcsine_distribution/cons/parms.cc: Likewise.
+ * testsuite/ext/random/beta_distribution/cons/parms.cc: Likewise.
+ * testsuite/ext/random/hoyt_distribution/cons/parms.cc: Likewise.
+ * testsuite/ext/random/hypergeometric_distribution/cons/parms.cc:
+ Likewise.
+ * testsuite/ext/random/k_distribution/cons/parms.cc: Likewise.
+ * testsuite/ext/random/logistic_distribution/cons/parms.cc: Likewise.
+ * testsuite/ext/random/nakagami_distribution/cons/parms.cc: Likewise.
+ * testsuite/ext/random/normal_mv_distribution/cons/parms.cc: Likewise.
+ * testsuite/ext/random/pareto_distribution/cons/parms.cc: Likewise.
+ * testsuite/ext/random/rice_distribution/cons/parms.cc: Likewise.
+ * testsuite/ext/random/triangular_distribution/cons/parms.cc:
+ Likewise.
+ * testsuite/ext/random/uniform_inside_sphere_distribution/cons/
+ parms.cc: Likewise.
+ * testsuite/ext/random/von_mises_distribution/cons/parms.cc: Likewise.
+
PR libstdc++/72792
* include/bits/alloc_traits.h (__allocator_traits_base::__diff_type)
(__allocator_traits_base::__size_type): Remove.
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
+
/** Parameter type. */
struct param_type
{
operator==(const param_type& __p1, const param_type& __p2)
{ return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
_RealType _M_a;
_RealType _M_b;
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
+
/** Parameter type. */
struct param_type
{
{ return (__p1._M_mean == __p2._M_mean
&& __p1._M_stddev == __p2._M_stddev); }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
_RealType _M_mean;
_RealType _M_stddev;
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
+
/** Parameter type. */
struct param_type
{
operator==(const param_type& __p1, const param_type& __p2)
{ return __p1._M_m == __p2._M_m && __p1._M_s == __p2._M_s; }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
_RealType _M_m;
_RealType _M_s;
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
+
/** Parameter type. */
struct param_type
{
{ return (__p1._M_alpha == __p2._M_alpha
&& __p1._M_beta == __p2._M_beta); }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
void
_M_initialize();
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
+
/** Parameter type. */
struct param_type
{
operator==(const param_type& __p1, const param_type& __p2)
{ return __p1._M_n == __p2._M_n; }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
_RealType _M_n;
};
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
+
/** Parameter type. */
struct param_type
{
operator==(const param_type& __p1, const param_type& __p2)
{ return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
_RealType _M_a;
_RealType _M_b;
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
+
/** Parameter type. */
struct param_type
{
operator==(const param_type& __p1, const param_type& __p2)
{ return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
_RealType _M_m;
_RealType _M_n;
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
+
/** Parameter type. */
struct param_type
{
operator==(const param_type& __p1, const param_type& __p2)
{ return __p1._M_n == __p2._M_n; }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
_RealType _M_n;
};
public:
/** The type of the range of the distribution. */
typedef bool result_type;
+
/** Parameter type. */
struct param_type
{
operator==(const param_type& __p1, const param_type& __p2)
{ return __p1._M_p == __p2._M_p; }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
double _M_p;
};
public:
/** The type of the range of the distribution. */
typedef _IntType result_type;
+
/** Parameter type. */
struct param_type
{
operator==(const param_type& __p1, const param_type& __p2)
{ return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
void
_M_initialize();
public:
/** The type of the range of the distribution. */
typedef _IntType result_type;
+
/** Parameter type. */
struct param_type
{
operator==(const param_type& __p1, const param_type& __p2)
{ return __p1._M_p == __p2._M_p; }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
void
_M_initialize()
public:
/** The type of the range of the distribution. */
typedef _IntType result_type;
+
/** Parameter type. */
struct param_type
{
operator==(const param_type& __p1, const param_type& __p2)
{ return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
_IntType _M_k;
double _M_p;
public:
/** The type of the range of the distribution. */
typedef _IntType result_type;
+
/** Parameter type. */
struct param_type
{
operator==(const param_type& __p1, const param_type& __p2)
{ return __p1._M_mean == __p2._M_mean; }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
// Hosts either log(mean) or the threshold of the simple method.
void
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
+
/** Parameter type. */
struct param_type
{
operator==(const param_type& __p1, const param_type& __p2)
{ return __p1._M_lambda == __p2._M_lambda; }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
_RealType _M_lambda;
};
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
+
/** Parameter type. */
struct param_type
{
operator==(const param_type& __p1, const param_type& __p2)
{ return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
_RealType _M_a;
_RealType _M_b;
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
+
/** Parameter type. */
struct param_type
{
operator==(const param_type& __p1, const param_type& __p2)
{ return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
_RealType _M_a;
_RealType _M_b;
public:
/** The type of the range of the distribution. */
typedef _IntType result_type;
+
/** Parameter type. */
struct param_type
{
operator==(const param_type& __p1, const param_type& __p2)
{ return __p1._M_prob == __p2._M_prob; }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
void
_M_initialize();
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
+
/** Parameter type. */
struct param_type
{
operator==(const param_type& __p1, const param_type& __p2)
{ return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
void
_M_initialize();
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
+
/** Parameter type. */
struct param_type
{
friend bool
operator==(const param_type& __p1, const param_type& __p2)
- { return (__p1._M_int == __p2._M_int
- && __p1._M_den == __p2._M_den); }
+ { return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
+
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
private:
void
operator==(const param_type& __p1, const param_type& __p2)
{ return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
_IntType _M_a;
_IntType _M_b;
*__f++ = __uctype(__urng()) - __urngmin + __param.a();
}
+ // operator!= and operator<< and operator>> are defined in <bits/random.h>
+
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
+
/** Parameter type. */
struct param_type
{
{ return (__p1._M_alpha == __p2._M_alpha
&& __p1._M_beta == __p2._M_beta); }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
void
_M_initialize();
operator==(const param_type& __p1, const param_type& __p2)
{ return __p1._M_mean == __p2._M_mean && __p1._M_t == __p2._M_t; }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
template <typename _InputIterator1, typename _InputIterator2>
void _M_init_full(_InputIterator1 __meanbegin,
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
+
/** Parameter type. */
struct param_type
{
friend bool
operator==(const param_type& __p1, const param_type& __p2)
- { return __p1._M_nu == __p2._M_nu
- && __p1._M_sigma == __p2._M_sigma; }
+ { return __p1._M_nu == __p2._M_nu && __p1._M_sigma == __p2._M_sigma; }
+
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
private:
void _M_initialize();
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
+
/** Parameter type. */
struct param_type
{
friend bool
operator==(const param_type& __p1, const param_type& __p2)
- { return __p1._M_mu == __p2._M_mu
- && __p1._M_omega == __p2._M_omega; }
+ { return __p1._M_mu == __p2._M_mu && __p1._M_omega == __p2._M_omega; }
+
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
private:
void _M_initialize();
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
+
/** Parameter type. */
struct param_type
{
operator==(const param_type& __p1, const param_type& __p2)
{ return __p1._M_alpha == __p2._M_alpha && __p1._M_mu == __p2._M_mu; }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
void _M_initialize();
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
+
/** Parameter type. */
struct param_type
{
friend bool
operator==(const param_type& __p1, const param_type& __p2)
- { return __p1._M_lambda == __p2._M_lambda
+ {
+ return __p1._M_lambda == __p2._M_lambda
&& __p1._M_mu == __p2._M_mu
- && __p1._M_nu == __p2._M_nu; }
+ && __p1._M_nu == __p2._M_nu;
+ }
+
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
private:
void _M_initialize();
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
+
/** Parameter type. */
struct param_type
{
operator==(const param_type& __p1, const param_type& __p2)
{ return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
void _M_initialize();
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
+
/** Parameter type. */
struct param_type
{
friend bool
operator==(const param_type& __p1, const param_type& __p2)
- { return __p1._M_q == __p2._M_q
- && __p1._M_omega == __p2._M_omega; }
+ { return __p1._M_q == __p2._M_q && __p1._M_omega == __p2._M_omega; }
+
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
private:
void _M_initialize();
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
+
/** Parameter type. */
struct param_type
{
friend bool
operator==(const param_type& __p1, const param_type& __p2)
- { return (__p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b
- && __p1._M_c == __p2._M_c); }
+ {
+ return (__p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b
+ && __p1._M_c == __p2._M_c);
+ }
+
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
private:
friend bool
operator==(const param_type& __p1, const param_type& __p2)
- { return (__p1._M_mu == __p2._M_mu
- && __p1._M_kappa == __p2._M_kappa); }
+ { return __p1._M_mu == __p2._M_mu && __p1._M_kappa == __p2._M_kappa; }
+
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
private:
_RealType _M_mu;
&& (__p1._M_K == __p2._M_K)
&& (__p1._M_n == __p2._M_n); }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
result_type _M_N;
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
+
/** Parameter type. */
struct param_type
{
friend bool
operator==(const param_type& __p1, const param_type& __p2)
- { return __p1._M_a == __p2._M_a
- && __p1._M_b == __p2._M_b; }
+ { return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
+
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
private:
void _M_initialize();
public:
/** The type of the range of the distribution. */
typedef std::array<_RealType, _Dimen> result_type;
+
/** Parameter type. */
struct param_type
{
{ }
friend bool
- operator==(const param_type& __p1, const param_type& __p2)
+ operator==(const param_type&, const param_type&)
{ return true; }
+
+ friend bool
+ operator!=(const param_type&, const param_type&)
+ { return false; }
};
/**
operator==(const param_type& __p1, const param_type& __p2)
{ return __p1._M_radius == __p2._M_radius; }
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
private:
_RealType _M_radius;
};
VERIFY( u.max() == std::numeric_limits<bool>::max() );
}
+void
+test02()
+{
+ using param_type = std::bernoulli_distribution::param_type;
+ const param_type p(0.75);
+ std::bernoulli_distribution u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ VERIFY( u.min() == std::numeric_limits<bool>::min() );
+ VERIFY( u.max() == std::numeric_limits<bool>::max() );
+}
+
int main()
{
test01();
- return 0;
+ test02();
}
VERIFY( u.max() == u.t() );
}
+void
+test02()
+{
+ using param_type = std::binomial_distribution<>::param_type;
+ const param_type p(3, 0.75);
+ std::binomial_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ VERIFY( u.min() == 0 );
+ VERIFY( u.max() == u.t() );
+}
+
int main()
{
test01();
- return 0;
+ test02();
}
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
+void
+test02()
+{
+ using param_type = std::cauchy_distribution<>::param_type;
+ const param_type p(5.0, 2.0);
+ std::cauchy_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ typedef std::cauchy_distribution<>::result_type result_type;
+ VERIFY( u.min() == std::numeric_limits<result_type>::lowest() );
+ VERIFY( u.max() == std::numeric_limits<result_type>::max() );
+}
+
int main()
{
test01();
- return 0;
+ test02();
}
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
+void
+test02()
+{
+ using param_type = std::chi_squared_distribution<>::param_type;
+ const param_type p(1.5);
+ std::chi_squared_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ 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;
+ test02();
}
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
+void
+test02()
+{
+ using param_type = std::exponential_distribution<>::param_type;
+ const param_type p(0.5);
+ std::exponential_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ typedef std::exponential_distribution<>::result_type result_type;
+ VERIFY( u.min() == 0.0 );
+ VERIFY( u.max() == std::numeric_limits<result_type>::max() );
+}
+
int main()
{
test01();
- return 0;
+ test02();
}
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
+void
+test02()
+{
+ using param_type = std::extreme_value_distribution<>::param_type;
+ const param_type p(5.0, 2.0);
+ std::extreme_value_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ typedef std::extreme_value_distribution<>::result_type result_type;
+ VERIFY( u.min() == std::numeric_limits<result_type>::lowest() );
+ VERIFY( u.max() == std::numeric_limits<result_type>::max() );
+}
+
int main()
{
test01();
- return 0;
+ test02();
}
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
+void
+test02()
+{
+ using param_type = std::fisher_f_distribution<>::param_type;
+ const param_type p(0.75);
+ std::fisher_f_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ 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;
+ test02();
}
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
+void
+test02()
+{
+ using param_type = std::gamma_distribution<>::param_type;
+ const param_type p(1.5, 3.0);
+ std::gamma_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ typedef std::gamma_distribution<>::result_type result_type;
+ VERIFY( u.max() == std::numeric_limits<result_type>::max() );
+}
+
int main()
{
test01();
- return 0;
+ test02();
}
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
+void
+test02()
+{
+ using param_type = std::geometric_distribution<>::param_type;
+ const param_type p(0.75);
+ std::geometric_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ typedef std::geometric_distribution<>::result_type result_type;
+ VERIFY( u.max() == std::numeric_limits<result_type>::max() );
+}
+
int main()
{
test01();
- return 0;
+ test02();
}
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
+void
+test02()
+{
+ using param_type = std::lognormal_distribution<>::param_type;
+ const param_type p(5.0, 2.0);
+ std::lognormal_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ 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;
+ test02();
}
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
+void
+test02()
+{
+ using param_type = std::negative_binomial_distribution<>::param_type;
+ const param_type p(3, 0.75);
+ std::negative_binomial_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ 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;
+ test02();
}
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
+void
+test02()
+{
+ using param_type = std::normal_distribution<>::param_type;
+ const param_type p(5.0, 2.0);
+ std::normal_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ typedef std::normal_distribution<>::result_type result_type;
+ VERIFY( u.min() == std::numeric_limits<result_type>::lowest() );
+ VERIFY( u.max() == std::numeric_limits<result_type>::max() );
+}
+
int main()
{
test01();
- return 0;
+ test02();
}
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
+void
+test02()
+{
+ using param_type = std::poisson_distribution<>::param_type;
+ const param_type p(5.0);
+ std::poisson_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ typedef std::poisson_distribution<>::result_type result_type;
+ VERIFY( u.max() == std::numeric_limits<result_type>::max() );
+}
+
int main()
{
test01();
- return 0;
+ test02();
}
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
+void
+test02()
+{
+ using param_type = std::student_t_distribution<>::param_type;
+ const param_type p(1.5);
+ std::student_t_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ typedef std::student_t_distribution<>::result_type result_type;
+ VERIFY( u.min() == std::numeric_limits<result_type>::lowest() );
+ VERIFY( u.max() == std::numeric_limits<result_type>::max() );
+}
+
int main()
{
test01();
- return 0;
+ test02();
}
VERIFY( u.max() == 20 );
}
+void
+test02()
+{
+ using param_type = std::uniform_int_distribution<int>::param_type;
+ const param_type p(1, 20);
+ std::uniform_int_distribution<int> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ VERIFY( u.min() == 1 );
+ VERIFY( u.max() == 20 );
+}
+
int main()
{
test01();
- return 0;
+ test02();
}
VERIFY( u.max() == 5.0 );
}
+void
+test02()
+{
+ using param_type = std::uniform_real_distribution<double>::param_type;
+ const param_type p(-5.0, 5.0);
+ std::uniform_real_distribution<double> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ VERIFY( u.min() == -5.0 );
+ VERIFY( u.max() == 5.0 );
+}
+
int main()
{
test01();
- return 0;
+ test02();
}
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
+void
+test02()
+{
+ using param_type = std::weibull_distribution<>::param_type;
+ const param_type p(2.0, 3.5);
+ std::weibull_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ typedef std::weibull_distribution<>::result_type result_type;
+ VERIFY( u.max() == std::numeric_limits<result_type>::max() );
+}
+
int main()
{
test01();
- return 0;
+ test02();
}
VERIFY( u.max() == 3.0 );
}
-int
-main()
+void
+test02()
+{
+ using param_type = __gnu_cxx::arcsine_distribution<>::param_type;
+ const param_type p(-1.5, 3.0);
+ __gnu_cxx::arcsine_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ VERIFY( u.min() == -1.5 );
+ VERIFY( u.max() == 3.0 );
+}
+
+int main()
{
test01();
- return 0;
+ test02();
}
VERIFY( u.max() == 1.0 );
}
+void
+test02()
+{
+ using param_type = __gnu_cxx::beta_distribution<>::param_type;
+ const param_type p(1.5, 3.0);
+ __gnu_cxx::beta_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ VERIFY( u.min() == 0.0 );
+ VERIFY( u.max() == 1.0 );
+}
+
int main()
{
test01();
- return 0;
+ test02();
}
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
-int
-main()
+void
+test02()
+{
+ using param_type = __gnu_cxx::hoyt_distribution<>::param_type;
+ const param_type p(0.05, 3.0);
+ __gnu_cxx::hoyt_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ typedef __gnu_cxx::hoyt_distribution<>::result_type result_type;
+ VERIFY( u.max() == std::numeric_limits<result_type>::max() );
+}
+
+int main()
{
test01();
- return 0;
+ test02();
}
VERIFY( u.max() == 2 );
}
-int
-main()
+void
+test02()
+{
+ using param_type = __gnu_cxx::hypergeometric_distribution<>::param_type;
+ const param_type p(15, 3, 2);
+ __gnu_cxx::hypergeometric_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ VERIFY( u.min() == 0 );
+ VERIFY( u.max() == 2 );
+}
+
+int main()
{
test01();
- return 0;
+ test02();
}
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
-int
-main()
+void
+test02()
+{
+ using param_type = __gnu_cxx::k_distribution<>::param_type;
+ const param_type p(2.0, 1.5, 3.0);
+ __gnu_cxx::k_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ typedef __gnu_cxx::k_distribution<>::result_type result_type;
+ VERIFY( u.max() == std::numeric_limits<result_type>::max() );
+}
+
+int main()
{
test01();
- return 0;
+ test02();
}
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
-int
-main()
+void
+test02()
+{
+ using param_type = __gnu_cxx::logistic_distribution<>::param_type;
+ const param_type p(1.5, 3.0);
+ __gnu_cxx::logistic_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+
+ typedef __gnu_cxx::logistic_distribution<>::result_type result_type;
+ VERIFY( u.min() == -std::numeric_limits<result_type>::max() );
+ VERIFY( u.max() == std::numeric_limits<result_type>::max() );
+}
+
+int main()
{
test01();
- return 0;
+ test02();
}
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
-int
-main()
+void
+test02()
+{
+ using param_type = __gnu_cxx::nakagami_distribution<>::param_type;
+ const param_type p(1.5, 3.0);
+ __gnu_cxx::nakagami_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ typedef __gnu_cxx::nakagami_distribution<>::result_type result_type;
+ VERIFY( u.max() == std::numeric_limits<result_type>::max() );
+}
+
+int main()
{
test01();
- return 0;
+ test02();
}
VERIFY( u.max()[1] == std::numeric_limits<result_type::value_type>::max() );
}
+void
+test02()
+{
+ using param_type = __gnu_cxx::normal_mv_distribution<2>::param_type;
+ const param_type p({5.0, 4.0}, {4.0, 9.0});
+ __gnu_cxx::normal_mv_distribution<2> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ typedef __gnu_cxx::normal_mv_distribution<2>::result_type result_type;
+ 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>::lowest() );
+ VERIFY( u.max()[1] == std::numeric_limits<result_type::value_type>::max() );
+}
+
int main()
{
test01();
- return 0;
+ test02();
}
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
-int
-main()
+void
+test02()
+{
+ using param_type = __gnu_cxx::pareto_distribution<>::param_type;
+ const param_type p(1.5, 3.0);
+ __gnu_cxx::pareto_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ typedef __gnu_cxx::pareto_distribution<>::result_type result_type;
+ VERIFY( u.max() == std::numeric_limits<result_type>::max() );
+}
+
+int main()
{
test01();
- return 0;
+ test02();
}
VERIFY( u.max() == std::numeric_limits<result_type>::max() );
}
-int
-main()
+void
+test02()
+{
+ using param_type = __gnu_cxx::rice_distribution<>::param_type;
+ const param_type p(1.5, 3.0);
+ __gnu_cxx::rice_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ typedef __gnu_cxx::rice_distribution<>::result_type result_type;
+ VERIFY( u.max() == std::numeric_limits<result_type>::max() );
+}
+
+int main()
{
test01();
- return 0;
+ test02();
}
VERIFY( u.max() == 3.5 );
}
+void
+test02()
+{
+ using param_type = __gnu_cxx::triangular_distribution<>::param_type;
+ const param_type p(1.5, 3.0, 3.5);
+ __gnu_cxx::triangular_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ VERIFY( u.min() == 1.5 );
+ VERIFY( u.max() == 3.5 );
+}
+
int main()
{
test01();
- return 0;
+ test02();
}
void
test01()
{
- bool test [[gnu::unused]] = true;
-
__gnu_cxx::uniform_inside_sphere_distribution<2> u(1.5);
VERIFY( u.radius() == 1.5 );
VERIFY( v.radius() == 3.0 );
}
-int
-main()
+void
+test02()
+{
+ using param_type
+ = __gnu_cxx::uniform_inside_sphere_distribution<2>::param_type;
+ const param_type p(1.5);
+ __gnu_cxx::uniform_inside_sphere_distribution<2> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+}
+
+int main()
{
test01();
- return 0;
+ test02();
}
VERIFY( u.max() == __gnu_cxx::__math_constants<double>::__pi );
}
+void
+test02()
+{
+ using param_type = __gnu_cxx::von_mises_distribution<>::param_type;
+ const param_type p(1.5, 3.0);
+ __gnu_cxx::von_mises_distribution<> u(p);
+ VERIFY( u.param() == p );
+ VERIFY( u.param() != param_type{} );
+ VERIFY( u.min() == -__gnu_cxx::__math_constants<double>::__pi );
+ VERIFY( u.max() == __gnu_cxx::__math_constants<double>::__pi );
+}
+
int main()
{
test01();
- return 0;
+ test02();
}