SNAP Library , Developer Reference
2013-01-07 14:03:36
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
Edge iterator. Only forward iteration (operator++) is supported. More...
#include <graph.h>
Public Member Functions | |
TEdgeI () | |
TEdgeI (const TNodeI &NodeI, const TNodeI &EndNodeI, const int &EdgeN=0) | |
TEdgeI (const TEdgeI &EdgeI) | |
TEdgeI & | operator= (const TEdgeI &EdgeI) |
TEdgeI & | operator++ (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 destination node of an edge. | |
Private Attributes | |
TNodeI | CurNode |
TNodeI | EndNode |
int | CurEdge |
Friends | |
class | TNGraph |
Edge iterator. Only forward iteration (operator++) is supported.
TNGraph::TEdgeI::TEdgeI | ( | ) | [inline] |
TNGraph::TEdgeI::TEdgeI | ( | const TNodeI & | NodeI, |
const TNodeI & | EndNodeI, | ||
const int & | EdgeN = 0 |
||
) | [inline] |
TNGraph::TEdgeI::TEdgeI | ( | const TEdgeI & | EdgeI | ) | [inline] |
int TNGraph::TEdgeI::GetDstNId | ( | ) | const [inline] |
Gets destination node of an edge.
Definition at line 386 of file graph.h.
References CurEdge, CurNode, and TNGraph::TNodeI::GetOutNId().
Referenced by TNGraph::AddEdge().
int TNGraph::TEdgeI::GetId | ( | ) | const [inline] |
int TNGraph::TEdgeI::GetSrcNId | ( | ) | const [inline] |
Gets the source node of an edge.
Definition at line 384 of file graph.h.
References CurNode, and TNGraph::TNodeI::GetId().
Referenced by TNGraph::AddEdge().
TEdgeI& TNGraph::TEdgeI::operator++ | ( | int | ) | [inline] |
Increment iterator.
Definition at line 377 of file graph.h.
References CurEdge, CurNode, EndNode, and TNGraph::TNodeI::GetOutDeg().
{ 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] |
bool TNGraph::TEdgeI::operator== | ( | const TEdgeI & | EdgeI | ) | const [inline] |
int TNGraph::TEdgeI::CurEdge [private] |
Definition at line 370 of file graph.h.
Referenced by GetDstNId(), operator++(), operator<(), operator=(), and operator==().
TNodeI TNGraph::TEdgeI::CurNode [private] |
Definition at line 369 of file graph.h.
Referenced by GetDstNId(), GetSrcNId(), operator++(), operator<(), operator=(), and operator==().
TNodeI TNGraph::TEdgeI::EndNode [private] |
Definition at line 369 of file graph.h.
Referenced by operator++(), and operator=().