SNAP Library , Developer Reference  2013-01-07 14:03:36
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
TNGraph::TNodeI Class Reference

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

#include <graph.h>

Collaboration diagram for TNGraph::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, the sum of in-degree and out-degree.
int GetInDeg () const
 Returns in-degree of the current node.
int GetOutDeg () const
 Returns out-degree of the current node.
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 TNGraph

Detailed Description

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

Definition at line 325 of file graph.h.


Member Typedef Documentation

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

Definition at line 327 of file graph.h.


Constructor & Destructor Documentation

Definition at line 330 of file graph.h.

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

Definition at line 331 of file graph.h.

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

Definition at line 332 of file graph.h.

: NodeHI(NodeI.NodeHI) { }

Member Function Documentation

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

Returns degree of the current node, the sum of in-degree and out-degree.

Definition at line 341 of file graph.h.

References NodeHI.

Referenced by TSubGraphEnum< TGraphCounter >::GetSubGraphs(), TSubGraphEnum< TGraphCounter >::GetSubGraphs_recursive(), and TKroneckerLL::SetBestDegPerm().

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

Here is the caller graph for this function:

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

Returns ID of the current node.

Definition at line 339 of file graph.h.

References NodeHI.

Referenced by TNGraph::AddNode(), TGHash< TDat >::GetNodeMap(), TNGraph::TEdgeI::GetSrcNId(), and TSubGraphsEnum::RecurBfs().

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

Here is the caller graph for this function:

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

Returns in-degree of the current node.

Definition at line 343 of file graph.h.

References NodeHI.

Referenced by TForestFire::BurnExpFire(), TForestFire::BurnGeoFire(), TCascade::GetProb(), TKroneckerLL::NodeDLLDelta(), TKroneckerLL::NodeLLDelta(), TSubGraphsEnum::RecurBfs(), TSubGraphsEnum::RecurBfs1(), and TMAGFitBern::UpdateApxPhiMI().

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

Here is the caller graph for this function:

int TNGraph::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().

Definition at line 349 of file graph.h.

References NodeHI.

Referenced by TForestFire::BurnExpFire(), TForestFire::BurnGeoFire(), TCascade::GetProb(), TKroneckerLL::NodeDLLDelta(), TKroneckerLL::NodeLLDelta(), TSubGraphsEnum::RecurBfs(), TSubGraphsEnum::RecurBfs1(), and TMAGFitBern::UpdateApxPhiMI().

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

Here is the caller graph for this function:

int TNGraph::TNodeI::GetNbrNId ( const int &  NodeN) const [inline]

Returns ID of NodeN-th neighboring node.

Range of NodeN: 0 <= NodeN < GetNbrDeg().

Definition at line 357 of file graph.h.

References NodeHI.

Referenced by TGraphEnumUtils::GetIndGraph(), TSubGraphEnum< TGraphCounter >::GetSubGraphs(), and TSubGraphEnum< TGraphCounter >::GetSubGraphs_recursive().

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

Here is the caller graph for this function:

int TNGraph::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().

Definition at line 353 of file graph.h.

References NodeHI.

Referenced by TForestFire::BurnExpFire(), TForestFire::BurnGeoFire(), TKroneckerLL::CalcApxGraphDLL(), TKroneckerLL::CalcApxGraphLL(), TKroneckerLL::CalcGraphLL(), TNetInfBs::GenCascade(), TSnap::GenCopyModel(), TNGraph::TEdgeI::GetDstNId(), TKroneckerLL::NodeDLLDelta(), TKroneckerLL::NodeLLDelta(), TSubGraphsEnum::RecurBfs(), TSubGraphsEnum::RecurBfs1(), and TMAGFitBern::UpdateApxPhiMI().

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

Here is the caller graph for this function:

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

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

Definition at line 359 of file graph.h.

References NodeHI.

Referenced by IsNbrNId().

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

Here is the caller graph for this function:

bool TNGraph::TNodeI::IsNbrNId ( const int &  NId) const [inline]

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

Definition at line 363 of file graph.h.

References IsInNId(), and IsOutNId().

{ return IsOutNId(NId) || IsInNId(NId); }

Here is the call graph for this function:

bool TNGraph::TNodeI::IsOutNId ( const int &  NId) const [inline]

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

Definition at line 361 of file graph.h.

References NodeHI.

Referenced by IsNbrNId().

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

Here is the caller graph for this function:

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

Increment iterator.

Definition at line 335 of file graph.h.

References NodeHI.

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

Definition at line 336 of file graph.h.

References NodeHI.

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

Definition at line 333 of file graph.h.

References NodeHI.

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

Definition at line 337 of file graph.h.

References NodeHI.

{ return NodeHI == NodeI.NodeHI; }

Friends And Related Function Documentation

friend class TNGraph [friend]

Definition at line 364 of file graph.h.


Member Data Documentation


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