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

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

#include <network.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 node of an edge.
int GetDstNId () const
 Gets the destination node of an edge.
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.

: CurNode(), EndNode(), CurEdge(0) { }
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.

: CurNode(NodeI), EndNode(EndNodeI), CurEdge(EdgeN) { }
template<class TNodeData>
TNodeNet< TNodeData >::TEdgeI::TEdgeI ( const TEdgeI EdgeI) [inline]

Definition at line 111 of file network.h.

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

Member Function Documentation

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

Definition at line 125 of file network.h.

{ return CurNode.GetOutNDat(CurEdge); }
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.

{ return CurNode.GetOutNId(CurEdge); }
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.

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

Definition at line 124 of file network.h.

{ return CurNode.GetDat(); }
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.

{ return CurNode.GetId(); }
template<class TNodeData>
TEdgeI& TNodeNet< TNodeData >::TEdgeI::operator++ ( int  ) [inline]

Increment iterator.

Definition at line 114 of file network.h.

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

Definition at line 116 of file network.h.

{ return CurNode<EdgeI.CurNode || (CurNode==EdgeI.CurNode && CurEdge<EdgeI.CurEdge); }
template<class TNodeData>
TEdgeI& TNodeNet< TNodeData >::TEdgeI::operator= ( const TEdgeI EdgeI) [inline]

Definition at line 112 of file network.h.

{ if (this!=&EdgeI) { CurNode=EdgeI.CurNode;  EndNode=EdgeI.EndNode;  CurEdge=EdgeI.CurEdge; }  return *this; }
template<class TNodeData>
bool TNodeNet< TNodeData >::TEdgeI::operator== ( const TEdgeI EdgeI) const [inline]

Definition at line 117 of file network.h.

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

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>
int TNodeNet< TNodeData >::TEdgeI::CurEdge [private]

Definition at line 107 of file network.h.

template<class TNodeData>
TNodeI TNodeNet< TNodeData >::TEdgeI::CurNode [private]

Definition at line 106 of file network.h.

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

Definition at line 106 of file network.h.


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