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
TSubGraphEnum< TGraphCounter >::TSSet Class Reference

Public Member Functions

 TSSet (int capacity)
 
 TSSet (const TSSet &set)
 
 ~TSSet ()
 
void Add (int i)
 
void Remove (int i)
 
bool IsKey (int i) const
 
int Capacity () const
 
int Size () const
 
bool operator[] (int i) const
 

Protected Attributes

int m_capacity
 
int m_size
 
bool * m_nodes
 

Detailed Description

template<class TGraphCounter>
class TSubGraphEnum< TGraphCounter >::TSSet

Definition at line 17 of file subgraphenum.h.

Constructor & Destructor Documentation

template<class TGraphCounter >
TSubGraphEnum< TGraphCounter >::TSSet::TSSet ( int  capacity)
inline

Definition at line 23 of file subgraphenum.h.

References TSubGraphEnum< TGraphCounter >::TSSet::m_capacity, TSubGraphEnum< TGraphCounter >::TSSet::m_nodes, and TSubGraphEnum< TGraphCounter >::TSSet::m_size.

23  {
24  m_nodes = (bool *)malloc(capacity); memset(m_nodes, 0, capacity);
25  m_capacity = capacity; m_size = 0; }
template<class TGraphCounter >
TSubGraphEnum< TGraphCounter >::TSSet::TSSet ( const TSSet set)
inline

Definition at line 26 of file subgraphenum.h.

References TSubGraphEnum< TGraphCounter >::TSSet::m_capacity, TSubGraphEnum< TGraphCounter >::TSSet::m_nodes, and TSubGraphEnum< TGraphCounter >::TSSet::m_size.

26  {
27  m_nodes = (bool *)malloc(set.m_capacity); memcpy(m_nodes, set.m_nodes, set.m_capacity);
28  m_capacity = set.m_capacity; m_size = set.m_size; }
template<class TGraphCounter >
TSubGraphEnum< TGraphCounter >::TSSet::~TSSet ( )
inline

Definition at line 29 of file subgraphenum.h.

References TSubGraphEnum< TGraphCounter >::TSSet::m_nodes.

29 { free(m_nodes); }

Member Function Documentation

template<class TGraphCounter >
void TSubGraphEnum< TGraphCounter >::TSSet::Add ( int  i)
inline
template<class TGraphCounter >
int TSubGraphEnum< TGraphCounter >::TSSet::Capacity ( ) const
inline

Definition at line 34 of file subgraphenum.h.

References TSubGraphEnum< TGraphCounter >::TSSet::m_capacity.

Referenced by TSubGraphEnum< TGraphCounter >::GetSubGraphs_recursive().

34 { return m_capacity; }

Here is the caller graph for this function:

template<class TGraphCounter >
bool TSubGraphEnum< TGraphCounter >::TSSet::IsKey ( int  i) const
inline

Definition at line 33 of file subgraphenum.h.

References TSubGraphEnum< TGraphCounter >::TSSet::m_nodes.

Referenced by TSubGraphEnum< TGraphCounter >::GetSubGraphs_recursive().

33 { return m_nodes[i]; }

Here is the caller graph for this function:

template<class TGraphCounter >
bool TSubGraphEnum< TGraphCounter >::TSSet::operator[] ( int  i) const
inline

Definition at line 36 of file subgraphenum.h.

References TSubGraphEnum< TGraphCounter >::TSSet::m_nodes.

36 { return m_nodes[i]; }
template<class TGraphCounter >
void TSubGraphEnum< TGraphCounter >::TSSet::Remove ( int  i)
inline

Definition at line 32 of file subgraphenum.h.

References TSubGraphEnum< TGraphCounter >::TSSet::m_nodes, and TSubGraphEnum< TGraphCounter >::TSSet::m_size.

Referenced by TSubGraphEnum< TGraphCounter >::GetSubGraphs_recursive().

32 { m_nodes[i]=false; m_size--; }

Here is the caller graph for this function:

template<class TGraphCounter >
int TSubGraphEnum< TGraphCounter >::TSSet::Size ( ) const
inline

Definition at line 35 of file subgraphenum.h.

References TSubGraphEnum< TGraphCounter >::TSSet::m_size.

35 { return m_size; }

Member Data Documentation

template<class TGraphCounter >
int TSubGraphEnum< TGraphCounter >::TSSet::m_capacity
protected

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