aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/libcxx/include/__random/fisher_f_distribution.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/libcxx/include/__random/fisher_f_distribution.h')
-rw-r--r--contrib/llvm-project/libcxx/include/__random/fisher_f_distribution.h41
1 files changed, 22 insertions, 19 deletions
diff --git a/contrib/llvm-project/libcxx/include/__random/fisher_f_distribution.h b/contrib/llvm-project/libcxx/include/__random/fisher_f_distribution.h
index b757607bc461..8da689a3b0f4 100644
--- a/contrib/llvm-project/libcxx/include/__random/fisher_f_distribution.h
+++ b/contrib/llvm-project/libcxx/include/__random/fisher_f_distribution.h
@@ -27,6 +27,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template<class _RealType = double>
class _LIBCPP_TEMPLATE_VIS fisher_f_distribution
{
+ static_assert(__libcpp_random_is_valid_realtype<_RealType>::value,
+ "RealType must be a supported floating-point type");
+
public:
// types
typedef _RealType result_type;
@@ -38,19 +41,19 @@ public:
public:
typedef fisher_f_distribution distribution_type;
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
explicit param_type(result_type __m = 1, result_type __n = 1)
: __m_(__m), __n_(__n) {}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
result_type m() const {return __m_;}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
result_type n() const {return __n_;}
- friend _LIBCPP_INLINE_VISIBILITY
+ friend _LIBCPP_HIDE_FROM_ABI
bool operator==(const param_type& __x, const param_type& __y)
{return __x.__m_ == __y.__m_ && __x.__n_ == __y.__n_;}
- friend _LIBCPP_INLINE_VISIBILITY
+ friend _LIBCPP_HIDE_FROM_ABI
bool operator!=(const param_type& __x, const param_type& __y)
{return !(__x == __y);}
};
@@ -61,51 +64,51 @@ private:
public:
// constructor and reset functions
#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
fisher_f_distribution() : fisher_f_distribution(1) {}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
explicit fisher_f_distribution(result_type __m, result_type __n = 1)
: __p_(param_type(__m, __n)) {}
#else
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
explicit fisher_f_distribution(result_type __m = 1, result_type __n = 1)
: __p_(param_type(__m, __n)) {}
#endif
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
explicit fisher_f_distribution(const param_type& __p)
: __p_(__p) {}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
void reset() {}
// generating functions
template<class _URNG>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
result_type operator()(_URNG& __g)
{return (*this)(__g, __p_);}
template<class _URNG>
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
// property functions
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
result_type m() const {return __p_.m();}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
result_type n() const {return __p_.n();}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
param_type param() const {return __p_;}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
void param(const param_type& __p) {__p_ = __p;}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
result_type min() const {return 0;}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
result_type max() const {return numeric_limits<result_type>::infinity();}
- friend _LIBCPP_INLINE_VISIBILITY
+ friend _LIBCPP_HIDE_FROM_ABI
bool operator==(const fisher_f_distribution& __x,
const fisher_f_distribution& __y)
{return __x.__p_ == __y.__p_;}
- friend _LIBCPP_INLINE_VISIBILITY
+ friend _LIBCPP_HIDE_FROM_ABI
bool operator!=(const fisher_f_distribution& __x,
const fisher_f_distribution& __y)
{return !(__x == __y);}