SNAP Library , Developer Reference  2013-01-07 14:03:36
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TDGraphCounter Class Reference

#include <graphcounter.h>

Collaboration diagram for TDGraphCounter:

List of all members.

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

Definition at line 29 of file graphcounter.h.

References m_graphCounters.

{ return m_graphCounters; }
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 >::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);
        }
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 32 of file graphcounter.h.

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

Definition at line 31 of file graphcounter.h.

Referenced by operator()().


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