28 virtual void init(
int seed);
31 virtual double get()
const = 0;
44 virtual double get()
const;
48 int getIndex(
int sz)
const;
50 int getIndexFast(
int sz,
int seed)
const;
57 template <
class T,
class SzTp>
58 void subselect(T*,SzTp sz,SzTp targetsz)
const;
63 void subselect(T&,
od_int64 targetsz)
const;
83 virtual double get()
const;
84 float get(
float expect,
float stdev)
const;
85 double get(
double expect,
double stdev)
const;
95 template <
class T,
class SzTp>
98 for ( SzTp idx=sz-1; idx>=targetsz; idx-- )
100 const SzTp notselidx = getIndex( idx );
101 if ( notselidx != idx )
102 Swap( arr[notselidx], arr[idx] );
107 template <
class ODSET>
110 typedef typename ODSET::size_type size_type;
111 const size_type sz = ods.size();
112 if ( sz <= targetsz )
return;
114 for ( size_type idx=sz-1; idx>=targetsz; idx-- )
116 const size_type notselidx = getIndex( idx );
117 if ( notselidx != idx )
118 ods.swap( notselidx, idx );
#define mExpClass(module)
Definition: commondefs.h:160
Definition: statrand.h:77
virtual ~RandomGenerator()
Definition: statrand.h:27
Uniform Random Generator.
Definition: statrand.h:38
#define mGlobal(module)
Definition: commondefs.h:163
#define od_int64
Definition: plftypes.h:36
double othdrawn_
Definition: statrand.h:90
void subselect(T *, SzTp sz, SzTp targetsz) const
Definition: statrand.h:96
int seed_
Definition: statrand.h:69
Random Generator.
Definition: statrand.h:23
void Swap(T &a, T &b)
Definition: commondefs.h:36
void removeRange(ODSET &inst, size_type start, size_type stop)
Removes a range from the set.
Definition: odset.h:57
Statistics.
Definition: array2dinterpol.h:28
bool useothdrawn_
Definition: statrand.h:89