SNAP Library 2.0, Developer Reference
2013-05-13 16:33:57
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 of an edge. Since the graph is undirected this is the node with smaller ID of the edge endpoints. | |
int | GetDstNId () const |
Gets destination of an edge. Since the graph is undirected this is the node with greater ID of the edge endpoints. | |
Private Attributes | |
TNodeI | CurNode |
TNodeI | EndNode |
int | CurEdge |
Friends | |
class | TUNGraph |
Edge iterator. Only forward iteration (operator++) is supported.
TUNGraph::TEdgeI::TEdgeI | ( | ) | [inline] |
TUNGraph::TEdgeI::TEdgeI | ( | const TNodeI & | NodeI, |
const TNodeI & | EndNodeI, | ||
const int & | EdgeN = 0 |
||
) | [inline] |
TUNGraph::TEdgeI::TEdgeI | ( | const TEdgeI & | EdgeI | ) | [inline] |
int TUNGraph::TEdgeI::GetDstNId | ( | ) | const [inline] |
Gets destination of an edge. Since the graph is undirected this is the node with greater ID of the edge endpoints.
Definition at line 129 of file graph.h.
References CurEdge, CurNode, and TUNGraph::TNodeI::GetOutNId().
Referenced by TUNGraph::AddEdge(), and operator++().
int TUNGraph::TEdgeI::GetId | ( | ) | const [inline] |
int TUNGraph::TEdgeI::GetSrcNId | ( | ) | const [inline] |
Gets the source of an edge. Since the graph is undirected this is the node with smaller ID of the edge endpoints.
Definition at line 127 of file graph.h.
References CurNode, and TUNGraph::TNodeI::GetId().
Referenced by TUNGraph::AddEdge(), and operator++().
TEdgeI& TUNGraph::TEdgeI::operator++ | ( | int | ) | [inline] |
Increment iterator.
Definition at line 121 of file graph.h.
References CurEdge, CurNode, EndNode, GetDstNId(), TUNGraph::TNodeI::GetOutDeg(), and GetSrcNId().
{ do { CurEdge++; if (CurEdge >= CurNode.GetOutDeg()) { CurEdge=0; CurNode++; while (CurNode < EndNode && CurNode.GetOutDeg()==0) { CurNode++; } } } while (CurNode < EndNode && GetSrcNId()>GetDstNId()); return *this; }
bool TUNGraph::TEdgeI::operator< | ( | const TEdgeI & | EdgeI | ) | const [inline] |
bool TUNGraph::TEdgeI::operator== | ( | const TEdgeI & | EdgeI | ) | const [inline] |
int TUNGraph::TEdgeI::CurEdge [private] |
Definition at line 114 of file graph.h.
Referenced by GetDstNId(), operator++(), operator<(), operator=(), and operator==().
TNodeI TUNGraph::TEdgeI::CurNode [private] |
Definition at line 113 of file graph.h.
Referenced by GetDstNId(), GetSrcNId(), operator++(), operator<(), operator=(), and operator==().
TNodeI TUNGraph::TEdgeI::EndNode [private] |
Definition at line 113 of file graph.h.
Referenced by operator++(), and operator=().