| 
    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 
   | 
 
#include <shash.h>

Public Types | |
| typedef TSparseTable< TKey,  GroupSize >::TIter  | TIter | 
| typedef TSparseTable< TKey,  GroupSize >::TSGroup  | TSGroup | 
Public Member Functions | |
| TSparseSet (const int &WantedVals=0) | |
| TSparseSet (TSIn &SIn) | |
| void | Load (TSIn &SIn) | 
| void | Save (TSOut &SOut) const | 
| TSparseSet & | operator= (const TSparseSet &SSet) | 
| bool | operator== (const TSparseSet &SSet) const | 
| bool | operator< (const TSparseSet &SSet) const | 
| ::TSize | GetMemUsed () const | 
| TIter | BegI () const | 
| TIter | EndI () const | 
| TIter | GetI (const int &KeyId) 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 (TSparseSet &SSet) | 
| int | AddKey (const TKey &Key) | 
| 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 | 
| void | GetKeyV (TVec< TKey > &KeyV) 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 TSparseSet &SSet, const int &MnWanted) | 
| void | MoveFrom (TSparseSet &SSet, 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< TKey, GroupSize > | Table | 
| typedef TSparseTable<TKey, GroupSize>::TIter TSparseSet< TKey, GroupSize >::TIter | 
| typedef TSparseTable<TKey, GroupSize>::TSGroup TSparseSet< TKey, GroupSize >::TSGroup | 
      
  | 
  inline | 
Definition at line 791 of file shash.h.
References TSparseSet< TKey, GroupSize >::ResetThresh().

      
  | 
  inline | 
| int TSparseSet< TKey, GroupSize >::AddKey | ( | const TKey & | Key | ) | 
Definition at line 960 of file shash.h.
      
  | 
  inline | 
Definition at line 801 of file shash.h.
References TSparseTable< TVal, GroupSize >::BegI(), and TSparseSet< TKey, GroupSize >::Table.

      
  | 
  inline | 
Definition at line 811 of file shash.h.
References TSparseTable< TVal, GroupSize >::Clr(), TSparseSet< TKey, GroupSize >::ResetThresh(), and TSparseSet< TKey, GroupSize >::Table.

      
  | 
  private | 
Definition at line 852 of file shash.h.
References Assert, TSparseTable< TVal, GroupSize >::GetGroup(), TSparseTable< TVal, GroupSize >::Groups(), TSparseSet< TKey, GroupSize >::Reserved(), and TSparseSet< TKey, GroupSize >::Table.

      
  | 
  inline | 
Definition at line 805 of file shash.h.
References TSparseSet< TKey, GroupSize >::Len().

      
  | 
  inline | 
Definition at line 802 of file shash.h.
References TSparseTable< TVal, GroupSize >::EndI(), and TSparseSet< TKey, GroupSize >::Table.

      
  | 
  private | 
Definition at line 915 of file shash.h.
References Assert.
Referenced by TSparseSet< TKey, GroupSize >::GetKeyId().

      
  | 
  inline | 
Definition at line 808 of file shash.h.
References TSparseTable< TVal, GroupSize >::GetDiskSz(), and TSparseSet< TKey, GroupSize >::Table.

      
  | 
  inline | 
Definition at line 803 of file shash.h.
References Assert, TSparseTable< TVal, GroupSize >::GetI(), TSparseSet< TKey, GroupSize >::IsKeyId(), and TSparseSet< TKey, GroupSize >::Table.

      
  | 
  inline | 
Definition at line 815 of file shash.h.
References TSparseTable< TVal, GroupSize >::Get(), and TSparseSet< TKey, GroupSize >::Table.

      
  | 
  inline | 
Definition at line 816 of file shash.h.
References TSparseSet< TKey, GroupSize >::FindPos().
Referenced by TSparseSet< TKey, GroupSize >::IsKey().


| void TSparseSet< TKey, GroupSize >::GetKeyV | ( | TVec< TKey > & | KeyV | ) | const | 
Definition at line 971 of file shash.h.
References TVec< TVal, TSizeTy >::Add(), and TVec< TVal, TSizeTy >::Gen().

      
  | 
  inline | 
Definition at line 799 of file shash.h.
References TSparseTable< TVal, GroupSize >::GetMemUsed(), and TSparseSet< TKey, GroupSize >::Table.

      
  | 
  private | 
      
  | 
  inline | 
Definition at line 822 of file shash.h.
References Assert, TSparseSet< TKey, GroupSize >::IsKeyId(), TSparseSet< TKey, GroupSize >::Len(), and TSparseSet< TKey, GroupSize >::Reserved().

      
  | 
  inline | 
Definition at line 818 of file shash.h.
References TSparseSet< TKey, GroupSize >::GetKeyId().

      
  | 
  inline | 
Definition at line 819 of file shash.h.
References TSparseSet< TKey, GroupSize >::GetKeyId().

      
  | 
  inline | 
Definition at line 821 of file shash.h.
References TSparseTable< TVal, GroupSize >::IsEmpty(), and TSparseSet< TKey, GroupSize >::Table.
Referenced by TSparseSet< TKey, GroupSize >::GetI(), and TSparseSet< TKey, GroupSize >::GetRndKeyId().


      
  | 
  inline | 
Definition at line 806 of file shash.h.
References TSparseTable< TVal, GroupSize >::Len(), and TSparseSet< TKey, GroupSize >::Table.
Referenced by TSparseSet< TKey, GroupSize >::Empty(), TSparseSet< TKey, GroupSize >::GetRndKeyId(), and TSparseSet< TKey, GroupSize >::Reserve().


      
  | 
  inline | 
Definition at line 793 of file shash.h.
References TSparseSet< TKey, GroupSize >::ExpandThresh, TSparseTable< TVal, GroupSize >::Load(), TInt::Load(), TSparseSet< TKey, GroupSize >::ShrinkThresh, and TSparseSet< TKey, GroupSize >::Table.

      
  | 
  private | 
Definition at line 875 of file shash.h.
References Assert, TSparseTable< TVal, GroupSize >::GetGroup(), TSparseTable< TVal, GroupSize >::Groups(), TSparseSet< TKey, GroupSize >::Reserved(), and TSparseSet< TKey, GroupSize >::Table.
Referenced by TSparseSet< TKey, GroupSize >::ResizeDelta().


| bool TSparseSet< TKey, GroupSize >::operator< | ( | const TSparseSet< TKey, GroupSize > & | SSet | ) | const | 
| TSparseSet< TKey, GroupSize > & TSparseSet< TKey, GroupSize >::operator= | ( | const TSparseSet< TKey, GroupSize > & | SSet | ) | 
Definition at line 933 of file shash.h.
References TSparseSet< TKey, GroupSize >::ExpandThresh, TSparseSet< TKey, GroupSize >::ShrinkThresh, and TSparseSet< TKey, GroupSize >::Table.
| bool TSparseSet< TKey, GroupSize >::operator== | ( | const TSparseSet< TKey, GroupSize > & | SSet | ) | const | 
      
  | 
  inline | 
Definition at line 810 of file shash.h.
References TSparseSet< TKey, GroupSize >::Len(), and TSparseSet< TKey, GroupSize >::ResizeDelta().

      
  | 
  inline | 
Definition at line 807 of file shash.h.
References TSparseTable< TVal, GroupSize >::Reserved(), and TSparseSet< TKey, GroupSize >::Table.
Referenced by TSparseSet< TKey, GroupSize >::CopyFrom(), TSparseSet< TKey, GroupSize >::GetRndKeyId(), and TSparseSet< TKey, GroupSize >::MoveFrom().


      
  | 
  private | 
Definition at line 839 of file shash.h.
Referenced by TSparseSet< TKey, GroupSize >::Clr(), TSparseSet< TKey, GroupSize >::ResizeDelta(), and TSparseSet< TKey, GroupSize >::TSparseSet().

      
  | 
  private | 
Definition at line 902 of file shash.h.
References TSparseSet< TKey, GroupSize >::MoveFrom(), TSparseSet< TKey, GroupSize >::ResetThresh(), and Swap().
Referenced by TSparseSet< TKey, GroupSize >::Reserve().


      
  | 
  inline | 
Definition at line 794 of file shash.h.
References TSparseSet< TKey, GroupSize >::ExpandThresh, TSparseTable< TVal, GroupSize >::Save(), TInt::Save(), TSparseSet< TKey, GroupSize >::ShrinkThresh, and TSparseSet< TKey, GroupSize >::Table.

| void TSparseSet< TKey, GroupSize >::Swap | ( | TSparseSet< TKey, GroupSize > & | SSet | ) | 
Definition at line 953 of file shash.h.
References TSparseSet< TKey, GroupSize >::ExpandThresh, TSparseSet< TKey, GroupSize >::ShrinkThresh, Swap(), and TSparseSet< TKey, GroupSize >::Table.

      
  | 
  private | 
Definition at line 788 of file shash.h.
Referenced by TSparseSet< TKey, GroupSize >::Load(), TSparseSet< TKey, GroupSize >::operator=(), TSparseSet< TKey, GroupSize >::Save(), and TSparseSet< TKey, GroupSize >::Swap().
      
  | 
  static | 
      
  | 
  static | 
      
  | 
  static | 
      
  | 
  private | 
Definition at line 788 of file shash.h.
Referenced by TSparseSet< TKey, GroupSize >::Load(), TSparseSet< TKey, GroupSize >::operator=(), TSparseSet< TKey, GroupSize >::Save(), and TSparseSet< TKey, GroupSize >::Swap().
      
  | 
  private | 
Definition at line 789 of file shash.h.
Referenced by TSparseSet< TKey, GroupSize >::BegI(), TSparseSet< TKey, GroupSize >::Clr(), TSparseSet< TKey, GroupSize >::CopyFrom(), TSparseSet< TKey, GroupSize >::EndI(), TSparseSet< TKey, GroupSize >::GetDiskSz(), TSparseSet< TKey, GroupSize >::GetI(), TSparseSet< TKey, GroupSize >::GetKey(), TSparseSet< TKey, GroupSize >::GetMemUsed(), TSparseSet< TKey, GroupSize >::IsKeyId(), TSparseSet< TKey, GroupSize >::Len(), TSparseSet< TKey, GroupSize >::Load(), TSparseSet< TKey, GroupSize >::MoveFrom(), TSparseSet< TKey, GroupSize >::operator<(), TSparseSet< TKey, GroupSize >::operator=(), TSparseSet< TKey, GroupSize >::operator==(), TSparseSet< TKey, GroupSize >::Reserved(), TSparseSet< TKey, GroupSize >::Save(), and TSparseSet< TKey, GroupSize >::Swap().