Scopira  20080306
scopira::tool::sysrand_gen Class Reference

#include <random.h>

Public Types

typedef int result_type
 

Public Member Functions

 sysrand_gen (unsigned int seed0=1)
 ctor
 
result_type min (void) const
 min val
 
result_type max (void) const
 max val
 
result_type operator() (void)
 
result_type operator() (result_type mx)
 

Static Public Member Functions

static void seed (unsigned int seed0)
 seed the generator
 
static result_type next (void)
 

Static Public Attributes

static const bool has_fixed_range = true
 
static const int min_value = 0
 
static const int max_value = RAND_MAX
 

Detailed Description

a global-state random generato that uses the C libraries srand and rand calls. the follow the boost form

Author
Aleksander Demko

Member Function Documentation

◆ operator()() [1/2]

result_type scopira::tool::sysrand_gen::operator() ( void  )
inline

Gets the next number in the sequence.

Author
Aleksander Demko

◆ operator()() [2/2]

result_type scopira::tool::sysrand_gen::operator() ( result_type  mx)
inline

Gets the next number in the sequence. Capped by mx (that is, <mx). Not numerically sound (FIXME).

Author
Aleksander Demko

The documentation for this class was generated from the following file: