3#ifndef TETL_RANDOM_UNIFORM_REAL_DISTRIBUTION_HPP
4#define TETL_RANDOM_UNIFORM_REAL_DISTRIBUTION_HPP
12template <
typename RealType =
double>
27 [[nodiscard]]
constexpr auto a() const noexcept ->
result_type {
return _min; }
29 [[nodiscard]]
constexpr auto b() const noexcept ->
result_type {
return _max; }
33 return (lhs._min == rhs._min) and (lhs._max == rhs._max);
60 [[nodiscard]]
constexpr auto a() const ->
result_type {
return _param.a(); }
62 [[nodiscard]]
constexpr auto b() const ->
result_type {
return _param.b(); }
68 constexpr auto reset() ->
void { (void)
this; }
70 template <
typename URBG>
73 return (*
this)(g, _param);
76 template <
typename URBG>
80 constexpr auto bits =
~size_t{0};
81 constexpr auto minBits = digits < bits ? digits : bits;
82 static_assert(minBits <= 64);
85 auto const a = parm.a();
86 auto const b = parm.b();
88 return a + u * (
b -
a);
93 return x.param() == y.param();
constexpr auto generate_canonical(RNG &g) noexcept(noexcept(g())) -> Real
Generates a random floating point number in range [0,1).
Definition generate_canonical.hpp:44
Definition adjacent_find.hpp:8
TETL_BUILTIN_SIZET size_t
etl::size_t is the unsigned integer type of the result of the sizeof operator.
Definition size_t.hpp:14
static constexpr int digits
Definition numeric_limits.hpp:24