SNAP Library 2.1, User Reference  2013-09-25 10:47:25
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>

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.

{ return m_graphCounters; }
void TDGraphCounter::operator() ( const PNGraph G,
const TIntV sg 
)

Definition at line 115 of file graphcounter.cpp.

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

Member Data Documentation

Definition at line 32 of file graphcounter.h.

Definition at line 31 of file graphcounter.h.


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