SNAP Library 3.0, User Reference  2016-07-20 17:56:49
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>

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 547 of file network.h.

Constructor & Destructor Documentation

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

Definition at line 552 of file network.h.

552 : 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 553 of file network.h.

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

Definition at line 554 of file network.h.

554 : 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 569 of file network.h.

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

Definition at line 570 of file network.h.

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

Definition at line 573 of file network.h.

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

Definition at line 574 of file network.h.

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

Gets the destination node of an edge.

Definition at line 566 of file network.h.

566 { 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:514
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 562 of file network.h.

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

Definition at line 571 of file network.h.

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

Definition at line 572 of file network.h.

572 { 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 564 of file network.h.

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

Definition at line 567 of file network.h.

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

Definition at line 568 of file network.h.

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

Increment iterator.

Definition at line 557 of file network.h.

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

Definition at line 559 of file network.h.

559 { 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 555 of file network.h.

555 { 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 560 of file network.h.

560 { 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 575 of file network.h.

Member Data Documentation

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

Definition at line 550 of file network.h.

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

Definition at line 549 of file network.h.

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

Definition at line 549 of file network.h.


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