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
TDGraphCounter Class Reference

#include <graphcounter.h>

Collaboration diagram for TDGraphCounter:

Public Member Functions

void operator() (const PNGraph &G, const TIntV &sg)
 
THash< TUInt64, TUInt64 > & GraphCounters ()
 

Private Attributes

THash< TUInt64, TUInt64m_graphMaps
 
THash< TUInt64, TUInt64m_graphCounters
 

Detailed Description

Definition at line 26 of file graphcounter.h.

Member Function Documentation

THash<TUInt64,TUInt64>& TDGraphCounter::GraphCounters ( )
inline

Definition at line 29 of file graphcounter.h.

References m_graphCounters.

29 { return m_graphCounters; }
THash< TUInt64, TUInt64 > m_graphCounters
Definition: graphcounter.h:32
void TDGraphCounter::operator() ( const PNGraph G,
const TIntV sg 
)

Definition at line 115 of file graphcounter.cpp.

References THash< TKey, TDat, THashFunc >::AddDat(), THash< TKey, TDat, THashFunc >::GetDat(), TGraphEnumUtils::GetIsoGraphs(), TGraphEnumUtils::GetMinAndGraphIds(), TGraphEnumUtils::GraphId(), THash< TKey, TDat, THashFunc >::IsKey(), TVec< TVal, TSizeTy >::Len(), m_graphCounters, and m_graphMaps.

115  {
116  uint64 graphId = TGraphEnumUtils::GraphId(G, sg);
117  //
118  if(m_graphMaps.IsKey(graphId)) {
119  TUInt64 minGraphId = m_graphMaps.GetDat(graphId);
120  m_graphCounters.GetDat(minGraphId)++;
121  }else{
122  TVec<PNGraph> isoG;
123  TGraphEnumUtils::GetIsoGraphs(graphId, sg.Len(), isoG);
124  //
125  TVec<uint64> graphIds(isoG.Len());
126  uint64 minGraphId = TGraphEnumUtils::GetMinAndGraphIds(isoG, graphIds);
127  for(int j=0; j<graphIds.Len(); j++)
128  m_graphMaps.AddDat(graphIds[j], minGraphId);
129  //
130  m_graphCounters.AddDat(minGraphId, 1);
131  }
132 }
THash< TUInt64, TUInt64 > m_graphMaps
Definition: graphcounter.h:31
THash< TUInt64, TUInt64 > m_graphCounters
Definition: graphcounter.h:32
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
const TDat & GetDat(const TKey &Key) const
Definition: hash.h:262
static void GetIsoGraphs(uint64 graphId, int nodes, TVec< PNGraph > &isoG)
unsigned long long uint64
Definition: bd.h:38
static uint64 GraphId(const PNGraph &G)
static uint64 GetMinAndGraphIds(const TVec< PNGraph > &isoG, TVec< uint64 > &graphIds)
bool IsKey(const TKey &Key) const
Definition: hash.h:258
TDat & AddDat(const TKey &Key)
Definition: hash.h:238
Definition: dt.h:1315
Vector is a sequence TVal objects representing an array that can change in size.
Definition: ds.h:430

Here is the call graph for this function:

Member Data Documentation

THash<TUInt64,TUInt64> TDGraphCounter::m_graphCounters
private

Definition at line 32 of file graphcounter.h.

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

THash<TUInt64,TUInt64> TDGraphCounter::m_graphMaps
private

Definition at line 31 of file graphcounter.h.

Referenced by operator()().


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