SNAP Library 6.0, User Reference  2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI Class Reference

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

#include <network.h>

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. More...
 
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. More...
 
int GetSrcNId () const
 Gets the source node of an edge. More...
 
int GetDstNId () const
 Gets the destination node of an edge. More...
 
TEdgeData & operator() ()
 
const TEdgeData & operator() () const
 
TEdgeData & GetDat ()
 
const TEdgeData & GetDat () const
 
TNodeData & GetSrcNDat ()
 
const TNodeData & GetSrcNDat () const
 
TNodeData & GetDstNDat ()
 
const TNodeData & GetDstNDat () const
 

Private Attributes

TNodeI CurNode
 
TNodeI EndNode
 
int CurEdge
 

Friends

class TNodeEDatNet< TNodeData, TEdgeData >
 

Detailed Description

template<class TNodeData, class TEdgeData>
class TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI

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

Definition at line 600 of file network.h.

Constructor & Destructor Documentation

template<class TNodeData, class TEdgeData>
TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::TEdgeI ( )
inline

Definition at line 605 of file network.h.

605 : CurNode(), EndNode(), CurEdge(0) { }
template<class TNodeData, class TEdgeData>
TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::TEdgeI ( const TNodeI NodeI,
const TNodeI EndNodeI,
const int &  EdgeN = 0 
)
inline

Definition at line 606 of file network.h.

606 : CurNode(NodeI), EndNode(EndNodeI), CurEdge(EdgeN) { }
template<class TNodeData, class TEdgeData>
TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::TEdgeI ( const TEdgeI EdgeI)
inline

Definition at line 607 of file network.h.

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

Member Function Documentation

template<class TNodeData, class TEdgeData>
TEdgeData& TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::GetDat ( )
inline

Definition at line 622 of file network.h.

622 { return CurNode.GetOutEDat(CurEdge); }
TEdgeData & GetOutEDat(const int &EdgeN)
Definition: network.h:590
template<class TNodeData, class TEdgeData>
const TEdgeData& TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::GetDat ( ) const
inline

Definition at line 623 of file network.h.

623 { return CurNode.GetOutEDat(CurEdge); }
TEdgeData & GetOutEDat(const int &EdgeN)
Definition: network.h:590
template<class TNodeData, class TEdgeData>
TNodeData& TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::GetDstNDat ( )
inline

Definition at line 626 of file network.h.

626 { return CurNode.GetOutNDat(CurEdge); }
const TNodeData & GetOutNDat(const int &NodeN) const
Definition: network.h:583
template<class TNodeData, class TEdgeData>
const TNodeData& TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::GetDstNDat ( ) const
inline

Definition at line 627 of file network.h.

627 { return CurNode.GetOutNDat(CurEdge); }
const TNodeData & GetOutNDat(const int &NodeN) const
Definition: network.h:583
template<class TNodeData, class TEdgeData>
int TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::GetDstNId ( ) const
inline

Gets the destination node of an edge.

Definition at line 619 of file network.h.

619 { return CurNode.GetOutNId(CurEdge); }
int GetOutNId(const int &NodeN) const
Returns ID of NodeN-th out-node (the node the current node points to).
Definition: network.h:567
template<class TNodeData, class TEdgeData>
int TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::GetId ( ) const
inline

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

Definition at line 615 of file network.h.

615 { return -1; }
template<class TNodeData, class TEdgeData>
TNodeData& TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::GetSrcNDat ( )
inline

Definition at line 624 of file network.h.

624 { return CurNode(); }
template<class TNodeData, class TEdgeData>
const TNodeData& TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::GetSrcNDat ( ) const
inline

Definition at line 625 of file network.h.

625 { return CurNode(); }
template<class TNodeData, class TEdgeData>
int TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::GetSrcNId ( ) const
inline

Gets the source node of an edge.

Definition at line 617 of file network.h.

617 { return CurNode.GetId(); }
int GetId() const
Returns ID of the current node.
Definition: network.h:553
template<class TNodeData, class TEdgeData>
TEdgeData& TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::operator() ( )
inline

Definition at line 620 of file network.h.

620 { return CurNode.GetOutEDat(CurEdge); }
TEdgeData & GetOutEDat(const int &EdgeN)
Definition: network.h:590
template<class TNodeData, class TEdgeData>
const TEdgeData& TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::operator() ( ) const
inline

Definition at line 621 of file network.h.

621 { return CurNode.GetOutEDat(CurEdge); }
TEdgeData & GetOutEDat(const int &EdgeN)
Definition: network.h:590
template<class TNodeData, class TEdgeData>
TEdgeI& TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::operator++ ( int  )
inline

Increment iterator.

Definition at line 610 of file network.h.

610  { CurEdge++; if (CurEdge >= CurNode.GetOutDeg()) { CurEdge=0; CurNode++;
611  while (CurNode < EndNode && CurNode.GetOutDeg()==0) { CurNode++; } } return *this; }
int GetOutDeg() const
Returns out-degree of the current node.
Definition: network.h:559
template<class TNodeData, class TEdgeData>
bool TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::operator< ( const TEdgeI EdgeI) const
inline

Definition at line 612 of file network.h.

612 { return CurNode<EdgeI.CurNode || (CurNode==EdgeI.CurNode && CurEdge<EdgeI.CurEdge); }
template<class TNodeData, class TEdgeData>
TEdgeI& TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::operator= ( const TEdgeI EdgeI)
inline

Definition at line 608 of file network.h.

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

Definition at line 613 of file network.h.

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

Friends And Related Function Documentation

template<class TNodeData, class TEdgeData>
friend class TNodeEDatNet< TNodeData, TEdgeData >
friend

Definition at line 628 of file network.h.

Member Data Documentation

template<class TNodeData, class TEdgeData>
int TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::CurEdge
private

Definition at line 603 of file network.h.

template<class TNodeData, class TEdgeData>
TNodeI TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::CurNode
private

Definition at line 602 of file network.h.

template<class TNodeData, class TEdgeData>
TNodeI TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::EndNode
private

Definition at line 602 of file network.h.


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