SNAP Library 6.0, User Reference  2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
TNGraph::TNodeI Class Reference

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

#include <graph.h>

Public Member Functions

 TNodeI ()
 
 TNodeI (const THashIter &NodeHIter)
 
 TNodeI (const TNodeI &NodeI)
 
TNodeIoperator= (const TNodeI &NodeI)
 
TNodeIoperator++ (int)
 Increment iterator. More...
 
TNodeIoperator-- (int)
 Decrement iterator. More...
 
bool operator< (const TNodeI &NodeI) const
 
bool operator== (const TNodeI &NodeI) const
 
int GetId () const
 Returns ID of the current node. More...
 
int GetDeg () const
 Returns degree of the current node, the sum of in-degree and out-degree. More...
 
int GetInDeg () const
 Returns in-degree of the current node. More...
 
int GetOutDeg () const
 Returns out-degree of the current node. More...
 
void SortNIdV ()
 Sorts the adjacency lists of the current node. 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 Attributes

THashIter NodeHI
 

Friends

class TNGraph
 

Detailed Description

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

Definition at line 383 of file graph.h.

Member Typedef Documentation

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

Definition at line 385 of file graph.h.

Constructor & Destructor Documentation

TNGraph::TNodeI::TNodeI ( )
inline

Definition at line 388 of file graph.h.

388 : NodeHI() { }
THashIter NodeHI
Definition: graph.h:386
TNGraph::TNodeI::TNodeI ( const THashIter NodeHIter)
inline

Definition at line 389 of file graph.h.

389 : NodeHI(NodeHIter) { }
THashIter NodeHI
Definition: graph.h:386
TNGraph::TNodeI::TNodeI ( const TNodeI NodeI)
inline

Definition at line 390 of file graph.h.

390 : NodeHI(NodeI.NodeHI) { }
THashIter NodeHI
Definition: graph.h:386

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

402 { return NodeHI.GetDat().GetDeg(); }
THashIter NodeHI
Definition: graph.h:386
int TNGraph::TNodeI::GetId ( ) const
inline

Returns ID of the current node.

Definition at line 400 of file graph.h.

400 { return NodeHI.GetDat().GetId(); }
THashIter NodeHI
Definition: graph.h:386
int TNGraph::TNodeI::GetInDeg ( ) const
inline

Returns in-degree of the current node.

Definition at line 404 of file graph.h.

404 { return NodeHI.GetDat().GetInDeg(); }
THashIter NodeHI
Definition: graph.h:386
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 412 of file graph.h.

412 { return NodeHI.GetDat().GetInNId(NodeN); }
THashIter NodeHI
Definition: graph.h:386
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 420 of file graph.h.

420 { return NodeHI.GetDat().GetNbrNId(NodeN); }
THashIter NodeHI
Definition: graph.h:386
int TNGraph::TNodeI::GetOutDeg ( ) const
inline

Returns out-degree of the current node.

Definition at line 406 of file graph.h.

406 { return NodeHI.GetDat().GetOutDeg(); }
THashIter NodeHI
Definition: graph.h:386
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 416 of file graph.h.

416 { return NodeHI.GetDat().GetOutNId(NodeN); }
THashIter NodeHI
Definition: graph.h:386
bool TNGraph::TNodeI::IsInNId ( const int &  NId) const
inline

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

Definition at line 422 of file graph.h.

422 { return NodeHI.GetDat().IsInNId(NId); }
THashIter NodeHI
Definition: graph.h:386
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 426 of file graph.h.

426 { return IsOutNId(NId) || IsInNId(NId); }
bool IsInNId(const int &NId) const
Tests whether node with ID NId points to the current node.
Definition: graph.h:422
bool IsOutNId(const int &NId) const
Tests whether the current node points to node with ID NId.
Definition: graph.h:424
bool TNGraph::TNodeI::IsOutNId ( const int &  NId) const
inline

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

Definition at line 424 of file graph.h.

424 { return NodeHI.GetDat().IsOutNId(NId); }
THashIter NodeHI
Definition: graph.h:386
TNodeI& TNGraph::TNodeI::operator++ ( int  )
inline

Increment iterator.

Definition at line 393 of file graph.h.

393 { NodeHI++; return *this; }
THashIter NodeHI
Definition: graph.h:386
TNodeI& TNGraph::TNodeI::operator-- ( int  )
inline

Decrement iterator.

Definition at line 395 of file graph.h.

395 { NodeHI--; return *this; }
THashIter NodeHI
Definition: graph.h:386
bool TNGraph::TNodeI::operator< ( const TNodeI NodeI) const
inline

Definition at line 397 of file graph.h.

397 { return NodeHI < NodeI.NodeHI; }
THashIter NodeHI
Definition: graph.h:386
TNodeI& TNGraph::TNodeI::operator= ( const TNodeI NodeI)
inline

Definition at line 391 of file graph.h.

391 { NodeHI = NodeI.NodeHI; return *this; }
THashIter NodeHI
Definition: graph.h:386
bool TNGraph::TNodeI::operator== ( const TNodeI NodeI) const
inline

Definition at line 398 of file graph.h.

398 { return NodeHI == NodeI.NodeHI; }
THashIter NodeHI
Definition: graph.h:386
void TNGraph::TNodeI::SortNIdV ( )
inline

Sorts the adjacency lists of the current node.

Definition at line 408 of file graph.h.

408 { NodeHI.GetDat().SortNIdV(); }
THashIter NodeHI
Definition: graph.h:386

Friends And Related Function Documentation

friend class TNGraph
friend

Definition at line 427 of file graph.h.

Member Data Documentation

THashIter TNGraph::TNodeI::NodeHI
private

Definition at line 386 of file graph.h.


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