From 6367596537adaeaf2a3194edd0eba3cfd71188a8 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Thu, 22 Aug 2019 13:22:48 +1000 Subject: [PATCH] region: add 'sample' convenience without generator parameter --- region.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) 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>;