|
SNAP Library 2.2, Developer Reference
2014-03-11 19:15:55
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <graphcounter.h>

Public Member Functions | |
| void | operator() (const PNGraph &G, const TIntV &sg) |
| THash< TUInt64, TUInt64 > & | GraphCounters () |
Private Attributes | |
| THash< TUInt64, TUInt64 > | m_graphMaps |
| THash< TUInt64, TUInt64 > | m_graphCounters |
Definition at line 26 of file graphcounter.h.
| THash<TUInt64,TUInt64>& TDGraphCounter::GraphCounters | ( | ) | [inline] |
Definition at line 29 of file graphcounter.h.
References m_graphCounters.
{ return m_graphCounters; }
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.
{
uint64 graphId = TGraphEnumUtils::GraphId(G, sg);
//
if(m_graphMaps.IsKey(graphId)) {
TUInt64 minGraphId = m_graphMaps.GetDat(graphId);
m_graphCounters.GetDat(minGraphId)++;
}else{
TVec<PNGraph> isoG;
TGraphEnumUtils::GetIsoGraphs(graphId, sg.Len(), isoG);
//
TVec<uint64> graphIds(isoG.Len());
uint64 minGraphId = TGraphEnumUtils::GetMinAndGraphIds(isoG, graphIds);
for(int j=0; j<graphIds.Len(); j++)
m_graphMaps.AddDat(graphIds[j], minGraphId);
//
m_graphCounters.AddDat(minGraphId, 1);
}
}

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()().