SNAP Library 2.1, Developer Reference  2013-09-25 10:47:25
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
TBPGraph::TNodeI Class Reference

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

#include <graph.h>

Collaboration diagram for TBPGraph::TNodeI:

List of all members.

Public Member Functions

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

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


Member Typedef Documentation

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

Definition at line 854 of file graph.h.


Constructor & Destructor Documentation

Definition at line 859 of file graph.h.

: LeftHI(), RightHI() { }
TBPGraph::TNodeI::TNodeI ( const THashIter LeftHIter,
const THashIter RightHIter 
) [inline]

Definition at line 860 of file graph.h.

: LeftHI(LeftHIter), RightHI(RightHIter) { }
TBPGraph::TNodeI::TNodeI ( const TNodeI NodeI) [inline]

Definition at line 861 of file graph.h.

: LeftHI(NodeI.LeftHI), RightHI(NodeI.RightHI) { }

Member Function Documentation

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

Returns degree of the current node.

Definition at line 879 of file graph.h.

References HI().

{ return HI().GetDat().GetDeg(); }

Here is the call graph for this function:

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

Returns ID of the current node.

Definition at line 873 of file graph.h.

References HI().

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

{ return HI().GetDat().GetId(); }

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

References HI().

{ return HI().GetDat().GetInDeg(); }

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

References HI().

{ return HI().GetDat().GetInNId(NodeN); }

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

References HI().

{ return HI().GetDat().GetNbrNId(NodeN); }

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

References HI().

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

{ return HI().GetDat().GetOutDeg(); }

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

References HI().

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

{ return HI().GetDat().GetOutNId(NodeN); }

Here is the call graph for this function:

Here is the caller graph for this function:

THashIter TBPGraph::TNodeI::HI ( ) const [inline, private]

Definition at line 857 of file graph.h.

References LeftHI, and RightHI.

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

{ return ! LeftHI.IsEnd()?LeftHI:RightHI; }

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

References HI().

{ return HI().GetDat().IsInNId(NId); }

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

References LeftHI.

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

{ return ! LeftHI.IsEnd(); }

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

References HI().

{ return HI().GetDat().IsNbrNId(NId); }

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

References HI().

{ return HI().GetDat().IsOutNId(NId); }

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

References IsLeft().

{ return ! IsLeft(); }

Here is the call graph for this function:

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

Increment iterator.

Definition at line 864 of file graph.h.

References LeftHI, and RightHI.

                             { 
      if (! LeftHI.IsEnd()) { 
        LeftHI++; } 
      else if (! RightHI.IsEnd()) { 
        RightHI++; } 
      return *this; }
bool TBPGraph::TNodeI::operator< ( const TNodeI NodeI) const [inline]

Definition at line 870 of file graph.h.

References LeftHI, and RightHI.

{ return LeftHI < NodeI.LeftHI || (LeftHI==NodeI.LeftHI && RightHI < NodeI.RightHI); }
TNodeI& TBPGraph::TNodeI::operator= ( const TNodeI NodeI) [inline]

Definition at line 862 of file graph.h.

References LeftHI, and RightHI.

{ LeftHI = NodeI.LeftHI; RightHI=NodeI.RightHI; return *this; }
bool TBPGraph::TNodeI::operator== ( const TNodeI NodeI) const [inline]

Definition at line 871 of file graph.h.

References LeftHI, and RightHI.

{ return LeftHI==NodeI.LeftHI && RightHI==NodeI.RightHI; }

Friends And Related Function Documentation

friend class TBPGraph [friend]

Definition at line 899 of file graph.h.


Member Data Documentation

Definition at line 855 of file graph.h.

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


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