SNAP Library 3.0, Developer Reference  2016-07-20 17:56:49
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 >::TSVec Class Reference
Collaboration diagram for TSubGraphEnum< TGraphCounter >::TSVec:

Public Member Functions

 TSVec (int capacity)
 
bool Contains (int nodeId) const
 
void Push (int nodeId)
 
void Pop ()
 
int Capacity () const
 
int Size () const
 
const TIntVgetVec () const
 
int operator[] (int i) const
 

Protected Attributes

int m_capacity
 
int m_size
 
int * m_arr
 
TIntV m_v
 

Detailed Description

template<class TGraphCounter>
class TSubGraphEnum< TGraphCounter >::TSVec

Definition at line 38 of file subgraphenum.h.

Constructor & Destructor Documentation

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

Definition at line 45 of file subgraphenum.h.

References TVec< TVal, TSizeTy >::BegI(), TVec< TVal, TSizeTy >::Gen(), TSubGraphEnum< TGraphCounter >::TSVec::m_arr, TSubGraphEnum< TGraphCounter >::TSVec::m_capacity, TSubGraphEnum< TGraphCounter >::TSVec::m_size, and TSubGraphEnum< TGraphCounter >::TSVec::m_v.

45  {
46  m_v.Gen(capacity); m_arr = (int *) m_v.BegI();
47  for(int i=0; i<capacity; i++) { m_arr[i]=-1; }
48  m_capacity = capacity; m_size = 0; }
TIter BegI() const
Returns an iterator pointing to the first element in the vector.
Definition: ds.h:565
void Gen(const TSizeTy &_Vals)
Constructs a vector (an array) of _Vals elements.
Definition: ds.h:495

Here is the call graph for this function:

Member Function Documentation

template<class TGraphCounter >
int TSubGraphEnum< TGraphCounter >::TSVec::Capacity ( ) const
inline

Definition at line 55 of file subgraphenum.h.

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

55 { return m_capacity; }
template<class TGraphCounter >
bool TSubGraphEnum< TGraphCounter >::TSVec::Contains ( int  nodeId) const
inline

Definition at line 50 of file subgraphenum.h.

References TSubGraphEnum< TGraphCounter >::TSVec::m_arr, and TSubGraphEnum< TGraphCounter >::TSVec::m_size.

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

50  {
51  for(int i=0; i<m_size; i++) { if(m_arr[i]==nodeId) return true; } return false; }

Here is the caller graph for this function:

template<class TGraphCounter >
const TIntV& TSubGraphEnum< TGraphCounter >::TSVec::getVec ( ) const
inline

Definition at line 57 of file subgraphenum.h.

References TSubGraphEnum< TGraphCounter >::TSVec::m_v.

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

57 { return m_v; }

Here is the caller graph for this function:

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

Definition at line 58 of file subgraphenum.h.

References TSubGraphEnum< TGraphCounter >::TSVec::m_arr.

58 { return m_arr[i]; }
template<class TGraphCounter >
void TSubGraphEnum< TGraphCounter >::TSVec::Pop ( )
inline
template<class TGraphCounter >
void TSubGraphEnum< TGraphCounter >::TSVec::Push ( int  nodeId)
inline
template<class TGraphCounter >
int TSubGraphEnum< TGraphCounter >::TSVec::Size ( ) const
inline

Definition at line 56 of file subgraphenum.h.

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

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

56 { return m_size; }

Here is the caller graph for this function:

Member Data Documentation

template<class TGraphCounter >
int TSubGraphEnum< TGraphCounter >::TSVec::m_capacity
protected
template<class TGraphCounter >
TIntV TSubGraphEnum< TGraphCounter >::TSVec::m_v
protected

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