A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/group__RandomGen.html below:

NCBI C++ ToolKit: Random Number Generation

◆ TValue

Type of the generated integer value and/or the seed value.

Definition at line 69 of file random_gen.hpp.

◆ anonymous enum ◆ EErrCode Enumerator eUnavailable 

System-dependent generator is not available.

eUnexpectedRandMethod 

The user called method which is not allowed for the used generator.

eSysGeneratorError 

Error getting a random value from the system-dependent generator.

Definition at line 182 of file random_gen.hpp.

◆ EGetRandMethod

Random generator to use in the GetRand() functions.

Enumerator eGetRand_LFG 

Use lagged Fibonacci (LFG) random number generator.

eGetRand_Sys 

Use system-dependent random generator.

Definition at line 72 of file random_gen.hpp.

◆ CRandom() [1/3] ◆ CRandom() [2/3] ◆ CRandom() [3/3] CRandom::CRandom ( TValue  seed ) ◆ GetErrCodeString() virtual const char* CRandomException::GetErrCodeString ( void  ) const inlineoverridevirtual ◆ GetMax() ◆ GetRand() [1/2] ◆ GetRand() [2/2]

Get the next random number in the interval [0..GetMax()] (inclusive)

See also
EGetRandMethod
Note
eGetRand_LFG generator could be 100 times faster than eGetRand_Sys one

Definition at line 238 of file random_gen.hpp.

References CRandom::x_GetRand32Bits().

Referenced by BOOST_AUTO_TEST_CASE(), CNCDistributionConf::GenerateBlobKey(), CNcbiEncryptApp::GenerateKey(), TestUtil::GenerateRandomSeqid_Gi(), GetKValues(), CDiscreteDistributionImpl::GetNextValue(), SCompoundIDPoolImpl::GetRand(), CMTTestThread::GetRandomId(), GetRandomNumbers(), CMTTestThread::Main(), CSeqportUtil_implementation::MapIupacnaToNcbi2na(), CSeqportUtil_implementation::MapNcbi4naToNcbi2na(), SNetServiceIterator_RandomPivot::Next(), CSymDustMasker::CIupac2Ncbi2na_converter::operator()(), alp_data::ran2(), CDbapiSampleApp::Run(), s_GetRand(), s_GetRandomNumbers(), s_Ncbi4naToNcbi2na(), s_SetNextTime(), CRandom::SetSeed(), CNCActiveSyncControl::x_FinishScanSlots(), CElementaryMatching::x_InitBasic(), and CAmbigDataBuilder::x_Random().

◆ GetRandIndex() ◆ GetRandIndexSize_t() size_t CRandom::GetRandIndexSize_t ( size_t  size ) inline ◆ GetRandIndexUint8() ◆ GetRandMethod() ◆ GetRandSize_t() size_t CRandom::GetRandSize_t ( size_t  min_value, size_t  max_value  ) inline ◆ GetRandUint8() [1/2] ◆ GetRandUint8() [2/2] Uint8 CRandom::GetRandUint8 ( void  ) inline ◆ GetSeed() ◆ NCBI_EXCEPTION_DEFAULT() ◆ operator=() ◆ Randomize() void CRandom::Randomize ( void  )

Re-initialize (re-seed) the generator using platform-specific randomization.

Note
Does nothing if system generator is used.

Definition at line 267 of file random_gen.cpp.

References CTime::eCurrent, CRandom::eGetRand_Sys, CCurrentProcess::GetPid(), CThread::GetSelf(), CRandom::m_RandMethod, CTime::NanoSecond(), s_RandomSupplier, CTime::Second(), seed, and CRandom::SetSeed().

Referenced by CNcbiEncryptApp::GenerateKey(), and NDirectNetStorageImpl::SContext::Init().

◆ Reset() void CRandom::Reset ( void  )

Reset random number generator to initial startup condition (LFG only)

Attention
Throw exception if non-LFG (i.e. system) generator is used.

Definition at line 234 of file random_gen.cpp.

References _ASSERT, CRandom::eGetRand_Sys, i, kStateOffset, CRandom::kStateSize, CRandom::m_RandMethod, CRandom::m_RJ, CRandom::m_RK, CRandom::m_State, and NCBI_THROW.

Referenced by CSubjectRangesSet::AddRange(), CRandom::CRandom(), and CSeqDBVol::SetOffsetRanges().

◆ SetSeed() void CRandom::SetSeed ( TValue  seed )

Seed the random number generator with "seed".

Attention
Throw exception if non-LFG (i.e. system) generator is used.

Definition at line 287 of file random_gen.cpp.

References _ASSERT, CRandom::eGetRand_Sys, CRandom::GetRand(), i, kStateOffset, CRandom::kStateSize, CRandom::m_RandMethod, CRandom::m_RJ, CRandom::m_RK, CRandom::m_Seed, CRandom::m_State, NCBI_THROW, and seed.

Referenced by alp_data::alp_data(), CRandom::CRandom(), CSeqportUtil_implementation::MapIupacnaToNcbi2na(), CSeqportUtil_implementation::MapNcbi4naToNcbi2na(), and CRandom::Randomize().

◆ x_GetRand32Bits() ◆ x_GetRand64Bits() Uint8 CRandom::x_GetRand64Bits ( void  ) private ◆ x_GetSysRand32Bits() ◆ m_RandMethod ◆ m_RJ ◆ m_RK ◆ m_Seed ◆ m_State

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4