EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Functions
EBGeometry::Random Namespace Reference

Namespace for random sampling utilities (a single, centralized home for RNG use). More...

Functions

template<class T >
std::vector< Vec3T< T > > samplePoints (size_t a_count, uint64_t a_seed)
 Sample a_count uniform random points in the unit cube [0,1]^3.
 

Detailed Description

Namespace for random sampling utilities (a single, centralized home for RNG use).

Function Documentation

◆ samplePoints()

template<class T >
std::vector< Vec3T< T > > EBGeometry::Random::samplePoints ( size_t  a_count,
uint64_t  a_seed 
)
inline

Sample a_count uniform random points in the unit cube [0,1]^3.

Deterministic for a given seed: the same a_seed always produces the same points (a std::mt19937_64 seeded with a_seed drives a std::uniform_real_distribution over [0,1)), so callers get reproducible run-to-run results. The engine's output is fixed by the standard, but the distribution's is not, so the points are only guaranteed to match across builds that use the same standard library.

Template Parameters
TFloating-point precision.
Parameters
[in]a_countNumber of points to sample.
[in]a_seedRNG seed.
Returns
Vector of a_count points, each with components in [0, 1).