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 >::TNodeI Class Reference

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

#include <network.h>

Public Member Functions

 TNodeI ()
 
 TNodeI (const THashIter &NodeHIter, const TNodeEDatNet *NetPt)
 
 TNodeI (const TNodeI &NodeI)
 
TNodeIoperator= (const TNodeI &NodeI)
 
TNodeIoperator++ (int)
 Increment iterator. More...
 
bool operator< (const TNodeI &NodeI) const
 
bool operator== (const TNodeI &NodeI) const
 
int GetId () const
 Returns ID of the current node. More...
 
int GetDeg () const
 Returns degree of the current node. More...
 
int GetInDeg () const
 Returns in-degree of the current node. More...
 
int GetOutDeg () const
 Returns out-degree of the current node. More...
 
int GetInNId (const int &NodeN) const
 Returns ID of NodeN-th in-node (the node pointing to the current node). More...
 
int GetOutNId (const int &NodeN) const
 Returns ID of NodeN-th out-node (the node the current node points to). More...
 
int GetNbrNId (const int &NodeN) const
 Returns ID of NodeN-th neighboring node. More...
 
bool IsInNId (const int &NId) const
 Tests whether node with ID NId points to the current node. More...
 
bool IsOutNId (const int &NId) const
 Tests whether the current node points to node with ID NId. More...
 
bool IsNbrNId (const int &NId) const
 Tests whether node with ID NId is a neighbor of the current node. More...
 
const TNodeData & operator() () const
 
TNodeData & operator() ()
 
const TNodeData & GetDat () const
 
TNodeData & GetDat ()
 
const TNodeData & GetOutNDat (const int &NodeN) const
 
TNodeData & GetOutNDat (const int &NodeN)
 
const TNodeData & GetInNDat (const int &NodeN) const
 
TNodeData & GetInNDat (const int &NodeN)
 
const TNodeData & GetNbrNDat (const int &NodeN) const
 
TNodeData & GetNbrNDat (const int &NodeN)
 
TEdgeData & GetOutEDat (const int &EdgeN)
 
const TEdgeData & GetOutEDat (const int &EdgeN) const
 
TEdgeData & GetInEDat (const int &EdgeN)
 
const TEdgeData & GetInEDat (const int &EdgeN) const
 
TEdgeData & GetNbrEDat (const int &EdgeN)
 
const TEdgeData & GetNbrEDat (const int &EdgeN) const
 

Private Types

typedef THash< TInt, TNode >::TIter THashIter
 

Private Attributes

THashIter NodeHI
 
TNodeEDatNetNet
 

Friends

class TNodeEDatNet< TNodeData, TEdgeData >
 

Detailed Description

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

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

Definition at line 484 of file network.h.

Member Typedef Documentation

template<class TNodeData, class TEdgeData>
typedef THash<TInt, TNode>::TIter TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::THashIter
private

Definition at line 486 of file network.h.

Constructor & Destructor Documentation

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

Definition at line 490 of file network.h.

490 : NodeHI(), Net(NULL) { }
TNodeEDatNet * Net
Definition: network.h:488
THashIter NodeHI
Definition: network.h:487
template<class TNodeData, class TEdgeData>
TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::TNodeI ( const THashIter NodeHIter,
const TNodeEDatNet NetPt 
)
inline

Definition at line 491 of file network.h.

491 : NodeHI(NodeHIter), Net((TNodeEDatNet *) NetPt) { }
TNodeEDatNet * Net
Definition: network.h:488
Node Edge Network (directed graph, TNGraph with data on nodes and edges).
Definition: network.h:444
THashIter NodeHI
Definition: network.h:487
template<class TNodeData, class TEdgeData>
TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::TNodeI ( const TNodeI NodeI)
inline

Definition at line 492 of file network.h.

492 : NodeHI(NodeI.NodeHI), Net(NodeI.Net) { }
TNodeEDatNet * Net
Definition: network.h:488
THashIter NodeHI
Definition: network.h:487

Member Function Documentation

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

Definition at line 528 of file network.h.

528 { return NodeHI.GetDat().GetDat(); }
THashIter NodeHI
Definition: network.h:487
template<class TNodeData, class TEdgeData>
TNodeData& TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::GetDat ( )
inline

Definition at line 529 of file network.h.

529 { return NodeHI.GetDat().GetDat(); }
THashIter NodeHI
Definition: network.h:487
template<class TNodeData, class TEdgeData>
int TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::GetDeg ( ) const
inline

Returns degree of the current node.

Definition at line 502 of file network.h.

502 { return NodeHI.GetDat().GetDeg(); }
THashIter NodeHI
Definition: network.h:487
template<class TNodeData, class TEdgeData>
int TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::GetId ( ) const
inline

Returns ID of the current node.

Definition at line 500 of file network.h.

500 { return NodeHI.GetDat().GetId(); }
THashIter NodeHI
Definition: network.h:487
template<class TNodeData, class TEdgeData>
int TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::GetInDeg ( ) const
inline

Returns in-degree of the current node.

Definition at line 504 of file network.h.

504 { return NodeHI.GetDat().GetInDeg(); }
THashIter NodeHI
Definition: network.h:487
template<class TNodeData, class TEdgeData>
TEdgeData& TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::GetInEDat ( const int &  EdgeN)
inline

Definition at line 539 of file network.h.

539 { return Net->GetEDat(GetInNId(EdgeN), GetId()); }
int GetInNId(const int &NodeN) const
Returns ID of NodeN-th in-node (the node pointing to the current node).
Definition: network.h:510
bool GetEDat(const int &SrcNId, const int &DstNId, TEdgeData &EdgeDat) const
Returns edge data in Data for the edge from node IDs SrcNId to DstNId.
Definition: network.h:860
TNodeEDatNet * Net
Definition: network.h:488
int GetId() const
Returns ID of the current node.
Definition: network.h:500
template<class TNodeData, class TEdgeData>
const TEdgeData& TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::GetInEDat ( const int &  EdgeN) const
inline

Definition at line 540 of file network.h.

540 { return Net->GetEDat(GetInNId(EdgeN), GetId()); }
int GetInNId(const int &NodeN) const
Returns ID of NodeN-th in-node (the node pointing to the current node).
Definition: network.h:510
bool GetEDat(const int &SrcNId, const int &DstNId, TEdgeData &EdgeDat) const
Returns edge data in Data for the edge from node IDs SrcNId to DstNId.
Definition: network.h:860
TNodeEDatNet * Net
Definition: network.h:488
int GetId() const
Returns ID of the current node.
Definition: network.h:500
template<class TNodeData, class TEdgeData>
const TNodeData& TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::GetInNDat ( const int &  NodeN) const
inline

Definition at line 532 of file network.h.

532 { return Net->GetNDat(GetInNId(NodeN)); }
int GetInNId(const int &NodeN) const
Returns ID of NodeN-th in-node (the node pointing to the current node).
Definition: network.h:510
TNodeData & GetNDat(const int &NId)
Returns node data for the node of ID NId in the network.
Definition: network.h:639
TNodeEDatNet * Net
Definition: network.h:488
template<class TNodeData, class TEdgeData>
TNodeData& TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::GetInNDat ( const int &  NodeN)
inline

Definition at line 533 of file network.h.

533 { return Net->GetNDat(GetInNId(NodeN)); }
int GetInNId(const int &NodeN) const
Returns ID of NodeN-th in-node (the node pointing to the current node).
Definition: network.h:510
TNodeData & GetNDat(const int &NId)
Returns node data for the node of ID NId in the network.
Definition: network.h:639
TNodeEDatNet * Net
Definition: network.h:488
template<class TNodeData, class TEdgeData>
int TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::GetInNId ( const int &  NodeN) const
inline

Returns ID of NodeN-th in-node (the node pointing to the current node).

Range of NodeN: 0 <= NodeN < GetInDeg().

Definition at line 510 of file network.h.

510 { return NodeHI.GetDat().GetInNId(NodeN); }
THashIter NodeHI
Definition: network.h:487
template<class TNodeData, class TEdgeData>
TEdgeData& TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::GetNbrEDat ( const int &  EdgeN)
inline

Definition at line 541 of file network.h.

541 { return EdgeN<GetOutDeg() ? GetOutEDat(EdgeN) : GetInEDat(EdgeN-GetOutDeg()); }
TEdgeData & GetInEDat(const int &EdgeN)
Definition: network.h:539
int GetOutDeg() const
Returns out-degree of the current node.
Definition: network.h:506
TEdgeData & GetOutEDat(const int &EdgeN)
Definition: network.h:537
template<class TNodeData, class TEdgeData>
const TEdgeData& TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::GetNbrEDat ( const int &  EdgeN) const
inline

Definition at line 542 of file network.h.

542 { return EdgeN<GetOutDeg() ? GetOutEDat(EdgeN) : GetInEDat(EdgeN-GetOutDeg()); }
TEdgeData & GetInEDat(const int &EdgeN)
Definition: network.h:539
int GetOutDeg() const
Returns out-degree of the current node.
Definition: network.h:506
TEdgeData & GetOutEDat(const int &EdgeN)
Definition: network.h:537
template<class TNodeData, class TEdgeData>
const TNodeData& TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::GetNbrNDat ( const int &  NodeN) const
inline

Definition at line 534 of file network.h.

534 { return Net->GetNDat(GetNbrNId(NodeN)); }
TNodeData & GetNDat(const int &NId)
Returns node data for the node of ID NId in the network.
Definition: network.h:639
int GetNbrNId(const int &NodeN) const
Returns ID of NodeN-th neighboring node.
Definition: network.h:518
TNodeEDatNet * Net
Definition: network.h:488
template<class TNodeData, class TEdgeData>
TNodeData& TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::GetNbrNDat ( const int &  NodeN)
inline

Definition at line 535 of file network.h.

535 { return Net->GetNDat(GetNbrNId(NodeN)); }
TNodeData & GetNDat(const int &NId)
Returns node data for the node of ID NId in the network.
Definition: network.h:639
int GetNbrNId(const int &NodeN) const
Returns ID of NodeN-th neighboring node.
Definition: network.h:518
TNodeEDatNet * Net
Definition: network.h:488
template<class TNodeData, class TEdgeData>
int TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::GetNbrNId ( const int &  NodeN) const
inline

Returns ID of NodeN-th neighboring node.

Range of NodeN: 0 <= NodeN < GetNbrDeg().

Definition at line 518 of file network.h.

518 { return NodeHI.GetDat().GetNbrNId(NodeN); }
THashIter NodeHI
Definition: network.h:487
template<class TNodeData, class TEdgeData>
int TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::GetOutDeg ( ) const
inline

Returns out-degree of the current node.

Definition at line 506 of file network.h.

506 { return NodeHI.GetDat().GetOutDeg(); }
THashIter NodeHI
Definition: network.h:487
template<class TNodeData, class TEdgeData>
TEdgeData& TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::GetOutEDat ( const int &  EdgeN)
inline

Definition at line 537 of file network.h.

537 { return NodeHI.GetDat().GetOutEDat(EdgeN); }
THashIter NodeHI
Definition: network.h:487
template<class TNodeData, class TEdgeData>
const TEdgeData& TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::GetOutEDat ( const int &  EdgeN) const
inline

Definition at line 538 of file network.h.

538 { return NodeHI.GetDat().GetOutEDat(EdgeN); }
THashIter NodeHI
Definition: network.h:487
template<class TNodeData, class TEdgeData>
const TNodeData& TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::GetOutNDat ( const int &  NodeN) const
inline

Definition at line 530 of file network.h.

530 { return Net->GetNDat(GetOutNId(NodeN)); }
TNodeData & GetNDat(const int &NId)
Returns node data for the node of ID NId in the network.
Definition: network.h:639
TNodeEDatNet * Net
Definition: network.h:488
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>
TNodeData& TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::GetOutNDat ( const int &  NodeN)
inline

Definition at line 531 of file network.h.

531 { return Net->GetNDat(GetOutNId(NodeN)); }
TNodeData & GetNDat(const int &NId)
Returns node data for the node of ID NId in the network.
Definition: network.h:639
TNodeEDatNet * Net
Definition: network.h:488
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 >::TNodeI::GetOutNId ( const int &  NodeN) const
inline

Returns ID of NodeN-th out-node (the node the current node points to).

Range of NodeN: 0 <= NodeN < GetOutDeg().

Definition at line 514 of file network.h.

514 { return NodeHI.GetDat().GetOutNId(NodeN); }
THashIter NodeHI
Definition: network.h:487
template<class TNodeData, class TEdgeData>
bool TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::IsInNId ( const int &  NId) const
inline

Tests whether node with ID NId points to the current node.

Definition at line 520 of file network.h.

520 { return NodeHI.GetDat().IsInNId(NId); }
THashIter NodeHI
Definition: network.h:487
template<class TNodeData, class TEdgeData>
bool TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::IsNbrNId ( const int &  NId) const
inline

Tests whether node with ID NId is a neighbor of the current node.

Definition at line 524 of file network.h.

524 { return IsOutNId(NId) || IsInNId(NId); }
bool IsInNId(const int &NId) const
Tests whether node with ID NId points to the current node.
Definition: network.h:520
bool IsOutNId(const int &NId) const
Tests whether the current node points to node with ID NId.
Definition: network.h:522
template<class TNodeData, class TEdgeData>
bool TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::IsOutNId ( const int &  NId) const
inline

Tests whether the current node points to node with ID NId.

Definition at line 522 of file network.h.

522 { return NodeHI.GetDat().IsOutNId(NId); }
THashIter NodeHI
Definition: network.h:487
template<class TNodeData, class TEdgeData>
const TNodeData& TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::operator() ( ) const
inline

Definition at line 526 of file network.h.

526 { return NodeHI.GetDat().NodeDat; }
THashIter NodeHI
Definition: network.h:487
template<class TNodeData, class TEdgeData>
TNodeData& TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::operator() ( )
inline

Definition at line 527 of file network.h.

527 { return NodeHI.GetDat().GetDat(); }
THashIter NodeHI
Definition: network.h:487
template<class TNodeData, class TEdgeData>
TNodeI& TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::operator++ ( int  )
inline

Increment iterator.

Definition at line 495 of file network.h.

495 { NodeHI++; return *this; }
THashIter NodeHI
Definition: network.h:487
template<class TNodeData, class TEdgeData>
bool TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::operator< ( const TNodeI NodeI) const
inline

Definition at line 496 of file network.h.

496 { return NodeHI < NodeI.NodeHI; }
THashIter NodeHI
Definition: network.h:487
template<class TNodeData, class TEdgeData>
TNodeI& TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::operator= ( const TNodeI NodeI)
inline

Definition at line 493 of file network.h.

493 { NodeHI=NodeI.NodeHI; Net=NodeI.Net; return *this; }
TNodeEDatNet * Net
Definition: network.h:488
THashIter NodeHI
Definition: network.h:487
template<class TNodeData, class TEdgeData>
bool TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::operator== ( const TNodeI NodeI) const
inline

Definition at line 497 of file network.h.

497 { return NodeHI == NodeI.NodeHI; }
THashIter NodeHI
Definition: network.h:487

Friends And Related Function Documentation

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

Definition at line 543 of file network.h.

Member Data Documentation

template<class TNodeData, class TEdgeData>
TNodeEDatNet* TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::Net
private

Definition at line 488 of file network.h.

template<class TNodeData, class TEdgeData>
THashIter TNodeEDatNet< TNodeData, TEdgeData >::TNodeI::NodeHI
private

Definition at line 487 of file network.h.


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