|
| TGHash (const bool &HashTrees, const int &MaxIsoCheck=8, const int &MaxSvdGraph=500) |
| Default contructor. More...
|
|
| TGHash (TSIn &SIn) |
|
void | Save (TSOut &SOut) const |
|
const TDat & | operator[] (const int &KeyId) const |
| Accesses the data at hash table position index KeyId. More...
|
|
TDat & | operator[] (const int &KeyId) |
| Accesses the data at hash table position index KeyId. More...
|
|
const TDat & | operator() (const TGraphKey &Key) const |
| Accesses the data of graph-key Key. More...
|
|
TDat & | operator() (const TGraphKey &Key) |
| Accesses the data of graph-key Key. More...
|
|
TIter | BegI () const |
| Returns iterator to the first element of the hash table. More...
|
|
TIter | EndI () const |
| Returns iterator to one past the last element of the hash table. More...
|
|
TIter | GetI (const int &KeyId) const |
| Returns iterator to a key at position index KeyId. More...
|
|
bool | HashTrees () const |
| Returns whether the hash table only hashes trees and not arbitrary directed graphs. More...
|
|
void | Gen (const int &ExpectVals) |
| Initializes the hash table for the expected number of keys ExpectVals. More...
|
|
void | Clr (const bool &DoDel=true, const int &NoDelLim=-1) |
| Removes all the elements from the hash table. More...
|
|
bool | Empty () const |
| Tests whether the hash table is empty. More...
|
|
int | Len () const |
| Returns the number of keys in the hash table. More...
|
|
int | GetPorts () const |
| Returns the number of ports in the hash table. More...
|
|
bool | IsAutoSize () const |
| Tests whether the hash table automatically adjusts the number of ports based on the number of keys. More...
|
|
int | GetMxKeyIds () const |
| Returns the maximum key Id of any element in the hash table. More...
|
|
bool | IsKeyIdEqKeyN () const |
| Tests whether there are any unused slots in the hash table. More...
|
|
int | AddKey (const PNGraph &Graph) |
| Adds a key Graph to the table and returns its KeyId. More...
|
|
TDat & | AddDat (const PNGraph &Graph) |
| Adds a key Graph to the table and returns its data value. More...
|
|
TDat & | AddDat (const PNGraph &Graph, const TDat &Dat) |
| Adds a key Graph to the table, sets its data value to value of Dat and returns Dat. More...
|
|
bool | IsKey (const PNGraph &Graph) const |
| Test whether Graph is an existing key in the hash table. More...
|
|
int | GetKeyId (const PNGraph &Graph) const |
| Returns the KeyId (position index) of key Graph. More...
|
|
const TDat & | GetDat (const PNGraph &Graph) const |
| Returns the data associated with key Graph. More...
|
|
TDat & | GetDat (const PNGraph &Graph) |
| Returns the data associated with key Graph. More...
|
|
const TGraphKey & | GetKey (const int &KeyId) const |
| Returns the GraphKey with position index KeyId. More...
|
|
int | GetKeyId (const TGraphKey &Key) const |
| Returns the KeyId for a given Key. More...
|
|
bool | IsKey (const TGraphKey &Key) const |
| Tests whether a given Key exists in the hash table. More...
|
|
bool | IsKey (const TGraphKey &Key, int &KeyId) const |
| Tests whether a given Key exists in the hash table. More...
|
|
bool | IsKeyId (const int &KeyId) const |
| Tests whether there exists a key at given position index KeyId. More...
|
|
const TDat & | GetDat (const TGraphKey &Key) const |
| Returns data with a given graph Key. More...
|
|
TDat & | GetDat (const TGraphKey &Key) |
| Returns data with a given graph Key. More...
|
|
const TDat & | GetDatId (const int &KeyId) const |
| Returns data at a given position index KeyId. More...
|
|
TDat & | GetDatId (const int &KeyId) |
| Returns data at a given position index KeyId. More...
|
|
void | GetKeyDat (const int &KeyId, TGraphKey &Key, TDat &Dat) const |
| Returns Key and Data at a given position index KeyId. More...
|
|
bool | IsKeyGetDat (const TGraphKey &Key, TDat &Dat) const |
| Test whether Key exists and sets its data to Dat. More...
|
|
bool | GetNodeMap (const PNGraph &Graph, TIntPrV &NodeMapV) const |
| Returns the mapping of node Ids of the Graph to those of the graph-key in the hash table. More...
|
|
bool | GetNodeMap (const PNGraph &Graph, TIntPrV &NodeMapV, int &KeyId) const |
| Returns the mapping of node Ids of the Graph to those of the graph-key in the hash table and the Graph KeyId. More...
|
|
int | FFirstKeyId () const |
| Finds first KeyId. More...
|
|
bool | FNextKeyId (int &KeyId) const |
| Finds next KeyId. More...
|
|
void | GetKeyV (TVec< TGraphKey > &KeyV) const |
| Returns a vector of keys stored in the hash table. More...
|
|
void | GetDatV (TVec< TDat > &DatV) const |
| Returns a vector of data elements stored in the hash table. More...
|
|
void | GetKeyIdByDat (TIntV &KeyIdV, const bool &Asc=true) const |
| Returns a vector of KeyIds of hash table elements sorted by their data value. More...
|
|
void | GetKeyIdByGSz (TIntV &KeyIdV, const bool &Asc=true) const |
| Returns a vector of KeyIds of hash table elements sorted by their graph size. More...
|
|
void | GetKeyDatPrV (TVec< TPair< TGraphKey, TDat > > &KeyDatPrV) const |
| Returns a vector of pairs (Key, Data) elements stored in the hash table. More...
|
|
void | GetDatKeyPrV (TVec< TPair< TDat, TGraphKey > > &DatKeyPrV) const |
| Returns a vector of pairs (Data, Key) elements stored in the hash table. More...
|
|
void | Defrag () |
| Removes unused slots from the hash table. More...
|
|
void | Pack () |
| Frees the unused memory by the hash table. More...
|
|
void | DrawGViz (const int &KeyId, const TStr &OutFNmPref, const TStr &OutputType="gif", TStr Desc="") const |
| Saves a given graph with key Id KeyId in DOT format and calls the GraphViz to draw it. More...
|
|
void | DrawGViz (const TIntV &KeyIdV, const TStr &OutFNmPref, const TStr &OutputType="gif") const |
| Saves a set of graphs with key Ids KeyIdV in DOT format and calls the GraphViz to draw them. More...
|
|
void | SaveTxt (const TStr &OutFNm, const TStr &Desc, const TStr &DatColNm, const bool &SortByKeyVal=true) const |
| Saves all graphs stored in the hash table into a text file. More...
|
|
void | SaveDetailTxt (const TStr &OutFNm, const TStr &Desc, const TStr &DatColNm) const |
| Saves all graphs stored in the hash table into a text file and include additional information. More...
|
|
template<class TDat>
class TGHash< TDat >
Graph Hash Table.
Keys in this hash table are (little) directed graphs. The class is useful for counting frequencies of small subgraphs or information cascades. For small graphs with less than MxIsoCheck nodes the class performs exact isomorphism checking. For graphs with less than MxSvdGraph nodes the class performs approximate isomorphism checking by comparing a numeric SVD-based signatures of two graphs. For graphs with more than MxSvdGraph nodes the class performs approximate isorphism checking by comparing only the signature based on simple graph statistics. For hashing trees (tree is encoded as a directed graph where children point to the parent) the class always performs exact isomorphism testing.
Definition at line 103 of file ghash.h.