SNAP Library 2.3, Developer Reference  2014-06-16 11:58:46
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
TBPGraph::TNodeI Class Reference

Node iterator. Only forward iteration (operator++) is supported. More...

#include <graph.h>

Collaboration diagram for TBPGraph::TNodeI:

Public Member Functions

 TNodeI ()
 
 TNodeI (const THashIter &LeftHIter, const THashIter &RightHIter)
 
 TNodeI (const TNodeI &NodeI)
 
TNodeIoperator= (const TNodeI &NodeI)
 
TNodeIoperator++ (int)
 Increment iterator. More...
 
bool operator< (const TNodeI &NodeI) const
 
bool operator== (const TNodeI &NodeI) const
 
int GetId () const
 Returns ID of the current node. More...
 
bool IsLeft () const
 Tests whether the node is left hand side node. More...
 
bool IsRight () const
 Tests whether the node is right hand side node. More...
 
int GetDeg () const
 Returns degree of the current node. More...
 
int GetInDeg () const
 Returns in-degree of the current node (returns same as value GetDeg() since the graph is undirected). More...
 
int GetOutDeg () const
 Returns out-degree of the current node (returns same as value GetDeg() since the graph is undirected). More...
 
int GetInNId (const int &NodeN) const
 Returns ID of NodeN-th in-node (the node pointing to the current node). More...
 
int GetOutNId (const int &NodeN) const
 Returns ID of NodeN-th out-node (the node the current node points to). More...
 
int GetNbrNId (const int &NodeN) const
 Returns ID of NodeN-th neighboring node. More...
 
bool IsInNId (const int &NId) const
 Tests whether node with ID NId points to the current node. More...
 
bool IsOutNId (const int &NId) const
 Tests whether the current node points to node with ID NId. More...
 
bool IsNbrNId (const int &NId) const
 Tests whether node with ID NId is a neighbor of the current node. More...
 

Private Types

typedef THash< TInt, TNode >::TIter THashIter
 

Private Member Functions

THashIter HI () const
 

Private Attributes

THashIter LeftHI
 
THashIter RightHI
 

Friends

class TBPGraph
 

Detailed Description

Node iterator. Only forward iteration (operator++) is supported.

Definition at line 857 of file graph.h.

Member Typedef Documentation

typedef THash<TInt, TNode>::TIter TBPGraph::TNodeI::THashIter
private

Definition at line 859 of file graph.h.

Constructor & Destructor Documentation

TBPGraph::TNodeI::TNodeI ( )
inline

Definition at line 864 of file graph.h.

864 : LeftHI(), RightHI() { }
THashIter LeftHI
Definition: graph.h:860
THashIter RightHI
Definition: graph.h:860
TBPGraph::TNodeI::TNodeI ( const THashIter LeftHIter,
const THashIter RightHIter 
)
inline

Definition at line 865 of file graph.h.

865 : LeftHI(LeftHIter), RightHI(RightHIter) { }
THashIter LeftHI
Definition: graph.h:860
THashIter RightHI
Definition: graph.h:860
TBPGraph::TNodeI::TNodeI ( const TNodeI NodeI)
inline

Definition at line 866 of file graph.h.

866 : LeftHI(NodeI.LeftHI), RightHI(NodeI.RightHI) { }
THashIter LeftHI
Definition: graph.h:860
THashIter RightHI
Definition: graph.h:860

Member Function Documentation

int TBPGraph::TNodeI::GetDeg ( ) const
inline

Returns degree of the current node.

Definition at line 884 of file graph.h.

References HI().

884 { return HI().GetDat().GetDeg(); }
THashIter HI() const
Definition: graph.h:862

Here is the call graph for this function:

int TBPGraph::TNodeI::GetId ( ) const
inline

Returns ID of the current node.

Definition at line 878 of file graph.h.

References HI().

Referenced by TBPGraph::AddNode(), TBPGraph::BegEI(), and TBPGraph::TEdgeI::GetSrcNId().

878 { return HI().GetDat().GetId(); }
THashIter HI() const
Definition: graph.h:862

Here is the call graph for this function:

Here is the caller graph for this function:

int TBPGraph::TNodeI::GetInDeg ( ) const
inline

Returns in-degree of the current node (returns same as value GetDeg() since the graph is undirected).

Definition at line 886 of file graph.h.

References HI().

886 { return HI().GetDat().GetInDeg(); }
THashIter HI() const
Definition: graph.h:862

Here is the call graph for this function:

int TBPGraph::TNodeI::GetInNId ( const int &  NodeN) const
inline

Returns ID of NodeN-th in-node (the node pointing to the current node).

Definition at line 891 of file graph.h.

References HI().

891 { return HI().GetDat().GetInNId(NodeN); }
THashIter HI() const
Definition: graph.h:862

Here is the call graph for this function:

int TBPGraph::TNodeI::GetNbrNId ( const int &  NodeN) const
inline

Returns ID of NodeN-th neighboring node.

Definition at line 897 of file graph.h.

References HI().

897 { return HI().GetDat().GetNbrNId(NodeN); }
THashIter HI() const
Definition: graph.h:862

Here is the call graph for this function:

int TBPGraph::TNodeI::GetOutDeg ( ) const
inline

Returns out-degree of the current node (returns same as value GetDeg() since the graph is undirected).

Definition at line 888 of file graph.h.

References HI().

Referenced by TBPGraph::BegEI(), and TBPGraph::TEdgeI::operator++().

888 { return HI().GetDat().GetOutDeg(); }
THashIter HI() const
Definition: graph.h:862

Here is the call graph for this function:

Here is the caller graph for this function:

int TBPGraph::TNodeI::GetOutNId ( const int &  NodeN) const
inline

Returns ID of NodeN-th out-node (the node the current node points to).

Definition at line 894 of file graph.h.

References HI().

Referenced by TBPGraph::BegEI(), and TBPGraph::TEdgeI::GetDstNId().

894 { return HI().GetDat().GetOutNId(NodeN); }
THashIter HI() const
Definition: graph.h:862

Here is the call graph for this function:

Here is the caller graph for this function:

THashIter TBPGraph::TNodeI::HI ( ) const
inlineprivate

Definition at line 862 of file graph.h.

References LeftHI, and RightHI.

Referenced by GetDeg(), GetId(), GetInDeg(), GetInNId(), GetNbrNId(), GetOutDeg(), GetOutNId(), IsInNId(), IsNbrNId(), and IsOutNId().

862 { return ! LeftHI.IsEnd()?LeftHI:RightHI; }
THashIter LeftHI
Definition: graph.h:860
THashIter RightHI
Definition: graph.h:860

Here is the caller graph for this function:

bool TBPGraph::TNodeI::IsInNId ( const int &  NId) const
inline

Tests whether node with ID NId points to the current node.

Definition at line 899 of file graph.h.

References HI().

899 { return HI().GetDat().IsInNId(NId); }
THashIter HI() const
Definition: graph.h:862

Here is the call graph for this function:

bool TBPGraph::TNodeI::IsLeft ( ) const
inline

Tests whether the node is left hand side node.

Definition at line 880 of file graph.h.

References LeftHI.

Referenced by TBPGraph::AddNode(), and IsRight().

880 { return ! LeftHI.IsEnd(); }
THashIter LeftHI
Definition: graph.h:860

Here is the caller graph for this function:

bool TBPGraph::TNodeI::IsNbrNId ( const int &  NId) const
inline

Tests whether node with ID NId is a neighbor of the current node.

Definition at line 903 of file graph.h.

References HI().

903 { return HI().GetDat().IsNbrNId(NId); }
THashIter HI() const
Definition: graph.h:862

Here is the call graph for this function:

bool TBPGraph::TNodeI::IsOutNId ( const int &  NId) const
inline

Tests whether the current node points to node with ID NId.

Definition at line 901 of file graph.h.

References HI().

901 { return HI().GetDat().IsOutNId(NId); }
THashIter HI() const
Definition: graph.h:862

Here is the call graph for this function:

bool TBPGraph::TNodeI::IsRight ( ) const
inline

Tests whether the node is right hand side node.

Definition at line 882 of file graph.h.

References IsLeft().

882 { return ! IsLeft(); }
bool IsLeft() const
Tests whether the node is left hand side node.
Definition: graph.h:880

Here is the call graph for this function:

TNodeI& TBPGraph::TNodeI::operator++ ( int  )
inline

Increment iterator.

Definition at line 869 of file graph.h.

References LeftHI, and RightHI.

869  {
870  if (! LeftHI.IsEnd()) {
871  LeftHI++; }
872  else if (! RightHI.IsEnd()) {
873  RightHI++; }
874  return *this; }
THashIter LeftHI
Definition: graph.h:860
THashIter RightHI
Definition: graph.h:860
bool TBPGraph::TNodeI::operator< ( const TNodeI NodeI) const
inline

Definition at line 875 of file graph.h.

References LeftHI, and RightHI.

875 { return LeftHI < NodeI.LeftHI || (LeftHI==NodeI.LeftHI && RightHI < NodeI.RightHI); }
THashIter LeftHI
Definition: graph.h:860
THashIter RightHI
Definition: graph.h:860
TNodeI& TBPGraph::TNodeI::operator= ( const TNodeI NodeI)
inline

Definition at line 867 of file graph.h.

References LeftHI, and RightHI.

867 { LeftHI = NodeI.LeftHI; RightHI=NodeI.RightHI; return *this; }
THashIter LeftHI
Definition: graph.h:860
THashIter RightHI
Definition: graph.h:860
bool TBPGraph::TNodeI::operator== ( const TNodeI NodeI) const
inline

Definition at line 876 of file graph.h.

References LeftHI, and RightHI.

876 { return LeftHI==NodeI.LeftHI && RightHI==NodeI.RightHI; }
THashIter LeftHI
Definition: graph.h:860
THashIter RightHI
Definition: graph.h:860

Friends And Related Function Documentation

friend class TBPGraph
friend

Definition at line 904 of file graph.h.

Member Data Documentation

THashIter TBPGraph::TNodeI::LeftHI
private

Definition at line 860 of file graph.h.

Referenced by TBPGraph::GetEI(), HI(), IsLeft(), operator++(), operator<(), operator=(), and operator==().

THashIter TBPGraph::TNodeI::RightHI
private

Definition at line 860 of file graph.h.

Referenced by HI(), operator++(), operator<(), operator=(), and operator==().


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