SNAP Library 2.2, Developer Reference  2014-03-11 19:15:55
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
TUNGraph::TNodeI Class Reference

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

#include <graph.h>

Collaboration diagram for TUNGraph::TNodeI:

List of all members.

Public Member Functions

 TNodeI ()
 TNodeI (const THashIter &NodeHIter)
 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.
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 Attributes

THashIter NodeHI

Friends

class TUNGraph

Detailed Description

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

Definition at line 63 of file graph.h.


Member Typedef Documentation

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

Definition at line 65 of file graph.h.


Constructor & Destructor Documentation

Definition at line 68 of file graph.h.

: NodeHI() { }
TUNGraph::TNodeI::TNodeI ( const THashIter NodeHIter) [inline]

Definition at line 69 of file graph.h.

: NodeHI(NodeHIter) { }
TUNGraph::TNodeI::TNodeI ( const TNodeI NodeI) [inline]

Definition at line 70 of file graph.h.

: NodeHI(NodeI.NodeHI) { }

Member Function Documentation

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

Returns ID of the current node.

Definition at line 80 of file graph.h.

References NodeHI.

Referenced by TUNGraph::AddNode(), TUNGraph::BegEI(), TSnap::GetBetweennessCentr(), TUNGraph::TEdgeI::GetSrcNId(), TAGMFit::NeighborComInit(), and TAGMFit::RandomInit().

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

Here is the caller graph for this function:

int TUNGraph::TNodeI::GetInDeg ( ) const [inline]

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

Definition at line 84 of file graph.h.

References NodeHI.

{ return NodeHI.GetDat().GetInDeg(); }
int TUNGraph::TNodeI::GetInNId ( const int &  NodeN) const [inline]

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

Range of NodeN: 0 <= NodeN < GetInDeg(). Since the graph is undirected GetInNId(), GetOutNId() and GetNbrNId() all give the same output.

Definition at line 91 of file graph.h.

References NodeHI.

{ return NodeHI.GetDat().GetInNId(NodeN); }
int TUNGraph::TNodeI::GetOutDeg ( ) const [inline]
int TUNGraph::TNodeI::GetOutNId ( const int &  NodeN) const [inline]

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

Range of NodeN: 0 <= NodeN < GetOutDeg(). Since the graph is undirected GetInNId(), GetOutNId() and GetNbrNId() all give the same output.

Definition at line 96 of file graph.h.

References NodeHI.

Referenced by TLocClust::ApproxPageRank(), TUNGraph::BegEI(), TUndirFFire::BurnGeoFire(), TSnap::GetBetweennessCentr(), TAGMUtil::GetConductance(), TLocClust::GetCutStat(), TUNGraph::TEdgeI::GetDstNId(), TSnap::GetSubGraph(), and TLocClust::SupportSweep().

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

Here is the caller graph for this function:

bool TUNGraph::TNodeI::IsInNId ( const int &  NId) const [inline]

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

Definition at line 103 of file graph.h.

References NodeHI.

{ return NodeHI.GetDat().IsInNId(NId); }
bool TUNGraph::TNodeI::IsNbrNId ( const int &  NId) const [inline]

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

Definition at line 107 of file graph.h.

References NodeHI.

{ return NodeHI.GetDat().IsNbrNId(NId); }
bool TUNGraph::TNodeI::IsOutNId ( const int &  NId) const [inline]

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

Definition at line 105 of file graph.h.

References NodeHI.

{ return NodeHI.GetDat().IsOutNId(NId); }
TNodeI& TUNGraph::TNodeI::operator++ ( int  ) [inline]

Increment iterator.

Definition at line 74 of file graph.h.

References NodeHI.

{ NodeHI++; return *this; }
bool TUNGraph::TNodeI::operator< ( const TNodeI NodeI) const [inline]

Definition at line 76 of file graph.h.

References NodeHI.

{ return NodeHI < NodeI.NodeHI; }
TNodeI& TUNGraph::TNodeI::operator= ( const TNodeI NodeI) [inline]

Definition at line 71 of file graph.h.

References NodeHI.

{ NodeHI = NodeI.NodeHI; return *this; }
bool TUNGraph::TNodeI::operator== ( const TNodeI NodeI) const [inline]

Definition at line 77 of file graph.h.

References NodeHI.

{ return NodeHI == NodeI.NodeHI; }

Friends And Related Function Documentation

friend class TUNGraph [friend]

Definition at line 108 of file graph.h.


Member Data Documentation


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