SNAP Library 2.3, Developer Reference  2014-06-16 11:58:46
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
THashSet< TKey, THashFunc > Class Template Reference

#include <shash.h>

Collaboration diagram for THashSet< TKey, THashFunc >:

Public Types

typedef THashSetKeyI< TKey > TIter
 

Public Member Functions

 THashSet ()
 
 THashSet (const THashSet &Set)
 
 THashSet (const int &ExpectVals, const bool &_AutoSizeP=false)
 
 THashSet (const TVec< TKey > &KeyV)
 
 THashSet (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)
 
THashSetoperator= (const THashSet &Set)
 
bool operator== (const THashSet &Set) const
 
const TKey & operator[] (const int &KeyId) const
 
TKey & operator[] (const int &KeyId)
 
::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)
 
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)
 
void AddKeyV (const TVec< TKey > &KeyV)
 
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
 
bool IsKey (const TKey &Key) const
 
bool IsKey (const TKey &Key, int &KeyId) const
 
bool IsKeyId (const int &KeyId) const
 
int FFirstKeyId () const
 
bool FNextKeyId (int &KeyId) const
 
void GetKeyV (TVec< TKey > &KeyV) const
 
void Swap (THashSet &Set)
 
void Defrag ()
 
void Pack ()
 

Static Public Member Functions

static THashSet< TKey > GetSet (const TKey &Key1)
 
static THashSet< TKey > GetSet (const TKey &Key1, const TKey &Key2)
 
static THashSet< TKey > GetSet (const TKey &Key1, const TKey &Key2, const TKey &Key3)
 
static THashSet< TKey > GetSet (const TKey &Key1, const TKey &Key2, const TKey &Key3, const TKey &Key4)
 
static THashSet< TKey > GetSet (const TKey &Key1, const TKey &Key2, const TKey &Key3, const TKey &Key4, const TKey &Key5)
 
static THashSet< TKey > GetSet (const TKey &Key1, const TKey &Key2, const TKey &Key3, const TKey &Key4, const TKey &Key5, const TKey &Key6)
 
static THashSet< TKey > GetSet (const TKey &Key1, const TKey &Key2, const TKey &Key3, const TKey &Key4, const TKey &Key5, const TKey &Key6, const TKey &Key7)
 
static THashSet< TKey > GetSet (const TKey &Key1, const TKey &Key2, const TKey &Key3, const TKey &Key4, const TKey &Key5, const TKey &Key6, const TKey &Key7, const TKey &Key8)
 
static THashSet< TKey > GetSet (const TKey &Key1, const TKey &Key2, const TKey &Key3, const TKey &Key4, const TKey &Key5, const TKey &Key6, const TKey &Key7, const TKey &Key8, const TKey &Key9)
 

Private Types

typedef THashSetKey< TKey > TSetKey
 

Private Member Functions

TSetKeyGetSetKey (const int &KeyId)
 
const TSetKeyGetSetKey (const int &KeyId) const
 
uint GetNextPrime (const uint &Val) const
 
void Resize ()
 

Private Attributes

TIntV PortV
 
TVec< TSetKeyKeyV
 
TBool AutoSizeP
 
TInt FFreeKeyId
 
TInt FreeKeys
 

Detailed Description

template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
class THashSet< TKey, THashFunc >

Definition at line 1041 of file shash.h.

Member Typedef Documentation

template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
typedef THashSetKeyI<TKey> THashSet< TKey, THashFunc >::TIter

Definition at line 1043 of file shash.h.

template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
typedef THashSetKey<TKey> THashSet< TKey, THashFunc >::TSetKey
private

Definition at line 1045 of file shash.h.

Constructor & Destructor Documentation

template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
THashSet< TKey, THashFunc >::THashSet ( )
inline

Definition at line 1060 of file shash.h.

1060  :
1061  PortV(), KeyV(),
1062  AutoSizeP(true), FFreeKeyId(-1), FreeKeys(0) { }
TInt FFreeKeyId
Definition: shash.h:1049
TVec< TSetKey > KeyV
Definition: shash.h:1047
TInt FreeKeys
Definition: shash.h:1049
TBool AutoSizeP
Definition: shash.h:1048
TIntV PortV
Definition: shash.h:1046
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
THashSet< TKey, THashFunc >::THashSet ( const THashSet< TKey, THashFunc > &  Set)
inline

Definition at line 1063 of file shash.h.

1063  :
1064  PortV(Set.PortV), KeyV(Set.KeyV), AutoSizeP(Set.AutoSizeP),
1065  FFreeKeyId(Set.FFreeKeyId), FreeKeys(Set.FreeKeys) { }
TInt FFreeKeyId
Definition: shash.h:1049
TVec< TSetKey > KeyV
Definition: shash.h:1047
TInt FreeKeys
Definition: shash.h:1049
TBool AutoSizeP
Definition: shash.h:1048
TIntV PortV
Definition: shash.h:1046
template<class TKey , class THashFunc >
THashSet< TKey, THashFunc >::THashSet ( const int &  ExpectVals,
const bool &  _AutoSizeP = false 
)

Definition at line 1211 of file shash.h.

References THashSet< TKey, THashFunc >::PortV, and TVec< TVal, TSizeTy >::PutAll().

1211  :
1212  PortV(GetNextPrime(ExpectVals/2+1)), KeyV(ExpectVals, 0),
1213  AutoSizeP(_AutoSizeP), FFreeKeyId(-1), FreeKeys(0) {
1214  PortV.PutAll(TInt(-1));
1215 }
TInt FFreeKeyId
Definition: shash.h:1049
TVec< TSetKey > KeyV
Definition: shash.h:1047
TInt FreeKeys
Definition: shash.h:1049
void PutAll(const TVal &Val)
Sets all elements of the vector to value Val.
Definition: ds.h:1130
TBool AutoSizeP
Definition: shash.h:1048
TIntV PortV
Definition: shash.h:1046
Definition: dt.h:1041
uint GetNextPrime(const uint &Val) const
Definition: shash.h:1178

Here is the call graph for this function:

template<class TKey, class THashFunc >
THashSet< TKey, THashFunc >::THashSet ( const TVec< TKey > &  KeyV)
explicit

Definition at line 1218 of file shash.h.

References THashSet< TKey, THashFunc >::AddKey(), TVec< TVal, TSizeTy >::Len(), THashSet< TKey, THashFunc >::PortV, and TVec< TVal, TSizeTy >::PutAll().

1218  :
1219  PortV(GetNextPrime(_KeyV.Len()/2+1)), KeyV(_KeyV.Len(), 0),
1220  AutoSizeP(false), FFreeKeyId(-1), FreeKeys(0) {
1221  PortV.PutAll(TInt(-1));
1222  for (int i = 0; i < _KeyV.Len(); i++) {
1223  AddKey(_KeyV[i]);
1224  }
1225 }
TInt FFreeKeyId
Definition: shash.h:1049
TVec< TSetKey > KeyV
Definition: shash.h:1047
TInt FreeKeys
Definition: shash.h:1049
void PutAll(const TVal &Val)
Sets all elements of the vector to value Val.
Definition: ds.h:1130
TBool AutoSizeP
Definition: shash.h:1048
int AddKey(const TKey &Key)
Definition: shash.h:1248
TIntV PortV
Definition: shash.h:1046
Definition: dt.h:1041
uint GetNextPrime(const uint &Val) const
Definition: shash.h:1178

Here is the call graph for this function:

template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
THashSet< TKey, THashFunc >::THashSet ( TSIn SIn)
inlineexplicit

Definition at line 1068 of file shash.h.

1068  :
1069  PortV(SIn), KeyV(SIn),
1070  AutoSizeP(SIn), FFreeKeyId(SIn), FreeKeys(SIn) {
1071  SIn.LoadCs(); }
TInt FFreeKeyId
Definition: shash.h:1049
TVec< TSetKey > KeyV
Definition: shash.h:1047
TInt FreeKeys
Definition: shash.h:1049
void LoadCs()
Definition: fl.cpp:28
TBool AutoSizeP
Definition: shash.h:1048
TIntV PortV
Definition: shash.h:1046

Member Function Documentation

template<class TKey, class THashFunc >
int THashSet< TKey, THashFunc >::AddKey ( const TKey &  Key)

Definition at line 1248 of file shash.h.

Referenced by TLocClustStat::BagOfWhiskers(), TUndirFFire::BurnGeoFire(), TNetConstraint< PGraph >::CalcConstraints(), TCliqueOverlap::CalculateOverlapMtx(), TSnap::CntEdgesToSet(), TSnap::CntUniqDirEdges(), TSnap::CntUniqUndirEdges(), TAGMUtil::ConnectCmtyVV(), TSnap::ConvertGraph(), TSnap::TSnapDetail::TGetSubGraph< PGraph, false >::Do(), TSnap::TSnapDetail::TConvertSubGraph< POutGraph, PInGraph, IsMultiGraph >::Do(), TSnap::TSnapDetail::TConvertSubGraph< POutGraph, PInGraph, false >::Do(), TArtPointVisitor::FinishNode(), TBiConVisitor::FinishNode(), TAGM::GenAGM(), TSnap::GenConfModel(), TCesna::GenHoldOutAttr(), TSnap::GenPrefAttach(), TSnap::GenRewire(), TSnap::GenSmallWorld(), TSnap::Get1CnCom(), TSnap::Get1CnComSzCnt(), TTimeNENet::Get1stEdgeNet(), TSnap::GetCmnNbrs(), TLocClust::GetCutStat(), TSnap::GetEdgeBridges(), TSnap::GetEdgesInOut(), TLocClustStat::TCutInfo::GetFracDegOut(), TCliqueOverlap::GetIntersection(), TAGMUtil::GetIntersection(), TCliqueOverlap::GetMaximalCliques(), TSnap::GetModularity(), TAGMUtil::GetNbhCom(), TCesnaUtil::GetNbhCom(), TAGMFastUtil::GetNbhCom(), TCliqueOverlap::GetNbrs(), TAGMUtil::GetNodeMembership(), TSnap::GetNodeTriads(), TTimeNENet::GetPrefAttach(), TCliqueOverlap::GetRelativeComplement(), THashSet< TInt >::GetSet(), TSnap::GetSubGraph(), TBigNet< TNodeData, IsDir >::GetSubGraph(), TSnap::GetTriadEdges(), TSnap::GetTriads(), TNodeEdgeNet< TNodeData, TEdgeData >::GetUniqEdges(), TSnap::GetWccs(), TSnap::GetWccSzCnt(), TSnap::LoadDyNet(), TSnap::LoadDyNetGraphV(), THashSet< TInt >::LoadXml(), TCluster::MCMC(), TCoda::MLEGradAscent(), TCesna::MLEGradAscent(), TCoda::MLEGradAscentParallel(), TAGMFast::MLENewton(), TLocClustStat::PlotNCPScatter(), TGnuPlot::PlotValMomH(), TAGM::RndConnectInsideCommunity(), TLocClustStat::Run(), TTimeNENet::SaveEdgeTm(), TSnap::SaveMatlabSparseMtx(), TGStatVec::SaveTxt(), TGraphKey::TakeGraph(), TGraphAttributes::TGraphAttributes(), and THashSet< TKey, THashFunc >::THashSet().

1248  {
1249  if ((KeyV.Len()>2*PortV.Len())||PortV.Empty()) {Resize(); }
1250  int PortN=abs(THashFunc::GetPrimHashCd(Key)%PortV.Len());
1251  int HashCd=abs(THashFunc::GetSecHashCd(Key));
1252  int PrevKeyId=-1;
1253  int KeyId=PortV[PortN];
1254 
1255  while ((KeyId!=-1) &&
1256  !((KeyV[KeyId].HashCd==HashCd) && (KeyV[KeyId].Key==Key))) {
1257  PrevKeyId=KeyId; KeyId=KeyV[KeyId].Next; }
1258 
1259  if (KeyId==-1) {
1260  if (FFreeKeyId==-1) {
1261  KeyId=KeyV.Add(TSetKey(-1, HashCd, Key));
1262  } else {
1263  KeyId=FFreeKeyId; FFreeKeyId=KeyV[FFreeKeyId].Next; FreeKeys--;
1264  KeyV[KeyId].Next = -1;
1265  KeyV[KeyId].HashCd = HashCd;
1266  KeyV[KeyId].Key = Key;
1267  }
1268  if (PrevKeyId==-1) {
1269  PortV[PortN]=KeyId;
1270  } else {
1271  KeyV[PrevKeyId].Next=KeyId;
1272  }
1273  }
1274  return KeyId;
1275 }
TInt FFreeKeyId
Definition: shash.h:1049
TVec< TSetKey > KeyV
Definition: shash.h:1047
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:535
TInt FreeKeys
Definition: shash.h:1049
bool Empty() const
Tests whether the vector is empty.
Definition: ds.h:530
void Resize()
Definition: shash.h:1190
THashSetKey< TKey > TSetKey
Definition: shash.h:1045
TIntV PortV
Definition: shash.h:1046

Here is the caller graph for this function:

template<class TKey, class THashFunc >
void THashSet< TKey, THashFunc >::AddKeyV ( const TVec< TKey > &  KeyV)

Definition at line 1278 of file shash.h.

References TVec< TVal, TSizeTy >::Len().

Referenced by TCliqueOverlap::GetCPMCommunities(), and TCesna::SetGraph().

1278  {
1279  for (int i = 0; i < KeyV.Len(); i++) { AddKey(KeyV[i]); }
1280 }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:535
int AddKey(const TKey &Key)
Definition: shash.h:1248

Here is the call graph for this function:

Here is the caller graph for this function:

template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
TIter THashSet< TKey, THashFunc >::BegI ( ) const
inline

Definition at line 1099 of file shash.h.

Referenced by TCliqueOverlap::GetIntersection(), TAGMUtil::GetIntersection(), TCliqueOverlap::GetNodeIdWithMaxDeg(), TCliqueOverlap::GetRelativeComplement(), TAGMFit::GradLogLForLambda(), TCliqueOverlap::Intersection(), TAGMUtil::Intersection(), Loss(), TCliqueOverlap::MaxNbrsInCANDNodeId(), TAGMFast::MLENewton(), and TAGMFit::SelectLambdaSum().

1099  {
1100  if (Len()>0) {
1101  if (IsKeyIdEqKeyN()) { return TIter(KeyV.BegI(), KeyV.EndI()); }
1102  int FKeyId=-1; FNextKeyId(FKeyId);
1103  return TIter(KeyV.BegI()+FKeyId, KeyV.EndI()); }
1104  return TIter(KeyV.EndI(), KeyV.EndI());
1105  }
TVec< TSetKey > KeyV
Definition: shash.h:1047
bool IsKeyIdEqKeyN() const
Definition: shash.h:1120
int Len() const
Definition: shash.h:1115
bool FNextKeyId(int &KeyId) const
Definition: shash.h:1335
THashSetKeyI< TKey > TIter
Definition: shash.h:1043

Here is the caller graph for this function:

template<class TKey , class THashFunc >
void THashSet< TKey, THashFunc >::Clr ( const bool &  DoDel = true,
const int &  NoDelLim = -1 
)

Definition at line 1237 of file shash.h.

Referenced by TUndirFFire::BurnGeoFire(), TSnap::CntUniqDirEdges(), TSnap::CntUniqUndirEdges(), TCliqueOverlap::Expand(), TBiConVisitor::FinishNode(), TSnap::GenPrefAttach(), TCliqueOverlap::GetCPMCommunities(), TTimeNENet::GetPrefAttach(), TSnap::GetTriadEdges(), TSnap::GetTriads(), TSnap::GetWccs(), and TLocClustStat::Run().

1237  {
1238  if (DoDel) {
1239  PortV.Clr(); KeyV.Clr();
1240  } else {
1241  PortV.PutAll(TInt(-1));
1242  KeyV.Clr(DoDel, NoDelLim);
1243  }
1244  FFreeKeyId=TInt(-1); FreeKeys=TInt(0);
1245 }
TInt FFreeKeyId
Definition: shash.h:1049
TVec< TSetKey > KeyV
Definition: shash.h:1047
TInt FreeKeys
Definition: shash.h:1049
void Clr(const bool &DoDel=true, const TSizeTy &NoDelLim=-1)
Clears the contents of the vector.
Definition: ds.h:953
void PutAll(const TVal &Val)
Sets all elements of the vector to value Val.
Definition: ds.h:1130
TIntV PortV
Definition: shash.h:1046
Definition: dt.h:1041

Here is the caller graph for this function:

template<class TKey , class THashFunc >
void THashSet< TKey, THashFunc >::Defrag ( )

Definition at line 1360 of file shash.h.

References IAssert.

Referenced by TSnap::TSnapDetail::TGetSubGraph< PGraph, false >::Do(), and THashSet< TInt >::SaveXml().

1360  {
1361  if (!IsKeyIdEqKeyN()) {
1362  THashSet<TKey> Set(PortV.Len());
1363  int KeyId=FFirstKeyId();
1364  while (FNextKeyId(KeyId)) {
1365  Set.AddKey(GetKey(KeyId));
1366  }
1367  Pack();
1368  operator=(Set);
1370  }
1371 }
#define IAssert(Cond)
Definition: bd.h:262
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:535
const TKey & GetKey(const int &KeyId) const
Definition: shash.h:1135
bool IsKeyIdEqKeyN() const
Definition: shash.h:1120
TIntV PortV
Definition: shash.h:1046
THashSet & operator=(const THashSet &Set)
Definition: shash.h:1087
bool FNextKeyId(int &KeyId) const
Definition: shash.h:1335
void Pack()
Definition: shash.h:1154
int FFirstKeyId() const
Definition: shash.h:1148

Here is the caller graph for this function:

template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
bool THashSet< TKey, THashFunc >::DelIfKey ( const TKey &  Key)
inline

Definition at line 1126 of file shash.h.

1126  {
1127  int KeyId; if (IsKey(Key, KeyId)) {DelKeyId(KeyId); return true;} return false;}
void DelKeyId(const int &KeyId)
Definition: shash.h:1128
bool IsKey(const TKey &Key) const
Definition: shash.h:1142
template<class TKey, class THashFunc >
void THashSet< TKey, THashFunc >::DelKey ( const TKey &  Key)

Definition at line 1283 of file shash.h.

References IAssert, and IAssertR.

Referenced by THashSet< TInt >::DelKeyId(), and TCliqueOverlap::Expand().

1283  {
1284  IAssert(!PortV.Empty());
1285  int PortN=abs(THashFunc::GetPrimHashCd(Key)%PortV.Len());
1286  int HashCd=abs(THashFunc::GetSecHashCd(Key));
1287  int PrevKeyId=-1;
1288  int KeyId=PortV[PortN];
1289 
1290  while ((KeyId!=-1) &&
1291  !((KeyV[KeyId].HashCd==HashCd) && (KeyV[KeyId].Key==Key))) {
1292  PrevKeyId=KeyId; KeyId=KeyV[KeyId].Next; }
1293 
1294  IAssertR(KeyId!=-1, Key.GetStr());
1295  if (PrevKeyId==-1) {PortV[PortN]=KeyV[KeyId].Next; }
1296  else {KeyV[PrevKeyId].Next=KeyV[KeyId].Next; }
1297  KeyV[KeyId].Next=FFreeKeyId; FFreeKeyId=KeyId; FreeKeys++;
1298  KeyV[KeyId].HashCd=TInt(-1);
1299  KeyV[KeyId].Key=TKey();
1300 }
#define IAssert(Cond)
Definition: bd.h:262
TInt FFreeKeyId
Definition: shash.h:1049
#define IAssertR(Cond, Reason)
Definition: bd.h:265
TVec< TSetKey > KeyV
Definition: shash.h:1047
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:535
TInt FreeKeys
Definition: shash.h:1049
bool Empty() const
Tests whether the vector is empty.
Definition: ds.h:530
TIntV PortV
Definition: shash.h:1046
Definition: dt.h:1041

Here is the caller graph for this function:

template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
void THashSet< TKey, THashFunc >::DelKeyId ( const int &  KeyId)
inline

Definition at line 1128 of file shash.h.

Referenced by THashSet< TInt >::DelIfKey(), THashSet< TInt >::DelKeyIdV(), and TSnap::GenRewire().

1128 {DelKey(GetKey(KeyId)); }
const TKey & GetKey(const int &KeyId) const
Definition: shash.h:1135
void DelKey(const TKey &Key)
Definition: shash.h:1283

Here is the caller graph for this function:

template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
void THashSet< TKey, THashFunc >::DelKeyIdV ( const TIntV KeyIdV)
inline

Definition at line 1129 of file shash.h.

1129  {
1130  for (int KeyIdN=0; KeyIdN<KeyIdV.Len(); KeyIdN++) {DelKeyId(KeyIdV[KeyIdN]); }}
void DelKeyId(const int &KeyId)
Definition: shash.h:1128
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:535
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
bool THashSet< TKey, THashFunc >::Empty ( ) const
inline

Definition at line 1114 of file shash.h.

Referenced by TCoda::MLEGradAscent(), TCoda::MLEGradAscentParallel(), TAGMFast::MLENewton(), and TLocClustStat::Run().

1114 {return Len()==0; }
int Len() const
Definition: shash.h:1115

Here is the caller graph for this function:

template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
TIter THashSet< TKey, THashFunc >::EndI ( ) const
inline
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
int THashSet< TKey, THashFunc >::FFirstKeyId ( ) const
inline

Definition at line 1148 of file shash.h.

1148 {return 0-1; }
template<class TKey , class THashFunc >
bool THashSet< TKey, THashFunc >::FNextKeyId ( int &  KeyId) const

Definition at line 1335 of file shash.h.

Referenced by THashSet< TInt >::BegI().

1335  {
1336  do {KeyId++; } while ((KeyId<KeyV.Len())&&(KeyV[KeyId].HashCd==-1));
1337  return KeyId<KeyV.Len();
1338 }
TVec< TSetKey > KeyV
Definition: shash.h:1047

Here is the caller graph for this function:

template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
void THashSet< TKey, THashFunc >::Gen ( const int &  ExpectVals)
inline

Definition at line 1109 of file shash.h.

Referenced by TCliqueOverlap::CalculateOverlapMtx(), TCoda::GetCmtyS(), TAGMUtil::GetIntersection(), TAGMUtil::GetNbhCom(), TCesnaUtil::GetNbhCom(), TAGMFastUtil::GetNbhCom(), TBigNet< TNodeData, IsDir >::GetSubGraph(), TSnap::GetWccs(), TTimeNENet::SaveEdgeTm(), and TCesna::SetGraph().

1109  {
1110  PortV.Gen(GetNextPrime(ExpectVals/2)); KeyV.Gen(ExpectVals, 0);
1111  FFreeKeyId=-1; FreeKeys=0; PortV.PutAll(TInt(-1)); }
TInt FFreeKeyId
Definition: shash.h:1049
TVec< TSetKey > KeyV
Definition: shash.h:1047
TInt FreeKeys
Definition: shash.h:1049
void PutAll(const TVal &Val)
Sets all elements of the vector to value Val.
Definition: ds.h:1130
TIntV PortV
Definition: shash.h:1046
Definition: dt.h:1041
uint GetNextPrime(const uint &Val) const
Definition: shash.h:1178
void Gen(const TSizeTy &_Vals)
Constructs a vector (an array) of _Vals elements.
Definition: ds.h:486

Here is the caller graph for this function:

template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
TIter THashSet< TKey, THashFunc >::GetI ( const TKey &  Key) const
inline

Definition at line 1107 of file shash.h.

1107 {return TIter(&KeyV[GetKeyId(Key)], KeyV.EndI()); }
TVec< TSetKey > KeyV
Definition: shash.h:1047
int GetKeyId(const TKey &Key) const
Definition: shash.h:1322
THashSetKeyI< TKey > TIter
Definition: shash.h:1043
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
const TKey& THashSet< TKey, THashFunc >::GetKey ( const int &  KeyId) const
inline

Definition at line 1135 of file shash.h.

Referenced by THashSet< TInt >::DelKeyId(), TSnap::GetTriads(), TCoda::GradientForNode(), TAGMFast::GradientForRow(), TCesna::GradientForRow(), and THashSet< TInt >::MarkDelKeyId().

1135  {
1136  return GetSetKey(KeyId).Key; }
TKey Key
Definition: shash.h:985
TSetKey & GetSetKey(const int &KeyId)
Definition: shash.h:1051

Here is the caller graph for this function:

template<class TKey, class THashFunc >
int THashSet< TKey, THashFunc >::GetKeyId ( const TKey &  Key) const

Definition at line 1322 of file shash.h.

Referenced by TCesna::GetComFromNID(), THashSet< TInt >::GetI(), TBigNet< TNodeData, IsDir >::GetSubGraph(), THashSet< TInt >::IsKey(), TSnap::LoadDyNet(), TSnap::LoadDyNetGraphV(), TTimeNENet::SaveEdgeTm(), TCesna::SetAttrHoldOut(), TCesna::SetCmtyVV(), TCesna::SetGraph(), and TGraphKey::TakeGraph().

1322  {
1323  if (PortV.Empty()) {return -1; }
1324  int PortN=abs(THashFunc::GetPrimHashCd(Key)%PortV.Len());
1325  int HashCd=abs(THashFunc::GetSecHashCd(Key));
1326  int KeyId=PortV[PortN];
1327 
1328  while ((KeyId!=-1) &&
1329  !((KeyV[KeyId].HashCd==HashCd) && (KeyV[KeyId].Key==Key))) {
1330  KeyId=KeyV[KeyId].Next; }
1331  return KeyId;
1332 }
TVec< TSetKey > KeyV
Definition: shash.h:1047
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:535
bool Empty() const
Tests whether the vector is empty.
Definition: ds.h:530
TIntV PortV
Definition: shash.h:1046

Here is the caller graph for this function:

template<class TKey, class THashFunc >
void THashSet< TKey, THashFunc >::GetKeyV ( TVec< TKey > &  KeyV) const

Definition at line 1341 of file shash.h.

References TVec< TVal, TSizeTy >::Add(), and TVec< TVal, TSizeTy >::Clr().

Referenced by TBiConVisitor::FinishNode(), TAGM::GenAGM(), TCesna::GetCmtyVV(), TCliqueOverlap::GetCPMCommunities(), TSnap::GetEdgeBridges(), TLocClustStat::PlotNCPScatter(), and TGStatVec::SaveTxt().

1341  {
1342  KeyV.Clr();
1343  int KeyId=FFirstKeyId();
1344  while (FNextKeyId(KeyId)) {
1345  KeyV.Add(GetKey(KeyId)); }
1346 }
const TKey & GetKey(const int &KeyId) const
Definition: shash.h:1135
void Clr(const bool &DoDel=true, const TSizeTy &NoDelLim=-1)
Clears the contents of the vector.
Definition: ds.h:953
bool FNextKeyId(int &KeyId) const
Definition: shash.h:1335
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:559
int FFirstKeyId() const
Definition: shash.h:1148

Here is the call graph for this function:

Here is the caller graph for this function:

template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
::TSize THashSet< TKey, THashFunc >::GetMemUsed ( ) const
inline

Definition at line 1096 of file shash.h.

1096  {
1097  return PortV.GetMemUsed() + KeyV.GetMemUsed() + sizeof(bool) + 2*sizeof(int); }
TVec< TSetKey > KeyV
Definition: shash.h:1047
TSizeTy GetMemUsed() const
Returns the memory footprint (the number of bytes) of the vector.
Definition: ds.h:474
TIntV PortV
Definition: shash.h:1046
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
int THashSet< TKey, THashFunc >::GetMxKeyIds ( ) const
inline

Definition at line 1118 of file shash.h.

1118 {return KeyV.Len(); }
TVec< TSetKey > KeyV
Definition: shash.h:1047
template<class TKey , class THashFunc >
uint THashSet< TKey, THashFunc >::GetNextPrime ( const uint Val) const
private

Definition at line 1178 of file shash.h.

References THash< TInt, TInt >::HashPrimes, and THash< TInt, TInt >::HashPrimeT.

Referenced by THashSet< TInt >::Gen().

1178  {
1180  int h, len = (int)TIntH::HashPrimes;
1181  while (len > 0) {
1182  h = len >> 1; m = f + h;
1183  if (*m < Val) { f = m; f++; len = len - h - 1; }
1184  else len = h;
1185  }
1186  return f == l ? *(l - 1) : *f;
1187 }
unsigned int uint
Definition: bd.h:11
static const unsigned int HashPrimeT[HashPrimes]
Definition: hash.h:91

Here is the caller graph for this function:

template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
int THashSet< TKey, THashFunc >::GetPorts ( ) const
inline

Definition at line 1116 of file shash.h.

1116 {return PortV.Len(); }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:535
TIntV PortV
Definition: shash.h:1046
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
int THashSet< TKey, THashFunc >::GetReservedKeyIds ( ) const
inline

Definition at line 1119 of file shash.h.

1119 { return KeyV.Reserved(); }
TVec< TSetKey > KeyV
Definition: shash.h:1047
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
int THashSet< TKey, THashFunc >::GetRndKeyId ( TRnd Rnd) const
inline

Definition at line 1138 of file shash.h.

Referenced by TSnap::GenRewire().

1138  {
1140  IAssert(Len()>0);
1141  return Rnd.GetUniDevInt(Len()); }
#define IAssert(Cond)
Definition: bd.h:262
bool IsKeyIdEqKeyN() const
Definition: shash.h:1120
int Len() const
Definition: shash.h:1115
int GetUniDevInt(const int &Range=0)
Definition: dt.cpp:39

Here is the caller graph for this function:

template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
static THashSet<TKey> THashSet< TKey, THashFunc >::GetSet ( const TKey &  Key1)
inlinestatic

Definition at line 1156 of file shash.h.

1156  {
1157  THashSet<TKey> Set(1); Set.AddKey(Key1); return Set;}
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
static THashSet<TKey> THashSet< TKey, THashFunc >::GetSet ( const TKey &  Key1,
const TKey &  Key2 
)
inlinestatic

Definition at line 1158 of file shash.h.

1158  {
1159  THashSet<TKey> Set(2); Set.AddKey(Key1); Set.AddKey(Key2); return Set;}
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
static THashSet<TKey> THashSet< TKey, THashFunc >::GetSet ( const TKey &  Key1,
const TKey &  Key2,
const TKey &  Key3 
)
inlinestatic

Definition at line 1160 of file shash.h.

1160  {
1161  THashSet<TKey> Set(3); Set.AddKey(Key1); Set.AddKey(Key2); Set.AddKey(Key3); return Set;}
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
static THashSet<TKey> THashSet< TKey, THashFunc >::GetSet ( const TKey &  Key1,
const TKey &  Key2,
const TKey &  Key3,
const TKey &  Key4 
)
inlinestatic

Definition at line 1162 of file shash.h.

1162  {
1163  THashSet<TKey> Set(4); Set.AddKey(Key1); Set.AddKey(Key2); Set.AddKey(Key3); Set.AddKey(Key4); return Set;}
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
static THashSet<TKey> THashSet< TKey, THashFunc >::GetSet ( const TKey &  Key1,
const TKey &  Key2,
const TKey &  Key3,
const TKey &  Key4,
const TKey &  Key5 
)
inlinestatic

Definition at line 1164 of file shash.h.

1164  {
1165  THashSet<TKey> Set(5); Set.AddKey(Key1); Set.AddKey(Key2); Set.AddKey(Key3); Set.AddKey(Key4); Set.AddKey(Key5); return Set;}
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
static THashSet<TKey> THashSet< TKey, THashFunc >::GetSet ( const TKey &  Key1,
const TKey &  Key2,
const TKey &  Key3,
const TKey &  Key4,
const TKey &  Key5,
const TKey &  Key6 
)
inlinestatic

Definition at line 1166 of file shash.h.

1166  {
1167  THashSet<TKey> Set(6); Set.AddKey(Key1); Set.AddKey(Key2); Set.AddKey(Key3); Set.AddKey(Key4); Set.AddKey(Key5); Set.AddKey(Key6); return Set;}
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
static THashSet<TKey> THashSet< TKey, THashFunc >::GetSet ( const TKey &  Key1,
const TKey &  Key2,
const TKey &  Key3,
const TKey &  Key4,
const TKey &  Key5,
const TKey &  Key6,
const TKey &  Key7 
)
inlinestatic

Definition at line 1168 of file shash.h.

1168  {
1169  THashSet<TKey> Set(7); Set.AddKey(Key1); Set.AddKey(Key2); Set.AddKey(Key3); Set.AddKey(Key4); Set.AddKey(Key5); Set.AddKey(Key6); Set.AddKey(Key7); return Set;}
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
static THashSet<TKey> THashSet< TKey, THashFunc >::GetSet ( const TKey &  Key1,
const TKey &  Key2,
const TKey &  Key3,
const TKey &  Key4,
const TKey &  Key5,
const TKey &  Key6,
const TKey &  Key7,
const TKey &  Key8 
)
inlinestatic

Definition at line 1170 of file shash.h.

1170  {
1171  THashSet<TKey> Set(8); Set.AddKey(Key1); Set.AddKey(Key2); Set.AddKey(Key3); Set.AddKey(Key4); Set.AddKey(Key5); Set.AddKey(Key6); Set.AddKey(Key7); Set.AddKey(Key8); return Set;}
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
static THashSet<TKey> THashSet< TKey, THashFunc >::GetSet ( const TKey &  Key1,
const TKey &  Key2,
const TKey &  Key3,
const TKey &  Key4,
const TKey &  Key5,
const TKey &  Key6,
const TKey &  Key7,
const TKey &  Key8,
const TKey &  Key9 
)
inlinestatic

Definition at line 1172 of file shash.h.

1172  {
1173  THashSet<TKey> Set(9); Set.AddKey(Key1); Set.AddKey(Key2); Set.AddKey(Key3); Set.AddKey(Key4); Set.AddKey(Key5); Set.AddKey(Key6); Set.AddKey(Key7); Set.AddKey(Key8); Set.AddKey(Key9); return Set;}
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
TSetKey& THashSet< TKey, THashFunc >::GetSetKey ( const int &  KeyId)
inlineprivate

Definition at line 1051 of file shash.h.

Referenced by THashSet< TInt >::GetKey(), and THashSet< TInt >::operator[]().

1051  {
1052  TSetKey& SetKey=KeyV[KeyId];
1053  Assert(SetKey.HashCd!=-1); return SetKey; }
TVec< TSetKey > KeyV
Definition: shash.h:1047
THashSetKey< TKey > TSetKey
Definition: shash.h:1045
#define Assert(Cond)
Definition: bd.h:251

Here is the caller graph for this function:

template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
const TSetKey& THashSet< TKey, THashFunc >::GetSetKey ( const int &  KeyId) const
inlineprivate

Definition at line 1054 of file shash.h.

1054  {
1055  const TSetKey& SetKey=KeyV[KeyId];
1056  Assert(SetKey.HashCd!=-1); return SetKey; }
TVec< TSetKey > KeyV
Definition: shash.h:1047
THashSetKey< TKey > TSetKey
Definition: shash.h:1045
#define Assert(Cond)
Definition: bd.h:251
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
bool THashSet< TKey, THashFunc >::IsAutoSize ( ) const
inline

Definition at line 1117 of file shash.h.

1117 {return AutoSizeP; }
TBool AutoSizeP
Definition: shash.h:1048
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
bool THashSet< TKey, THashFunc >::IsKey ( const TKey &  Key,
int &  KeyId 
) const
inline

Definition at line 1143 of file shash.h.

1143  {
1144  KeyId=GetKeyId(Key); return KeyId!=-1; }
int GetKeyId(const TKey &Key) const
Definition: shash.h:1322
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
bool THashSet< TKey, THashFunc >::IsKeyId ( const int &  KeyId) const
inline

Definition at line 1145 of file shash.h.

1145  {
1146  return (0<=KeyId)&&(KeyId<KeyV.Len())&&(KeyV[KeyId].HashCd!=-1); }
TVec< TSetKey > KeyV
Definition: shash.h:1047
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
bool THashSet< TKey, THashFunc >::IsKeyIdEqKeyN ( ) const
inline

Definition at line 1120 of file shash.h.

Referenced by THashSet< TInt >::BegI(), and THashSet< TInt >::GetRndKeyId().

1120 {return FreeKeys==0; }
TInt FreeKeys
Definition: shash.h:1049

Here is the caller graph for this function:

template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
int THashSet< TKey, THashFunc >::Len ( ) const
inline
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
void THashSet< TKey, THashFunc >::Load ( TSIn SIn)
inline

Definition at line 1072 of file shash.h.

Referenced by TCesna::Load().

1072  {
1073  PortV.Load(SIn); KeyV.Load(SIn);
1074  AutoSizeP=TBool(SIn); FFreeKeyId=TInt(SIn); FreeKeys=TInt(SIn);
1075  SIn.LoadCs(); }
TInt FFreeKeyId
Definition: shash.h:1049
TVec< TSetKey > KeyV
Definition: shash.h:1047
TInt FreeKeys
Definition: shash.h:1049
void Load(TSIn &SIn)
Definition: ds.h:877
void LoadCs()
Definition: fl.cpp:28
TBool AutoSizeP
Definition: shash.h:1048
TIntV PortV
Definition: shash.h:1046
Definition: dt.h:1041
Definition: dt.h:881

Here is the caller graph for this function:

template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
void THashSet< TKey, THashFunc >::LoadXml ( const PXmlTok XmlTok,
const TStr Nm = "" 
)
inline

Definition at line 1080 of file shash.h.

1080  {
1082  for (int KeyN=0; KeyN<KeyV.Len(); KeyN++) {
1083  AddKey(KeyV[KeyN].Key); }}
#define XLoadHd(Nm)
Definition: bd.h:312
TVec< TSetKey > KeyV
Definition: shash.h:1047
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:535
#define XLoad(Nm)
Definition: bd.h:315
TBool AutoSizeP
Definition: shash.h:1048
int AddKey(const TKey &Key)
Definition: shash.h:1248
Vector is a sequence TVal objects representing an array that can change in size.
Definition: ds.h:420
template<class TKey, class THashFunc >
void THashSet< TKey, THashFunc >::MarkDelKey ( const TKey &  Key)

Definition at line 1303 of file shash.h.

References IAssert, and IAssertR.

Referenced by THashSet< TInt >::MarkDelKeyId().

1303  {
1304  IAssert(!PortV.Empty());
1305  int PortN=abs(THashFunc::GetPrimHashCd(Key)%PortV.Len());
1306  int HashCd=abs(THashFunc::GetSecHashCd(Key));
1307  int PrevKeyId=-1;
1308  int KeyId=PortV[PortN];
1309 
1310  while ((KeyId!=-1) &&
1311  !((KeyV[KeyId].HashCd==HashCd) && (KeyV[KeyId].Key==Key))) {
1312  PrevKeyId=KeyId; KeyId=KeyV[KeyId].Next; }
1313 
1314  IAssertR(KeyId!=-1, Key.GetStr());
1315  if (PrevKeyId==-1) {PortV[PortN]=KeyV[KeyId].Next; }
1316  else {KeyV[PrevKeyId].Next=KeyV[KeyId].Next; }
1317  KeyV[KeyId].Next=FFreeKeyId; FFreeKeyId=KeyId; FreeKeys++;
1318  KeyV[KeyId].HashCd=TInt(-1);
1319 }
#define IAssert(Cond)
Definition: bd.h:262
TInt FFreeKeyId
Definition: shash.h:1049
#define IAssertR(Cond, Reason)
Definition: bd.h:265
TVec< TSetKey > KeyV
Definition: shash.h:1047
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:535
TInt FreeKeys
Definition: shash.h:1049
bool Empty() const
Tests whether the vector is empty.
Definition: ds.h:530
TIntV PortV
Definition: shash.h:1046
Definition: dt.h:1041

Here is the caller graph for this function:

template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
void THashSet< TKey, THashFunc >::MarkDelKeyId ( const int &  KeyId)
inline

Definition at line 1133 of file shash.h.

1133 {MarkDelKey(GetKey(KeyId)); }
const TKey & GetKey(const int &KeyId) const
Definition: shash.h:1135
void MarkDelKey(const TKey &Key)
Definition: shash.h:1303
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
THashSet& THashSet< TKey, THashFunc >::operator= ( const THashSet< TKey, THashFunc > &  Set)
inline

Definition at line 1087 of file shash.h.

1087  {
1088  if (this!=&Set) {
1089  PortV=Set.PortV; KeyV=Set.KeyV; AutoSizeP=Set.AutoSizeP;
1091  return *this; }
TInt FFreeKeyId
Definition: shash.h:1049
TVec< TSetKey > KeyV
Definition: shash.h:1047
TInt FreeKeys
Definition: shash.h:1049
TBool AutoSizeP
Definition: shash.h:1048
TIntV PortV
Definition: shash.h:1046
template<class TKey , class THashFunc >
bool THashSet< TKey, THashFunc >::operator== ( const THashSet< TKey, THashFunc > &  Set) const

Definition at line 1228 of file shash.h.

References THashSet< TKey, THashFunc >::IsKey(), and THashSet< TKey, THashFunc >::Len().

1228  {
1229  if (Len() != Set.Len()) { return false; }
1230  for (int k = FFirstKeyId(); FNextKeyId(k); k++) {
1231  if (! Set.IsKey(GetKey(k))) { return false; }
1232  }
1233  return true;
1234 }
bool IsKey(const TKey &Key) const
Definition: shash.h:1142
const TKey & GetKey(const int &KeyId) const
Definition: shash.h:1135
int Len() const
Definition: shash.h:1115
bool FNextKeyId(int &KeyId) const
Definition: shash.h:1335
int FFirstKeyId() const
Definition: shash.h:1148

Here is the call graph for this function:

template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
const TKey& THashSet< TKey, THashFunc >::operator[] ( const int &  KeyId) const
inline

Definition at line 1093 of file shash.h.

1093 {return GetSetKey(KeyId).Key; }
TKey Key
Definition: shash.h:985
TSetKey & GetSetKey(const int &KeyId)
Definition: shash.h:1051
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
TKey& THashSet< TKey, THashFunc >::operator[] ( const int &  KeyId)
inline

Definition at line 1094 of file shash.h.

1094 {return GetSetKey(KeyId).Key; }
TKey Key
Definition: shash.h:985
TSetKey & GetSetKey(const int &KeyId)
Definition: shash.h:1051
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
void THashSet< TKey, THashFunc >::Pack ( )
inline

Definition at line 1154 of file shash.h.

1154 {KeyV.Pack(); }
TVec< TSetKey > KeyV
Definition: shash.h:1047
template<class TKey , class THashFunc >
void THashSet< TKey, THashFunc >::Resize ( )
private

Definition at line 1190 of file shash.h.

References THashSetKey< TKey >::HashCd, THashSetKey< TKey >::Key, and THashSetKey< TKey >::Next.

1190  {
1191  // resize & initialize port vector
1192  if (PortV.Len()==0) {PortV.Gen(17); }
1193  else if (AutoSizeP&&(KeyV.Len()>2*PortV.Len())) {
1194  PortV.Gen(GetNextPrime(PortV.Len()+1));
1195  } else {
1196  return;
1197  }
1198  PortV.PutAll(TInt(-1));
1199  // reSet keys
1200  for (int KeyId=0; KeyId<KeyV.Len(); KeyId++) {
1201  TSetKey& SetKey=KeyV[KeyId];
1202  if (SetKey.HashCd!=-1) {
1203  int PortN=abs(THashFunc::GetPrimHashCd(SetKey.Key)%PortV.Len());
1204  SetKey.Next=PortV[PortN];
1205  PortV[PortN]=KeyId;
1206  }
1207  }
1208 }
TVec< TSetKey > KeyV
Definition: shash.h:1047
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:535
void PutAll(const TVal &Val)
Sets all elements of the vector to value Val.
Definition: ds.h:1130
TBool AutoSizeP
Definition: shash.h:1048
THashSetKey< TKey > TSetKey
Definition: shash.h:1045
TIntV PortV
Definition: shash.h:1046
Definition: dt.h:1041
uint GetNextPrime(const uint &Val) const
Definition: shash.h:1178
void Gen(const TSizeTy &_Vals)
Constructs a vector (an array) of _Vals elements.
Definition: ds.h:486
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
void THashSet< TKey, THashFunc >::Save ( TSOut SOut) const
inline

Definition at line 1076 of file shash.h.

Referenced by TCesna::Save().

1076  {
1077  PortV.Save(SOut); KeyV.Save(SOut);
1078  AutoSizeP.Save(SOut); FFreeKeyId.Save(SOut); FreeKeys.Save(SOut);
1079  SOut.SaveCs(); }
TInt FFreeKeyId
Definition: shash.h:1049
TVec< TSetKey > KeyV
Definition: shash.h:1047
void Save(TSOut &SOut) const
Definition: dt.h:1057
TInt FreeKeys
Definition: shash.h:1049
void Save(TSOut &SOut) const
Definition: dt.h:902
void Save(TSOut &SOut) const
Definition: ds.h:885
void SaveCs()
Definition: fl.h:171
TBool AutoSizeP
Definition: shash.h:1048
TIntV PortV
Definition: shash.h:1046

Here is the caller graph for this function:

template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
void THashSet< TKey, THashFunc >::SaveXml ( TSOut SOut,
const TStr Nm 
)
inline

Definition at line 1084 of file shash.h.

1084  {
1085  Defrag(); XSaveHd(Nm); XSave(KeyV); XSave(AutoSizeP); }
void Defrag()
Definition: shash.h:1360
TVec< TSetKey > KeyV
Definition: shash.h:1047
#define XSaveHd(Nm)
Definition: bd.h:318
#define XSave(Nm)
Definition: bd.h:333
TBool AutoSizeP
Definition: shash.h:1048
template<class TKey , class THashFunc >
void THashSet< TKey, THashFunc >::Swap ( THashSet< TKey, THashFunc > &  Set)

Definition at line 1349 of file shash.h.

References THashSet< TKey, THashFunc >::AutoSizeP, THashSet< TKey, THashFunc >::FFreeKeyId, THashSet< TKey, THashFunc >::FreeKeys, THashSet< TKey, THashFunc >::KeyV, THashSet< TKey, THashFunc >::PortV, and Swap().

1349  {
1350  if (this!=&Set) {
1351  PortV.Swap(Set.PortV);
1352  KeyV.Swap(Set.KeyV);
1353  ::Swap(AutoSizeP, Set.AutoSizeP);
1355  ::Swap(FreeKeys, Set.FreeKeys);
1356  }
1357 }
TInt FFreeKeyId
Definition: shash.h:1049
TVec< TSetKey > KeyV
Definition: shash.h:1047
TInt FreeKeys
Definition: shash.h:1049
void Swap(TVec< TVal, TSizeTy > &Vec)
Swaps the contents of the vector with Vec.
Definition: ds.h:1011
TBool AutoSizeP
Definition: shash.h:1048
TIntV PortV
Definition: shash.h:1046
void Swap(THashSet &Set)
Definition: shash.h:1349

Here is the call graph for this function:

Member Data Documentation

template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
TBool THashSet< TKey, THashFunc >::AutoSizeP
private
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
TInt THashSet< TKey, THashFunc >::FFreeKeyId
private
template<class TKey, class THashFunc = TDefaultHashFunc<TKey>>
TInt THashSet< TKey, THashFunc >::FreeKeys
private

The documentation for this class was generated from the following file: