SNAP Library 4.0, Developer Reference  2017-07-27 13:18:06
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI Class Reference

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

#include <network.h>

Collaboration diagram for TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI:

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
template<class TNodeData, class TEdgeData>
const TEdgeData& TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::GetDat ( ) const
inline
template<class TNodeData, class TEdgeData>
TNodeData& TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::GetDstNDat ( )
inline

Definition at line 626 of file network.h.

References TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::CurEdge, TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::CurNode, and TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::GetOutNDat().

626 { return CurNode.GetOutNDat(CurEdge); }
const TNodeData & GetOutNDat(const int &NodeN) const
Definition: network.h:583

Here is the call graph for this function:

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

Definition at line 627 of file network.h.

References TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::CurEdge, TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::CurNode, and TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::GetOutNDat().

627 { return CurNode.GetOutNDat(CurEdge); }
const TNodeData & GetOutNDat(const int &NodeN) const
Definition: network.h:583

Here is the call graph for this function:

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.

References TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::CurEdge, TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::CurNode, and TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::GetOutNId().

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

Here is the call graph for this function:

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.

References TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::CurNode.

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.

References TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::CurNode.

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.

References TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::CurNode, and TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::GetId().

617 { return CurNode.GetId(); }
int GetId() const
Returns ID of the current node.
Definition: network.h:553

Here is the call graph for this function:

template<class TNodeData, class TEdgeData>
TEdgeData& TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::operator() ( )
inline
template<class TNodeData, class TEdgeData>
const TEdgeData& TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::operator() ( ) const
inline
template<class TNodeData, class TEdgeData>
TEdgeI& TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::operator++ ( int  )
inline

Increment iterator.

Definition at line 610 of file network.h.

References TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::CurEdge, TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::CurNode, TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::EndNode, and TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::GetOutDeg().

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

Here is the call graph for this function:

template<class TNodeData, class TEdgeData>
bool TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::operator< ( const TEdgeI EdgeI) const
inline

Definition at line 612 of file network.h.

References TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::CurEdge, and TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::CurNode.

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.

References TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::CurEdge, TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::CurNode, and TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::EndNode.

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.

References TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::CurEdge, and TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::CurNode.

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>
TNodeI TNodeEDatNet< TNodeData, TEdgeData >::TEdgeI::EndNode
private

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