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
TDirNet::TEdgeI Class Reference

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

#include <network.h>

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
 Returns edge ID. Always returns -1 since only edges in multigraphs have explicit IDs. More...
 
int GetSrcNId () const
 Returns the source node of the edge. More...
 
int GetDstNId () const
 Returns the destination node of the edge. More...
 

Private Attributes

TNodeI CurNode
 
TNodeI EndNode
 
int CurEdge
 

Friends

class TDirNet
 

Detailed Description

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

Definition at line 3343 of file network.h.

Constructor & Destructor Documentation

TDirNet::TEdgeI::TEdgeI ( )
inline

Definition at line 3348 of file network.h.

3348 : CurNode(), EndNode(), CurEdge(0) { }
TNodeI CurNode
Definition: network.h:3345
TNodeI EndNode
Definition: network.h:3345
TDirNet::TEdgeI::TEdgeI ( const TNodeI NodeI,
const TNodeI EndNodeI,
const int &  EdgeN = 0 
)
inline

Definition at line 3349 of file network.h.

3349 : CurNode(NodeI), EndNode(EndNodeI), CurEdge(EdgeN) { }
TNodeI CurNode
Definition: network.h:3345
TNodeI EndNode
Definition: network.h:3345
TDirNet::TEdgeI::TEdgeI ( const TEdgeI EdgeI)
inline

Definition at line 3350 of file network.h.

3350 : CurNode(EdgeI.CurNode), EndNode(EdgeI.EndNode), CurEdge(EdgeI.CurEdge) { }
TNodeI CurNode
Definition: network.h:3345
TNodeI EndNode
Definition: network.h:3345

Member Function Documentation

int TDirNet::TEdgeI::GetDstNId ( ) const
inline

Returns the destination node of the edge.

Definition at line 3362 of file network.h.

3362 { return CurNode.GetOutNId(CurEdge); }
int GetOutNId(const int &NodeN) const
Returns ID of NodeN-th out-node (the node the current node points to).
Definition: network.h:3329
TNodeI CurNode
Definition: network.h:3345
int TDirNet::TEdgeI::GetId ( ) const
inline

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

Definition at line 3358 of file network.h.

3358 { return -1; }
int TDirNet::TEdgeI::GetSrcNId ( ) const
inline

Returns the source node of the edge.

Definition at line 3360 of file network.h.

3360 { return CurNode.GetId(); }
TNodeI CurNode
Definition: network.h:3345
int GetId() const
Returns ID of the current node.
Definition: network.h:3315
TEdgeI& TDirNet::TEdgeI::operator++ ( int  )
inline

Increment iterator.

Definition at line 3353 of file network.h.

3353  { CurEdge++; if (CurEdge >= CurNode.GetOutDeg()) { CurEdge=0; CurNode++;
3354  while (CurNode < EndNode && CurNode.GetOutDeg()==0) { CurNode++; } } return *this; }
TNodeI CurNode
Definition: network.h:3345
TNodeI EndNode
Definition: network.h:3345
int GetOutDeg() const
Returns out-degree of the current node.
Definition: network.h:3321
bool TDirNet::TEdgeI::operator< ( const TEdgeI EdgeI) const
inline

Definition at line 3355 of file network.h.

3355 { return CurNode<EdgeI.CurNode || (CurNode==EdgeI.CurNode && CurEdge<EdgeI.CurEdge); }
TNodeI CurNode
Definition: network.h:3345
TEdgeI& TDirNet::TEdgeI::operator= ( const TEdgeI EdgeI)
inline

Definition at line 3351 of file network.h.

3351 { if (this!=&EdgeI) { CurNode=EdgeI.CurNode; EndNode=EdgeI.EndNode; CurEdge=EdgeI.CurEdge; } return *this; }
TNodeI CurNode
Definition: network.h:3345
TNodeI EndNode
Definition: network.h:3345
bool TDirNet::TEdgeI::operator== ( const TEdgeI EdgeI) const
inline

Definition at line 3356 of file network.h.

3356 { return CurNode == EdgeI.CurNode && CurEdge == EdgeI.CurEdge; }
TNodeI CurNode
Definition: network.h:3345

Friends And Related Function Documentation

friend class TDirNet
friend

Definition at line 3363 of file network.h.

Member Data Documentation

int TDirNet::TEdgeI::CurEdge
private

Definition at line 3346 of file network.h.

TNodeI TDirNet::TEdgeI::CurNode
private

Definition at line 3345 of file network.h.

TNodeI TDirNet::TEdgeI::EndNode
private

Definition at line 3345 of file network.h.


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