SNAP Library 3.0, User Reference  2016-07-20 17:56:49
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>

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

Member Typedef Documentation

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

Definition at line 890 of file graph.h.

Constructor & Destructor Documentation

TBPGraph::TNodeI::TNodeI ( )
inline

Definition at line 895 of file graph.h.

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

Definition at line 896 of file graph.h.

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

Definition at line 897 of file graph.h.

897 : LeftHI(NodeI.LeftHI), RightHI(NodeI.RightHI) { }
THashIter LeftHI
Definition: graph.h:891
THashIter RightHI
Definition: graph.h:891

Member Function Documentation

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

Returns degree of the current node.

Definition at line 915 of file graph.h.

915 { return HI().GetDat().GetDeg(); }
THashIter HI() const
Definition: graph.h:893
int TBPGraph::TNodeI::GetId ( ) const
inline

Returns ID of the current node.

Definition at line 909 of file graph.h.

909 { return HI().GetDat().GetId(); }
THashIter HI() const
Definition: graph.h:893
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 917 of file graph.h.

917 { return HI().GetDat().GetInDeg(); }
THashIter HI() const
Definition: graph.h:893
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 922 of file graph.h.

922 { return HI().GetDat().GetInNId(NodeN); }
THashIter HI() const
Definition: graph.h:893
int TBPGraph::TNodeI::GetNbrNId ( const int &  NodeN) const
inline

Returns ID of NodeN-th neighboring node.

Definition at line 928 of file graph.h.

928 { return HI().GetDat().GetNbrNId(NodeN); }
THashIter HI() const
Definition: graph.h:893
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 919 of file graph.h.

919 { return HI().GetDat().GetOutDeg(); }
THashIter HI() const
Definition: graph.h:893
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 925 of file graph.h.

925 { return HI().GetDat().GetOutNId(NodeN); }
THashIter HI() const
Definition: graph.h:893
THashIter TBPGraph::TNodeI::HI ( ) const
inlineprivate

Definition at line 893 of file graph.h.

893 { return ! LeftHI.IsEnd()?LeftHI:RightHI; }
THashIter LeftHI
Definition: graph.h:891
THashIter RightHI
Definition: graph.h:891
bool TBPGraph::TNodeI::IsInNId ( const int &  NId) const
inline

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

Definition at line 930 of file graph.h.

930 { return HI().GetDat().IsInNId(NId); }
THashIter HI() const
Definition: graph.h:893
bool TBPGraph::TNodeI::IsLeft ( ) const
inline

Tests whether the node is left hand side node.

Definition at line 911 of file graph.h.

911 { return ! LeftHI.IsEnd(); }
THashIter LeftHI
Definition: graph.h:891
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 934 of file graph.h.

934 { return HI().GetDat().IsNbrNId(NId); }
THashIter HI() const
Definition: graph.h:893
bool TBPGraph::TNodeI::IsOutNId ( const int &  NId) const
inline

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

Definition at line 932 of file graph.h.

932 { return HI().GetDat().IsOutNId(NId); }
THashIter HI() const
Definition: graph.h:893
bool TBPGraph::TNodeI::IsRight ( ) const
inline

Tests whether the node is right hand side node.

Definition at line 913 of file graph.h.

913 { return ! IsLeft(); }
bool IsLeft() const
Tests whether the node is left hand side node.
Definition: graph.h:911
TNodeI& TBPGraph::TNodeI::operator++ ( int  )
inline

Increment iterator.

Definition at line 900 of file graph.h.

900  {
901  if (! LeftHI.IsEnd()) {
902  LeftHI++; }
903  else if (! RightHI.IsEnd()) {
904  RightHI++; }
905  return *this; }
THashIter LeftHI
Definition: graph.h:891
THashIter RightHI
Definition: graph.h:891
bool TBPGraph::TNodeI::operator< ( const TNodeI NodeI) const
inline

Definition at line 906 of file graph.h.

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

Definition at line 898 of file graph.h.

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

Definition at line 907 of file graph.h.

907 { return LeftHI==NodeI.LeftHI && RightHI==NodeI.RightHI; }
THashIter LeftHI
Definition: graph.h:891
THashIter RightHI
Definition: graph.h:891

Friends And Related Function Documentation

friend class TBPGraph
friend

Definition at line 935 of file graph.h.

Member Data Documentation

THashIter TBPGraph::TNodeI::LeftHI
private

Definition at line 891 of file graph.h.

THashIter TBPGraph::TNodeI::RightHI
private

Definition at line 891 of file graph.h.


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