SNAP Library 6.0, User Reference
2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <shash.h>
Public Types | |
typedef TSHashKeyDat< TKey, TDat > | THashKeyDat |
typedef TSparseTable< THashKeyDat, GroupSize >::TIter | TIter |
typedef TSparseTable< THashKeyDat, GroupSize >::TSGroup | TSGroup |
Public Member Functions | |
TSparseHash (const int &WantedVals=0) | |
TSparseHash (TSIn &SIn) | |
void | Load (TSIn &SIn) |
void | Save (TSOut &SOut) const |
TSparseHash & | operator= (const TSparseHash &SHT) |
bool | operator== (const TSparseHash &SHT) const |
bool | operator< (const TSparseHash &SHT) const |
::TSize | GetMemUsed () const |
TIter | BegI () const |
TIter | EndI () const |
TIter | GetI (const TKey &Key) const |
bool | Empty () const |
int | Len () const |
int | Reserved () const |
uint | GetDiskSz () const |
void | Reserve (const int &MxVals) |
void | Clr (const bool &DoDel=true) |
void | Swap (TSparseHash &HT) |
int | AddKey (const TKey &Key) |
TDat & | AddDat (const TKey &Key) |
TDat & | AddDat (const TKey &Key, const TDat &Dat) |
const TKey & | GetKey (const int &KeyId) const |
int | GetKeyId (const TKey &Key) const |
bool | IsKey (const TKey &Key) const |
bool | IsKey (const TKey &Key, int &KeyId) const |
bool | IsKeyId (const int &KeyId) const |
int | GetRndKeyId (TRnd &Rnd=TInt::Rnd) const |
const TDat & | GetDat (const TKey &Key) const |
TDat & | GetDat (const TKey &Key) |
const TDat & | GetDatKeyId (const int &KeyId) const |
TDat & | GetDatKeyId (const int &KeyId) |
void | GetKeyDat (const int &KeyId, TKey &Key, TDat &Dat) const |
bool | IsKeyGetDat (const TKey &Key, TDat &Dat) 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 |
Static Public Attributes | |
static const float | MxOccupancy = 0.8f |
static const float | MnOccupancy = 0.4f * 0.8f |
static const int | MinBuckets = 32 |
Private Member Functions | |
void | ResetThresh () |
int | GetMinSize (const int &CurVals, const int &WantedVals) const |
void | CopyFrom (const TSparseHash &HT, const int &MnWanted) |
void | MoveFrom (TSparseHash &HT, const int &MnWanted) |
void | ResizeDelta (const int &ValsToAdd, const int &MnWanted=0) |
void | FindPos (const TKey &Key, int &Pos, int &PosToIns) const |
Private Attributes | |
TInt | ShrinkThresh |
TInt | ExpandThresh |
TSparseTable< THashKeyDat, GroupSize > | Table |
typedef TSHashKeyDat<TKey, TDat> TSparseHash< TKey, TDat, GroupSize >::THashKeyDat |
typedef TSparseTable<THashKeyDat, GroupSize>::TIter TSparseHash< TKey, TDat, GroupSize >::TIter |
typedef TSparseTable<THashKeyDat, GroupSize>::TSGroup TSparseHash< TKey, TDat, GroupSize >::TSGroup |
|
inline |
Definition at line 494 of file shash.h.
|
inline |
TDat & TSparseHash< TKey, TDat, GroupSize >::AddDat | ( | const TKey & | Key | ) |
Definition at line 687 of file shash.h.
TDat & TSparseHash< TKey, TDat, GroupSize >::AddDat | ( | const TKey & | Key, |
const TDat & | Dat | ||
) |
Definition at line 696 of file shash.h.
int TSparseHash< TKey, TDat, GroupSize >::AddKey | ( | const TKey & | Key | ) |
Definition at line 676 of file shash.h.
|
inline |
|
inline |
|
private |
Definition at line 568 of file shash.h.
|
inline |
|
inline |
|
private |
const TDat & TSparseHash< TKey, TDat, GroupSize >::GetDat | ( | const TKey & | Key | ) | const |
Definition at line 705 of file shash.h.
TDat & TSparseHash< TKey, TDat, GroupSize >::GetDat | ( | const TKey & | Key | ) |
Definition at line 713 of file shash.h.
|
inline |
|
inline |
void TSparseHash< TKey, TDat, GroupSize >::GetDatKeyPrV | ( | TVec< TPair< TDat, TKey > > & | DatKeyPrV | ) | const |
void TSparseHash< TKey, TDat, GroupSize >::GetDatV | ( | TVec< TDat > & | DatV | ) | const |
|
inline |
|
inline |
|
inline |
void TSparseHash< TKey, TDat, GroupSize >::GetKeyDat | ( | const int & | KeyId, |
TKey & | Key, | ||
TDat & | Dat | ||
) | const |
void TSparseHash< TKey, TDat, GroupSize >::GetKeyDatPrV | ( | TVec< TPair< TKey, TDat > > & | KeyDatPrV | ) | const |
|
inline |
Definition at line 522 of file shash.h.
void TSparseHash< TKey, TDat, GroupSize >::GetKeyV | ( | TVec< TKey > & | KeyV | ) | const |
|
inline |
|
private |
|
inline |
|
inline |
|
inline |
bool TSparseHash< TKey, TDat, GroupSize >::IsKeyGetDat | ( | const TKey & | Key, |
TDat & | Dat | ||
) | const |
|
inline |
|
inline |
|
inline |
|
private |
Definition at line 591 of file shash.h.
bool TSparseHash< TKey, TDat, GroupSize >::operator< | ( | const TSparseHash< TKey, TDat, GroupSize > & | SHT | ) | const |
TSparseHash< TKey, TDat, GroupSize > & TSparseHash< TKey, TDat, GroupSize >::operator= | ( | const TSparseHash< TKey, TDat, GroupSize > & | SHT | ) |
bool TSparseHash< TKey, TDat, GroupSize >::operator== | ( | const TSparseHash< TKey, TDat, GroupSize > & | SHT | ) | const |
|
inline |
Definition at line 513 of file shash.h.
|
inline |
|
private |
|
private |
Definition at line 618 of file shash.h.
|
inline |
void TSparseHash< TKey, TDat, GroupSize >::Swap | ( | TSparseHash< TKey, TDat, GroupSize > & | HT | ) |
|
private |
|
static |
|
static |
|
static |
|
private |
|
private |