SNAP Library 3.0, User Reference  2016-07-20 17:56:49
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
TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI Class Reference

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

#include <network.h>

Public Member Functions

 TNodeI ()
 
 TNodeI (const THashIter &NodeHIter, const TNodeEdgeNet *NetPt)
 
 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...
 
const TNodeData & operator() () const
 
TNodeData & operator() ()
 
const TNodeData & GetDat () const
 
TNodeData & GetDat ()
 
const TNodeData & GetInNDat (const int &EdgeN) const
 
TNodeData & GetInNDat (const int &EdgeN)
 
const TNodeData & GetOutNDat (const int &EdgeN) const
 
TNodeData & GetOutNDat (const int &EdgeN)
 
const TNodeData & GetNbrNDat (const int &EdgeN) const
 
TNodeData & GetNbrNDat (const int &EdgeN)
 
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...
 
TEdgeDatGetInEDat (const int &EdgeN)
 
const TEdgeDatGetInEDat (const int &EdgeN) const
 
TEdgeDatGetOutEDat (const int &EdgeN)
 
const TEdgeDatGetOutEDat (const int &EdgeN) const
 
TEdgeDatGetNbrEDat (const int &EdgeN)
 
const TEdgeDatGetNbrEDat (const int &EdgeN) const
 

Private Types

typedef THash< TInt, TNode >::TIter THashIter
 

Private Attributes

THashIter NodeHI
 
TNodeEdgeNetNet
 

Friends

class TNodeEdgeNet
 

Detailed Description

template<class TNodeData, class TEdgeData>
class TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI

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

Definition at line 1037 of file network.h.

Member Typedef Documentation

template<class TNodeData, class TEdgeData>
typedef THash<TInt, TNode>::TIter TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::THashIter
private

Definition at line 1039 of file network.h.

Constructor & Destructor Documentation

template<class TNodeData, class TEdgeData>
TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::TNodeI ( )
inline

Definition at line 1043 of file network.h.

1043 : NodeHI(), Net(NULL) { }
THashIter NodeHI
Definition: network.h:1040
TNodeEdgeNet * Net
Definition: network.h:1041
template<class TNodeData, class TEdgeData>
TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::TNodeI ( const THashIter NodeHIter,
const TNodeEdgeNet NetPt 
)
inline

Definition at line 1044 of file network.h.

1044 : NodeHI(NodeHIter), Net((TNodeEdgeNet *)NetPt) { }
Node Edge Network (directed multigraph, TNEGraph with data on nodes and edges).
Definition: network.h:981
THashIter NodeHI
Definition: network.h:1040
TNodeEdgeNet * Net
Definition: network.h:1041
template<class TNodeData, class TEdgeData>
TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::TNodeI ( const TNodeI NodeI)
inline

Definition at line 1045 of file network.h.

1045 : NodeHI(NodeI.NodeHI), Net(NodeI.Net) { }
THashIter NodeHI
Definition: network.h:1040
TNodeEdgeNet * Net
Definition: network.h:1041

Member Function Documentation

template<class TNodeData, class TEdgeData>
const TNodeData& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetDat ( ) const
inline

Definition at line 1081 of file network.h.

1081 { return NodeHI.GetDat().GetDat(); }
THashIter NodeHI
Definition: network.h:1040
template<class TNodeData, class TEdgeData>
TNodeData& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetDat ( )
inline

Definition at line 1082 of file network.h.

1082 { return NodeHI.GetDat().GetDat(); }
THashIter NodeHI
Definition: network.h:1040
template<class TNodeData, class TEdgeData>
int TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetDeg ( ) const
inline

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

Definition at line 1054 of file network.h.

1054 { return NodeHI.GetDat().GetDeg(); }
THashIter NodeHI
Definition: network.h:1040
template<class TNodeData, class TEdgeData>
int TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetId ( ) const
inline

Returns ID of the current node.

Definition at line 1052 of file network.h.

1052 { return NodeHI.GetDat().GetId(); }
THashIter NodeHI
Definition: network.h:1040
template<class TNodeData, class TEdgeData>
int TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetInDeg ( ) const
inline

Returns in-degree of the current node.

Definition at line 1056 of file network.h.

1056 { return NodeHI.GetDat().GetInDeg(); }
THashIter NodeHI
Definition: network.h:1040
template<class TNodeData, class TEdgeData>
TEdgeDat& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetInEDat ( const int &  EdgeN)
inline

Definition at line 1103 of file network.h.

1103 { return Net->GetEDat(GetInEId(EdgeN)); }
int GetInEId(const int &EdgeN) const
Returns ID of EdgeN-th in-edge.
Definition: network.h:1091
TEdgeData & GetEDat(const int &EId)
Returns edge data for the edge with ID EId.
Definition: network.h:1261
TNodeEdgeNet * Net
Definition: network.h:1041
template<class TNodeData, class TEdgeData>
const TEdgeDat& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetInEDat ( const int &  EdgeN) const
inline

Definition at line 1104 of file network.h.

1104 { return Net->GetEDat(GetInEId(EdgeN)); }
int GetInEId(const int &EdgeN) const
Returns ID of EdgeN-th in-edge.
Definition: network.h:1091
TEdgeData & GetEDat(const int &EId)
Returns edge data for the edge with ID EId.
Definition: network.h:1261
TNodeEdgeNet * Net
Definition: network.h:1041
template<class TNodeData, class TEdgeData>
int TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetInEId ( const int &  EdgeN) const
inline

Returns ID of EdgeN-th in-edge.

Definition at line 1091 of file network.h.

1091 { return NodeHI.GetDat().GetInEId(EdgeN); }
THashIter NodeHI
Definition: network.h:1040
template<class TNodeData, class TEdgeData>
const TNodeData& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetInNDat ( const int &  EdgeN) const
inline

Definition at line 1083 of file network.h.

1083 { return Net->GetNDat(GetInNId(EdgeN)); }
int GetInNId(const int &EdgeN) const
Returns ID of EdgeN-th in-node (the node pointing to the current node).
Definition: network.h:1062
TNodeData & GetNDat(const int &NId)
Returns node data for the node of ID NId in the network.
Definition: network.h:1208
TNodeEdgeNet * Net
Definition: network.h:1041
template<class TNodeData, class TEdgeData>
TNodeData& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetInNDat ( const int &  EdgeN)
inline

Definition at line 1084 of file network.h.

1084 { return Net->GetNDat(GetInNId(EdgeN)); }
int GetInNId(const int &EdgeN) const
Returns ID of EdgeN-th in-node (the node pointing to the current node).
Definition: network.h:1062
TNodeData & GetNDat(const int &NId)
Returns node data for the node of ID NId in the network.
Definition: network.h:1208
TNodeEdgeNet * Net
Definition: network.h:1041
template<class TNodeData, class TEdgeData>
int TNodeEdgeNet< TNodeData, TEdgeData >::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 1062 of file network.h.

1062 { return Net->GetEdge(NodeHI.GetDat().GetInEId(EdgeN)).GetSrcNId(); }
THashIter NodeHI
Definition: network.h:1040
TNodeEdgeNet * Net
Definition: network.h:1041
TEdge & GetEdge(const int &EId)
Definition: network.h:1147
template<class TNodeData, class TEdgeData>
TEdgeDat& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetNbrEDat ( const int &  EdgeN)
inline

Definition at line 1107 of file network.h.

1107 { return Net->GetEDat(GetNbrEId(EdgeN)); }
int GetNbrEId(const int &EdgeN) const
Returns ID of EdgeN-th in or out-edge.
Definition: network.h:1095
TEdgeData & GetEDat(const int &EId)
Returns edge data for the edge with ID EId.
Definition: network.h:1261
TNodeEdgeNet * Net
Definition: network.h:1041
template<class TNodeData, class TEdgeData>
const TEdgeDat& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetNbrEDat ( const int &  EdgeN) const
inline

Definition at line 1108 of file network.h.

1108 { return Net->GetEDat(GetNbrEId(EdgeN)); }
int GetNbrEId(const int &EdgeN) const
Returns ID of EdgeN-th in or out-edge.
Definition: network.h:1095
TEdgeData & GetEDat(const int &EId)
Returns edge data for the edge with ID EId.
Definition: network.h:1261
TNodeEdgeNet * Net
Definition: network.h:1041
template<class TNodeData, class TEdgeData>
int TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetNbrEId ( const int &  EdgeN) const
inline

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

Definition at line 1095 of file network.h.

1095 { return NodeHI.GetDat().GetNbrEId(EdgeN); }
THashIter NodeHI
Definition: network.h:1040
template<class TNodeData, class TEdgeData>
const TNodeData& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetNbrNDat ( const int &  EdgeN) const
inline

Definition at line 1087 of file network.h.

1087 { return Net->GetNDat(GetNbrNId(EdgeN)); }
int GetNbrNId(const int &EdgeN) const
Returns ID of EdgeN-th neighboring node.
Definition: network.h:1070
TNodeData & GetNDat(const int &NId)
Returns node data for the node of ID NId in the network.
Definition: network.h:1208
TNodeEdgeNet * Net
Definition: network.h:1041
template<class TNodeData, class TEdgeData>
TNodeData& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetNbrNDat ( const int &  EdgeN)
inline

Definition at line 1088 of file network.h.

1088 { return Net->GetNDat(GetNbrNId(EdgeN)); }
int GetNbrNId(const int &EdgeN) const
Returns ID of EdgeN-th neighboring node.
Definition: network.h:1070
TNodeData & GetNDat(const int &NId)
Returns node data for the node of ID NId in the network.
Definition: network.h:1208
TNodeEdgeNet * Net
Definition: network.h:1041
template<class TNodeData, class TEdgeData>
int TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetNbrNId ( const int &  EdgeN) const
inline

Returns ID of EdgeN-th neighboring node.

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

Definition at line 1070 of file network.h.

1070  { const TEdge& E = Net->GetEdge(NodeHI.GetDat().GetNbrEId(EdgeN));
1071  return GetId()==E.GetSrcNId() ? E.GetDstNId():E.GetSrcNId(); }
THashIter NodeHI
Definition: network.h:1040
TNodeEdgeNet * Net
Definition: network.h:1041
TEdge & GetEdge(const int &EId)
Definition: network.h:1147
int GetId() const
Returns ID of the current node.
Definition: network.h:1052
template<class TNodeData, class TEdgeData>
int TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetOutDeg ( ) const
inline

Returns out-degree of the current node.

Definition at line 1058 of file network.h.

1058 { return NodeHI.GetDat().GetOutDeg(); }
THashIter NodeHI
Definition: network.h:1040
template<class TNodeData, class TEdgeData>
TEdgeDat& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetOutEDat ( const int &  EdgeN)
inline

Definition at line 1105 of file network.h.

1105 { return Net->GetEDat(GetOutEId(EdgeN)); }
int GetOutEId(const int &EdgeN) const
Returns ID of EdgeN-th out-edge.
Definition: network.h:1093
TEdgeData & GetEDat(const int &EId)
Returns edge data for the edge with ID EId.
Definition: network.h:1261
TNodeEdgeNet * Net
Definition: network.h:1041
template<class TNodeData, class TEdgeData>
const TEdgeDat& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetOutEDat ( const int &  EdgeN) const
inline

Definition at line 1106 of file network.h.

1106 { return Net->GetEDat(GetOutEId(EdgeN)); }
int GetOutEId(const int &EdgeN) const
Returns ID of EdgeN-th out-edge.
Definition: network.h:1093
TEdgeData & GetEDat(const int &EId)
Returns edge data for the edge with ID EId.
Definition: network.h:1261
TNodeEdgeNet * Net
Definition: network.h:1041
template<class TNodeData, class TEdgeData>
int TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetOutEId ( const int &  EdgeN) const
inline

Returns ID of EdgeN-th out-edge.

Definition at line 1093 of file network.h.

1093 { return NodeHI.GetDat().GetOutEId(EdgeN); }
THashIter NodeHI
Definition: network.h:1040
template<class TNodeData, class TEdgeData>
const TNodeData& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetOutNDat ( const int &  EdgeN) const
inline

Definition at line 1085 of file network.h.

1085 { return Net->GetNDat(GetOutNId(EdgeN)); }
int GetOutNId(const int &EdgeN) const
Returns ID of EdgeN-th out-node (the node the current node points to).
Definition: network.h:1066
TNodeData & GetNDat(const int &NId)
Returns node data for the node of ID NId in the network.
Definition: network.h:1208
TNodeEdgeNet * Net
Definition: network.h:1041
template<class TNodeData, class TEdgeData>
TNodeData& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetOutNDat ( const int &  EdgeN)
inline

Definition at line 1086 of file network.h.

1086 { return Net->GetNDat(GetOutNId(EdgeN)); }
int GetOutNId(const int &EdgeN) const
Returns ID of EdgeN-th out-node (the node the current node points to).
Definition: network.h:1066
TNodeData & GetNDat(const int &NId)
Returns node data for the node of ID NId in the network.
Definition: network.h:1208
TNodeEdgeNet * Net
Definition: network.h:1041
template<class TNodeData, class TEdgeData>
int TNodeEdgeNet< TNodeData, TEdgeData >::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 1066 of file network.h.

1066 { return Net->GetEdge(NodeHI.GetDat().GetOutEId(EdgeN)).GetDstNId(); }
THashIter NodeHI
Definition: network.h:1040
TNodeEdgeNet * Net
Definition: network.h:1041
TEdge & GetEdge(const int &EId)
Definition: network.h:1147
template<class TNodeData, class TEdgeData>
bool TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::IsInEId ( const int &  EId) const
inline

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

Definition at line 1097 of file network.h.

1097 { return NodeHI.GetDat().IsInEId(EId); }
THashIter NodeHI
Definition: network.h:1040
template<class TNodeData , class TEdgeData >
bool TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::IsInNId ( const int &  NId) const

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

Definition at line 1325 of file network.h.

1325  {
1326  const TNode& Node = NodeHI.GetDat();
1327  for (int edge = 0; edge < Node.GetInDeg(); edge++) {
1328  if (NId == Net->GetEdge(Node.GetInEId(edge)).GetSrcNId())
1329  return true;
1330  }
1331  return false;
1332 }
THashIter NodeHI
Definition: network.h:1040
TNodeEdgeNet * Net
Definition: network.h:1041
TEdge & GetEdge(const int &EId)
Definition: network.h:1147
template<class TNodeData, class TEdgeData>
bool TNodeEdgeNet< TNodeData, TEdgeData >::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 1101 of file network.h.

1101 { return NodeHI.GetDat().IsNbrEId(EId); }
THashIter NodeHI
Definition: network.h:1040
template<class TNodeData, class TEdgeData>
bool TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::IsNbrNId ( const int &  NId) const
inline

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

Definition at line 1077 of file network.h.

1077 { return IsOutNId(NId) || IsInNId(NId); }
bool IsOutNId(const int &NId) const
Tests whether the current node points to node with ID NId.
Definition: network.h:1335
bool IsInNId(const int &NId) const
Tests whether node with ID NId points to the current node.
Definition: network.h:1325
template<class TNodeData, class TEdgeData>
bool TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::IsOutEId ( const int &  EId) const
inline

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

Definition at line 1099 of file network.h.

1099 { return NodeHI.GetDat().IsOutEId(EId); }
THashIter NodeHI
Definition: network.h:1040
template<class TNodeData , class TEdgeData >
bool TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::IsOutNId ( const int &  NId) const

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

Definition at line 1335 of file network.h.

1335  {
1336  const TNode& Node = NodeHI.GetDat();
1337  for (int edge = 0; edge < Node.GetOutDeg(); edge++) {
1338  if (NId == Net->GetEdge(Node.GetOutEId(edge)).GetDstNId())
1339  return true;
1340  }
1341  return false;
1342 }
THashIter NodeHI
Definition: network.h:1040
TNodeEdgeNet * Net
Definition: network.h:1041
TEdge & GetEdge(const int &EId)
Definition: network.h:1147
template<class TNodeData, class TEdgeData>
const TNodeData& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::operator() ( ) const
inline

Definition at line 1079 of file network.h.

1079 { return NodeHI.GetDat().GetDat(); }
THashIter NodeHI
Definition: network.h:1040
template<class TNodeData, class TEdgeData>
TNodeData& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::operator() ( )
inline

Definition at line 1080 of file network.h.

1080 { return NodeHI.GetDat().GetDat(); }
THashIter NodeHI
Definition: network.h:1040
template<class TNodeData, class TEdgeData>
TNodeI& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::operator++ ( int  )
inline

Increment iterator.

Definition at line 1048 of file network.h.

1048 { NodeHI++; return *this; }
THashIter NodeHI
Definition: network.h:1040
template<class TNodeData, class TEdgeData>
bool TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::operator< ( const TNodeI NodeI) const
inline

Definition at line 1049 of file network.h.

1049 { return NodeHI < NodeI.NodeHI; }
THashIter NodeHI
Definition: network.h:1040
template<class TNodeData, class TEdgeData>
TNodeI& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::operator= ( const TNodeI NodeI)
inline

Definition at line 1046 of file network.h.

1046 { NodeHI = NodeI.NodeHI; Net=NodeI.Net; return *this; }
THashIter NodeHI
Definition: network.h:1040
TNodeEdgeNet * Net
Definition: network.h:1041
template<class TNodeData, class TEdgeData>
bool TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::operator== ( const TNodeI NodeI) const
inline

Definition at line 1050 of file network.h.

1050 { return NodeHI == NodeI.NodeHI; }
THashIter NodeHI
Definition: network.h:1040

Friends And Related Function Documentation

template<class TNodeData, class TEdgeData>
friend class TNodeEdgeNet
friend

Definition at line 1109 of file network.h.

Member Data Documentation

template<class TNodeData, class TEdgeData>
TNodeEdgeNet* TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::Net
private

Definition at line 1041 of file network.h.

template<class TNodeData, class TEdgeData>
THashIter TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::NodeHI
private

Definition at line 1040 of file network.h.


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