SNAP Library , Developer Reference
2013-01-07 14:03:36
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
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) | |
TNodeI & | operator= (const TNodeI &NodeI) |
TNodeI & | operator++ (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 &EdgeN) const |
Returns ID of EdgeN-th in-node (the node pointing to the current node). | |
int | GetOutNId (const int &EdgeN) const |
Returns ID of EdgeN-th out-node (the node the current node points to). | |
int | GetNbrNId (const int &EdgeN) const |
Returns ID of EdgeN-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. | |
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. | |
int | GetOutEId (const int &EdgeN) const |
Returns ID of EdgeN-th out-edge. | |
int | GetNbrEId (const int &EdgeN) const |
Returns ID of EdgeN-th in or out-edge. | |
bool | IsInEId (const int &EId) const |
Tests whether the edge with ID EId is an in-edge of current node. | |
bool | IsOutEId (const int &EId) const |
Tests whether the edge with ID EId is an out-edge of current node. | |
bool | IsNbrEId (const int &EId) const |
Tests whether the edge with ID EId is an in or out-edge of current node. | |
TEdgeDat & | GetInEDat (const int &EdgeN) |
const TEdgeDat & | GetInEDat (const int &EdgeN) const |
TEdgeDat & | GetOutEDat (const int &EdgeN) |
const TEdgeDat & | GetOutEDat (const int &EdgeN) const |
TEdgeDat & | GetNbrEDat (const int &EdgeN) |
const TEdgeDat & | GetNbrEDat (const int &EdgeN) const |
Private Types | |
typedef THash< TInt, TNode >::TIter | THashIter |
Private Attributes | |
THashIter | NodeHI |
TNodeEdgeNet * | Net |
Friends | |
class | TNodeEdgeNet |
Node iterator. Only forward iteration (operator++) is supported.
typedef THash<TInt, TNode>::TIter TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::THashIter [private] |
TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::TNodeI | ( | ) | [inline] |
TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::TNodeI | ( | const THashIter & | NodeHIter, |
const TNodeEdgeNet * | NetPt | ||
) | [inline] |
Definition at line 1041 of file network.h.
: NodeHI(NodeHIter), Net((TNodeEdgeNet *)NetPt) { }
TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::TNodeI | ( | const TNodeI & | NodeI | ) | [inline] |
const TNodeData& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetDat | ( | ) | const [inline] |
Definition at line 1078 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::NodeHI.
{ return NodeHI.GetDat().GetDat(); }
TNodeData& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetDat | ( | ) | [inline] |
Definition at line 1079 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::NodeHI.
{ return NodeHI.GetDat().GetDat(); }
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 1051 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::NodeHI.
{ return NodeHI.GetDat().GetDeg(); }
int TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetId | ( | ) | const [inline] |
Returns ID of the current node.
Definition at line 1049 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::NodeHI.
Referenced by TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetNbrNId().
{ return NodeHI.GetDat().GetId(); }
int TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetInDeg | ( | ) | const [inline] |
Returns in-degree of the current node.
Definition at line 1053 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::NodeHI.
{ return NodeHI.GetDat().GetInDeg(); }
TEdgeDat& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetInEDat | ( | const int & | EdgeN | ) | [inline] |
Definition at line 1100 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::GetEDat(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetInEId(), and TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::Net.
const TEdgeDat& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetInEDat | ( | const int & | EdgeN | ) | const [inline] |
Definition at line 1101 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::GetEDat(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetInEId(), and TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::Net.
int TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetInEId | ( | const int & | EdgeN | ) | const [inline] |
Returns ID of EdgeN-th in-edge.
Definition at line 1088 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::NodeHI.
Referenced by TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetInEDat().
{ return NodeHI.GetDat().GetInEId(EdgeN); }
const TNodeData& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetInNDat | ( | const int & | EdgeN | ) | const [inline] |
Definition at line 1080 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetInNId(), TNodeEdgeNet< TNodeData, TEdgeData >::GetNDat(), and TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::Net.
TNodeData& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetInNDat | ( | const int & | EdgeN | ) | [inline] |
Definition at line 1081 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetInNId(), and TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::Net.
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 1059 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::GetEdge(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::Net, and TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::NodeHI.
Referenced by TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetInNDat().
TEdgeDat& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetNbrEDat | ( | const int & | EdgeN | ) | [inline] |
Definition at line 1104 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::GetEDat(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetNbrEId(), and TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::Net.
const TEdgeDat& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetNbrEDat | ( | const int & | EdgeN | ) | const [inline] |
Definition at line 1105 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::GetEDat(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetNbrEId(), and TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::Net.
int TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetNbrEId | ( | const int & | EdgeN | ) | const [inline] |
Returns ID of EdgeN-th in or out-edge.
Definition at line 1092 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::NodeHI.
Referenced by TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetNbrEDat().
{ return NodeHI.GetDat().GetNbrEId(EdgeN); }
const TNodeData& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetNbrNDat | ( | const int & | EdgeN | ) | const [inline] |
Definition at line 1084 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetNbrNId(), TNodeEdgeNet< TNodeData, TEdgeData >::GetNDat(), and TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::Net.
TNodeData& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetNbrNDat | ( | const int & | EdgeN | ) | [inline] |
Definition at line 1085 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetNbrNId(), TNodeEdgeNet< TNodeData, TEdgeData >::GetNDat(), and TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::Net.
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 1067 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TEdge::GetDstNId(), TNodeEdgeNet< TNodeData, TEdgeData >::GetEdge(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetId(), TNodeEdgeNet< TNodeData, TEdgeData >::TEdge::GetSrcNId(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::Net, and TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::NodeHI.
Referenced by TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetNbrNDat().
{ const TEdge& E = Net->GetEdge(NodeHI.GetDat().GetNbrEId(EdgeN)); return GetId()==E.GetSrcNId() ? E.GetDstNId():E.GetSrcNId(); }
int TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetOutDeg | ( | ) | const [inline] |
Returns out-degree of the current node.
Definition at line 1055 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::NodeHI.
{ return NodeHI.GetDat().GetOutDeg(); }
TEdgeDat& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetOutEDat | ( | const int & | EdgeN | ) | [inline] |
Definition at line 1102 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::GetEDat(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetOutEId(), and TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::Net.
const TEdgeDat& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetOutEDat | ( | const int & | EdgeN | ) | const [inline] |
Definition at line 1103 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::GetEDat(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetOutEId(), and TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::Net.
int TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetOutEId | ( | const int & | EdgeN | ) | const [inline] |
Returns ID of EdgeN-th out-edge.
Definition at line 1090 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::NodeHI.
Referenced by TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetOutEDat().
{ return NodeHI.GetDat().GetOutEId(EdgeN); }
const TNodeData& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetOutNDat | ( | const int & | EdgeN | ) | const [inline] |
Definition at line 1082 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::GetNDat(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetOutNId(), and TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::Net.
TNodeData& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetOutNDat | ( | const int & | EdgeN | ) | [inline] |
Definition at line 1083 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::GetNDat(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetOutNId(), and TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::Net.
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 1063 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::GetEdge(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::Net, and TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::NodeHI.
Referenced by TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetOutNDat().
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 1094 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::NodeHI.
{ return NodeHI.GetDat().IsInEId(EId); }
bool TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::IsInNId | ( | const int & | NId | ) | const |
Tests whether node with ID NId points to the current node.
Definition at line 1321 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::GetEdge(), TNodeEdgeNet< TNodeData, TEdgeData >::TNode::GetInDeg(), TNodeEdgeNet< TNodeData, TEdgeData >::TNode::GetInEId(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::Net, and TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::NodeHI.
Referenced by TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::IsNbrNId().
{ const TNode& Node = NodeHI.GetDat(); for (int edge = 0; edge < Node.GetInDeg(); edge++) { if (NId == Net->GetEdge(Node.GetInEId(edge)).GetSrcNId()) return true; } return false; }
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 1098 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::NodeHI.
{ return NodeHI.GetDat().IsNbrEId(EId); }
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 1074 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::IsInNId(), and TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::IsOutNId().
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 1096 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::NodeHI.
{ return NodeHI.GetDat().IsOutEId(EId); }
bool TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::IsOutNId | ( | const int & | NId | ) | const |
Tests whether the current node points to node with ID NId.
Definition at line 1331 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TNode::GetDat(), TNodeEdgeNet< TNodeData, TEdgeData >::TNode::GetOutDeg(), and TNodeEdgeNet< TNodeData, TEdgeData >::TNode::GetOutEId().
Referenced by TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::IsNbrNId().
{ const TNode& Node = NodeHI.GetDat(); for (int edge = 0; edge < Node.GetOutDeg(); edge++) { if (NId == Net->GetEdge(Node.GetOutEId(edge)).GetDstNId()) return true; } return false; }
const TNodeData& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::operator() | ( | ) | const [inline] |
Definition at line 1076 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::NodeHI.
{ return NodeHI.GetDat().GetDat(); }
TNodeData& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::operator() | ( | ) | [inline] |
Definition at line 1077 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::NodeHI.
{ return NodeHI.GetDat().GetDat(); }
TNodeI& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::operator++ | ( | int | ) | [inline] |
Increment iterator.
Definition at line 1045 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::NodeHI.
{ NodeHI++; return *this; }
bool TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::operator< | ( | const TNodeI & | NodeI | ) | const [inline] |
Definition at line 1046 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::NodeHI.
{ return NodeHI < NodeI.NodeHI; }
TNodeI& TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::operator= | ( | const TNodeI & | NodeI | ) | [inline] |
Definition at line 1043 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::Net, and TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::NodeHI.
bool TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::operator== | ( | const TNodeI & | NodeI | ) | const [inline] |
Definition at line 1047 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::NodeHI.
{ return NodeHI == NodeI.NodeHI; }
friend class TNodeEdgeNet [friend] |
TNodeEdgeNet* TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::Net [private] |
Definition at line 1038 of file network.h.
Referenced by TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetInEDat(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetInNDat(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetInNId(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetNbrEDat(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetNbrNDat(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetNbrNId(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetOutEDat(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetOutNDat(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetOutNId(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::IsInNId(), and TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::operator=().
THashIter TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::NodeHI [private] |
Definition at line 1037 of file network.h.
Referenced by TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetDat(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetDeg(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetId(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetInDeg(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetInEId(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetInNId(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetNbrEId(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetNbrNId(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetOutDeg(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetOutEId(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::GetOutNId(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::IsInEId(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::IsInNId(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::IsNbrEId(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::IsOutEId(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::operator()(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::operator++(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::operator<(), TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::operator=(), and TNodeEdgeNet< TNodeData, TEdgeData >::TNodeI::operator==().