diff --git a/region.hpp b/region.hpp index 7daf33d2..83a32347 100644 --- a/region.hpp +++ b/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 + decltype(auto) + sample (region const &shape) + { + return sample (shape, cruft::random::generator ()); + } + + /////////////////////////////////////////////////////////////////////////// template using region2 = region<2,T>; template using region3 = region<3,T>;