 |
OpendTect
6.6
|
Go to the documentation of this file.
27 virtual void init(
int seed);
30 virtual double get()
const = 0;
43 virtual double get()
const;
58 template <
class T,
class SzTp>
59 void subselect(T*,SzTp sz,SzTp targetsz)
const;
84 virtual double get()
const;
85 float get(
float expect,
float stdev)
const;
86 double get(
double expect,
double stdev)
const;
96 template <
class T,
class SzTp>
99 for ( SzTp idx=sz-1; idx>=targetsz; idx-- )
101 const SzTp notselidx = getIndex( idx );
102 if ( notselidx != idx )
103 Swap( arr[notselidx], arr[idx] );
108 template <
class ODSET>
111 typedef typename ODSET::size_type size_type;
112 const size_type sz = ods.size();
113 if ( sz <= targetsz )
return;
115 for ( size_type idx=sz-1; idx>=targetsz; idx-- )
117 const size_type notselidx = getIndex( idx );
118 if ( notselidx != idx )
119 ods.swap( notselidx, idx );
void Swap(T &a, T &b)
Definition: commondefs.h:46
int getIndex(int sz) const
random index in the range [0,sz>
#define mGlobal(module)
Definition: commondefs.h:180
#define od_int64
Definition: plftypes.h:35
virtual void init(int seed)
#define mExpClass(module)
Definition: commondefs.h:177
int getInt(int min, int max) const
random int in the range [min,max]>
int seed_
Definition: statrand.h:70
bool useothdrawn_
Definition: statrand.h:90
od_int64 getIndexFast(od_int64 sz, od_int64 seed) const
getIndex using a very simple random generator
float get(float expect, float stdev) const
virtual double get() const =0
int getInt() const
Uniform int.
virtual double get() const
Uniform [0-1].
od_int64 getIndex(od_int64 sz) const
random index in the range [0,sz>
void subselect(T &, od_int64 targetsz) const
Definition: statrand.h:79
double othdrawn_
Definition: statrand.h:91
Random Generator.
Definition: statrand.h:23
Uniform Random Generator.
Definition: statrand.h:38
virtual ~RandomGenerator()
Definition: statrand.h:26
Statistics.
Definition: array2dinterpol.h:27
double get(double expect, double stdev) const
void subselect(T *, SzTp sz, SzTp targetsz) const
Definition: statrand.h:97
virtual double get() const
void removeRange(ODSET &inst, size_type start, size_type stop)
Removes a range from the set.
Definition: odset.h:59
int getIndexFast(int sz, int seed) const
getIndex using a very simple random generator
Generated at
for the OpendTect
seismic interpretation project.
Copyright (C): dGB Beheer B.V. 1995-2021