region: add 'sample' convenience without generator parameter
This commit is contained in:
parent
70c523d029
commit
6367596537
11
region.hpp
11
region.hpp
@ -287,6 +287,17 @@ namespace cruft {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///------------------------------------------------------------------------
|
||||||
|
/// Returns a uniformly randomly sampled point within the supplied region
|
||||||
|
/// using the default thread-local generator.
|
||||||
|
template <size_t S, typename T>
|
||||||
|
decltype(auto)
|
||||||
|
sample (region<S,T> const &shape)
|
||||||
|
{
|
||||||
|
return sample (shape, cruft::random::generator ());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
template <typename T> using region2 = region<2,T>;
|
template <typename T> using region2 = region<2,T>;
|
||||||
template <typename T> using region3 = region<3,T>;
|
template <typename T> using region3 = region<3,T>;
|
||||||
|
Loading…
Reference in New Issue
Block a user