SNAP Library 2.3, Developer Reference  2014-06-16 11:58:46
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
TNodeNet< TNodeData >::TEdgeI Class Reference

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

#include <network.h>

Collaboration diagram for TNodeNet< TNodeData >::TEdgeI:

Public Member Functions

 TEdgeI ()
 
 TEdgeI (const TNodeI &NodeI, const TNodeI &EndNodeI, const int &EdgeN=0)
 
 TEdgeI (const TEdgeI &EdgeI)
 
TEdgeIoperator= (const TEdgeI &EdgeI)
 
TEdgeIoperator++ (int)
 Increment iterator. More...
 
bool operator< (const TEdgeI &EdgeI) const
 
bool operator== (const TEdgeI &EdgeI) const
 
int GetId () const
 Gets edge ID. Always returns -1 since only edges in multigraphs have explicit IDs. More...
 
int GetSrcNId () const
 Gets the source node of an edge. More...
 
int GetDstNId () const
 Gets the destination node of an edge. More...
 
const TNodeData & GetSrcNDat () const
 
TNodeData & GetDstNDat ()
 

Private Attributes

TNodeI CurNode
 
TNodeI EndNode
 
int CurEdge
 

Friends

class TNodeNet< TNodeData >
 

Detailed Description

template<class TNodeData>
class TNodeNet< TNodeData >::TEdgeI

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

Definition at line 104 of file network.h.

Constructor & Destructor Documentation

template<class TNodeData>
TNodeNet< TNodeData >::TEdgeI::TEdgeI ( )
inline

Definition at line 109 of file network.h.

109 : CurNode(), EndNode(), CurEdge(0) { }
TNodeI EndNode
Definition: network.h:106
TNodeI CurNode
Definition: network.h:106
template<class TNodeData>
TNodeNet< TNodeData >::TEdgeI::TEdgeI ( const TNodeI NodeI,
const TNodeI EndNodeI,
const int &  EdgeN = 0 
)
inline

Definition at line 110 of file network.h.

110 : CurNode(NodeI), EndNode(EndNodeI), CurEdge(EdgeN) { }
TNodeI EndNode
Definition: network.h:106
TNodeI CurNode
Definition: network.h:106
template<class TNodeData>
TNodeNet< TNodeData >::TEdgeI::TEdgeI ( const TEdgeI EdgeI)
inline

Definition at line 111 of file network.h.

111 : CurNode(EdgeI.CurNode), EndNode(EdgeI.EndNode), CurEdge(EdgeI.CurEdge) { }
TNodeI EndNode
Definition: network.h:106
TNodeI CurNode
Definition: network.h:106

Member Function Documentation

template<class TNodeData>
TNodeData& TNodeNet< TNodeData >::TEdgeI::GetDstNDat ( )
inline

Definition at line 125 of file network.h.

References TNodeNet< TNodeData >::TEdgeI::CurEdge, TNodeNet< TNodeData >::TEdgeI::CurNode, and TNodeNet< TNodeData >::TNodeI::GetOutNDat().

125 { return CurNode.GetOutNDat(CurEdge); }
const TNodeData & GetOutNDat(const int &NodeN) const
Definition: network.h:96
TNodeI CurNode
Definition: network.h:106

Here is the call graph for this function:

template<class TNodeData>
int TNodeNet< TNodeData >::TEdgeI::GetDstNId ( ) const
inline

Gets the destination node of an edge.

Definition at line 123 of file network.h.

References TNodeNet< TNodeData >::TEdgeI::CurEdge, TNodeNet< TNodeData >::TEdgeI::CurNode, and TNodeNet< TNodeData >::TNodeI::GetOutNId().

123 { return CurNode.GetOutNId(CurEdge); }
TNodeI CurNode
Definition: network.h:106
int GetOutNId(const int &NodeN) const
Returns ID of NodeN-th out-node (the node the current node points to).
Definition: network.h:79

Here is the call graph for this function:

template<class TNodeData>
int TNodeNet< TNodeData >::TEdgeI::GetId ( ) const
inline

Gets edge ID. Always returns -1 since only edges in multigraphs have explicit IDs.

Definition at line 119 of file network.h.

119 { return -1; }
template<class TNodeData>
const TNodeData& TNodeNet< TNodeData >::TEdgeI::GetSrcNDat ( ) const
inline

Definition at line 124 of file network.h.

References TNodeNet< TNodeData >::TEdgeI::CurNode, and TNodeNet< TNodeData >::TNodeI::GetDat().

124 { return CurNode.GetDat(); }
const TNodeData & GetDat() const
Definition: network.h:92
TNodeI CurNode
Definition: network.h:106

Here is the call graph for this function:

template<class TNodeData>
int TNodeNet< TNodeData >::TEdgeI::GetSrcNId ( ) const
inline

Gets the source node of an edge.

Definition at line 121 of file network.h.

References TNodeNet< TNodeData >::TEdgeI::CurNode, and TNodeNet< TNodeData >::TNodeI::GetId().

121 { return CurNode.GetId(); }
int GetId() const
Returns ID of the current node.
Definition: network.h:65
TNodeI CurNode
Definition: network.h:106

Here is the call graph for this function:

template<class TNodeData>
TEdgeI& TNodeNet< TNodeData >::TEdgeI::operator++ ( int  )
inline

Increment iterator.

Definition at line 114 of file network.h.

References TNodeNet< TNodeData >::TEdgeI::CurEdge, TNodeNet< TNodeData >::TEdgeI::CurNode, TNodeNet< TNodeData >::TEdgeI::EndNode, and TNodeNet< TNodeData >::TNodeI::GetOutDeg().

114  { CurEdge++; if (CurEdge >= CurNode.GetOutDeg()) { CurEdge=0; CurNode++;
115  while (CurNode < EndNode && CurNode.GetOutDeg()==0) { CurNode++; } } return *this; }
TNodeI EndNode
Definition: network.h:106
TNodeI CurNode
Definition: network.h:106
int GetOutDeg() const
Returns out-degree of the current node.
Definition: network.h:71

Here is the call graph for this function:

template<class TNodeData>
bool TNodeNet< TNodeData >::TEdgeI::operator< ( const TEdgeI EdgeI) const
inline

Definition at line 116 of file network.h.

References TNodeNet< TNodeData >::TEdgeI::CurEdge, and TNodeNet< TNodeData >::TEdgeI::CurNode.

116 { return CurNode<EdgeI.CurNode || (CurNode==EdgeI.CurNode && CurEdge<EdgeI.CurEdge); }
TNodeI CurNode
Definition: network.h:106
template<class TNodeData>
TEdgeI& TNodeNet< TNodeData >::TEdgeI::operator= ( const TEdgeI EdgeI)
inline

Definition at line 112 of file network.h.

References TNodeNet< TNodeData >::TEdgeI::CurEdge, TNodeNet< TNodeData >::TEdgeI::CurNode, and TNodeNet< TNodeData >::TEdgeI::EndNode.

112 { if (this!=&EdgeI) { CurNode=EdgeI.CurNode; EndNode=EdgeI.EndNode; CurEdge=EdgeI.CurEdge; } return *this; }
TNodeI EndNode
Definition: network.h:106
TNodeI CurNode
Definition: network.h:106
template<class TNodeData>
bool TNodeNet< TNodeData >::TEdgeI::operator== ( const TEdgeI EdgeI) const
inline

Definition at line 117 of file network.h.

References TNodeNet< TNodeData >::TEdgeI::CurEdge, and TNodeNet< TNodeData >::TEdgeI::CurNode.

117 { return CurNode == EdgeI.CurNode && CurEdge == EdgeI.CurEdge; }
TNodeI CurNode
Definition: network.h:106

Friends And Related Function Documentation

template<class TNodeData>
friend class TNodeNet< TNodeData >
friend

Definition at line 126 of file network.h.

Member Data Documentation

template<class TNodeData>
TNodeI TNodeNet< TNodeData >::TEdgeI::EndNode
private

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