SNAP Library 2.1, User Reference  2013-09-25 10:47:25
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
TBPGraph::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
 Gets edge ID. Always returns -1 since only edges in multigraphs have explicit IDs.
int GetSrcNId () const
 Gets the source ('left' side) of an edge. Since the graph is undirected this is the node with smaller ID of the edge endpoints.
int GetDstNId () const
 Gets destination ('right' side) of an edge. Since the graph is undirected this is the node with greater ID of the edge endpoints.
int GetLNId () const
 Gets the id of the node on the 'left' side of the edge.
int GetRNId () const
 Gets the id of the node on the 'right' side of the edge.

Private Attributes

TNodeI CurNode
TNodeI EndNode
int CurEdge

Friends

class TBPGraph

Detailed Description

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

Definition at line 902 of file graph.h.


Constructor & Destructor Documentation

Definition at line 907 of file graph.h.

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

Definition at line 908 of file graph.h.

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

Definition at line 909 of file graph.h.

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

Member Function Documentation

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

Gets destination ('right' side) of an edge. Since the graph is undirected this is the node with greater ID of the edge endpoints.

Definition at line 921 of file graph.h.

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

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

Definition at line 917 of file graph.h.

{ return -1; }
int TBPGraph::TEdgeI::GetLNId ( ) const [inline]

Gets the id of the node on the 'left' side of the edge.

Definition at line 923 of file graph.h.

{ return GetSrcNId(); }
int TBPGraph::TEdgeI::GetRNId ( ) const [inline]

Gets the id of the node on the 'right' side of the edge.

Definition at line 925 of file graph.h.

{ return GetDstNId(); }
int TBPGraph::TEdgeI::GetSrcNId ( ) const [inline]

Gets the source ('left' side) of an edge. Since the graph is undirected this is the node with smaller ID of the edge endpoints.

Definition at line 919 of file graph.h.

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

Increment iterator.

Definition at line 912 of file graph.h.

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

Definition at line 914 of file graph.h.

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

Definition at line 910 of file graph.h.

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

Definition at line 915 of file graph.h.

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

Friends And Related Function Documentation

friend class TBPGraph [friend]

Definition at line 926 of file graph.h.


Member Data Documentation

Definition at line 905 of file graph.h.

Definition at line 904 of file graph.h.

Definition at line 904 of file graph.h.


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