OpendTect  6.6
Public Member Functions | Private Attributes | List of all members
Stats::RandGen Class Reference

Uniform Random Generator. More...

Inheritance diagram for Stats::RandGen:
[legend]

Public Member Functions

 RandGen ()
 
virtual double get () const
 Uniform [0-1]. More...
 
int getIndex (int sz) const
 random index in the range [0,sz> More...
 
od_int64 getIndex (od_int64 sz) const
 random index in the range [0,sz> More...
 
int getIndexFast (int sz, int seed) const
 getIndex using a very simple random generator More...
 
od_int64 getIndexFast (od_int64 sz, od_int64 seed) const
 getIndex using a very simple random generator More...
 
int getInt () const
 Uniform int. More...
 
int getInt (int min, int max) const
 random int in the range [min,max]> More...
 
template<class ODSET >
void subselect (ODSET &ods, od_int64 targetsz) const
 
template<class T >
void subselect (T &, od_int64 targetsz) const
 
template<class T , class SzTp >
void subselect (T *, SzTp sz, SzTp targetsz) const
 
- Public Member Functions inherited from Stats::RandomGenerator
virtual ~RandomGenerator ()
 
virtual void init (int seed)
 

Private Attributes

int seed_
 

Detailed Description

Uniform Random Generator.

<>

Constructor & Destructor Documentation

◆ RandGen()

Stats::RandGen::RandGen ( )

Member Function Documentation

◆ get()

virtual double Stats::RandGen::get ( ) const
virtual

Uniform [0-1].

Implements Stats::RandomGenerator.

◆ getIndex() [1/2]

int Stats::RandGen::getIndex ( int  sz) const

random index in the range [0,sz>

◆ getIndex() [2/2]

od_int64 Stats::RandGen::getIndex ( od_int64  sz) const

random index in the range [0,sz>

◆ getIndexFast() [1/2]

int Stats::RandGen::getIndexFast ( int  sz,
int  seed 
) const

getIndex using a very simple random generator

◆ getIndexFast() [2/2]

od_int64 Stats::RandGen::getIndexFast ( od_int64  sz,
od_int64  seed 
) const

getIndex using a very simple random generator

◆ getInt() [1/2]

int Stats::RandGen::getInt ( ) const

Uniform int.

◆ getInt() [2/2]

int Stats::RandGen::getInt ( int  min,
int  max 
) const

random int in the range [min,max]>

◆ subselect() [1/3]

template<class ODSET >
void Stats::RandGen::subselect ( ODSET &  ods,
od_int64  targetsz 
) const
inline

◆ subselect() [2/3]

template<class T >
void Stats::RandGen::subselect ( T &  ,
od_int64  targetsz 
) const

Does not preserve order The removed items will really be erased

◆ subselect() [3/3]

template<class T , class SzTp >
void Stats::RandGen::subselect ( T *  arr,
SzTp  sz,
SzTp  targetsz 
) const
inline

Does not preserve order. Afterwards, the 'removed' values occupy the indexes targetsz - maxsz-1

Member Data Documentation

◆ seed_

int Stats::RandGen::seed_
private

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2022