SNAP Library 2.2, User Reference  2014-03-11 19:15:55
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TNGraph::TEdgeI Class Reference

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

#include <graph.h>

List of all members.

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.
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.
int GetSrcNId () const
 Returns the source node of the edge.
int GetDstNId () const
 Returns the destination node of the edge.

Private Attributes

TNodeI CurNode
TNodeI EndNode
int CurEdge

Friends

class TNGraph

Detailed Description

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

Definition at line 366 of file graph.h.


Constructor & Destructor Documentation

Definition at line 371 of file graph.h.

: CurNode(), EndNode(), CurEdge(0) { }
TNGraph::TEdgeI::TEdgeI ( const TNodeI NodeI,
const TNodeI EndNodeI,
const int &  EdgeN = 0 
) [inline]

Definition at line 372 of file graph.h.

: CurNode(NodeI), EndNode(EndNodeI), CurEdge(EdgeN) { }
TNGraph::TEdgeI::TEdgeI ( const TEdgeI EdgeI) [inline]

Definition at line 373 of file graph.h.

: CurNode(EdgeI.CurNode), EndNode(EdgeI.EndNode), CurEdge(EdgeI.CurEdge) { }

Member Function Documentation

int TNGraph::TEdgeI::GetDstNId ( ) const [inline]

Returns the destination node of the edge.

Definition at line 385 of file graph.h.

{ return CurNode.GetOutNId(CurEdge); }
int TNGraph::TEdgeI::GetId ( ) const [inline]

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

Definition at line 381 of file graph.h.

{ return -1; }
int TNGraph::TEdgeI::GetSrcNId ( ) const [inline]

Returns the source node of the edge.

Definition at line 383 of file graph.h.

{ return CurNode.GetId(); }
TEdgeI& TNGraph::TEdgeI::operator++ ( int  ) [inline]

Increment iterator.

Definition at line 376 of file graph.h.

                             { CurEdge++; if (CurEdge >= CurNode.GetOutDeg()) { CurEdge=0; CurNode++;
      while (CurNode < EndNode && CurNode.GetOutDeg()==0) { CurNode++; } }  return *this; }
bool TNGraph::TEdgeI::operator< ( const TEdgeI EdgeI) const [inline]

Definition at line 378 of file graph.h.

{ return CurNode<EdgeI.CurNode || (CurNode==EdgeI.CurNode && CurEdge<EdgeI.CurEdge); }
TEdgeI& TNGraph::TEdgeI::operator= ( const TEdgeI EdgeI) [inline]

Definition at line 374 of file graph.h.

{ if (this!=&EdgeI) { CurNode=EdgeI.CurNode; EndNode=EdgeI.EndNode; CurEdge=EdgeI.CurEdge; }  return *this; }
bool TNGraph::TEdgeI::operator== ( const TEdgeI EdgeI) const [inline]

Definition at line 379 of file graph.h.

{ return CurNode == EdgeI.CurNode && CurEdge == EdgeI.CurEdge; }

Friends And Related Function Documentation

friend class TNGraph [friend]

Definition at line 386 of file graph.h.


Member Data Documentation

int TNGraph::TEdgeI::CurEdge [private]

Definition at line 369 of file graph.h.

Definition at line 368 of file graph.h.

Definition at line 368 of file graph.h.


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