6 virtual void seed(
unsigned val) = 0;
8 virtual unsigned genrand(
unsigned range)=0;
10 double genrand_f() {
return (
double)genrand(0xFFFFFFFF) / (double)0xFFFFFFFF; }
15 unsigned genrandMax = (unsigned) pfc::min_t<size_t>(count, 0xFFFFFFFF);
17 for(n=0;n<count;n++) out[n]=n;
18 for(n=0;n<count;n++)
pfc::swap_t(out[n],out[genrand(genrandMax)]);
PRNG service. Implemented by the core, do not reimplement. Use g_create() helper function to instanti...
void generate_random_order(t_size *out, t_size count)
static service_ptr_t< genrand_service > g_create()
Base class for all service classes. Provides interfaces for reference counter and querying for differ...
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
void swap_t(T &p_item1, T &p_item2)