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

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

#include <network.h>

Inherited by TModeNet::TNodeI.

Public Member Functions

 TNodeI ()
 
 TNodeI (const THashIter &NodeHIter, const TNEANet *GraphPt)
 
 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, the sum of in-degree and out-degree. 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 &EdgeN) const
 Returns ID of EdgeN-th in-node (the node pointing to the current node). More...
 
int GetOutNId (const int &EdgeN) const
 Returns ID of EdgeN-th out-node (the node the current node points to). More...
 
int GetNbrNId (const int &EdgeN) const
 Returns ID of EdgeN-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...
 
int GetInEId (const int &EdgeN) const
 Returns ID of EdgeN-th in-edge. More...
 
int GetOutEId (const int &EdgeN) const
 Returns ID of EdgeN-th out-edge. More...
 
int GetNbrEId (const int &EdgeN) const
 Returns ID of EdgeN-th in or out-edge. More...
 
bool IsInEId (const int &EId) const
 Tests whether the edge with ID EId is an in-edge of current node. More...
 
bool IsOutEId (const int &EId) const
 Tests whether the edge with ID EId is an out-edge of current node. More...
 
bool IsNbrEId (const int &EId) const
 Tests whether the edge with ID EId is an in or out-edge of current node. More...
 
void GetAttrNames (TStrV &Names) const
 Gets vector of attribute names. More...
 
void GetAttrVal (TStrV &Val) const
 Gets vector of attribute values. More...
 
void GetIntAttrNames (TStrV &Names) const
 Gets vector of int attribute names. More...
 
void GetIntAttrVal (TIntV &Val) const
 Gets vector of int attribute values. More...
 
void GetIntVAttrNames (TStrV &Names) const
 Gets vector of int attribute names. More...
 
void GetIntVAttrVal (TVec< TIntV > &Val) const
 Gets vector of int attribute values. More...
 
void GetStrAttrNames (TStrV &Names) const
 Gets vector of str attribute names. More...
 
void GetStrAttrVal (TStrV &Val) const
 Gets vector of str attribute values. More...
 
void GetFltAttrNames (TStrV &Names) const
 Gets vector of flt attribute names. More...
 
void GetFltAttrVal (TFltV &Val) const
 Gets vector of flt attribute values. More...
 

Protected Types

typedef THash< TInt, TNode >::TIter THashIter
 

Protected Attributes

THashIter NodeHI
 
const TNEANetGraph
 

Friends

class TNEANet
 

Detailed Description

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

Definition at line 1632 of file network.h.

Member Typedef Documentation

typedef THash<TInt, TNode>::TIter TNEANet::TNodeI::THashIter
protected

Definition at line 1634 of file network.h.

Constructor & Destructor Documentation

TNEANet::TNodeI::TNodeI ( )
inline

Definition at line 1638 of file network.h.

1638 : NodeHI(), Graph(NULL) { }
const TNEANet * Graph
Definition: network.h:1636
THashIter NodeHI
Definition: network.h:1635
TNEANet::TNodeI::TNodeI ( const THashIter NodeHIter,
const TNEANet GraphPt 
)
inline

Definition at line 1639 of file network.h.

1639 : NodeHI(NodeHIter), Graph(GraphPt) { }
const TNEANet * Graph
Definition: network.h:1636
THashIter NodeHI
Definition: network.h:1635
TNEANet::TNodeI::TNodeI ( const TNodeI NodeI)
inline

Definition at line 1640 of file network.h.

1640 : NodeHI(NodeI.NodeHI), Graph(NodeI.Graph) { }
const TNEANet * Graph
Definition: network.h:1636
THashIter NodeHI
Definition: network.h:1635

Member Function Documentation

void TNEANet::TNodeI::GetAttrNames ( TStrV Names) const
inline

Gets vector of attribute names.

Definition at line 1685 of file network.h.

1685 { Graph->AttrNameNI(GetId(), Names); }
const TNEANet * Graph
Definition: network.h:1636
int GetId() const
Returns ID of the current node.
Definition: network.h:1647
void AttrNameNI(const TInt &NId, TStrV &Names) const
Returns a vector of attr names for node NId.
Definition: network.h:2034
void TNEANet::TNodeI::GetAttrVal ( TStrV Val) const
inline

Gets vector of attribute values.

Definition at line 1687 of file network.h.

1687 { Graph->AttrValueNI(GetId(), Val); }
const TNEANet * Graph
Definition: network.h:1636
void AttrValueNI(const TInt &NId, TStrV &Values) const
Returns a vector of attr values for node NId.
Definition: network.h:2038
int GetId() const
Returns ID of the current node.
Definition: network.h:1647
int TNEANet::TNodeI::GetDeg ( ) const
inline

Returns degree of the current node, the sum of in-degree and out-degree.

Definition at line 1649 of file network.h.

1649 { return NodeHI.GetDat().GetDeg(); }
THashIter NodeHI
Definition: network.h:1635
void TNEANet::TNodeI::GetFltAttrNames ( TStrV Names) const
inline

Gets vector of flt attribute names.

Definition at line 1701 of file network.h.

1701 { Graph->FltAttrNameNI(GetId(), Names); }
void FltAttrNameNI(const TInt &NId, TStrV &Names) const
Returns a vector of int attr names for node NId.
Definition: network.h:2071
const TNEANet * Graph
Definition: network.h:1636
int GetId() const
Returns ID of the current node.
Definition: network.h:1647
void TNEANet::TNodeI::GetFltAttrVal ( TFltV Val) const
inline

Gets vector of flt attribute values.

Definition at line 1703 of file network.h.

1703 { Graph->FltAttrValueNI(GetId(), Val); }
const TNEANet * Graph
Definition: network.h:1636
int GetId() const
Returns ID of the current node.
Definition: network.h:1647
void FltAttrValueNI(const TInt &NId, TFltV &Values) const
Returns a vector of attr values for node NId.
Definition: network.h:2075
int TNEANet::TNodeI::GetId ( ) const
inline

Returns ID of the current node.

Definition at line 1647 of file network.h.

1647 { return NodeHI.GetDat().GetId(); }
THashIter NodeHI
Definition: network.h:1635
int TNEANet::TNodeI::GetInDeg ( ) const
inline

Returns in-degree of the current node.

Definition at line 1651 of file network.h.

1651 { return NodeHI.GetDat().GetInDeg(); }
THashIter NodeHI
Definition: network.h:1635
int TNEANet::TNodeI::GetInEId ( const int &  EdgeN) const
inline

Returns ID of EdgeN-th in-edge.

Definition at line 1673 of file network.h.

1673 { return NodeHI.GetDat().GetInEId(EdgeN); }
THashIter NodeHI
Definition: network.h:1635
int TNEANet::TNodeI::GetInNId ( const int &  EdgeN) const
inline

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

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

Definition at line 1657 of file network.h.

1657 { return Graph->GetEdge(NodeHI.GetDat().GetInEId(EdgeN)).GetSrcNId(); }
const TNEANet * Graph
Definition: network.h:1636
TEdge & GetEdge(const int &EId)
Definition: network.h:1842
THashIter NodeHI
Definition: network.h:1635
void TNEANet::TNodeI::GetIntAttrNames ( TStrV Names) const
inline

Gets vector of int attribute names.

Definition at line 1689 of file network.h.

1689 { Graph->IntAttrNameNI(GetId(), Names); }
const TNEANet * Graph
Definition: network.h:1636
void IntAttrNameNI(const TInt &NId, TStrV &Names) const
Returns a vector of int attr names for node NId.
Definition: network.h:2043
int GetId() const
Returns ID of the current node.
Definition: network.h:1647
void TNEANet::TNodeI::GetIntAttrVal ( TIntV Val) const
inline

Gets vector of int attribute values.

Definition at line 1691 of file network.h.

1691 { Graph->IntAttrValueNI(GetId(), Val); }
const TNEANet * Graph
Definition: network.h:1636
int GetId() const
Returns ID of the current node.
Definition: network.h:1647
void IntAttrValueNI(const TInt &NId, TIntV &Values) const
Returns a vector of attr values for node NId.
Definition: network.h:2047
void TNEANet::TNodeI::GetIntVAttrNames ( TStrV Names) const
inline

Gets vector of int attribute names.

Definition at line 1693 of file network.h.

1693 { Graph->IntVAttrNameNI(GetId(), Names); }
void IntVAttrNameNI(const TInt &NId, TStrV &Names) const
Returns a vector of int attr names for node NId.
Definition: network.h:2053
const TNEANet * Graph
Definition: network.h:1636
int GetId() const
Returns ID of the current node.
Definition: network.h:1647
void TNEANet::TNodeI::GetIntVAttrVal ( TVec< TIntV > &  Val) const
inline

Gets vector of int attribute values.

Definition at line 1695 of file network.h.

1695 { Graph->IntVAttrValueNI(GetId(), Val); }
const TNEANet * Graph
Definition: network.h:1636
void IntVAttrValueNI(const TInt &NId, TVec< TIntV > &Values) const
Returns a vector of attr values for node NId.
Definition: network.h:2057
int GetId() const
Returns ID of the current node.
Definition: network.h:1647
int TNEANet::TNodeI::GetNbrEId ( const int &  EdgeN) const
inline

Returns ID of EdgeN-th in or out-edge.

Definition at line 1677 of file network.h.

1677 { return NodeHI.GetDat().GetNbrEId(EdgeN); }
THashIter NodeHI
Definition: network.h:1635
int TNEANet::TNodeI::GetNbrNId ( const int &  EdgeN) const
inline

Returns ID of EdgeN-th neighboring node.

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

Definition at line 1665 of file network.h.

1665 { const TEdge& E = Graph->GetEdge(NodeHI.GetDat().GetNbrEId(EdgeN)); return GetId()==E.GetSrcNId() ? E.GetDstNId():E.GetSrcNId(); }
const TNEANet * Graph
Definition: network.h:1636
int GetId() const
Returns ID of the current node.
Definition: network.h:1647
TEdge & GetEdge(const int &EId)
Definition: network.h:1842
THashIter NodeHI
Definition: network.h:1635
int TNEANet::TNodeI::GetOutDeg ( ) const
inline

Returns out-degree of the current node.

Definition at line 1653 of file network.h.

1653 { return NodeHI.GetDat().GetOutDeg(); }
THashIter NodeHI
Definition: network.h:1635
int TNEANet::TNodeI::GetOutEId ( const int &  EdgeN) const
inline

Returns ID of EdgeN-th out-edge.

Definition at line 1675 of file network.h.

1675 { return NodeHI.GetDat().GetOutEId(EdgeN); }
THashIter NodeHI
Definition: network.h:1635
int TNEANet::TNodeI::GetOutNId ( const int &  EdgeN) const
inline

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

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

Definition at line 1661 of file network.h.

1661 { return Graph->GetEdge(NodeHI.GetDat().GetOutEId(EdgeN)).GetDstNId(); }
const TNEANet * Graph
Definition: network.h:1636
TEdge & GetEdge(const int &EId)
Definition: network.h:1842
THashIter NodeHI
Definition: network.h:1635
void TNEANet::TNodeI::GetStrAttrNames ( TStrV Names) const
inline

Gets vector of str attribute names.

Definition at line 1697 of file network.h.

1697 { Graph->StrAttrNameNI(GetId(), Names); }
void StrAttrNameNI(const TInt &NId, TStrV &Names) const
Returns a vector of str attr names for node NId.
Definition: network.h:2063
const TNEANet * Graph
Definition: network.h:1636
int GetId() const
Returns ID of the current node.
Definition: network.h:1647
void TNEANet::TNodeI::GetStrAttrVal ( TStrV Val) const
inline

Gets vector of str attribute values.

Definition at line 1699 of file network.h.

1699 { Graph->StrAttrValueNI(GetId(), Val); }
const TNEANet * Graph
Definition: network.h:1636
void StrAttrValueNI(const TInt &NId, TStrV &Values) const
Returns a vector of attr values for node NId.
Definition: network.h:2067
int GetId() const
Returns ID of the current node.
Definition: network.h:1647
bool TNEANet::TNodeI::IsInEId ( const int &  EId) const
inline

Tests whether the edge with ID EId is an in-edge of current node.

Definition at line 1679 of file network.h.

1679 { return NodeHI.GetDat().IsInEId(EId); }
THashIter NodeHI
Definition: network.h:1635
bool TNEANet::TNodeI::IsInNId ( const int &  NId) const

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

Definition at line 7 of file network.cpp.

7  {
8  const TNode& Node = NodeHI.GetDat();
9  for (int edge = 0; edge < Node.GetInDeg(); edge++) {
10  if (NId == Graph->GetEdge(Node.GetInEId(edge)).GetSrcNId())
11  return true;
12  }
13  return false;
14 }
const TNEANet * Graph
Definition: network.h:1636
TEdge & GetEdge(const int &EId)
Definition: network.h:1842
THashIter NodeHI
Definition: network.h:1635
bool TNEANet::TNodeI::IsNbrEId ( const int &  EId) const
inline

Tests whether the edge with ID EId is an in or out-edge of current node.

Definition at line 1683 of file network.h.

1683 { return IsInEId(EId) || IsOutEId(EId); }
bool IsInEId(const int &EId) const
Tests whether the edge with ID EId is an in-edge of current node.
Definition: network.h:1679
bool IsOutEId(const int &EId) const
Tests whether the edge with ID EId is an out-edge of current node.
Definition: network.h:1681
bool TNEANet::TNodeI::IsNbrNId ( const int &  NId) const
inline

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

Definition at line 1671 of file network.h.

1671 { return IsOutNId(NId) || IsInNId(NId); }
bool IsInNId(const int &NId) const
Tests whether node with ID NId points to the current node.
Definition: network.cpp:7
bool IsOutNId(const int &NId) const
Tests whether the current node points to node with ID NId.
Definition: network.cpp:16
bool TNEANet::TNodeI::IsOutEId ( const int &  EId) const
inline

Tests whether the edge with ID EId is an out-edge of current node.

Definition at line 1681 of file network.h.

1681 { return NodeHI.GetDat().IsOutEId(EId); }
THashIter NodeHI
Definition: network.h:1635
bool TNEANet::TNodeI::IsOutNId ( const int &  NId) const

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

Definition at line 16 of file network.cpp.

16  {
17  const TNode& Node = NodeHI.GetDat();
18  for (int edge = 0; edge < Node.GetOutDeg(); edge++) {
19  if (NId == Graph->GetEdge(Node.GetOutEId(edge)).GetDstNId())
20  return true;
21  }
22  return false;
23 }
const TNEANet * Graph
Definition: network.h:1636
TEdge & GetEdge(const int &EId)
Definition: network.h:1842
THashIter NodeHI
Definition: network.h:1635
TNodeI& TNEANet::TNodeI::operator++ ( int  )
inline

Increment iterator.

Definition at line 1643 of file network.h.

1643 { NodeHI++; return *this; }
THashIter NodeHI
Definition: network.h:1635
bool TNEANet::TNodeI::operator< ( const TNodeI NodeI) const
inline

Definition at line 1644 of file network.h.

1644 { return NodeHI < NodeI.NodeHI; }
THashIter NodeHI
Definition: network.h:1635
TNodeI& TNEANet::TNodeI::operator= ( const TNodeI NodeI)
inline

Definition at line 1641 of file network.h.

1641 { NodeHI = NodeI.NodeHI; Graph=NodeI.Graph; return *this; }
const TNEANet * Graph
Definition: network.h:1636
THashIter NodeHI
Definition: network.h:1635
bool TNEANet::TNodeI::operator== ( const TNodeI NodeI) const
inline

Definition at line 1645 of file network.h.

1645 { return NodeHI == NodeI.NodeHI; }
THashIter NodeHI
Definition: network.h:1635

Friends And Related Function Documentation

friend class TNEANet
friend

Definition at line 1704 of file network.h.

Member Data Documentation

const TNEANet* TNEANet::TNodeI::Graph
protected

Definition at line 1636 of file network.h.

THashIter TNEANet::TNodeI::NodeHI
protected

Definition at line 1635 of file network.h.


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