SNAP Library 4.0, Developer Reference
2017-07-27 13:18:06
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <dt.h>
Public Member Functions | |
TRnd (const int &_Seed=1, const int &Steps=0) | |
TRnd (TSIn &SIn) | |
void | Save (TSOut &SOut) const |
void | LoadXml (const PXmlTok &XmlTok, const TStr &Nm) |
void | SaveXml (TSOut &SOut, const TStr &Nm) const |
TRnd & | operator= (const TRnd &Rnd) |
bool | operator== (const TRnd &) const |
double | GetUniDev () |
int | GetUniDevInt (const int &Range=0) |
int | GetUniDevInt (const int &MnVal, const int &MxVal) |
uint | GetUniDevUInt (const uint &Range=0) |
int64 | GetUniDevInt64 (const int64 &Range=0) |
uint64 | GetUniDevUInt64 (const uint64 &Range=0) |
double | GetNrmDev () |
double | GetNrmDev (const double &Mean, const double &SDev, const double &Mn, const double &Mx) |
double | GetExpDev () |
double | GetExpDev (const double &Lambda) |
double | GetGammaDev (const int &Order) |
double | GetPoissonDev (const double &Mean) |
double | GetBinomialDev (const double &Prb, const int &Trials) |
int | GetGeoDev (const double &Prb) |
double | GetPowerDev (const double &AlphaSlope) |
double | GetRayleigh (const double &Sigma) |
double | GetWeibull (const double &K, const double &Lambda) |
void | PutSeed (const int &_Seed) |
int | GetSeed () const |
void | Randomize () |
void | Move (const int &Steps) |
bool | Check () |
void | SaveTxt (TOLx &Lx) const |
Static Public Member Functions | |
static double | GetUniDevStep (const int &Seed, const int &Steps) |
static double | GetNrmDevStep (const int &Seed, const int &Steps) |
static double | GetExpDevStep (const int &Seed, const int &Steps) |
static TRnd | LoadTxt (TILx &Lx) |
Static Public Attributes | |
static const int | RndSeed =0 |
Private Member Functions | |
int | GetNextSeed () |
Private Attributes | |
int | Seed |
Static Private Attributes | |
static const int | a =16807 |
static const int | m =2147483647 |
static const int | q =127773 |
static const int | r =2836 |
|
inline |
|
inlineexplicit |
Definition at line 22 of file dt.h.
References TSIn::Load(), and Seed.
bool TRnd::Check | ( | ) |
Definition at line 33 of file dt.cpp.
References GetNextSeed(), and Seed.
double TRnd::GetBinomialDev | ( | const double & | Prb, |
const int & | Trials | ||
) |
Definition at line 154 of file dt.cpp.
References GetUniDev(), TSpecFunc::LnGamma(), and TMath::Pi.
Referenced by TAGM::RndConnectInsideCommunity().
double TRnd::GetExpDev | ( | ) |
Definition at line 83 of file dt.cpp.
References GetUniDev().
Referenced by TNetInfBs::GenCascade(), TNIBs::GenCascade(), GetExpDev(), and GetExpDevStep().
double TRnd::GetExpDev | ( | const double & | Lambda | ) |
Definition at line 91 of file dt.cpp.
References GetExpDev().
|
inlinestatic |
Definition at line 68 of file dt.h.
References GetExpDev(), and Move().
double TRnd::GetGammaDev | ( | const int & | Order | ) |
Definition at line 95 of file dt.cpp.
References Fail, and GetUniDev().
Referenced by TMAGNodeBeta::AttrGen().
|
inline |
Definition at line 45 of file dt.h.
References GetUniDev().
Referenced by TForestFire::BurnGeoFire(), and TUndirFFire::BurnGeoFire().
|
inlineprivate |
Definition at line 17 of file dt.h.
References a, m, q, r, and Seed.
Referenced by Check(), GetUniDev(), GetUniDevInt(), GetUniDevUInt(), and Move().
double TRnd::GetNrmDev | ( | ) |
Definition at line 63 of file dt.cpp.
References GetUniDev().
Referenced by TMAGAffMtx::AddRndNoise(), TKronMtx::AddRndNoise(), TLAMisc::FillRnd(), GetNrmDev(), GetNrmDevStep(), and TSnap::TSnapDetail::GetSphereDev().
double TRnd::GetNrmDev | ( | const double & | Mean, |
const double & | SDev, | ||
const double & | Mn, | ||
const double & | Mx | ||
) |
Definition at line 75 of file dt.cpp.
References GetNrmDev().
|
inlinestatic |
Definition at line 66 of file dt.h.
References GetNrmDev(), and Move().
double TRnd::GetPoissonDev | ( | const double & | Mean | ) |
Definition at line 121 of file dt.cpp.
References GetUniDev(), TSpecFunc::LnGamma(), and TMath::Pi.
|
inline |
Definition at line 47 of file dt.h.
References GetUniDev(), and IAssert.
Referenced by TNetInfBs::GenCascade(), TNIBs::GenCascade(), TAGMUtil::GenPLSeq(), and TSnap::GenRndPowerLaw().
|
inline |
Definition at line 50 of file dt.h.
References GetUniDev(), and IAssert.
Referenced by TNetInfBs::GenCascade(), and TNIBs::GenCascade().
|
inline |
|
inline |
Definition at line 30 of file dt.h.
References GetNextSeed(), and m.
Referenced by TFfGGen::AddNodes(), AliasDrawInt(), TForestFire::BurnExpFire(), TMAGFitBern::ComputeJointLL(), TMAGFitBern::DoEMAlg(), TNIBs::GenCascade(), TSnap::GenCopyModel(), TKronMtx::GenDetKronecker(), TKronMtx::GenFastKronecker(), TKronMtx::GenKronecker(), TSnap::GenRMat(), TKronMtx::GenRndGraph(), TSnap::GenSmallWorld(), GetBinomialDev(), GetExpDev(), GetGammaDev(), GetGeoDev(), TKronMtx::GetInitMtx(), GetNrmDev(), GetPoissonDev(), GetPowerDev(), GetRayleigh(), TFlt::GetRnd(), GetUniDevStep(), GetWeibull(), InitPosEmb(), TCluster::MCMC(), TAGMFast::NeighborComInit(), TCoda::NeighborComInit(), TCesna::NeighborComInit(), TSparseSVD::OrtoIterSVD(), TAGMFast::RandomInit(), TCoda::RandomInit(), TCesna::RandomInit(), TMAGFitBern::RandomInit(), RndUnigramInt(), TAGMFit::RunMCMC(), TKroneckerLL::SampleNextPerm(), TSnap::SamplePersonalizedPageRank(), TKroneckerLL::SetRandomEdges(), TMAGAffMtx::SetRndMtx(), and TKronMtx::SetRndMtx().
int TRnd::GetUniDevInt | ( | const int & | Range = 0 | ) |
Definition at line 39 of file dt.cpp.
References GetNextSeed(), and Seed.
Referenced by TFfGGen::AddNodes(), TUndirFFire::AddNodes(), TNIBs::BSG(), TAGMUtil::ConnectCmtyVV(), TMAGFitBern::DoEStepApxOneIter(), TMAGFitBern::DoEStepOneIter(), TAGMFast::FindComsByCV(), TKronNoise::FlipEdgeNoise(), TSnap::GenConfModel(), TSnap::GenCopyModel(), TSnap::GenGeoPrefAttach(), TCesna::GenHoldOutAttr(), TCesnaUtil::GenHoldOutPairs(), TAGMFastUtil::GenHoldOutPairs(), TTree< TVal >::GenRandomTree(), TSnap::GenRndBipart(), TSnap::GenRndGnm(), TSnap::GenSmallWorld(), TTimeNENet::GetGnmRndNet(), TSnap::GetMxDegNId(), TSnap::GetMxInDegNId(), TSnap::GetMxOutDegNId(), TTimeNENet::GetPrefAttach(), TBool::GetRnd(), TInt::GetRnd(), TSnap::TSnapDetail::GetRndEdgeNonAdjNode(), THash< TKey, TDat, THashFunc >::GetRndKeyId(), THashSet< TInt >::GetRndKeyId(), TCnCom::GetRndNId(), TBPGraph::GetRndNId(), TBreathFS< PGraph >::GetRndPath(), GetUniDevInt(), GetUniDevInt64(), GetUniDevUInt64(), TKroneckerLL::MetroGibbsSampleNext(), TAGMFast::NeighborComInit(), TCoda::NeighborComInit(), TCesna::NeighborComInit(), TAGMFast::RandomInit(), TCoda::RandomInit(), TAGMFit::RandomInit(), TCesna::RandomInit(), TAGMUtil::RewireCmtyNID(), TAGM::RndConnectInsideCommunity(), TKroneckerLL::SampleNextPerm(), TSnap::SamplePersonalizedPageRank(), TAGMFit::SampleTransition(), TNIBs::SG(), TVec< TVal, TSizeTy >::Shuffle(), TVecPool< TVal, TSizeTy >::ShuffleAll(), TGLib_OLD::TVecPool< TVal >::ShuffleAll(), TVVec< TVal, TSizeTy >::ShuffleX(), TVVec< TVal, TSizeTy >::ShuffleY(), SimulateWalk(), TUniChDb::TestFindNextWordOrSentenceBoundary(), TCluster::Train(), and TrainModel().
|
inline |
Definition at line 32 of file dt.h.
References GetUniDevInt(), and IAssert.
Definition at line 51 of file dt.cpp.
References GetUniDevInt().
Referenced by TVec< TVal, TSizeTy >::Shuffle().
|
inlinestatic |
Definition at line 64 of file dt.h.
References GetUniDev(), and Move().
Definition at line 45 of file dt.cpp.
References GetNextSeed(), and Seed.
Referenced by TUInt::GetRnd(), and TUniCodec::GetRndUint().
Definition at line 57 of file dt.cpp.
References GetUniDevInt().
|
inline |
Definition at line 53 of file dt.h.
References GetUniDev(), and IAssert.
Definition at line 215 of file dt.cpp.
References TILx::GetInt(), and TRnd().
Definition at line 9 of file dt.cpp.
References TXmlObjSer::GetIntArg(), Seed, and XLoadHd.
void TRnd::Move | ( | const int & | Steps | ) |
Definition at line 29 of file dt.cpp.
References GetNextSeed().
Referenced by GetExpDevStep(), GetNrmDevStep(), GetUniDevStep(), and TRnd().
|
inline |
void TRnd::PutSeed | ( | const int & | _Seed | ) |
Definition at line 18 of file dt.cpp.
Referenced by TAGMFit::Load(), TAGMFast::Load(), TCoda::Load(), TKronMtx::PutRndSeed(), TMAGFitBern::RandomInit(), Randomize(), and TRnd().
|
inline |
Definition at line 60 of file dt.h.
References PutSeed(), and RndSeed.
Referenced by TNIBs::GenCascade(), and TSnap::Infomap().
|
inline |
Definition at line 23 of file dt.h.
References TSOut::Save(), and Seed.
void TRnd::SaveTxt | ( | TOLx & | Lx | ) | const |
Definition at line 219 of file dt.cpp.
References TOLx::PutInt(), and Seed.
Definition at line 14 of file dt.cpp.
References TInt::GetStr(), Seed, and XSaveBETagArg.
|
staticprivate |
Definition at line 15 of file dt.h.
Referenced by GetNextSeed().
|
staticprivate |
Definition at line 15 of file dt.h.
Referenced by GetNextSeed(), and GetUniDev().
|
staticprivate |
Definition at line 15 of file dt.h.
Referenced by GetNextSeed().
|
staticprivate |
Definition at line 15 of file dt.h.
Referenced by GetNextSeed().
|
static |
Definition at line 13 of file dt.h.
Referenced by Randomize().
|
private |
Definition at line 16 of file dt.h.
Referenced by Check(), GetNextSeed(), GetSeed(), GetUniDevInt(), GetUniDevUInt(), LoadXml(), operator=(), PutSeed(), Save(), SaveTxt(), SaveXml(), and TRnd().