SNAP Library, User Reference
2012-10-02 12:56:23
SNAP, a general purpose network analysis and graph mining library
|
Classes | |
class | THashKeyDatCmp |
Public Types | |
enum | { HashPrimes = 32 } |
typedef THashKeyDatI< TKey, TDat > | TIter |
Public Member Functions | |
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 |
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) |
void | 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. | |
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). | |
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) |
Static Public Attributes | |
static const unsigned int | HashPrimeT [HashPrimes] |
typedef THashKeyDatI<TKey, TDat> THash< TKey, TDat, THashFunc >::TIter |
anonymous enum |
THash< TKey, TDat, THashFunc >::THash | ( | ) | [inline] |
THash< TKey, TDat, THashFunc >::THash | ( | const THash< TKey, TDat, THashFunc > & | Hash | ) | [inline] |
THash< TKey, TDat, THashFunc >::THash | ( | const int & | ExpectVals, |
const bool & | _AutoSizeP = false |
||
) | [explicit] |
THash< TKey, TDat, THashFunc >::THash | ( | TSIn & | SIn | ) | [inline, explicit] |
TDat& THash< TKey, TDat, THashFunc >::AddDat | ( | const TKey & | Key | ) | [inline] |
TDat& THash< TKey, TDat, THashFunc >::AddDat | ( | const TKey & | Key, |
const TDat & | Dat | ||
) | [inline] |
TDat& THash< TKey, TDat, THashFunc >::AddDatId | ( | const TKey & | Key | ) | [inline] |
int THash< TKey, TDat, THashFunc >::AddKey | ( | const TKey & | Key | ) |
TIter THash< TKey, TDat, THashFunc >::BegI | ( | ) | const [inline] |
void THash< TKey, TDat, THashFunc >::Clr | ( | const bool & | DoDel = true , |
const int & | NoDelLim = -1 , |
||
const bool & | ResetDat = true |
||
) |
void THash< TKey, TDat, THashFunc >::Defrag | ( | ) |
void THash< TKey, TDat, THashFunc >::DelIfKey | ( | const TKey & | Key | ) | [inline] |
void THash< TKey, TDat, THashFunc >::DelKey | ( | const TKey & | Key | ) |
void THash< TKey, TDat, THashFunc >::DelKeyId | ( | const int & | KeyId | ) | [inline] |
void THash< TKey, TDat, THashFunc >::DelKeyIdV | ( | const TIntV & | KeyIdV | ) | [inline] |
bool THash< TKey, TDat, THashFunc >::Empty | ( | ) | const [inline] |
TIter THash< TKey, TDat, THashFunc >::EndI | ( | ) | const [inline] |
int THash< TKey, TDat, THashFunc >::FFirstKeyId | ( | ) | const [inline] |
bool THash< TKey, TDat, THashFunc >::FNextKeyId | ( | int & | KeyId | ) | const |
void THash< TKey, TDat, THashFunc >::Gen | ( | const int & | ExpectVals | ) | [inline] |
const TDat& THash< TKey, TDat, THashFunc >::GetDat | ( | const TKey & | Key | ) | const [inline] |
TDat& THash< TKey, TDat, THashFunc >::GetDat | ( | const TKey & | Key | ) | [inline] |
void THash< TKey, TDat, THashFunc >::GetDatKeyKdV | ( | TVec< TKeyDat< TDat, TKey > > & | DatKeyKdV | ) | const |
void THash< TKey, TDat, THashFunc >::GetDatKeyPrV | ( | TVec< TPair< TDat, TKey > > & | DatKeyPrV | ) | const |
void THash< TKey, TDat, THashFunc >::GetDatV | ( | TVec< TDat > & | DatV | ) | const |
TIter THash< TKey, TDat, THashFunc >::GetI | ( | const TKey & | Key | ) | const [inline] |
const TKey& THash< TKey, TDat, THashFunc >::GetKey | ( | const int & | KeyId | ) | const [inline] |
void THash< TKey, TDat, THashFunc >::GetKeyDat | ( | const int & | KeyId, |
TKey & | Key, | ||
TDat & | Dat | ||
) | const [inline] |
void THash< TKey, TDat, THashFunc >::GetKeyDatKdV | ( | TVec< TKeyDat< TKey, TDat > > & | KeyDatKdV | ) | const |
void THash< TKey, TDat, THashFunc >::GetKeyDatPrV | ( | TVec< TPair< TKey, TDat > > & | KeyDatPrV | ) | const |
int THash< TKey, TDat, THashFunc >::GetKeyId | ( | const TKey & | Key | ) | const |
void THash< TKey, TDat, THashFunc >::GetKeyV | ( | TVec< TKey > & | KeyV | ) | const |
::TSize THash< TKey, TDat, THashFunc >::GetMemUsed | ( | ) | const [inline] |
int THash< TKey, TDat, THashFunc >::GetMxKeyIds | ( | ) | const [inline] |
int THash< TKey, TDat, THashFunc >::GetPorts | ( | ) | const [inline] |
int THash< TKey, TDat, THashFunc >::GetReservedKeyIds | ( | ) | const [inline] |
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.
int THash< TKey, TDat, THashFunc >::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).
bool THash< TKey, TDat, THashFunc >::IsAutoSize | ( | ) | const [inline] |
bool THash< TKey, TDat, THashFunc >::IsKey | ( | const TKey & | Key | ) | const [inline] |
bool THash< TKey, TDat, THashFunc >::IsKey | ( | const TKey & | Key, |
int & | KeyId | ||
) | const [inline] |
bool THash< TKey, TDat, THashFunc >::IsKeyGetDat | ( | const TKey & | Key, |
TDat & | Dat | ||
) | const [inline] |
bool THash< TKey, TDat, THashFunc >::IsKeyId | ( | const int & | KeyId | ) | const [inline] |
bool THash< TKey, TDat, THashFunc >::IsKeyIdEqKeyN | ( | ) | const [inline] |
int THash< TKey, TDat, THashFunc >::Len | ( | ) | const [inline] |
void THash< TKey, TDat, THashFunc >::Load | ( | TSIn & | SIn | ) | [inline] |
void THash< TKey, TDat, THashFunc >::LoadXml | ( | const PXmlTok & | XmlTok, |
const TStr & | Nm = "" |
||
) |
void THash< TKey, TDat, THashFunc >::MarkDelKey | ( | const TKey & | Key | ) |
void THash< TKey, TDat, THashFunc >::MarkDelKeyId | ( | const int & | KeyId | ) | [inline] |
TDat& THash< TKey, TDat, THashFunc >::operator() | ( | const TKey & | Key | ) | [inline] |
bool THash< TKey, TDat, THashFunc >::operator< | ( | const THash< TKey, TDat, THashFunc > & | Hash | ) | const [inline] |
THash& THash< TKey, TDat, THashFunc >::operator= | ( | const THash< TKey, TDat, THashFunc > & | Hash | ) | [inline] |
bool THash< TKey, TDat, THashFunc >::operator== | ( | const THash< TKey, TDat, THashFunc > & | Hash | ) | const |
const TDat& THash< TKey, TDat, THashFunc >::operator[] | ( | const int & | KeyId | ) | const [inline] |
TDat& THash< TKey, TDat, THashFunc >::operator[] | ( | const int & | KeyId | ) | [inline] |
void THash< TKey, TDat, THashFunc >::Pack | ( | ) | [inline] |
void THash< TKey, TDat, THashFunc >::Save | ( | TSOut & | SOut | ) | const [inline] |
void THash< TKey, TDat, THashFunc >::SaveXml | ( | TSOut & | SOut, |
const TStr & | Nm | ||
) |
void THash< TKey, TDat, THashFunc >::Sort | ( | const bool & | CmpKey, |
const bool & | Asc | ||
) |
void THash< TKey, TDat, THashFunc >::SortByDat | ( | const bool & | Asc = true | ) | [inline] |
void THash< TKey, TDat, THashFunc >::SortByKey | ( | const bool & | Asc = true | ) | [inline] |
void THash< TKey, TDat, THashFunc >::Swap | ( | THash< TKey, TDat, THashFunc > & | Hash | ) |
const unsigned int THash< TKey, TDat, THashFunc >::HashPrimeT [static] |
{ 3ul, 5ul, 11ul, 23ul, 53ul, 97ul, 193ul, 389ul, 769ul, 1543ul, 3079ul, 6151ul, 12289ul, 24593ul, 49157ul, 98317ul, 196613ul, 393241ul, 786433ul, 1572869ul, 3145739ul, 6291469ul, 12582917ul, 25165843ul, 50331653ul, 100663319ul, 201326611ul, 402653189ul, 805306457ul, 1610612741ul, 3221225473ul, 4294967291ul }