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 ('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 |
Edge iterator. Only forward iteration (operator++) is supported.
TBPGraph::TEdgeI::TEdgeI | ( | ) | [inline] |
TBPGraph::TEdgeI::TEdgeI | ( | const TNodeI & | NodeI, |
const TNodeI & | EndNodeI, | ||
const int & | EdgeN = 0 |
||
) | [inline] |
TBPGraph::TEdgeI::TEdgeI | ( | const TEdgeI & | EdgeI | ) | [inline] |
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 920 of file graph.h.
References CurEdge, CurNode, and TBPGraph::TNodeI::GetOutNId().
Referenced by TBPGraph::AddEdge(), and GetRNId().
int TBPGraph::TEdgeI::GetId | ( | ) | const [inline] |
int TBPGraph::TEdgeI::GetLNId | ( | ) | const [inline] |
Gets the id of the node on the 'left' side of the edge.
Definition at line 922 of file graph.h.
References GetSrcNId().
{ return GetSrcNId(); }
int TBPGraph::TEdgeI::GetRNId | ( | ) | const [inline] |
Gets the id of the node on the 'right' side of the edge.
Definition at line 924 of file graph.h.
References GetDstNId().
{ 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 918 of file graph.h.
References CurNode, and TBPGraph::TNodeI::GetId().
Referenced by TBPGraph::AddEdge(), and GetLNId().
TEdgeI& TBPGraph::TEdgeI::operator++ | ( | int | ) | [inline] |
Increment iterator.
Definition at line 911 of file graph.h.
References CurEdge, CurNode, EndNode, and TBPGraph::TNodeI::GetOutDeg().
{ 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] |
bool TBPGraph::TEdgeI::operator== | ( | const TEdgeI & | EdgeI | ) | const [inline] |
int TBPGraph::TEdgeI::CurEdge [private] |
Definition at line 904 of file graph.h.
Referenced by GetDstNId(), operator++(), operator<(), operator=(), and operator==().
TNodeI TBPGraph::TEdgeI::CurNode [private] |
Definition at line 903 of file graph.h.
Referenced by GetDstNId(), GetSrcNId(), operator++(), operator<(), operator=(), and operator==().
TNodeI TBPGraph::TEdgeI::EndNode [private] |
Definition at line 903 of file graph.h.
Referenced by operator++(), and operator=().