SNAP Library 2.0, User 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
TBigNet< TNodeData, IsDir >::TNodeI Class Reference

Node iterator. More...

#include <bignet.h>

List of all members.

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.
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.

: NodeHI(), Pool(NULL), InDeg(0), OutDeg(0), InNIdV(NULL), OutNIdV(NULL) { }
template<class TNodeData, bool IsDir>
TBigNet< TNodeData, IsDir >::TNodeI::TNodeI ( const THashIter NodeHIter,
TVPool PoolPt 
) [inline]

Definition at line 62 of file bignet.h.

: NodeHI(NodeHIter), Pool(PoolPt) { GetInOutNIdV(); }
template<class TNodeData, bool IsDir>
TBigNet< TNodeData, IsDir >::TNodeI::TNodeI ( const TNodeI NodeI) [inline]

Definition at line 63 of file bignet.h.

: NodeHI(NodeI.NodeHI), Pool(NodeI.Pool) { GetInOutNIdV(); }

Member Function Documentation

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

Definition at line 237 of file bignet.h.

                                                 {
  printf("NodeId: %d\n", GetId());
  printf("  I:%4d]", GetInDeg());
  for (int i = 0; i < GetInDeg(); i++) { printf("  %d", GetInNId(i)); }
  printf("\n  O:%4d]", GetOutDeg());
  for (int i = 0; i < GetOutDeg(); i++) { printf("  %d", GetOutNId(i)); }
  printf("\n");
}
template<class TNodeData, bool IsDir>
const TNodeData& TBigNet< TNodeData, IsDir >::TNodeI::GetDat ( ) const [inline]

Definition at line 81 of file bignet.h.

{ return NodeHI->Dat.Dat; }
template<class TNodeData, bool IsDir>
TNodeData& TBigNet< TNodeData, IsDir >::TNodeI::GetDat ( ) [inline]

Definition at line 82 of file bignet.h.

{ return NodeHI->Dat.Dat; }
template<class TNodeData, bool IsDir>
int TBigNet< TNodeData, IsDir >::TNodeI::GetDeg ( ) const [inline]

Definition at line 70 of file bignet.h.

{ return GetInDeg()+(InNIdV!=OutNIdV?GetOutDeg():0); }
template<class TNodeData, bool IsDir>
int TBigNet< TNodeData, IsDir >::TNodeI::GetId ( ) const [inline]

Definition at line 69 of file bignet.h.

{ return NodeHI->Key(); }
template<class TNodeData, bool IsDir>
int TBigNet< TNodeData, IsDir >::TNodeI::GetInDeg ( ) const [inline]

Definition at line 71 of file bignet.h.

{ return InDeg; }
template<class TNodeData, bool IsDir>
int TBigNet< TNodeData, IsDir >::TNodeI::GetInNId ( const int &  NodeN) const [inline]

Definition at line 73 of file bignet.h.

{ return InNIdV[NodeN]; }
template<class TNodeData , bool IsDir>
void TBigNet< TNodeData, IsDir >::TNodeI::GetInOutNIdV ( ) [inline]

Definition at line 223 of file bignet.h.

                                                          {
  if (NodeHI.IsEnd()) return;
  const TNode& N = NodeHI->Dat;
  if (! Pool->IsVId(N.InVId)) {
    InDeg=0; OutDeg=0; }
  else {
    InDeg=Pool->GetVLen(N.InVId);
    OutDeg=Pool->GetVLen(N.OutVId);
    InNIdV=(int *)Pool->GetValVPt(N.InVId);
    OutNIdV=(int *)Pool->GetValVPt(N.OutVId);
  }
}
template<class TNodeData, bool IsDir>
int TBigNet< TNodeData, IsDir >::TNodeI::GetInVId ( ) const [inline]

Definition at line 58 of file bignet.h.

{ return NodeHI->Dat.InVId; }
template<class TNodeData, bool IsDir>
int TBigNet< TNodeData, IsDir >::TNodeI::GetOutDeg ( ) const [inline]

Definition at line 72 of file bignet.h.

{ return OutDeg; }
template<class TNodeData, bool IsDir>
int TBigNet< TNodeData, IsDir >::TNodeI::GetOutNbrId ( const int &  NodeN) const [inline]

Definition at line 75 of file bignet.h.

{ return NodeN<OutDeg ? OutNIdV[NodeN]:InNIdV[NodeN-OutDeg]; }
template<class TNodeData, bool IsDir>
int TBigNet< TNodeData, IsDir >::TNodeI::GetOutNId ( const int &  NodeN) const [inline]

Definition at line 74 of file bignet.h.

{ return OutNIdV[NodeN]; }
template<class TNodeData, bool IsDir>
int TBigNet< TNodeData, IsDir >::TNodeI::GetOutVId ( ) const [inline]

Definition at line 59 of file bignet.h.

{ return NodeHI->Dat.OutVId; }
template<class TNodeData, bool IsDir>
bool TBigNet< TNodeData, IsDir >::TNodeI::IsInNId ( const int &  NId) const [inline]

Definition at line 76 of file bignet.h.

{ return BinSearch(InNIdV, InNIdV+InDeg, NId)!=NULL; }
template<class TNodeData, bool IsDir>
bool TBigNet< TNodeData, IsDir >::TNodeI::IsNbrNId ( const int &  NId) const [inline]

Definition at line 78 of file bignet.h.

{ return IsOutNId(NId) || IsInNId(NId); }
template<class TNodeData, bool IsDir>
bool TBigNet< TNodeData, IsDir >::TNodeI::IsOutNId ( const int &  NId) const [inline]

Definition at line 77 of file bignet.h.

{ return BinSearch(OutNIdV, OutNIdV+OutDeg, NId)!=NULL; }
template<class TNodeData, bool IsDir>
const TNodeData& TBigNet< TNodeData, IsDir >::TNodeI::operator() ( ) const [inline]

Definition at line 79 of file bignet.h.

{ return GetDat(); }
template<class TNodeData, bool IsDir>
TNodeData& TBigNet< TNodeData, IsDir >::TNodeI::operator() ( ) [inline]

Definition at line 80 of file bignet.h.

{ return GetDat(); }
template<class TNodeData, bool IsDir>
TNodeI& TBigNet< TNodeData, IsDir >::TNodeI::operator++ ( int  ) [inline]

Increment iterator.

Definition at line 66 of file bignet.h.

{ NodeHI++; GetInOutNIdV(); return *this; }
template<class TNodeData, bool IsDir>
bool TBigNet< TNodeData, IsDir >::TNodeI::operator< ( const TNodeI NI) const [inline]

Definition at line 67 of file bignet.h.

{ return NodeHI < NI.NodeHI; }
template<class TNodeData, bool IsDir>
TNodeI& TBigNet< TNodeData, IsDir >::TNodeI::operator= ( const TNodeI NI) [inline]

Definition at line 64 of file bignet.h.

{ NodeHI=NI.NodeHI; Pool=NI.Pool; GetInOutNIdV(); return *this; }
template<class TNodeData, bool IsDir>
bool TBigNet< TNodeData, IsDir >::TNodeI::operator== ( const TNodeI NI) const [inline]

Definition at line 68 of file bignet.h.

{ return NodeHI == NI.NodeHI; }

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]

Definition at line 55 of file bignet.h.

template<class TNodeData, bool IsDir>
int * TBigNet< TNodeData, IsDir >::TNodeI::InNIdV [protected]

Definition at line 55 of file bignet.h.

template<class TNodeData, bool IsDir>
THashIter TBigNet< TNodeData, IsDir >::TNodeI::NodeHI [protected]

Definition at line 53 of file bignet.h.

template<class TNodeData, bool IsDir>
int TBigNet< TNodeData, IsDir >::TNodeI::OutDeg [protected]

Definition at line 55 of file bignet.h.

template<class TNodeData, bool IsDir>
int * TBigNet< TNodeData, IsDir >::TNodeI::OutNIdV [protected]

Definition at line 55 of file bignet.h.

template<class TNodeData, bool IsDir>
TVPool* TBigNet< TNodeData, IsDir >::TNodeI::Pool [protected]

Definition at line 54 of file bignet.h.


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