26 virtual void init(
int seed);
29 virtual double get()
const = 0;
42 virtual double get()
const;
46 int getIndex(
int sz)
const;
48 int getIndexFast(
int sz,
int seed)
const;
55 template <
class T,
class SzTp>
56 void subselect(T*,SzTp sz,SzTp targetsz)
const;
61 void subselect(T&,
od_int64 targetsz)
const;
81 virtual double get()
const;
82 float get(
float expect,
float stdev)
const;
83 double get(
double expect,
double stdev)
const;
93 template <
class T,
class SzTp>
96 for ( SzTp idx=sz-1; idx>=targetsz; idx-- )
98 const SzTp notselidx = getIndex( idx );
99 if ( notselidx != idx )
100 Swap( arr[notselidx], arr[idx] );
105 template <
class ODSET>
108 typedef typename ODSET::size_type size_type;
109 const size_type sz = ods.size();
110 if ( sz <= targetsz )
return;
112 for ( size_type idx=sz-1; idx>=targetsz; idx-- )
114 const size_type notselidx = getIndex( idx );
115 if ( notselidx != idx )
116 ods.swap( notselidx, idx );
#define mExpClass(module)
Definition: commondefs.h:157
Definition: statrand.h:75
virtual ~RandomGenerator()
Definition: statrand.h:25
Uniform Random Generator.
Definition: statrand.h:36
#define mGlobal(module)
Definition: commondefs.h:160
#define od_int64
Definition: plftypes.h:34
double othdrawn_
Definition: statrand.h:88
void subselect(T *, SzTp sz, SzTp targetsz) const
Definition: statrand.h:94
int seed_
Definition: statrand.h:67
Random Generator.
Definition: statrand.h:21
void Swap(T &a, T &b)
Definition: commondefs.h:34
void removeRange(ODSET &inst, size_type start, size_type stop)
Removes a range from the set.
Definition: odset.h:55
Statistics.
Definition: array2dinterpol.h:27
bool useothdrawn_
Definition: statrand.h:87