SNAP Library 4.0, User 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 >::TSVec Class Reference

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.

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:593
void Gen(const TSizeTy &_Vals)
Constructs a vector (an array) of _Vals elements.
Definition: ds.h:523

Member Function Documentation

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

Definition at line 55 of file subgraphenum.h.

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

Definition at line 50 of file subgraphenum.h.

50  {
51  for(int i=0; i<m_size; i++) { if(m_arr[i]==nodeId) return true; } return false; }
template<class TGraphCounter >
const TIntV& TSubGraphEnum< TGraphCounter >::TSVec::getVec ( ) const
inline

Definition at line 57 of file subgraphenum.h.

57 { return m_v; }
template<class TGraphCounter >
int TSubGraphEnum< TGraphCounter >::TSVec::operator[] ( int  i) const
inline

Definition at line 58 of file subgraphenum.h.

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

Definition at line 54 of file subgraphenum.h.

template<class TGraphCounter >
void TSubGraphEnum< TGraphCounter >::TSVec::Push ( int  nodeId)
inline

Definition at line 53 of file subgraphenum.h.

53 { m_arr[m_size]=nodeId; m_size++; }
template<class TGraphCounter >
int TSubGraphEnum< TGraphCounter >::TSVec::Size ( ) const
inline

Definition at line 56 of file subgraphenum.h.

56 { return m_size; }

Member Data Documentation

template<class TGraphCounter >
int* TSubGraphEnum< TGraphCounter >::TSVec::m_arr
protected

Definition at line 42 of file subgraphenum.h.

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

Definition at line 40 of file subgraphenum.h.

template<class TGraphCounter >
int TSubGraphEnum< TGraphCounter >::TSVec::m_size
protected

Definition at line 41 of file subgraphenum.h.

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

Definition at line 43 of file subgraphenum.h.


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