SNAP Library 2.0, Developer Reference  2013-05-13 16:33:57
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
TD34GraphCounter Class Reference

#include <graphcounter.h>

Collaboration diagram for TD34GraphCounter:

List of all members.

Public Member Functions

 TD34GraphCounter (int GraphSz)
void operator() (const PNGraph &G, const TIntV &sg)
int Len () const
int GetId (const int &i) const
uint64 GetCnt (const int &GraphId) const
PNGraph GetGraph (const int &GraphId) const

Private Attributes

THash< TInt, TIntm_graphMaps
THash< TInt, TUInt64m_graphCounters
int m_subGraphSize

Detailed Description

Definition at line 8 of file graphcounter.h.


Constructor & Destructor Documentation

Definition at line 71 of file graphcounter.cpp.

References THash< TKey, TDat, THashFunc >::AddDat(), TGraphEnumUtils::GetIsoGraphs(), TGraphEnumUtils::GetMinAndGraphIds(), IAssert, TVec< TVal, TSizeTy >::Len(), m_graphCounters, TD3Graph::m_graphIds, TD4Graph::m_graphIds, m_graphMaps, TD3Graph::m_numOfGraphs, TD4Graph::m_numOfGraphs, and m_subGraphSize.

                                              {
        IAssert(GraphSz==3 || GraphSz==4);
        //
        m_subGraphSize = GraphSz;
        //
        int numOfGraphs = 0;
        if(GraphSz==3) numOfGraphs = TD3Graph::m_numOfGraphs;
        else if(GraphSz==4) numOfGraphs = TD4Graph::m_numOfGraphs;
        //
        for(int i=0; i<numOfGraphs; i++) {
                int graphId = 0;
                if(GraphSz==3) graphId = TD3Graph::m_graphIds[i];
                else if(GraphSz==4) graphId = TD4Graph::m_graphIds[i];
                //
                TVec<PNGraph> isoG;
                TGraphEnumUtils::GetIsoGraphs(graphId, GraphSz, isoG);
                //
                TVec<uint64> graphIds(isoG.Len());
                uint64 minGraphId = TGraphEnumUtils::GetMinAndGraphIds(isoG, graphIds);
                for(int j=0; j<graphIds.Len(); j++)
                        m_graphMaps.AddDat((int)graphIds[j], (int)minGraphId);
                //
                m_graphCounters.AddDat((int)minGraphId, 0);
        }
}

Here is the call graph for this function:


Member Function Documentation

uint64 TD34GraphCounter::GetCnt ( const int &  GraphId) const [inline]

Definition at line 16 of file graphcounter.h.

References THash< TKey, TDat, THashFunc >::GetDat(), and m_graphCounters.

{ return m_graphCounters.GetDat(GraphId); }

Here is the call graph for this function:

PNGraph TD34GraphCounter::GetGraph ( const int &  GraphId) const

Definition at line 107 of file graphcounter.cpp.

References m_subGraphSize, and TNGraph::New().

                                                           {
  PNGraph G = TNGraph::New();
  TGraphEnumUtils::GetGraph(GraphId, m_subGraphSize, G);
  return G;
}

Here is the call graph for this function:

int TD34GraphCounter::GetId ( const int &  i) const [inline]

Definition at line 15 of file graphcounter.h.

References THash< TKey, TDat, THashFunc >::GetKey(), and m_graphCounters.

{ return m_graphCounters.GetKey(i); }

Here is the call graph for this function:

int TD34GraphCounter::Len ( ) const [inline]

Definition at line 14 of file graphcounter.h.

References THash< TKey, TDat, THashFunc >::Len(), and m_graphCounters.

{ return m_graphCounters.Len(); }

Here is the call graph for this function:

void TD34GraphCounter::operator() ( const PNGraph G,
const TIntV sg 
)

Definition at line 96 of file graphcounter.cpp.

References THash< TKey, TDat, THashFunc >::GetDat(), TD3Graph::getId(), TD4Graph::getId(), THash< TKey, TDat, THashFunc >::IsKey(), m_graphCounters, m_graphMaps, and m_subGraphSize.

                                                                   {
        int graphId = 0;
        if(m_subGraphSize==3) graphId = TD3Graph::getId(G, sg);
        else if(m_subGraphSize==4) graphId = TD4Graph::getId(G, sg);
        //
        if(!m_graphMaps.IsKey(graphId)) { printf("This graph does not exist: %d\n", graphId); getchar(); return; }
        int minGraphId = m_graphMaps.GetDat(graphId);
        //
        m_graphCounters.GetDat(minGraphId)++;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 19 of file graphcounter.h.

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

Definition at line 21 of file graphcounter.h.

Referenced by GetGraph(), operator()(), and TD34GraphCounter().


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