|
| THash () |
|
| THash (const THash &Hash) |
|
| THash (const int &ExpectVals, const bool &_AutoSizeP=false) |
|
| THash (TSIn &SIn) |
|
void | Load (TSIn &SIn) |
|
void | Save (TSOut &SOut) const |
|
void | LoadXml (const PXmlTok &XmlTok, const TStr &Nm="") |
|
void | SaveXml (TSOut &SOut, const TStr &Nm) |
|
THash & | operator= (const THash &Hash) |
|
bool | operator== (const THash &Hash) const |
|
bool | operator< (const THash &Hash) const |
|
const TDat & | operator[] (const int &KeyId) const |
| The [] operator takes KeyId, use GetDat() if you need value access via the key. More...
|
|
TDat & | operator[] (const int &KeyId) |
|
TDat & | operator() (const TKey &Key) |
|
::TSize | GetMemUsed () const |
|
TIter | BegI () const |
|
TIter | EndI () const |
|
TIter | GetI (const TKey &Key) const |
|
void | Gen (const int &ExpectVals) |
|
void | Clr (const bool &DoDel=true, const int &NoDelLim=-1, const bool &ResetDat=true) |
|
bool | Empty () const |
|
int | Len () const |
|
int | GetPorts () const |
|
bool | IsAutoSize () const |
|
int | GetMxKeyIds () const |
|
int | GetReservedKeyIds () const |
|
bool | IsKeyIdEqKeyN () const |
|
int | AddKey (const TKey &Key) |
|
TDat & | AddDatId (const TKey &Key) |
|
TDat & | AddDat (const TKey &Key) |
|
TDat & | AddDat (const TKey &Key, const TDat &Dat) |
|
void | DelKey (const TKey &Key) |
|
bool | DelIfKey (const TKey &Key) |
|
void | DelKeyId (const int &KeyId) |
|
void | DelKeyIdV (const TIntV &KeyIdV) |
|
void | MarkDelKey (const TKey &Key) |
|
void | MarkDelKeyId (const int &KeyId) |
|
const TKey & | GetKey (const int &KeyId) const |
|
int | GetKeyId (const TKey &Key) const |
|
int | GetRndKeyId (TRnd &Rnd) const |
| Get an index of a random element. If the hash table has many deleted keys, this may take a long time. More...
|
|
int | GetRndKeyId (TRnd &Rnd, const double &EmptyFrac) |
| Get an index of a random element. If the hash table has many deleted keys, defrag the hash table first (that's why the function is non-const). More...
|
|
bool | IsKey (const TKey &Key) const |
|
bool | IsKey (const TKey &Key, int &KeyId) const |
|
bool | IsKeyId (const int &KeyId) const |
|
const TDat & | GetDat (const TKey &Key) const |
|
TDat & | GetDat (const TKey &Key) |
|
void | GetKeyDat (const int &KeyId, TKey &Key, TDat &Dat) const |
|
bool | IsKeyGetDat (const TKey &Key, TDat &Dat) const |
|
int | FFirstKeyId () const |
|
bool | FNextKeyId (int &KeyId) const |
|
void | GetKeyV (TVec< TKey > &KeyV) const |
|
void | GetDatV (TVec< TDat > &DatV) const |
|
void | GetKeyDatPrV (TVec< TPair< TKey, TDat > > &KeyDatPrV) const |
|
void | GetDatKeyPrV (TVec< TPair< TDat, TKey > > &DatKeyPrV) const |
|
void | GetKeyDatKdV (TVec< TKeyDat< TKey, TDat > > &KeyDatKdV) const |
|
void | GetDatKeyKdV (TVec< TKeyDat< TDat, TKey > > &DatKeyKdV) const |
|
void | Swap (THash &Hash) |
|
void | Defrag () |
|
void | Pack () |
|
void | Sort (const bool &CmpKey, const bool &Asc) |
|
void | SortByKey (const bool &Asc=true) |
|
void | SortByDat (const bool &Asc=true) |
|
template<class TKey, class TDat, class THashFunc = TDefaultHashFunc<TKey>>
class THash< TKey, TDat, THashFunc >
Definition at line 88 of file hash.h.
template<class TKey, class TDat, class THashFunc = TDefaultHashFunc<TKey>>
TDat& THash< TKey, TDat, THashFunc >::AddDat |
( |
const TKey & |
Key | ) |
|
|
inline |
Definition at line 196 of file hash.h.
Referenced by TCascade::Add(), TUnionFind::Add(), TExpBi::AddBi(), TNIBs::AddCasc(), TNIBs::AddDomainNm(), TNEGraph::AddEdge(), TNodeEdgeNet< TNodeData, TEdgeData >::AddEdge(), TNEANet::AddEdge(), THttpRq::AddFldVal(), THttpResp::AddFldVal(), TNEANet::AddFltAttrDatE(), TNEANet::AddFltAttrDatN(), TNEANet::AddFltAttrE(), TNEANet::AddFltAttrN(), THttpResp::AddHdFld(), TNEANet::AddIntAttrDatE(), TNEANet::AddIntAttrDatN(), TNEANet::AddIntAttrE(), TNEANet::AddIntAttrN(), TUNGraph::AddNode(), TNGraph::AddNode(), TNEGraph::AddNode(), TNodeEdgeNet< TNodeData, TEdgeData >::AddNode(), TNEANet::AddNode(), TNetInfBs::AddNodeNm(), TNIBs::AddNodeNm(), TSnap::TSnapDetail::TCNMQMatrix::TCmtyDat::AddQ(), TILx::AddRw(), TOLx::AddRw(), TNEANet::AddStrAttrDatE(), TNEANet::AddStrAttrDatN(), TNEANet::AddStrAttrE(), TNEANet::AddStrAttrN(), TLocClust::ApproxPageRank(), TGStat::AvgGStat(), TLocClustStat::BagOfWhiskers(), TLocClustStat::BagOfWhiskers2(), TNIBs::BSG(), TForestFire::BurnExpFire(), TForestFire::BurnGeoFire(), TSnap::TSnapDetail::TCNMQMatrix::CmtyCMN(), TSnap::CommunityGirvanNewman(), TAGMUtil::ConnectCmtyVV(), CreateEmptyFeatures(), CreateNodeIdMtxIdxHash(), TMom::Def(), TArtPointVisitor::DiscoverNode(), TBiConVisitor::DiscoverNode(), TSccVisitor< PGraph, OnlyCount >::DiscoverNode(), TLocClust::DrawWhiskers(), TSpecFunc::EntropyBias(), TNIBs::FG(), TZipIn::FillFExtToCmdH(), TZipOut::FillFExtToCmdH(), TCesnaUtil::FilterLowEntropy(), FindRoles(), TSccVisitor< PGraph, OnlyCount >::FinishNode(), TNetInfBs::GenCascade(), TNIBs::GenCascade(), TSnap::GetBetweennessCentr(), TSnap::GetBfsEffDiam(), TSnap::GetBiConSzCnt(), TSnap::GetClustCf(), TAGMFast::GetCmtyVV(), TCoda::GetCmtyVV(), TAGMFit::GetCmtyVV(), TCesna::GetCmtyVV(), TSnap::GetDegCnt(), TCnCom::GetDfsVisitor(), TSnap::GetEigenVectorCentr(), TSnap::GetHits(), TSnap::GetInDegCnt(), GetNIdSorted(), TCoda::GetNIDValH(), TSnap::GetNodeClustCf(), TAGMUtil::GetNodeMembership(), TSnap::GetNodesAtHops(), TGraphEnumUtils::GetNormalizedMap(), TSnap::GetOutDegCnt(), TSnap::GetPageRank(), TLxSymStr::GetSSym(), TBigNet< TNodeData, IsDir >::GetSubGraph(), TXmlObjSer::GetTagNm(), TCoda::GetTopCIDs(), TSnap::GetTriadParticip(), TGStat::GetValStr(), TCoda::GradientForNode(), TAGMFast::GradientForRow(), TCesna::GradientForRow(), TSnap::Infomap(), TNetInfBs::Init(), TUniChDb::InitScripts(), TUniChDb::InitSpecialCasing(), TUniChDb::InitWordAndSentenceBoundaryFlags(), TSnap::IntFlowBiDBFS(), TBigNet< TNodeData, IsDir >::InvertFromSources(), TTimeNet::LoadArxiv(), TAGMUtil::LoadEdgeListStr(), TNIBs::LoadGroundTruthNodesTxt(), TNetInfBs::LoadGroundTruthTxt(), TNIBs::LoadGroundTruthTxt(), TKeyDatFl< TKey, TDat, THashFunc >::LoadHash(), TNIBs::LoadInferredNodesTxt(), TNIBs::LoadInferredTxt(), TCesnaUtil::LoadNIDAttrHFromNIDKH(), TUniCaseFolding::LoadTxt(), TUniChDb::LoadTxt(), TSnap::TSnapDetail::MapEquationNew2Modules(), TCluster::MCMC(), TCoda::MLEGradAscentParallel(), TDGraphCounter::operator()(), THash< TPair, THash >::operator()(), THttpResp::ParseHttpResp(), THttpRq::ParseHttpRq(), TNcpGraphsBase::PlotAvgNcp(), TLocClustStat::PlotBoltzmanCurve(), TSnap::PlotEigValDistr(), TLocClustStat::PlotPhiDistr(), PlotRoles(), TSnap::PlotShortPathDistr(), TSnap::PlotSngValDistr(), TAGMFit::PrintSummary(), TXmlLx::PutEntityVal(), TXmlLx::PutPEntityVal(), TMacro::PutVarVal(), TBigNet< TNodeData, IsDir >::Rewire(), TAGMUtil::RewireCmtyVV(), TSnap::SavePajek(), TBigNet< TNodeData, IsDir >::SaveToDisk(), TAGMFast::SetCmtyVV(), TCoda::SetCmtyVV(), TXmlChDef::SetEntityVal(), THtmlLxChDef::SetEscStr(), TGStat::SetVal(), TNIBs::SG(), TD34GraphCounter::TD34GraphCounter(), THttpRq::THttpRq(), TMacro::TMacro(), TArtPointVisitor::TreeEdge(), TBiConVisitor::TreeEdge(), and TNIBs::UpdateDiff().
int AddKey(const TKey &Key)
template<class TKey, class TDat , class THashFunc >
int THash< TKey, TDat, THashFunc >::AddKey |
( |
const TKey & |
Key | ) |
|
Definition at line 327 of file hash.h.
Referenced by TUniTrie< TInt >::Add(), THash< TPair, THash >::AddDat(), THash< TPair, THash >::AddDatId(), TTmProfiler::AddTimer(), TLocClustStat::BagOfWhiskers(), TTimeNENet::GetEdgeTmBuckets(), TSnap::GetSngVals(), TSnap::GetSngVec(), TStrCache::GetStr(), TTimeNet::GetTmBuckets(), TTimeNENet::GetTmBuckets(), TUniChDb::InitDerivedCoreProperties(), TUniChDb::InitLineBreaks(), TUniChDb::InitPropList(), TUniChDb::InitScripts(), THtmlTok::IsBreakTag(), TUniChDb::LoadTxt(), TSnap::PrintInfo(), TUniChDb::TSubcatHelper::ProcessComment(), TGraphKey::TakeGraph(), TGraphKey::TakeSig(), and TUniChDb::TestComposition().
329 const int PortN=abs(THashFunc::GetPrimHashCd(Key)%
PortV.
Len());
330 const int HashCd=abs(THashFunc::GetSecHashCd(Key));
332 int KeyId=
PortV[PortN];
333 while ((KeyId!=-1) &&
335 PrevKeyId=KeyId; KeyId=
KeyDatV[KeyId].Next;}
TSizeTy Len() const
Returns the number of elements in the vector.
bool Empty() const
Tests whether the vector is empty.
THashKeyDat< TKey, TDat > THKeyDat
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
template<class TKey, class TDat, class THashFunc = TDefaultHashFunc<TKey>>
TIter THash< TKey, TDat, THashFunc >::BegI |
( |
| ) |
const |
|
inline |
Definition at line 171 of file hash.h.
Referenced by TNIBs::AddCasc(), AppendFeatures(), TNEANet::AttrNameEI(), TNEANet::AttrNameNI(), TNEANet::AttrValueEI(), TNEANet::AttrValueNI(), TNEGraph::BegEI(), TNodeEdgeNet< TSecTm, TSecTm >::BegEI(), TNEANet::BegEI(), TCascade::BegI(), TGHash< TUInt64 >::BegI(), TBPGraph::BegLNI(), TBigNet< TNodeData, IsDir >::BegNI(), TNodeNet< TSecTm >::BegNI(), TUNGraph::BegNI(), TNGraph::BegNI(), TNodeEDatNet< TStr, TFltFltH >::BegNI(), TNEGraph::BegNI(), TBPGraph::BegNI(), TNodeEdgeNet< TSecTm, TSecTm >::BegNI(), TNEANet::BegNI(), TBPGraph::BegRNI(), ConvertFeatureToMatrix(), CreateEmptyFeatures(), CreateNodeIdMtxIdxHash(), TAGMFast::DotProduct(), TCoda::DotProduct(), TCesna::DotProduct(), TNEANet::FltAttrNameEI(), TNEANet::FltAttrNameNI(), TNEANet::FltAttrValueEI(), TNEANet::FltAttrValueNI(), FPrintRoles(), TNetInfBs::GenCascade(), TNIBs::GenCascade(), TNIBs::GetGroundTruthGraphAtT(), TNIBs::GetGroundTruthNetworkAtT(), TNIBs::GetInferredGraphAtT(), TNIBs::GetInferredNetworkAtT(), GetNIdSorted(), GetNodeId(), TAGMUtil::GetNodeMembership(), GetNthFeature(), GetNumFeatures(), TNIBs::Init(), Inner(), TNEANet::IntAttrNameEI(), TNEANet::IntAttrNameNI(), TNEANet::IntAttrValueEI(), TNEANet::IntAttrValueNI(), TCoda::LikelihoodForNode(), TAGMFast::LikelihoodForRow(), TCesna::LikelihoodForRow(), TAGMFast::MLEGradAscent(), TCoda::MLEGradAscent(), TAGMFast::MLEGradAscentParallel(), TCoda::MLEGradAscentParallel(), TCesna::MLEGradAscentParallel(), TAGMFast::MLENewton(), TAGMFast::Norm2(), TCoda::Norm2(), TCesna::Norm2(), PlotRoles(), TCesna::PredictAttrK(), PrintFeatures(), PrintRoles(), TNetInfBs::SaveCascades(), TNIBs::SaveCascades(), TNIBs::SaveGroundTruth(), TNIBs::SaveGroundTruthPajek(), TNIBs::SaveInferred(), TNIBs::SaveInferredPajek(), TNetInfBs::SavePajek(), TNetInfBs::SavePlaneTextNet(), TNIBs::SaveSites(), TBigNet< TNodeData, IsDir >::SaveToDisk(), TNEANet::StrAttrNameEI(), TNEANet::StrAttrNameNI(), TNEANet::StrAttrValueEI(), TNEANet::StrAttrValueNI(), TAGMFast::Sum(), TCoda::Sum(), and TCesna::Sum().
TIter EndI() const
Returns an iterator referring to the past-the-end element in the vector.
bool IsKeyIdEqKeyN() const
bool FNextKeyId(int &KeyId) const
THashKeyDatI< TKey, TDat > TIter
TIter BegI() const
Returns an iterator pointing to the first element in the vector.
template<class TKey , class TDat , class THashFunc >
void THash< TKey, TDat, THashFunc >::Clr |
( |
const bool & |
DoDel = true , |
|
|
const int & |
NoDelLim = -1 , |
|
|
const bool & |
ResetDat = true |
|
) |
| |
Definition at line 315 of file hash.h.
Referenced by TLocClust::ApproxPageRank(), TNIBs::BSG(), TStrCache::Clr(), TCascade::Clr(), TGHash< TUInt64 >::Clr(), TBigNet< TNodeData, IsDir >::Clr(), TNodeNet< TSecTm >::Clr(), TUNGraph::Clr(), TUniCaseFolding::Clr(), TNGraph::Clr(), TNodeEDatNet< TStr, TFltFltH >::Clr(), TNEGraph::Clr(), TBPGraph::Clr(), TUniTrie< TInt >::Clr(), TUniChDb::Clr(), TNodeEdgeNet< TSecTm, TSecTm >::Clr(), TNEANet::Clr(), TNIBs::FG(), TNetInfBs::GenCascade(), TNIBs::GenCascade(), TSnap::GetBetweennessCentr(), TSnap::GetNodeClustCf(), TAGMUtil::GetNodeMembership(), TSnap::GetShortPath(), TNIBs::Init(), TCesnaUtil::LoadNIDAttrHFromNIDKH(), TCoda::MLEGradAscentParallel(), TNIBs::Reset(), and TNIBs::SG().
void Clr(const bool &DoDel=true, const TSizeTy &NoDelLim=-1)
Clears the contents of the vector.
THashKeyDat< TKey, TDat > THKeyDat
void PutAll(const TVal &Val)
Sets all elements of the vector to value Val.
template<class TKey, class TDat , class THashFunc >
void THash< TKey, TDat, THashFunc >::DelKey |
( |
const TKey & |
Key | ) |
|
Definition at line 358 of file hash.h.
References IAssert.
Referenced by TCascade::Del(), TNEANet::DelAttrE(), TNEANet::DelAttrN(), TNEGraph::DelEdge(), TNodeEdgeNet< TNodeData, TEdgeData >::DelEdge(), TNEANet::DelEdge(), THash< TPair, THash >::DelKeyId(), TSnap::TSnapDetail::TCNMQMatrix::TCmtyDat::DelLink(), TUNGraph::DelNode(), TNGraph::DelNode(), TNEGraph::DelNode(), TBPGraph::DelNode(), TNodeEdgeNet< TNodeData, TEdgeData >::DelNode(), TNEANet::DelNode(), TSnap::Infomap(), TSnap::TSnapDetail::MapEquationNew2Modules(), TBigNet< TNodeData, IsDir >::Rewire(), and TUniChDb::TSubcatHelper::~TSubcatHelper().
360 const int PortN=abs(THashFunc::GetPrimHashCd(Key)%
PortV.
Len());
361 const int HashCd=abs(THashFunc::GetSecHashCd(Key));
363 int KeyId=
PortV[PortN];
365 while ((KeyId!=-1) &&
367 PrevKeyId=KeyId; KeyId=
KeyDatV[KeyId].Next;}
TSizeTy Len() const
Returns the number of elements in the vector.
bool Empty() const
Tests whether the vector is empty.
template<class TKey, class TDat, class THashFunc = TDefaultHashFunc<TKey>>
TIter THash< TKey, TDat, THashFunc >::EndI |
( |
| ) |
const |
|
inline |
Definition at line 176 of file hash.h.
Referenced by TNIBs::AddCasc(), AppendFeatures(), TBPGraph::BegLNI(), TBPGraph::BegRNI(), ConvertFeatureToMatrix(), CreateEmptyFeatures(), CreateNodeIdMtxIdxHash(), TAGMFast::DotProduct(), TCoda::DotProduct(), TCesna::DotProduct(), TNEGraph::EndEI(), TNodeEdgeNet< TSecTm, TSecTm >::EndEI(), TNEANet::EndEI(), TCascade::EndI(), TGHash< TUInt64 >::EndI(), TBigNet< TNodeData, IsDir >::EndNI(), TNodeNet< TSecTm >::EndNI(), TUNGraph::EndNI(), TNGraph::EndNI(), TNodeEDatNet< TStr, TFltFltH >::EndNI(), TNEGraph::EndNI(), TBPGraph::EndNI(), TNodeEdgeNet< TSecTm, TSecTm >::EndNI(), TNEANet::EndNI(), FPrintRoles(), TNetInfBs::GenCascade(), TNIBs::GetGroundTruthGraphAtT(), TNIBs::GetGroundTruthNetworkAtT(), TNIBs::GetInferredGraphAtT(), TNIBs::GetInferredNetworkAtT(), TBPGraph::GetNI(), GetNIdSorted(), GetNodeId(), TAGMUtil::GetNodeMembership(), GetNthFeature(), TNIBs::Init(), TCoda::LikelihoodForNode(), TAGMFast::LikelihoodForRow(), TCesna::LikelihoodForRow(), TAGMFast::MLEGradAscent(), TCoda::MLEGradAscent(), TAGMFast::MLEGradAscentParallel(), TCoda::MLEGradAscentParallel(), TCesna::MLEGradAscentParallel(), TAGMFast::MLENewton(), TAGMFast::Norm2(), TCoda::Norm2(), TCesna::Norm2(), PlotRoles(), TCesna::PredictAttrK(), PrintFeatures(), PrintRoles(), TNetInfBs::SaveCascades(), TNIBs::SaveCascades(), TNIBs::SaveGroundTruth(), TNIBs::SaveGroundTruthPajek(), TNIBs::SaveInferred(), TNIBs::SaveInferredPajek(), TNetInfBs::SavePajek(), TNetInfBs::SavePlaneTextNet(), TNIBs::SaveSites(), TBigNet< TNodeData, IsDir >::SaveToDisk(), TAGMFast::Sum(), TCoda::Sum(), and TCesna::Sum().
TIter EndI() const
Returns an iterator referring to the past-the-end element in the vector.
THashKeyDatI< TKey, TDat > TIter
template<class TKey, class TDat, class THashFunc = TDefaultHashFunc<TKey>>
void THash< TKey, TDat, THashFunc >::Gen |
( |
const int & |
ExpectVals | ) |
|
|
inline |
Definition at line 180 of file hash.h.
Referenced by TCesnaUtil::FilterLowEntropy(), TGHash< TUInt64 >::Gen(), TSnap::GetEigenVectorCentr(), TSnap::GetHits(), TCoda::GetNIDValH(), TSnap::GetPageRank(), TCoda::GradientForNode(), TAGMFast::GradientForRow(), TCesna::GradientForRow(), TAGMUtil::LoadEdgeListStr(), TKeyDatFl< TKey, TDat, THashFunc >::LoadHash(), TCesnaUtil::LoadNIDAttrHFromNIDKH(), TNodeNet< TSecTm >::Reserve(), TUNGraph::Reserve(), TNGraph::Reserve(), TNodeEDatNet< TStr, TFltFltH >::Reserve(), TNEGraph::Reserve(), TNodeEdgeNet< TSecTm, TSecTm >::Reserve(), and TNEANet::Reserve().
void PutAll(const TVal &Val)
Sets all elements of the vector to value Val.
uint GetNextPrime(const uint &Val) const
void Gen(const TSizeTy &_Vals)
Constructs a vector (an array) of _Vals elements.
template<class TKey, class TDat, class THashFunc = TDefaultHashFunc<TKey>>
const TDat& THash< TKey, TDat, THashFunc >::GetDat |
( |
const TKey & |
Key | ) |
const |
|
inline |
Definition at line 220 of file hash.h.
Referenced by TSnap::TSnapDetail::_GirvanNewmanGetModularity(), TNEANet::AddEdge(), AddEgonetFeatures(), TNEANet::AddFltAttrDatE(), TNEANet::AddFltAttrDatN(), TNEANet::AddIntAttrDatE(), TNEANet::AddIntAttrDatN(), AddLocalFeatures(), TNEANet::AddNode(), TNEANet::AddStrAttrDatE(), TNEANet::AddStrAttrDatN(), AppendFeatures(), TLocClust::ApproxPageRank(), AssignBinValue(), TArtPointVisitor::BackEdge(), TBiConVisitor::BackEdge(), TLocClustStat::BagOfWhiskers(), TLocClustStat::BagOfWhiskers2(), TNEANet::BegEAFltI(), TNEANet::BegEAIntI(), TNEANet::BegEAStrI(), TNEANet::BegNAFltI(), TNEANet::BegNAIntI(), TNEANet::BegNAStrI(), TNIBs::BSG(), TAGMUtil::ConnectCmtyVV(), TNEANet::DelAttrDatE(), TNEANet::DelAttrDatN(), TNEANet::DelAttrE(), TNEANet::DelAttrN(), TBPGraph::DelNode(), TAGMFast::DotProduct(), TCoda::DotProduct(), TCesna::DotProduct(), TCodaAnalyzer::Draw2ModeCommunity(), TCodaAnalyzer::Dump2ModeCommunities(), TAGMUtil::DumpCmtyVV(), TCesnaUtil::DumpNIDAttrHToMetis(), TNEANet::EndEAFltI(), TNEANet::EndEAIntI(), TNEANet::EndEAStrI(), TNEANet::EndNAFltI(), TNEANet::EndNAIntI(), TNEANet::EndNAStrI(), TSpecFunc::EntropyBias(), TNIBs::FG(), TCesnaUtil::FilterLowEntropy(), TSnap::FindAugV(), TArtPointVisitor::FinishNode(), TBiConVisitor::FinishNode(), TSccVisitor< PGraph, OnlyCount >::FinishNode(), TArtPointVisitor::FwdEdge(), TNetInfBs::GenCascade(), TNIBs::GenCascade(), GenerateRecursiveFeatures(), TSnap::GetBetweennessCentr(), TSnap::GetBfsTree(), TNIBs::GetCasc(), TNIBs::GetCascadeId(), TZipIn::GetCmd(), TZipOut::GetCmd(), TAGMFast::GetCmtyVV(), TCesna::GetCmtyVV(), TD34GraphCounter::GetCnt(), TGHash< TUInt64 >::GetDat(), TCnCom::GetDfsVisitor(), TNIBs::GetDomainId(), TNEANet::GetEAFltI(), TNEANet::GetEAIntI(), TNEANet::GetEAStrI(), TNodeEdgeNet< TSecTm, TSecTm >::GetEDat(), TNEGraph::GetEdge(), TNodeEdgeNet< TSecTm, TSecTm >::GetEdge(), TNEANet::GetEdge(), TNEANet::GetEdgeAttrValue(), TTimeNENet::GetEdgeTmBuckets(), TSnap::GetEigenVectorCentr(), TExpBi::GetExpBiArgType(), THttpRq::GetFldVal(), THttpResp::GetFldVal(), THttpResp::GetFldValV(), TNEANet::GetFltAttrDatE(), TNEANet::GetFltAttrDatN(), TNEANet::GetFltAttrDefaultE(), TNEANet::GetFltAttrDefaultN(), TUrlEnv::GetFullUrlStr(), TSnap::GetHits(), TNEANet::GetIntAttrDatE(), TNEANet::GetIntAttrDatN(), TNEANet::GetIntAttrDefaultE(), TNEANet::GetIntAttrDefaultN(), TNEANet::GetIntAttrIndE(), TNEANet::GetIntAttrIndN(), TSccVisitor< PGraph, OnlyCount >::GetMinDiscTm(), GetMtxIdx(), TNEANet::GetNAFltI(), TNEANet::GetNAIntI(), TNEANet::GetNAStrI(), TBigNet< TNodeData, IsDir >::GetNDat(), TNodeNet< TSecTm >::GetNDat(), TNodeEDatNet< TStr, TFltFltH >::GetNDat(), TNodeEdgeNet< TSecTm, TSecTm >::GetNDat(), TGraphAnf< PGraph >::GetNIdOffset(), TBigNet< TNodeData, IsDir >::GetNode(), TNodeNet< TSecTm >::GetNode(), TUNGraph::GetNode(), TNGraph::GetNode(), TNodeEDatNet< TStr, TFltFltH >::GetNode(), TNEGraph::GetNode(), TNodeEdgeNet< TSecTm, TSecTm >::GetNode(), TNEANet::GetNode(), TNEANet::GetNodeAttrValue(), TNetInfBs::GetNodeInfo(), TNIBs::GetNodeInfo(), TNetInfBs::GetNodeNm(), TNIBs::GetNodeNm(), TGraphEnumUtils::GetNormalizedGraph(), TSnap::GetPageRank(), TCascade::GetParent(), TCascade::GetProb(), TILx::GetRw(), TAGMFast::GetStepSizeByLineSearch(), TCoda::GetStepSizeByLineSearch(), TCesna::GetStepSizeByLineSearch(), TNEANet::GetStrAttrDatE(), TNEANet::GetStrAttrDatN(), TNEANet::GetStrAttrDefaultE(), TNEANet::GetStrAttrDefaultN(), TCascade::GetTm(), TTimeNet::GetTmBuckets(), TTimeNENet::GetTmBuckets(), TGStat::GetVal(), TGStat::GetValStr(), TMacro::GetVarVal(), TAGMUtil::GVizComGraph(), TSnap::Infomap(), TNetInfBs::Init(), TUniChDb::InitWordAndSentenceBoundaryFlags(), TBigNet< TNodeData, IsDir >::InvertFromSources(), TTimeNet::LoadArxiv(), TNIBs::LoadInferredNodesTxt(), TNIBs::LoadInferredTxt(), TCesnaUtil::LoadNIDAttrHFromNIDKH(), TUniChDb::LoadTxt(), TSnap::TSnapDetail::MapEquationNew2Modules(), TCluster::MCMC(), TSnap::TSnapDetail::TCNMQMatrix::MergeBestQ(), TCesna::MLEGradAscent(), TAGMFast::MLEGradAscentParallel(), TCoda::MLEGradAscentParallel(), TCesna::MLEGradAscentParallel(), TD34GraphCounter::operator()(), TDGraphCounter::operator()(), TGHash< TUInt64 >::operator()(), TGStat::operator<(), THash< TKey, TDat, THashFunc >::operator==(), TUnionFind::Parent(), TUnionFind::Rank(), TBigNet< TNodeData, IsDir >::Rewire(), TAGMUtil::SaveBipartiteGephi(), TNetInfBs::SaveEdgeInfo(), TAGMUtil::SaveGephi(), TNetInfBs::SaveGroundTruth(), TSnap::SaveGViz(), TSnap::SavePajek(), TNIBs::SaveSites(), TNodeEdgeNet< TNodeData, TEdgeData >::SetNDat(), TNIBs::SG(), TNIBs::UpdateDiff(), and TCascade::UpdateProb().
int GetKeyId(const TKey &Key) const
template<class TKey, class TDat , class THashFunc >
int THash< TKey, TDat, THashFunc >::GetKeyId |
( |
const TKey & |
Key | ) |
const |
Definition at line 420 of file hash.h.
Referenced by TUniChDb::AddDecomposition(), TNEANet::AddEdge(), TNEANet::AddFltAttrDatE(), TNEANet::AddFltAttrDatN(), TNEANet::AddIntAttrDatE(), TNEANet::AddIntAttrDatN(), TNEANet::AddNode(), TSnap::TSnapDetail::TCNMQMatrix::TCmtyDat::AddQ(), TNEANet::AddStrAttrDatE(), TNEANet::AddStrAttrDatN(), TNEANet::DelAttrDatE(), TNEANet::DelAttrDatN(), TNEANet::DelEdge(), TNEANet::DelNode(), TNEANet::EdgeAttrIsFltDeleted(), TNEANet::EdgeAttrIsIntDeleted(), TNEANet::EdgeAttrIsStrDeleted(), TNEANet::FltAttrValueNI(), TUniCaseFolding::Fold(), TUniCaseFolding::FoldInPlace(), TUniChDb::GetCaseConverted(), TUniChDb::GetCat(), TUniChDb::GetCharName(), TUniChDb::GetCombiningClass(), THash< TPair, THash >::GetDat(), TNEANet::GetEAFltI(), TNEANet::GetEAIntI(), TNEANet::GetEAStrI(), TNEANet::GetEdgeAttrValue(), THtmlLxChDef::GetEscStr(), TNEANet::GetFltAttrDatE(), TNEANet::GetFltAttrDatN(), THash< TPair, THash >::GetI(), TNEANet::GetIntAttrDatE(), TNEANet::GetIntAttrDatN(), TNEANet::GetIntAttrIndDatE(), TNEANet::GetIntAttrIndDatN(), TGHash< TUInt64 >::GetKeyId(), TNEANet::GetNAFltI(), TNEANet::GetNAIntI(), TNEANet::GetNAStrI(), TNEANet::GetNodeAttrValue(), TUniChDb::GetSbFlags(), TUniChDb::GetScript(), TUniChDb::GetScriptByName(), TUniChDb::GetSimpleCaseConverted(), TSnap::GetSngVals(), TSnap::GetSngVec(), TMacro::GetSrcSubstStrN(), TLxSymStr::GetSSym(), TNEANet::GetStrAttrDatE(), TNEANet::GetStrAttrDatN(), TUniChDb::GetSubCat(), TILx::GetSym(), TUniChDb::GetWbFlags(), TUniChDb::InitDerivedCoreProperties(), TUniChDb::InitLineBreaks(), TUniChDb::InitPropList(), TUniChDb::InitScripts(), TUniChDb::InitWordAndSentenceBoundaryFlags(), TNEANet::IntAttrValueNI(), TUniChDb::IsGetChInfo(), THash< TPair, THash >::IsKey(), TUniChDb::IsPrivateUse(), TUniChDb::IsSbFlag(), TUniChDb::IsSurrogate(), TUniChDb::IsWbFlag(), TUniChDb::IsWbIgnored(), TUniChDb::LoadTxt(), TNEANet::NodeAttrIsFltDeleted(), TNEANet::NodeAttrIsIntDeleted(), TNEANet::NodeAttrIsStrDeleted(), TUniChDb::TSubcatHelper::SetCat(), TNEANet::StrAttrValueNI(), TLocClust::SupportSweep(), TGraphKey::TakeGraph(), TGraphKey::TakeSig(), TUniChDb::TSubcatHelper::TestCat(), and TUniChDb::ToSimpleCaseConverted().
422 const int PortN=abs(THashFunc::GetPrimHashCd(Key)%
PortV.
Len());
423 const int HashCd=abs(THashFunc::GetSecHashCd(Key));
424 int KeyId=
PortV[PortN];
425 while ((KeyId!=-1) &&
TSizeTy Len() const
Returns the number of elements in the vector.
bool Empty() const
Tests whether the vector is empty.
template<class TKey, class TDat , class THashFunc >
void THash< TKey, TDat, THashFunc >::GetKeyV |
( |
TVec< TKey > & |
KeyV | ) |
const |
Definition at line 438 of file hash.h.
References TVec< TVal, TSizeTy >::Add(), and TVec< TVal, TSizeTy >::Gen().
Referenced by TNEANet::AddEdge(), TNEANet::AddNode(), TCoda::GetCmtyVV(), TGHash< TUInt64 >::GetKeyV(), TCoda::GetTopCIDs(), TBreathFS< PGraph >::GetVisitedNIdV(), and TBigNet< TNodeData, IsDir >::Rewire().
bool FNextKeyId(int &KeyId) const
void Gen(const TSizeTy &_Vals)
Constructs a vector (an array) of _Vals elements.
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
const TKey & GetKey(const int &KeyId) const
template<class TKey , class TDat , class THashFunc >
int THash< TKey, TDat, THashFunc >::GetRndKeyId |
( |
TRnd & |
Rnd | ) |
const |
Get an index of a random element. If the hash table has many deleted keys, this may take a long time.
Definition at line 398 of file hash.h.
References TRnd::GetUniDevInt(), and IAssert.
Referenced by TNEGraph::GetRndEId(), TNodeEdgeNet< TSecTm, TSecTm >::GetRndEId(), TNEANet::GetRndEId(), TBigNet< TNodeData, IsDir >::GetRndNId(), TNodeNet< TSecTm >::GetRndNId(), TUNGraph::GetRndNId(), TNGraph::GetRndNId(), TNodeEDatNet< TStr, TFltFltH >::GetRndNId(), TNEGraph::GetRndNId(), TNodeEdgeNet< TSecTm, TSecTm >::GetRndNId(), TNEANet::GetRndNId(), and TBigNet< TNodeData, IsDir >::Rewire().
401 while (
KeyDatV[KeyId].HashCd == -1) {
TSizeTy Len() const
Returns the number of elements in the vector.
int GetUniDevInt(const int &Range=0)
template<class TKey, class TDat, class THashFunc = TDefaultHashFunc<TKey>>
bool THash< TKey, TDat, THashFunc >::IsKey |
( |
const TKey & |
Key | ) |
const |
|
inline |
Definition at line 216 of file hash.h.
Referenced by TNEANet::AddFltAttrDatE(), TNEANet::AddFltAttrDatN(), TNEANet::AddFltAttrE(), TNEANet::AddFltAttrN(), TNEANet::AddIntAttrDatE(), TNEANet::AddIntAttrDatN(), TNEANet::AddIntAttrE(), TNEANet::AddIntAttrN(), TILx::AddRw(), TOLx::AddRw(), TNEANet::AddStrAttrDatE(), TNEANet::AddStrAttrDatN(), TNEANet::AddStrAttrE(), TNEANet::AddStrAttrN(), TArtPointVisitor::BackEdge(), TBiConVisitor::BackEdge(), TLocClustStat::BagOfWhiskers(), TLocClustStat::BagOfWhiskers2(), TNIBs::BSG(), TForestFire::BurnExpFire(), TForestFire::BurnGeoFire(), TNEANet::DelAttrE(), TNEANet::DelAttrN(), THash< TPair, THash >::DelIfKey(), TAGMFast::DotProduct(), TCoda::DotProduct(), TCesna::DotProduct(), TCodaAnalyzer::Draw2ModeCommunity(), TCodaAnalyzer::Dump2ModeCommunities(), TAGMUtil::DumpCmtyVV(), TCesnaUtil::DumpNIDAttrHToMetis(), TSpecFunc::EntropyBias(), TCesnaUtil::FilterLowEntropy(), TArtPointVisitor::FinishNode(), TBiConVisitor::FinishNode(), TNetInfBs::GenCascade(), TNIBs::GenCascade(), TZipIn::GetCmd(), TZipOut::GetCmd(), TCnCom::GetDfsVisitor(), TMacro::GetDstTxtStr(), TTimeNENet::GetEdgeTmBuckets(), THttpRq::GetFldVal(), THttpResp::GetFldVal(), THttpResp::GetFldValV(), TNEANet::GetFltAttrDefaultE(), TNEANet::GetFltAttrDefaultN(), TNIBs::GetGroundTruthGraphAtT(), TNIBs::GetGroundTruthNetworkAtT(), TNIBs::GetInferredGraphAtT(), TNIBs::GetInferredNetworkAtT(), TNEANet::GetIntAttrDefaultE(), TNEANet::GetIntAttrDefaultN(), TStrCache::GetStr(), TNEANet::GetStrAttrDefaultE(), TNEANet::GetStrAttrDefaultN(), TTimeNet::GetTmBuckets(), TTimeNENet::GetTmBuckets(), TGStat::GetVal(), TGStat::GetValStr(), TUniTrie< TInt >::Has1Gram(), TGStat::HasVal(), TNetInfBs::Init(), TUniChDb::InitWordAndSentenceBoundaryFlags(), TSnap::IntFlowBiDBFS(), THtmlTok::IsBreakTag(), TNIBs::IsCascade(), TNIBs::IsDomainNm(), TNEGraph::IsEdge(), TNodeEdgeNet< TSecTm, TSecTm >::IsEdge(), TNEANet::IsEdge(), TExpBi::IsExpBiId(), THttpRq::IsFldNm(), THttpResp::IsFldNm(), TGHash< TUInt64 >::IsKey(), TUnionFind::IsKey(), THash< TPair, THash >::IsKeyGetDat(), TBPGraph::IsLNode(), TCascade::IsNode(), TBigNet< TNodeData, IsDir >::IsNode(), TNodeNet< TSecTm >::IsNode(), TUNGraph::IsNode(), TNGraph::IsNode(), TNodeEDatNet< TStr, TFltFltH >::IsNode(), TNEGraph::IsNode(), TNodeEdgeNet< TSecTm, TSecTm >::IsNode(), TNEANet::IsNode(), TNetInfBs::IsNodeNm(), TNIBs::IsNodeNm(), TBPGraph::IsRNode(), TMacro::IsSrcSubstStr(), TZipIn::IsZipExt(), TZipOut::IsZipExt(), TTimeNet::LoadArxiv(), TNIBs::LoadInferredNodesTxt(), TNIBs::LoadInferredTxt(), TCesnaUtil::LoadNIDAttrHFromNIDKH(), TUniCaseFolding::LoadTxt(), TUniChDb::LoadTxt(), TSnap::TSnapDetail::MapEquationNew2Modules(), TSnap::TSnapDetail::TCNMQMatrix::MergeBestQ(), TCoda::MLEGradAscentParallel(), TD34GraphCounter::operator()(), TDGraphCounter::operator()(), TGStat::operator<(), THash< TKey, TDat, THashFunc >::operator==(), TBigNet< TNodeData, IsDir >::Rewire(), TAGMUtil::RewireCmtyNID(), TAGMUtil::SaveBipartiteGephi(), TNIBs::SaveCascades(), TAGMUtil::SaveGephi(), TNetInfBs::SaveGroundTruth(), TNIBs::SaveGroundTruth(), TNIBs::SaveGroundTruthPajek(), TSnap::SaveGViz(), TNIBs::SaveInferred(), TNIBs::SaveInferredEdges(), TNIBs::SaveInferredPajek(), TSnap::SavePajek(), TNIBs::SaveSites(), TNIBs::SG(), TUniChDb::TestComposition(), TNIBs::UpdateDiff(), and TUniChDb::TSubcatHelper::~TSubcatHelper().
int GetKeyId(const TKey &Key) const
template<class TKey, class TDat, class THashFunc = TDefaultHashFunc<TKey>>
int THash< TKey, TDat, THashFunc >::Len |
( |
| ) |
const |
|
inline |
Definition at line 186 of file hash.h.
Referenced by TNIBs::AddCasc(), TNIBs::AddDomainNm(), TGnuPlot::AddPlot(), TILx::AddRw(), TOLx::AddRw(), TLocClust::ApproxPageRank(), AssignBinValue(), TLocClustStat::BagOfWhiskers(), TLocClustStat::BagOfWhiskers2(), THash< TPair, THash >::BegI(), TNIBs::BSG(), TForestFire::BurnExpFire(), TForestFire::BurnGeoFire(), TSnap::TSnapDetail::TCNMQMatrix::CmtyCMN(), ConvertFeatureToMatrix(), TMom::Def(), TAGMFast::DotProduct(), TCoda::DotProduct(), TCesna::DotProduct(), TUnionFind::Dump(), TCoda::DumpMemberships(), TCesnaUtil::DumpNIDAttrHToNIDK(), THash< TPair, THash >::Empty(), TSnap::TSnapDetail::Equation(), TNIBs::FG(), TCesnaUtil::FilterLowEntropy(), TLocClust::FindBestCut(), TNIBs::GenCascade(), TCesnaUtil::GetAttrs(), TSnap::GetBfsEffDiam(), TSnap::GetBfsTree(), TNIBs::GetCascs(), TSnap::GetClustCf(), TLocClustStat::GetCurveStat(), TSnap::GetDegCnt(), TNEGraph::GetEdges(), TNodeEdgeNet< TSecTm, TSecTm >::GetEdges(), TNEANet::GetEdges(), TSnap::GetEigenVectorCentr(), TSnap::GetHits(), TSnap::GetInDegCnt(), TBPGraph::GetLNodes(), TCascade::GetMaxTm(), TSnap::GetNodeEcc(), TAGMUtil::GetNodeMembership(), TBigNet< TNodeData, IsDir >::GetNodes(), TNodeNet< TSecTm >::GetNodes(), TUNGraph::GetNodes(), TNGraph::GetNodes(), TNodeEDatNet< TStr, TFltFltH >::GetNodes(), TNEGraph::GetNodes(), TNodeEdgeNet< TSecTm, TSecTm >::GetNodes(), TNEANet::GetNodes(), TSnap::GetNodesAtHop(), TSnap::GetNodesAtHops(), TBreathFS< PGraph >::GetNVisited(), TSnap::GetOutDegCnt(), TSnap::GetPageRank(), TBPGraph::GetRNodes(), TSnap::GetShortPath(), TLxSymStr::GetSSym(), TAGMFast::GetStepSizeByLineSearch(), TCoda::GetStepSizeByLineSearch(), TCesna::GetStepSizeByLineSearch(), THttpRq::GetStr(), TMacro::GetSubstStrs(), TSnap::GetSubTreeSz(), TCoda::GetTopCIDs(), TGStat::GetVals(), TMacro::GetVars(), TCoda::GradientForNode(), TAGMFast::GradientForRow(), TCesna::GradientForRow(), TSnap::Infomap(), TUniChDb::InitScripts(), THtmlTok::IsBreakTag(), TNIBs::LabelBurstAutomaton(), TD34GraphCounter::Len(), TCascade::Len(), TGHash< TUInt64 >::Len(), TUnionFind::Len(), TNetConstraint< PGraph >::Len(), TCascade::LenAfterT(), TCascade::LenBeforeT(), TTimeNet::LoadArxiv(), TAGMUtil::LoadEdgeListStr(), TNIBs::LoadGroundTruthTxt(), TNIBs::LoadInferredTxt(), TCesnaUtil::LoadNIDAttrHFromNIDKH(), TUniCaseFolding::LoadTxt(), TUniChDb::LoadTxt(), TCesna::MLEGradAscent(), TAGMFast::MLEGradAscentParallel(), TCoda::MLEGradAscentParallel(), TCesna::MLEGradAscentParallel(), THash< TKey, TDat, THashFunc >::operator==(), TSnap::PlotShortPathDistr(), TGnuPlot::PlotValCntH(), TSnap::PrintInfo(), TBigNet< TNodeData, IsDir >::Rewire(), TAGMUtil::RewireCmtyNID(), TKeyDatFl< TKey, TDat, THashFunc >::Save(), TNIBs::SaveGroundTruthPajek(), TNIBs::SaveInferredPajek(), TBigNet< TNodeData, IsDir >::SaveToDisk(), TCesna::SetGraph(), TNIBs::SG(), and TLocClust::SupportSweep().
TSizeTy Len() const
Returns the number of elements in the vector.
template<class TKey, class TDat, class THashFunc = TDefaultHashFunc<TKey>>
void THash< TKey, TDat, THashFunc >::Save |
( |
TSOut & |
SOut | ) |
const |
|
inline |
Definition at line 141 of file hash.h.
Referenced by TStrCache::Save(), TKeyDatFl< TKey, TDat, THashFunc >::Save(), TAGMFit::Save(), TGStat::Save(), TCascade::Save(), TNetInfBs::Save(), TNodeNet< TSecTm >::Save(), TUNGraph::Save(), TNIBs::Save(), TUniCaseFolding::Save(), TNGraph::Save(), TNodeEDatNet< TStr, TFltFltH >::Save(), PHash< TKey, TDat >::Save(), TNEGraph::Save(), TBPGraph::Save(), TNodeEdgeNet< TSecTm, TSecTm >::Save(), TUniChDb::Save(), and TNEANet::Save().
void Save(TSOut &SOut) const
void Save(TSOut &SOut) const
void Save(TSOut &SOut) const
template<class TKey , class TDat , class THashFunc >
void THash< TKey, TDat, THashFunc >::Sort |
( |
const bool & |
CmpKey, |
|
|
const bool & |
Asc |
|
) |
| |
Definition at line 524 of file hash.h.
References IAssertR, and THashKeyDat< TKey, TDat >::Next.
Referenced by THash< TPair, THash >::SortByDat(), and THash< TPair, THash >::SortByKey().
527 for (
int i = 0; i < TargV.Len(); i++) {
528 TargV[i] = i; MapV[i] = i; StateV[i] = i;
531 THashKeyDatCmp HashCmp(*
this, CmpKey, Asc);
532 TargV.SortCmp(HashCmp);
535 for (
int i = 0; i < TargV.Len()-1; i++) {
536 const int SrcPos = MapV[TargV[i]];
543 MapV[StateV[i]] = SrcPos;
544 StateV.Swap(Loc, SrcPos);
546 for (
int i = 0; i < TargV.Len(); i++) {
547 MapV[TargV[i]] = i; }
548 for (
int p = 0; p <
PortV.
Len(); p++) {
549 if (
PortV[p] != -1) {
bool IsKeyIdEqKeyN() const
#define IAssertR(Cond, Reason)
TSizeTy Len() const
Returns the number of elements in the vector.
template<class TKey , class TDat , class THashFunc >
void THash< TKey, TDat, THashFunc >::Swap |
( |
THash< TKey, TDat, THashFunc > & |
Hash | ) |
|
Definition at line 498 of file hash.h.
References THash< TKey, TDat, THashFunc >::AutoSizeP, THash< TKey, TDat, THashFunc >::FFreeKeyId, THash< TKey, TDat, THashFunc >::FreeKeys, THash< TKey, TDat, THashFunc >::KeyDatV, THash< TKey, TDat, THashFunc >::PortV, and Swap().
Referenced by TSnap::GetShortPath().
void Swap(TVec< TVal, TSizeTy > &Vec)
Swaps the contents of the vector with Vec.