SNAP Library 6.0, Developer Reference  2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
TBigNet< TNodeData, IsDir >::TNodeI Class Reference

Node iterator. More...

#include <bignet.h>

Collaboration diagram for TBigNet< TNodeData, IsDir >::TNodeI:

Public Member Functions

void GetInOutNIdV ()
 
int GetInVId () const
 
int GetOutVId () const
 
 TNodeI ()
 
 TNodeI (const THashIter &NodeHIter, TVPool *PoolPt)
 
 TNodeI (const TNodeI &NodeI)
 
TNodeIoperator= (const TNodeI &NI)
 
TNodeIoperator++ (int)
 Increment iterator. More...
 
bool operator< (const TNodeI &NI) const
 
bool operator== (const TNodeI &NI) const
 
int GetId () const
 
int GetDeg () const
 
int GetInDeg () const
 
int GetOutDeg () const
 
int GetInNId (const int &NodeN) const
 
int GetOutNId (const int &NodeN) const
 
int GetOutNbrId (const int &NodeN) const
 
bool IsInNId (const int &NId) const
 
bool IsOutNId (const int &NId) const
 
bool IsNbrNId (const int &NId) const
 
const TNodeData & operator() () const
 
TNodeData & operator() ()
 
const TNodeData & GetDat () const
 
TNodeData & GetDat ()
 
void Dump () const
 

Protected Types

typedef TNodeH::TIter THashIter
 

Protected Attributes

THashIter NodeHI
 
TVPoolPool
 
int InDeg
 
int OutDeg
 
int * InNIdV
 
int * OutNIdV
 

Friends

class TBigNet< TNodeData, IsDir >
 

Detailed Description

template<class TNodeData, bool IsDir>
class TBigNet< TNodeData, IsDir >::TNodeI

Node iterator.

Only forward iteration (operator++) is supported.

Definition at line 50 of file bignet.h.

Member Typedef Documentation

template<class TNodeData, bool IsDir>
typedef TNodeH::TIter TBigNet< TNodeData, IsDir >::TNodeI::THashIter
protected

Definition at line 52 of file bignet.h.

Constructor & Destructor Documentation

template<class TNodeData, bool IsDir>
TBigNet< TNodeData, IsDir >::TNodeI::TNodeI ( )
inline

Definition at line 61 of file bignet.h.

61 : NodeHI(), Pool(NULL), InDeg(0), OutDeg(0), InNIdV(NULL), OutNIdV(NULL) { }
int * OutNIdV
Definition: bignet.h:55
int * InNIdV
Definition: bignet.h:55
TVPool * Pool
Definition: bignet.h:54
THashIter NodeHI
Definition: bignet.h:53
template<class TNodeData, bool IsDir>
TBigNet< TNodeData, IsDir >::TNodeI::TNodeI ( const THashIter NodeHIter,
TVPool PoolPt 
)
inline

Definition at line 62 of file bignet.h.

References TBigNet< TNodeData, IsDir >::TNodeI::GetInOutNIdV().

62 : NodeHI(NodeHIter), Pool(PoolPt) { GetInOutNIdV(); }
void GetInOutNIdV()
Definition: bignet.h:224
TVPool * Pool
Definition: bignet.h:54
THashIter NodeHI
Definition: bignet.h:53

Here is the call graph for this function:

template<class TNodeData, bool IsDir>
TBigNet< TNodeData, IsDir >::TNodeI::TNodeI ( const TNodeI NodeI)
inline

Definition at line 63 of file bignet.h.

References TBigNet< TNodeData, IsDir >::TNodeI::GetInOutNIdV().

63 : NodeHI(NodeI.NodeHI), Pool(NodeI.Pool) { GetInOutNIdV(); }
void GetInOutNIdV()
Definition: bignet.h:224
TVPool * Pool
Definition: bignet.h:54
THashIter NodeHI
Definition: bignet.h:53

Here is the call graph for this function:

Member Function Documentation

template<class TNodeData , bool IsDir>
void TBigNet< TNodeData, IsDir >::TNodeI::Dump ( ) const

Definition at line 238 of file bignet.h.

238  {
239  printf("NodeId: %d\n", GetId());
240  printf(" I:%4d]", GetInDeg());
241  for (int i = 0; i < GetInDeg(); i++) { printf(" %d", GetInNId(i)); }
242  printf("\n O:%4d]", GetOutDeg());
243  for (int i = 0; i < GetOutDeg(); i++) { printf(" %d", GetOutNId(i)); }
244  printf("\n");
245 }
int GetOutDeg() const
Definition: bignet.h:72
int GetInDeg() const
Definition: bignet.h:71
int GetInNId(const int &NodeN) const
Definition: bignet.h:73
int GetId() const
Definition: bignet.h:69
int GetOutNId(const int &NodeN) const
Definition: bignet.h:74
template<class TNodeData, bool IsDir>
const TNodeData& TBigNet< TNodeData, IsDir >::TNodeI::GetDat ( ) const
inline

Definition at line 81 of file bignet.h.

Referenced by TBigNet< TNodeData, IsDir >::TNodeI::operator()().

81 { return NodeHI->Dat.Dat; }
THashIter NodeHI
Definition: bignet.h:53

Here is the caller graph for this function:

template<class TNodeData, bool IsDir>
TNodeData& TBigNet< TNodeData, IsDir >::TNodeI::GetDat ( )
inline

Definition at line 82 of file bignet.h.

82 { return NodeHI->Dat.Dat; }
THashIter NodeHI
Definition: bignet.h:53
template<class TNodeData, bool IsDir>
int TBigNet< TNodeData, IsDir >::TNodeI::GetDeg ( ) const
inline

Definition at line 70 of file bignet.h.

References TBigNet< TNodeData, IsDir >::TNodeI::GetInDeg(), and TBigNet< TNodeData, IsDir >::TNodeI::GetOutDeg().

70 { return GetInDeg()+(InNIdV!=OutNIdV?GetOutDeg():0); }
int * OutNIdV
Definition: bignet.h:55
int GetOutDeg() const
Definition: bignet.h:72
int GetInDeg() const
Definition: bignet.h:71
int * InNIdV
Definition: bignet.h:55

Here is the call graph for this function:

template<class TNodeData, bool IsDir>
int TBigNet< TNodeData, IsDir >::TNodeI::GetId ( ) const
inline

Definition at line 69 of file bignet.h.

Referenced by TBigNet< TNodeData, IsDir >::TEdgeI::GetSrcNId(), TBigNet< TNodeData, IsDir >::IsOk(), and TBigNet< TNodeData, IsDir >::Rewire().

69 { return NodeHI->Key(); }
THashIter NodeHI
Definition: bignet.h:53

Here is the caller graph for this function:

template<class TNodeData, bool IsDir>
int TBigNet< TNodeData, IsDir >::TNodeI::GetInDeg ( ) const
inline
template<class TNodeData, bool IsDir>
int TBigNet< TNodeData, IsDir >::TNodeI::GetInNId ( const int &  NodeN) const
inline

Definition at line 73 of file bignet.h.

Referenced by TBigNet< TNodeData, IsDir >::GetSubGraph(), TBigNet< TNodeData, IsDir >::GetSubNGraph(), and TBigNet< TNodeData, IsDir >::IsOk().

73 { return InNIdV[NodeN]; }
int * InNIdV
Definition: bignet.h:55

Here is the caller graph for this function:

template<class TNodeData , bool IsDir>
void TBigNet< TNodeData, IsDir >::TNodeI::GetInOutNIdV ( )
inline

Definition at line 224 of file bignet.h.

References TVecPool< TVal, TSizeTy >::GetValVPt(), TVecPool< TVal, TSizeTy >::GetVLen(), TBigNet< TNodeData, IsDir >::TNodeI::InDeg, TBigNet< TNodeData, IsDir >::TNodeI::InNIdV, TBigNet< TNodeData, IsDir >::TNode::InVId, TVecPool< TVal, TSizeTy >::IsVId(), TBigNet< TNodeData, IsDir >::TNodeI::NodeHI, TBigNet< TNodeData, IsDir >::TNodeI::OutDeg, TBigNet< TNodeData, IsDir >::TNodeI::OutNIdV, and TBigNet< TNodeData, IsDir >::TNode::OutVId.

Referenced by TBigNet< TNodeData, IsDir >::TNodeI::operator++(), TBigNet< TNodeData, IsDir >::TNodeI::operator=(), and TBigNet< TNodeData, IsDir >::TNodeI::TNodeI().

224  {
225  if (NodeHI.IsEnd()) return;
226  const TNode& N = NodeHI->Dat;
227  if (! Pool->IsVId(N.InVId)) {
228  InDeg=0; OutDeg=0; }
229  else {
230  InDeg=Pool->GetVLen(N.InVId);
231  OutDeg=Pool->GetVLen(N.OutVId);
232  InNIdV=(int *)Pool->GetValVPt(N.InVId);
233  OutNIdV=(int *)Pool->GetValVPt(N.OutVId);
234  }
235 }
int * OutNIdV
Definition: bignet.h:55
TVal * GetValVPt(const int &VId) const
Returns pointer to the first element of the vector with id VId.
Definition: ds.h:1731
int GetVLen(const int &VId) const
Returns the number of elements in the vector with id VId.
Definition: ds.h:1729
int * InNIdV
Definition: bignet.h:55
TVPool * Pool
Definition: bignet.h:54
THashIter NodeHI
Definition: bignet.h:53
bool IsVId(const int &VId) const
Tests whether vector of id VId is in the pool.
Definition: ds.h:1709

Here is the call graph for this function:

Here is the caller graph for this function:

template<class TNodeData, bool IsDir>
int TBigNet< TNodeData, IsDir >::TNodeI::GetInVId ( ) const
inline

Definition at line 58 of file bignet.h.

Referenced by TBigNet< TNodeData, IsDir >::GetSubGraph().

58 { return NodeHI->Dat.InVId; }
THashIter NodeHI
Definition: bignet.h:53

Here is the caller graph for this function:

template<class TNodeData, bool IsDir>
int TBigNet< TNodeData, IsDir >::TNodeI::GetOutDeg ( ) const
inline
template<class TNodeData, bool IsDir>
int TBigNet< TNodeData, IsDir >::TNodeI::GetOutNbrId ( const int &  NodeN) const
inline

Definition at line 75 of file bignet.h.

References TBigNet< TNodeData, IsDir >::TNodeI::OutDeg.

75 { return NodeN<OutDeg ? OutNIdV[NodeN]:InNIdV[NodeN-OutDeg]; }
int * OutNIdV
Definition: bignet.h:55
int * InNIdV
Definition: bignet.h:55
template<class TNodeData, bool IsDir>
int TBigNet< TNodeData, IsDir >::TNodeI::GetOutNId ( const int &  NodeN) const
inline
template<class TNodeData, bool IsDir>
int TBigNet< TNodeData, IsDir >::TNodeI::GetOutVId ( ) const
inline

Definition at line 59 of file bignet.h.

Referenced by TBigNet< TNodeData, IsDir >::GetSubGraph().

59 { return NodeHI->Dat.OutVId; }
THashIter NodeHI
Definition: bignet.h:53

Here is the caller graph for this function:

template<class TNodeData, bool IsDir>
bool TBigNet< TNodeData, IsDir >::TNodeI::IsInNId ( const int &  NId) const
inline

Definition at line 76 of file bignet.h.

References TBigNet< TNodeData, IsDir >::BinSearch().

Referenced by TBigNet< TNodeData, IsDir >::TNodeI::IsNbrNId(), and TBigNet< TNodeData, IsDir >::Rewire().

76 { return BinSearch(InNIdV, InNIdV+InDeg, NId)!=NULL; }
int * InNIdV
Definition: bignet.h:55
static const int * BinSearch(const int *Beg, const int *End, const int &Val)
Definition: bignet.h:264

Here is the call graph for this function:

Here is the caller graph for this function:

template<class TNodeData, bool IsDir>
bool TBigNet< TNodeData, IsDir >::TNodeI::IsNbrNId ( const int &  NId) const
inline

Definition at line 78 of file bignet.h.

References TBigNet< TNodeData, IsDir >::TNodeI::IsInNId(), and TBigNet< TNodeData, IsDir >::TNodeI::IsOutNId().

78 { return IsOutNId(NId) || IsInNId(NId); }
bool IsOutNId(const int &NId) const
Definition: bignet.h:77
bool IsInNId(const int &NId) const
Definition: bignet.h:76

Here is the call graph for this function:

template<class TNodeData, bool IsDir>
bool TBigNet< TNodeData, IsDir >::TNodeI::IsOutNId ( const int &  NId) const
inline

Definition at line 77 of file bignet.h.

References TBigNet< TNodeData, IsDir >::BinSearch().

Referenced by TBigNet< TNodeData, IsDir >::TNodeI::IsNbrNId().

77 { return BinSearch(OutNIdV, OutNIdV+OutDeg, NId)!=NULL; }
int * OutNIdV
Definition: bignet.h:55
static const int * BinSearch(const int *Beg, const int *End, const int &Val)
Definition: bignet.h:264

Here is the call graph for this function:

Here is the caller graph for this function:

template<class TNodeData, bool IsDir>
const TNodeData& TBigNet< TNodeData, IsDir >::TNodeI::operator() ( ) const
inline

Definition at line 79 of file bignet.h.

References TBigNet< TNodeData, IsDir >::TNodeI::GetDat().

79 { return GetDat(); }
const TNodeData & GetDat() const
Definition: bignet.h:81

Here is the call graph for this function:

template<class TNodeData, bool IsDir>
TNodeData& TBigNet< TNodeData, IsDir >::TNodeI::operator() ( )
inline

Definition at line 80 of file bignet.h.

References TBigNet< TNodeData, IsDir >::TNodeI::GetDat().

80 { return GetDat(); }
const TNodeData & GetDat() const
Definition: bignet.h:81

Here is the call graph for this function:

template<class TNodeData, bool IsDir>
TNodeI& TBigNet< TNodeData, IsDir >::TNodeI::operator++ ( int  )
inline

Increment iterator.

Definition at line 66 of file bignet.h.

References TBigNet< TNodeData, IsDir >::TNodeI::GetInOutNIdV().

66 { NodeHI++; GetInOutNIdV(); return *this; }
void GetInOutNIdV()
Definition: bignet.h:224
THashIter NodeHI
Definition: bignet.h:53

Here is the call graph for this function:

template<class TNodeData, bool IsDir>
bool TBigNet< TNodeData, IsDir >::TNodeI::operator< ( const TNodeI NI) const
inline

Definition at line 67 of file bignet.h.

References TBigNet< TNodeData, IsDir >::TNodeI::NodeHI.

67 { return NodeHI < NI.NodeHI; }
THashIter NodeHI
Definition: bignet.h:53
template<class TNodeData, bool IsDir>
TNodeI& TBigNet< TNodeData, IsDir >::TNodeI::operator= ( const TNodeI NI)
inline

Definition at line 64 of file bignet.h.

References TBigNet< TNodeData, IsDir >::TNodeI::GetInOutNIdV(), TBigNet< TNodeData, IsDir >::TNodeI::NodeHI, and TBigNet< TNodeData, IsDir >::TNodeI::Pool.

64 { NodeHI=NI.NodeHI; Pool=NI.Pool; GetInOutNIdV(); return *this; }
void GetInOutNIdV()
Definition: bignet.h:224
TVPool * Pool
Definition: bignet.h:54
THashIter NodeHI
Definition: bignet.h:53

Here is the call graph for this function:

template<class TNodeData, bool IsDir>
bool TBigNet< TNodeData, IsDir >::TNodeI::operator== ( const TNodeI NI) const
inline

Definition at line 68 of file bignet.h.

References TBigNet< TNodeData, IsDir >::TNodeI::NodeHI.

68 { return NodeHI == NI.NodeHI; }
THashIter NodeHI
Definition: bignet.h:53

Friends And Related Function Documentation

template<class TNodeData, bool IsDir>
friend class TBigNet< TNodeData, IsDir >
friend

Definition at line 91 of file bignet.h.

Member Data Documentation

template<class TNodeData, bool IsDir>
int TBigNet< TNodeData, IsDir >::TNodeI::InDeg
protected
template<class TNodeData, bool IsDir>
int * TBigNet< TNodeData, IsDir >::TNodeI::InNIdV
protected
template<class TNodeData, bool IsDir>
int TBigNet< TNodeData, IsDir >::TNodeI::OutDeg
protected
template<class TNodeData, bool IsDir>
int * TBigNet< TNodeData, IsDir >::TNodeI::OutNIdV
protected
template<class TNodeData, bool IsDir>
TVPool* TBigNet< TNodeData, IsDir >::TNodeI::Pool
protected

Definition at line 54 of file bignet.h.

Referenced by TBigNet< TNodeData, IsDir >::TNodeI::operator=().


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