SNAP Library 4.0, Developer Reference  2017-07-27 13:18:06
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
TDGHashGraphCounter Class Reference

#include <graphcounter.h>

Collaboration diagram for TDGHashGraphCounter:

Public Member Functions

 TDGHashGraphCounter ()
 
void operator() (const PNGraph &G, const TIntV &sg)
 
TGHash< TUInt64 > & Graphs ()
 

Private Attributes

TGHash< TUInt64m_graphs
 

Detailed Description

Definition at line 37 of file graphcounter.h.

Constructor & Destructor Documentation

TDGHashGraphCounter::TDGHashGraphCounter ( )
inline

Definition at line 39 of file graphcounter.h.

39 : m_graphs(false) {}
TGHash< TUInt64 > m_graphs
Definition: graphcounter.h:44

Member Function Documentation

TGHash<TUInt64>& TDGHashGraphCounter::Graphs ( )
inline

Definition at line 42 of file graphcounter.h.

References m_graphs.

42 { return m_graphs; }
TGHash< TUInt64 > m_graphs
Definition: graphcounter.h:44
void TDGHashGraphCounter::operator() ( const PNGraph G,
const TIntV sg 
)

Definition at line 136 of file graphcounter.cpp.

References TGHash< TDat >::AddDat(), TGHash< TDat >::GetDat(), TGraphEnumUtils::GetIndGraph(), TGHash< TDat >::IsKey(), m_graphs, and TNGraph::New().

136  {
137  PNGraph indG = TNGraph::New();
138  TGraphEnumUtils::GetIndGraph(G, sg, indG);
139  //
140  if(m_graphs.IsKey(indG))
141  m_graphs.GetDat(indG)++;
142  else m_graphs.AddDat(indG, 1);
143 }
static PNGraph New()
Static constructor that returns a pointer to the graph. Call: PNGraph Graph = TNGraph::New().
Definition: graph.h:477
const TDat & GetDat(const PNGraph &Graph) const
Returns the data associated with key Graph.
Definition: ghash.h:192
bool IsKey(const PNGraph &Graph) const
Test whether Graph is an existing key in the hash table.
Definition: ghash.h:184
TDat & AddDat(const PNGraph &Graph)
Adds a key Graph to the table and returns its data value.
Definition: ghash.h:177
TGHash< TUInt64 > m_graphs
Definition: graphcounter.h:44
static void GetIndGraph(const PNGraph &G, const TIntV &sg, PNGraph &indG)

Here is the call graph for this function:

Member Data Documentation

TGHash<TUInt64> TDGHashGraphCounter::m_graphs
private

Definition at line 44 of file graphcounter.h.

Referenced by Graphs(), and operator()().


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