SNAP Library 4.0, Developer 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
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 960 of file graph.h.

Member Typedef Documentation

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

Definition at line 962 of file graph.h.

Constructor & Destructor Documentation

TBPGraph::TNodeI::TNodeI ( )
inline

Definition at line 967 of file graph.h.

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

Definition at line 968 of file graph.h.

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

Definition at line 969 of file graph.h.

969 : LeftHI(NodeI.LeftHI), RightHI(NodeI.RightHI) { }
THashIter LeftHI
Definition: graph.h:963
THashIter RightHI
Definition: graph.h:963

Member Function Documentation

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

Returns degree of the current node.

Definition at line 987 of file graph.h.

References HI().

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

Here is the call graph for this function:

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

Returns ID of the current node.

Definition at line 981 of file graph.h.

References HI().

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

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

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 989 of file graph.h.

References HI().

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

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 994 of file graph.h.

References HI().

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

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 1000 of file graph.h.

References HI().

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

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 991 of file graph.h.

References HI().

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

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

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 997 of file graph.h.

References HI().

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

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

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 965 of file graph.h.

References LeftHI, and RightHI.

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

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

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 1002 of file graph.h.

References HI().

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

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 983 of file graph.h.

References LeftHI.

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

983 { return ! LeftHI.IsEnd(); }
THashIter LeftHI
Definition: graph.h:963

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 1006 of file graph.h.

References HI().

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

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 1004 of file graph.h.

References HI().

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

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 985 of file graph.h.

References IsLeft().

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

Here is the call graph for this function:

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

Increment iterator.

Definition at line 972 of file graph.h.

References LeftHI, and RightHI.

972  {
973  if (! LeftHI.IsEnd()) {
974  LeftHI++; }
975  else if (! RightHI.IsEnd()) {
976  RightHI++; }
977  return *this; }
THashIter LeftHI
Definition: graph.h:963
THashIter RightHI
Definition: graph.h:963
bool TBPGraph::TNodeI::operator< ( const TNodeI NodeI) const
inline

Definition at line 978 of file graph.h.

References LeftHI, and RightHI.

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

Definition at line 970 of file graph.h.

References LeftHI, and RightHI.

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

Definition at line 979 of file graph.h.

References LeftHI, and RightHI.

979 { return LeftHI==NodeI.LeftHI && RightHI==NodeI.RightHI; }
THashIter LeftHI
Definition: graph.h:963
THashIter RightHI
Definition: graph.h:963

Friends And Related Function Documentation

friend class TBPGraph
friend

Definition at line 1007 of file graph.h.

Member Data Documentation

THashIter TBPGraph::TNodeI::LeftHI
private

Definition at line 963 of file graph.h.

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

THashIter TBPGraph::TNodeI::RightHI
private

Definition at line 963 of file graph.h.

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


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