SNAP Library 4.0, Developer Reference  2017-07-27 13:18:06
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
TNEANet::TNodeI Class Reference

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

#include <network.h>

Inheritance diagram for TNEANet::TNodeI:
Collaboration diagram for TNEANet::TNodeI:

Public Member Functions

 TNodeI ()
 
 TNodeI (const THashIter &NodeHIter, const TNEANet *GraphPt)
 
 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...
 
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...
 
int GetInNId (const int &EdgeN) const
 Returns ID of EdgeN-th in-node (the node pointing to the current node). More...
 
int GetOutNId (const int &EdgeN) const
 Returns ID of EdgeN-th out-node (the node the current node points to). More...
 
int GetNbrNId (const int &EdgeN) const
 Returns ID of EdgeN-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...
 
int GetInEId (const int &EdgeN) const
 Returns ID of EdgeN-th in-edge. More...
 
int GetOutEId (const int &EdgeN) const
 Returns ID of EdgeN-th out-edge. More...
 
int GetNbrEId (const int &EdgeN) const
 Returns ID of EdgeN-th in or out-edge. More...
 
bool IsInEId (const int &EId) const
 Tests whether the edge with ID EId is an in-edge of current node. More...
 
bool IsOutEId (const int &EId) const
 Tests whether the edge with ID EId is an out-edge of current node. More...
 
bool IsNbrEId (const int &EId) const
 Tests whether the edge with ID EId is an in or out-edge of current node. More...
 
void GetAttrNames (TStrV &Names) const
 Gets vector of attribute names. More...
 
void GetAttrVal (TStrV &Val) const
 Gets vector of attribute values. More...
 
void GetIntAttrNames (TStrV &Names) const
 Gets vector of int attribute names. More...
 
void GetIntAttrVal (TIntV &Val) const
 Gets vector of int attribute values. More...
 
void GetIntVAttrNames (TStrV &Names) const
 Gets vector of int attribute names. More...
 
void GetIntVAttrVal (TVec< TIntV > &Val) const
 Gets vector of int attribute values. More...
 
void GetStrAttrNames (TStrV &Names) const
 Gets vector of str attribute names. More...
 
void GetStrAttrVal (TStrV &Val) const
 Gets vector of str attribute values. More...
 
void GetFltAttrNames (TStrV &Names) const
 Gets vector of flt attribute names. More...
 
void GetFltAttrVal (TFltV &Val) const
 Gets vector of flt attribute values. More...
 

Protected Types

typedef THash< TInt, TNode >::TIter THashIter
 

Protected Attributes

THashIter NodeHI
 
const TNEANetGraph
 

Friends

class TNEANet
 

Detailed Description

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

Definition at line 1792 of file network.h.

Member Typedef Documentation

typedef THash<TInt, TNode>::TIter TNEANet::TNodeI::THashIter
protected

Definition at line 1794 of file network.h.

Constructor & Destructor Documentation

TNEANet::TNodeI::TNodeI ( )
inline

Definition at line 1798 of file network.h.

1798 : NodeHI(), Graph(NULL) { }
const TNEANet * Graph
Definition: network.h:1796
THashIter NodeHI
Definition: network.h:1795
TNEANet::TNodeI::TNodeI ( const THashIter NodeHIter,
const TNEANet GraphPt 
)
inline

Definition at line 1799 of file network.h.

1799 : NodeHI(NodeHIter), Graph(GraphPt) { }
const TNEANet * Graph
Definition: network.h:1796
THashIter NodeHI
Definition: network.h:1795
TNEANet::TNodeI::TNodeI ( const TNodeI NodeI)
inline

Definition at line 1800 of file network.h.

1800 : NodeHI(NodeI.NodeHI), Graph(NodeI.Graph) { }
const TNEANet * Graph
Definition: network.h:1796
THashIter NodeHI
Definition: network.h:1795

Member Function Documentation

void TNEANet::TNodeI::GetAttrNames ( TStrV Names) const
inline

Gets vector of attribute names.

Definition at line 1845 of file network.h.

1845 { Graph->AttrNameNI(GetId(), Names); }
const TNEANet * Graph
Definition: network.h:1796
int GetId() const
Returns ID of the current node.
Definition: network.h:1807
void AttrNameNI(const TInt &NId, TStrV &Names) const
Returns a vector of attr names for node NId.
Definition: network.h:2392
void TNEANet::TNodeI::GetAttrVal ( TStrV Val) const
inline

Gets vector of attribute values.

Definition at line 1847 of file network.h.

1847 { Graph->AttrValueNI(GetId(), Val); }
const TNEANet * Graph
Definition: network.h:1796
void AttrValueNI(const TInt &NId, TStrV &Values) const
Returns a vector of attr values for node NId.
Definition: network.h:2396
int GetId() const
Returns ID of the current node.
Definition: network.h:1807
int TNEANet::TNodeI::GetDeg ( ) const
inline

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

Definition at line 1809 of file network.h.

Referenced by TSnap::PushRelabel().

1809 { return NodeHI.GetDat().GetDeg(); }
THashIter NodeHI
Definition: network.h:1795

Here is the caller graph for this function:

void TNEANet::TNodeI::GetFltAttrNames ( TStrV Names) const
inline

Gets vector of flt attribute names.

Definition at line 1861 of file network.h.

Referenced by TTable::GetNodeTable().

1861 { Graph->FltAttrNameNI(GetId(), Names); }
void FltAttrNameNI(const TInt &NId, TStrV &Names) const
Returns a vector of int attr names for node NId.
Definition: network.h:2429
const TNEANet * Graph
Definition: network.h:1796
int GetId() const
Returns ID of the current node.
Definition: network.h:1807

Here is the caller graph for this function:

void TNEANet::TNodeI::GetFltAttrVal ( TFltV Val) const
inline

Gets vector of flt attribute values.

Definition at line 1863 of file network.h.

1863 { Graph->FltAttrValueNI(GetId(), Val); }
const TNEANet * Graph
Definition: network.h:1796
int GetId() const
Returns ID of the current node.
Definition: network.h:1807
void FltAttrValueNI(const TInt &NId, TFltV &Values) const
Returns a vector of attr values for node NId.
Definition: network.h:2433
int TNEANet::TNodeI::GetInDeg ( ) const
inline

Returns in-degree of the current node.

Definition at line 1811 of file network.h.

Referenced by TSnap::GetWeightedPageRankMP(), TSnap::GlobalRelabel(), TSnap::IntFlowBiDBFS(), TSnap::PushRelabel(), and TSnap::Relabel().

1811 { return NodeHI.GetDat().GetInDeg(); }
THashIter NodeHI
Definition: network.h:1795

Here is the caller graph for this function:

int TNEANet::TNodeI::GetInEId ( const int &  EdgeN) const
inline

Returns ID of EdgeN-th in-edge.

Definition at line 1833 of file network.h.

Referenced by TSnap::GlobalRelabel(), TSnap::IntFlowBiDBFS(), TSnap::PushRelabel(), and TSnap::Relabel().

1833 { return NodeHI.GetDat().GetInEId(EdgeN); }
THashIter NodeHI
Definition: network.h:1795

Here is the caller graph for this function:

int TNEANet::TNodeI::GetInNId ( const int &  EdgeN) const
inline

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

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

Definition at line 1817 of file network.h.

Referenced by TSnap::GetWeightedPageRankMP(), TSnap::GlobalRelabel(), TSnap::IntFlowBiDBFS(), TSnap::PushRelabel(), and TSnap::Relabel().

1817 { return Graph->GetEdge(NodeHI.GetDat().GetInEId(EdgeN)).GetSrcNId(); }
const TNEANet * Graph
Definition: network.h:1796
TEdge & GetEdge(const int &EId)
Definition: network.h:2007
THashIter NodeHI
Definition: network.h:1795

Here is the caller graph for this function:

void TNEANet::TNodeI::GetIntAttrNames ( TStrV Names) const
inline

Gets vector of int attribute names.

Definition at line 1849 of file network.h.

Referenced by TTable::GetNodeTable().

1849 { Graph->IntAttrNameNI(GetId(), Names); }
const TNEANet * Graph
Definition: network.h:1796
void IntAttrNameNI(const TInt &NId, TStrV &Names) const
Returns a vector of int attr names for node NId.
Definition: network.h:2401
int GetId() const
Returns ID of the current node.
Definition: network.h:1807

Here is the caller graph for this function:

void TNEANet::TNodeI::GetIntAttrVal ( TIntV Val) const
inline

Gets vector of int attribute values.

Definition at line 1851 of file network.h.

1851 { Graph->IntAttrValueNI(GetId(), Val); }
const TNEANet * Graph
Definition: network.h:1796
int GetId() const
Returns ID of the current node.
Definition: network.h:1807
void IntAttrValueNI(const TInt &NId, TIntV &Values) const
Returns a vector of attr values for node NId.
Definition: network.h:2405
void TNEANet::TNodeI::GetIntVAttrNames ( TStrV Names) const
inline

Gets vector of int attribute names.

Definition at line 1853 of file network.h.

1853 { Graph->IntVAttrNameNI(GetId(), Names); }
void IntVAttrNameNI(const TInt &NId, TStrV &Names) const
Returns a vector of int attr names for node NId.
Definition: network.h:2411
const TNEANet * Graph
Definition: network.h:1796
int GetId() const
Returns ID of the current node.
Definition: network.h:1807
void TNEANet::TNodeI::GetIntVAttrVal ( TVec< TIntV > &  Val) const
inline

Gets vector of int attribute values.

Definition at line 1855 of file network.h.

1855 { Graph->IntVAttrValueNI(GetId(), Val); }
const TNEANet * Graph
Definition: network.h:1796
void IntVAttrValueNI(const TInt &NId, TVec< TIntV > &Values) const
Returns a vector of attr values for node NId.
Definition: network.h:2415
int GetId() const
Returns ID of the current node.
Definition: network.h:1807
int TNEANet::TNodeI::GetNbrEId ( const int &  EdgeN) const
inline

Returns ID of EdgeN-th in or out-edge.

Definition at line 1837 of file network.h.

1837 { return NodeHI.GetDat().GetNbrEId(EdgeN); }
THashIter NodeHI
Definition: network.h:1795
int TNEANet::TNodeI::GetNbrNId ( const int &  EdgeN) const
inline

Returns ID of EdgeN-th neighboring node.

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

Definition at line 1825 of file network.h.

References TNEANet::TEdge::GetDstNId(), and TNEANet::TEdge::GetSrcNId().

1825 { const TEdge& E = Graph->GetEdge(NodeHI.GetDat().GetNbrEId(EdgeN)); return GetId()==E.GetSrcNId() ? E.GetDstNId():E.GetSrcNId(); }
const TNEANet * Graph
Definition: network.h:1796
int GetId() const
Returns ID of the current node.
Definition: network.h:1807
TEdge & GetEdge(const int &EId)
Definition: network.h:2007
THashIter NodeHI
Definition: network.h:1795

Here is the call graph for this function:

int TNEANet::TNodeI::GetOutDeg ( ) const
inline

Returns out-degree of the current node.

Definition at line 1813 of file network.h.

Referenced by TSnap::GetMaxFlowIntPR(), TSnap::GlobalRelabel(), TSnap::IntFlowBiDBFS(), and TSnap::Relabel().

1813 { return NodeHI.GetDat().GetOutDeg(); }
THashIter NodeHI
Definition: network.h:1795

Here is the caller graph for this function:

int TNEANet::TNodeI::GetOutEId ( const int &  EdgeN) const
inline

Returns ID of EdgeN-th out-edge.

Definition at line 1835 of file network.h.

Referenced by TSnap::GetMaxFlowIntPR(), TSnap::GlobalRelabel(), TSnap::IntFlowBiDBFS(), TSnap::PushRelabel(), and TSnap::Relabel().

1835 { return NodeHI.GetDat().GetOutEId(EdgeN); }
THashIter NodeHI
Definition: network.h:1795

Here is the caller graph for this function:

int TNEANet::TNodeI::GetOutNId ( const int &  EdgeN) const
inline

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

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

Definition at line 1821 of file network.h.

Referenced by TSnap::GetMaxFlowIntPR(), TSnap::GlobalRelabel(), TSnap::IntFlowBiDBFS(), TSnap::PushRelabel(), and TSnap::Relabel().

1821 { return Graph->GetEdge(NodeHI.GetDat().GetOutEId(EdgeN)).GetDstNId(); }
const TNEANet * Graph
Definition: network.h:1796
TEdge & GetEdge(const int &EId)
Definition: network.h:2007
THashIter NodeHI
Definition: network.h:1795

Here is the caller graph for this function:

void TNEANet::TNodeI::GetStrAttrNames ( TStrV Names) const
inline

Gets vector of str attribute names.

Definition at line 1857 of file network.h.

Referenced by TTable::GetNodeTable().

1857 { Graph->StrAttrNameNI(GetId(), Names); }
void StrAttrNameNI(const TInt &NId, TStrV &Names) const
Returns a vector of str attr names for node NId.
Definition: network.h:2421
const TNEANet * Graph
Definition: network.h:1796
int GetId() const
Returns ID of the current node.
Definition: network.h:1807

Here is the caller graph for this function:

void TNEANet::TNodeI::GetStrAttrVal ( TStrV Val) const
inline

Gets vector of str attribute values.

Definition at line 1859 of file network.h.

1859 { Graph->StrAttrValueNI(GetId(), Val); }
const TNEANet * Graph
Definition: network.h:1796
void StrAttrValueNI(const TInt &NId, TStrV &Values) const
Returns a vector of attr values for node NId.
Definition: network.h:2425
int GetId() const
Returns ID of the current node.
Definition: network.h:1807
bool TNEANet::TNodeI::IsInEId ( const int &  EId) const
inline

Tests whether the edge with ID EId is an in-edge of current node.

Definition at line 1839 of file network.h.

1839 { return NodeHI.GetDat().IsInEId(EId); }
THashIter NodeHI
Definition: network.h:1795
bool TNEANet::TNodeI::IsInNId ( const int &  NId) const

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

Definition at line 50 of file network.cpp.

References edge, TNEANet::GetEdge(), TNEANet::TNode::GetInDeg(), TNEANet::TNode::GetInEId(), Graph, and NodeHI.

50  {
51  const TNode& Node = NodeHI.GetDat();
52  for (int edge = 0; edge < Node.GetInDeg(); edge++) {
53  if (NId == Graph->GetEdge(Node.GetInEId(edge)).GetSrcNId())
54  return true;
55  }
56  return false;
57 }
const TNEANet * Graph
Definition: network.h:1796
TEdge & GetEdge(const int &EId)
Definition: network.h:2007
THashIter NodeHI
Definition: network.h:1795

Here is the call graph for this function:

bool TNEANet::TNodeI::IsNbrEId ( const int &  EId) const
inline

Tests whether the edge with ID EId is an in or out-edge of current node.

Definition at line 1843 of file network.h.

1843 { return IsInEId(EId) || IsOutEId(EId); }
bool IsInEId(const int &EId) const
Tests whether the edge with ID EId is an in-edge of current node.
Definition: network.h:1839
bool IsOutEId(const int &EId) const
Tests whether the edge with ID EId is an out-edge of current node.
Definition: network.h:1841
bool TNEANet::TNodeI::IsNbrNId ( const int &  NId) const
inline

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

Definition at line 1831 of file network.h.

1831 { return IsOutNId(NId) || IsInNId(NId); }
bool IsInNId(const int &NId) const
Tests whether node with ID NId points to the current node.
Definition: network.cpp:50
bool IsOutNId(const int &NId) const
Tests whether the current node points to node with ID NId.
Definition: network.cpp:59
bool TNEANet::TNodeI::IsOutEId ( const int &  EId) const
inline

Tests whether the edge with ID EId is an out-edge of current node.

Definition at line 1841 of file network.h.

1841 { return NodeHI.GetDat().IsOutEId(EId); }
THashIter NodeHI
Definition: network.h:1795
bool TNEANet::TNodeI::IsOutNId ( const int &  NId) const

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

Definition at line 59 of file network.cpp.

References edge, TNEANet::TNode::GetOutDeg(), and TNEANet::TNode::GetOutEId().

59  {
60  const TNode& Node = NodeHI.GetDat();
61  for (int edge = 0; edge < Node.GetOutDeg(); edge++) {
62  if (NId == Graph->GetEdge(Node.GetOutEId(edge)).GetDstNId())
63  return true;
64  }
65  return false;
66 }
const TNEANet * Graph
Definition: network.h:1796
TEdge & GetEdge(const int &EId)
Definition: network.h:2007
THashIter NodeHI
Definition: network.h:1795

Here is the call graph for this function:

TNodeI& TNEANet::TNodeI::operator++ ( int  )
inline

Increment iterator.

Definition at line 1803 of file network.h.

1803 { NodeHI++; return *this; }
THashIter NodeHI
Definition: network.h:1795
bool TNEANet::TNodeI::operator< ( const TNodeI NodeI) const
inline

Definition at line 1804 of file network.h.

References NodeHI.

1804 { return NodeHI < NodeI.NodeHI; }
THashIter NodeHI
Definition: network.h:1795
TNodeI& TNEANet::TNodeI::operator= ( const TNodeI NodeI)
inline

Definition at line 1801 of file network.h.

References Graph, and NodeHI.

1801 { NodeHI = NodeI.NodeHI; Graph=NodeI.Graph; return *this; }
const TNEANet * Graph
Definition: network.h:1796
THashIter NodeHI
Definition: network.h:1795
bool TNEANet::TNodeI::operator== ( const TNodeI NodeI) const
inline

Definition at line 1805 of file network.h.

References NodeHI.

1805 { return NodeHI == NodeI.NodeHI; }
THashIter NodeHI
Definition: network.h:1795

Friends And Related Function Documentation

friend class TNEANet
friend

Definition at line 1864 of file network.h.

Member Data Documentation

const TNEANet* TNEANet::TNodeI::Graph
protected

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