random: add coord generator
This commit is contained in:
parent
d21b7809dd
commit
5dadd8eb38
16
random.hpp
16
random.hpp
@ -123,6 +123,22 @@ namespace util::random {
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
template <
|
||||
typename T,
|
||||
typename = std::enable_if_t<
|
||||
is_coord_v<T> && std::is_floating_point_v<typename T::value_type>
|
||||
>
|
||||
>
|
||||
T
|
||||
uniform (void)
|
||||
{
|
||||
T res {};
|
||||
std::fill (res.begin (), res.end (), uniform<typename T::value_type> ());
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
/// choose a value at random from an array
|
||||
template <typename T, size_t N>
|
||||
|
Loading…
Reference in New Issue
Block a user