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

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

#include <network.h>

Collaboration diagram for TUndirNet::TNodeI:

Public Member Functions

 TNodeI ()
 
 TNodeI (const THashIter &NodeHIter)
 
 TNodeI (const TNodeI &NodeI)
 
TNodeIoperator= (const TNodeI &NodeI)
 
TNodeIoperator++ (int)
 Increment iterator. More...
 
TNodeIoperator-- (int)
 Decrement 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 (returns same as value GetDeg() since the network is undirected). More...
 
int GetOutDeg () const
 Returns out-degree of the current node (returns same as value GetDeg() since the network is undirected). More...
 
void SortNIdV ()
 Sorts the adjacency lists 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...
 

Private Types

typedef THash< TInt, TNode >::TIter THashIter
 

Private Attributes

THashIter NodeHI
 

Friends

class TUndirNet
 

Detailed Description

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

Definition at line 3181 of file network.h.

Member Typedef Documentation

typedef THash<TInt, TNode>::TIter TUndirNet::TNodeI::THashIter
private

Definition at line 3183 of file network.h.

Constructor & Destructor Documentation

TUndirNet::TNodeI::TNodeI ( )
inline

Definition at line 3186 of file network.h.

3186 : NodeHI() { }
THashIter NodeHI
Definition: network.h:3184
TUndirNet::TNodeI::TNodeI ( const THashIter NodeHIter)
inline

Definition at line 3187 of file network.h.

3187 : NodeHI(NodeHIter) { }
THashIter NodeHI
Definition: network.h:3184
TUndirNet::TNodeI::TNodeI ( const TNodeI NodeI)
inline

Definition at line 3188 of file network.h.

3188 : NodeHI(NodeI.NodeHI) { }
THashIter NodeHI
Definition: network.h:3184

Member Function Documentation

int TUndirNet::TNodeI::GetDeg ( ) const
inline

Returns degree of the current node.

Definition at line 3203 of file network.h.

3203 { return NodeHI.GetDat().GetDeg(); }
THashIter NodeHI
Definition: network.h:3184
int TUndirNet::TNodeI::GetId ( ) const
inline

Returns ID of the current node.

Definition at line 3201 of file network.h.

Referenced by TUndirNet::AddNode(), TUndirNet::AddSAttrDatN(), TUndirNet::BegEI(), TUndirNet::DelSAttrDatN(), TUndirNet::GetSAttrDatN(), and TUndirNet::GetSAttrVN().

3201 { return NodeHI.GetDat().GetId(); }
THashIter NodeHI
Definition: network.h:3184

Here is the caller graph for this function:

int TUndirNet::TNodeI::GetInDeg ( ) const
inline

Returns in-degree of the current node (returns same as value GetDeg() since the network is undirected).

Definition at line 3205 of file network.h.

3205 { return NodeHI.GetDat().GetInDeg(); }
THashIter NodeHI
Definition: network.h:3184
int TUndirNet::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(). Since the graph is undirected GetInNId(), GetOutNId() and GetNbrNId() all give the same output.

Definition at line 3214 of file network.h.

3214 { return NodeHI.GetDat().GetInNId(NodeN); }
THashIter NodeHI
Definition: network.h:3184
int TUndirNet::TNodeI::GetNbrNId ( const int &  NodeN) const
inline

Returns ID of NodeN-th neighboring node.

Range of NodeN: 0 <= NodeN < GetNbrDeg(). Since the graph is undirected GetInNId(), GetOutNId() and GetNbrNId() all give the same output.

Definition at line 3224 of file network.h.

3224 { return NodeHI.GetDat().GetNbrNId(NodeN); }
THashIter NodeHI
Definition: network.h:3184
int TUndirNet::TNodeI::GetOutDeg ( ) const
inline

Returns out-degree of the current node (returns same as value GetDeg() since the network is undirected).

Definition at line 3207 of file network.h.

Referenced by TUndirNet::BegEI().

3207 { return NodeHI.GetDat().GetOutDeg(); }
THashIter NodeHI
Definition: network.h:3184

Here is the caller graph for this function:

int TUndirNet::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(). Since the graph is undirected GetInNId(), GetOutNId() and GetNbrNId() all give the same output.

Definition at line 3219 of file network.h.

Referenced by TUndirNet::BegEI().

3219 { return NodeHI.GetDat().GetOutNId(NodeN); }
THashIter NodeHI
Definition: network.h:3184

Here is the caller graph for this function:

bool TUndirNet::TNodeI::IsInNId ( const int &  NId) const
inline

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

Definition at line 3226 of file network.h.

3226 { return NodeHI.GetDat().IsInNId(NId); }
THashIter NodeHI
Definition: network.h:3184
bool TUndirNet::TNodeI::IsNbrNId ( const int &  NId) const
inline

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

Definition at line 3230 of file network.h.

3230 { return NodeHI.GetDat().IsNbrNId(NId); }
THashIter NodeHI
Definition: network.h:3184
bool TUndirNet::TNodeI::IsOutNId ( const int &  NId) const
inline

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

Definition at line 3228 of file network.h.

3228 { return NodeHI.GetDat().IsOutNId(NId); }
THashIter NodeHI
Definition: network.h:3184
TNodeI& TUndirNet::TNodeI::operator++ ( int  )
inline

Increment iterator.

Definition at line 3192 of file network.h.

3192 { NodeHI++; return *this; }
THashIter NodeHI
Definition: network.h:3184
TNodeI& TUndirNet::TNodeI::operator-- ( int  )
inline

Decrement iterator.

Definition at line 3194 of file network.h.

3194 { NodeHI--; return *this; }
THashIter NodeHI
Definition: network.h:3184
bool TUndirNet::TNodeI::operator< ( const TNodeI NodeI) const
inline

Definition at line 3197 of file network.h.

References NodeHI.

3197 { return NodeHI < NodeI.NodeHI; }
THashIter NodeHI
Definition: network.h:3184
TNodeI& TUndirNet::TNodeI::operator= ( const TNodeI NodeI)
inline

Definition at line 3189 of file network.h.

References NodeHI.

3189 { NodeHI = NodeI.NodeHI; return *this; }
THashIter NodeHI
Definition: network.h:3184
bool TUndirNet::TNodeI::operator== ( const TNodeI NodeI) const
inline

Definition at line 3198 of file network.h.

References NodeHI.

3198 { return NodeHI == NodeI.NodeHI; }
THashIter NodeHI
Definition: network.h:3184
void TUndirNet::TNodeI::SortNIdV ( )
inline

Sorts the adjacency lists of the current node.

Definition at line 3209 of file network.h.

3209 { NodeHI.GetDat().SortNIdV(); }
THashIter NodeHI
Definition: network.h:3184

Friends And Related Function Documentation

friend class TUndirNet
friend

Definition at line 3231 of file network.h.

Member Data Documentation

THashIter TUndirNet::TNodeI::NodeHI
private

Definition at line 3184 of file network.h.

Referenced by TUndirNet::GetEI(), operator<(), operator=(), and operator==().


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