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
TNodeNet< TNodeData >::TNode Class Reference

#include <network.h>

Collaboration diagram for TNodeNet< TNodeData >::TNode:

Public Member Functions

 TNode ()
 
 TNode (const int &NId)
 
 TNode (const int &NId, const TNodeData &NodeData)
 
 TNode (const TNode &Node)
 
 TNode (TSIn &SIn)
 
void Save (TSOut &SOut) const
 
int GetId () const
 
int GetDeg () const
 
int GetInDeg () const
 
int GetOutDeg () const
 
const TNodeData & GetDat () const
 
TNodeData & GetDat ()
 
int GetInNId (const int &NodeN) const
 
int GetOutNId (const int &NodeN) const
 
int GetNbrNId (const int &NodeN) const
 
bool IsInNId (const int &NId) const
 
bool IsOutNId (const int &NId) const
 
bool IsNbrNId (const int &NId) const
 
void LoadShM (TShMIn &MStream)
 
bool operator< (const TNode &Node) const
 

Private Attributes

TInt Id
 
TNodeData NodeDat
 
TIntV InNIdV
 
TIntV OutNIdV
 

Friends

class TNodeNet< TNodeData >
 

Detailed Description

template<class TNodeData>
class TNodeNet< TNodeData >::TNode

Definition at line 23 of file network.h.

Constructor & Destructor Documentation

template<class TNodeData>
TNodeNet< TNodeData >::TNode::TNode ( )
inline

Definition at line 29 of file network.h.

29 : Id(-1), NodeDat(), InNIdV(), OutNIdV() { }
TNodeData NodeDat
Definition: network.h:26
TIntV InNIdV
Definition: network.h:27
TIntV OutNIdV
Definition: network.h:27
template<class TNodeData>
TNodeNet< TNodeData >::TNode::TNode ( const int &  NId)
inline

Definition at line 30 of file network.h.

30 : Id(NId), NodeDat(), InNIdV(), OutNIdV() { }
TNodeData NodeDat
Definition: network.h:26
TIntV InNIdV
Definition: network.h:27
TIntV OutNIdV
Definition: network.h:27
template<class TNodeData>
TNodeNet< TNodeData >::TNode::TNode ( const int &  NId,
const TNodeData &  NodeData 
)
inline

Definition at line 31 of file network.h.

31 : Id(NId), NodeDat(NodeData), InNIdV(), OutNIdV() { }
TNodeData NodeDat
Definition: network.h:26
TIntV InNIdV
Definition: network.h:27
TIntV OutNIdV
Definition: network.h:27
template<class TNodeData>
TNodeNet< TNodeData >::TNode::TNode ( const TNode Node)
inline

Definition at line 32 of file network.h.

32 : Id(Node.Id), NodeDat(Node.NodeDat), InNIdV(Node.InNIdV), OutNIdV(Node.OutNIdV) { }
TNodeData NodeDat
Definition: network.h:26
TIntV InNIdV
Definition: network.h:27
TIntV OutNIdV
Definition: network.h:27
template<class TNodeData>
TNodeNet< TNodeData >::TNode::TNode ( TSIn SIn)
inline

Definition at line 33 of file network.h.

33 : Id(SIn), NodeDat(SIn), InNIdV(SIn), OutNIdV(SIn) { }
TNodeData NodeDat
Definition: network.h:26
TIntV InNIdV
Definition: network.h:27
TIntV OutNIdV
Definition: network.h:27

Member Function Documentation

template<class TNodeData>
const TNodeData& TNodeNet< TNodeData >::TNode::GetDat ( ) const
inline

Definition at line 39 of file network.h.

References TNodeNet< TNodeData >::TNode::NodeDat.

39 { return NodeDat; }
TNodeData NodeDat
Definition: network.h:26
template<class TNodeData>
TNodeData& TNodeNet< TNodeData >::TNode::GetDat ( )
inline

Definition at line 40 of file network.h.

References TNodeNet< TNodeData >::TNode::NodeDat.

40 { return NodeDat; }
TNodeData NodeDat
Definition: network.h:26
template<class TNodeData>
int TNodeNet< TNodeData >::TNode::GetDeg ( ) const
inline

Definition at line 36 of file network.h.

References TNodeNet< TNodeData >::TNode::GetInDeg(), and TNodeNet< TNodeData >::TNode::GetOutDeg().

36 { return GetInDeg() + GetOutDeg(); }
int GetInDeg() const
Definition: network.h:37
int GetOutDeg() const
Definition: network.h:38

Here is the call graph for this function:

template<class TNodeData>
int TNodeNet< TNodeData >::TNode::GetId ( ) const
inline

Definition at line 35 of file network.h.

References TNodeNet< TNodeData >::TNode::Id.

Referenced by TNodeNet< TNodeData >::IsOk().

35 { return Id; }

Here is the caller graph for this function:

template<class TNodeData>
int TNodeNet< TNodeData >::TNode::GetInDeg ( ) const
inline

Definition at line 37 of file network.h.

References TNodeNet< TNodeData >::TNode::InNIdV, and TVec< TVal, TSizeTy >::Len().

Referenced by TNodeNet< TNodeData >::DelNode(), TNodeNet< TNodeData >::TNode::GetDeg(), and TNodeNet< TNodeData >::IsOk().

37 { return InNIdV.Len(); }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
TIntV InNIdV
Definition: network.h:27

Here is the call graph for this function:

Here is the caller graph for this function:

template<class TNodeData>
int TNodeNet< TNodeData >::TNode::GetInNId ( const int &  NodeN) const
inline

Definition at line 41 of file network.h.

References TNodeNet< TNodeData >::TNode::InNIdV.

Referenced by TNodeNet< TNodeData >::DelNode(), TNodeNet< TNodeData >::TNode::GetNbrNId(), and TNodeNet< TNodeData >::IsOk().

41 { return InNIdV[NodeN]; }
TIntV InNIdV
Definition: network.h:27

Here is the caller graph for this function:

template<class TNodeData>
int TNodeNet< TNodeData >::TNode::GetNbrNId ( const int &  NodeN) const
inline

Definition at line 43 of file network.h.

References TNodeNet< TNodeData >::TNode::GetInNId(), TNodeNet< TNodeData >::TNode::GetOutDeg(), and TNodeNet< TNodeData >::TNode::GetOutNId().

43 { return NodeN<GetOutDeg() ? GetOutNId(NodeN):GetInNId(NodeN-GetOutDeg()); }
int GetInNId(const int &NodeN) const
Definition: network.h:41
int GetOutNId(const int &NodeN) const
Definition: network.h:42
int GetOutDeg() const
Definition: network.h:38

Here is the call graph for this function:

template<class TNodeData>
int TNodeNet< TNodeData >::TNode::GetOutDeg ( ) const
inline

Definition at line 38 of file network.h.

References TVec< TVal, TSizeTy >::Len(), and TNodeNet< TNodeData >::TNode::OutNIdV.

Referenced by TNodeNet< TNodeData >::DelNode(), TNodeNet< TNodeData >::TNode::GetDeg(), TNodeNet< TNodeData >::TNode::GetNbrNId(), and TNodeNet< TNodeData >::IsOk().

38 { return OutNIdV.Len(); }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
TIntV OutNIdV
Definition: network.h:27

Here is the call graph for this function:

Here is the caller graph for this function:

template<class TNodeData>
int TNodeNet< TNodeData >::TNode::GetOutNId ( const int &  NodeN) const
inline

Definition at line 42 of file network.h.

References TNodeNet< TNodeData >::TNode::OutNIdV.

Referenced by TNodeNet< TNodeData >::DelNode(), TNodeNet< TNodeData >::TNode::GetNbrNId(), and TNodeNet< TNodeData >::IsOk().

42 { return OutNIdV[NodeN]; }
TIntV OutNIdV
Definition: network.h:27

Here is the caller graph for this function:

template<class TNodeData>
bool TNodeNet< TNodeData >::TNode::IsInNId ( const int &  NId) const
inline

Definition at line 44 of file network.h.

References TNodeNet< TNodeData >::TNode::InNIdV, and TVec< TVal, TSizeTy >::SearchBin().

Referenced by TNodeNet< TNodeData >::TNode::IsNbrNId().

44 { return InNIdV.SearchBin(NId) != -1; }
TIntV InNIdV
Definition: network.h:27
TSizeTy SearchBin(const TVal &Val) const
Returns the position of an element with value Val.
Definition: ds.h:1519

Here is the call graph for this function:

Here is the caller graph for this function:

template<class TNodeData>
bool TNodeNet< TNodeData >::TNode::IsNbrNId ( const int &  NId) const
inline

Definition at line 46 of file network.h.

References TNodeNet< TNodeData >::TNode::IsInNId(), and TNodeNet< TNodeData >::TNode::IsOutNId().

46 { return IsOutNId(NId) || IsInNId(NId); }
bool IsOutNId(const int &NId) const
Definition: network.h:45
bool IsInNId(const int &NId) const
Definition: network.h:44

Here is the call graph for this function:

template<class TNodeData>
bool TNodeNet< TNodeData >::TNode::IsOutNId ( const int &  NId) const
inline

Definition at line 45 of file network.h.

References TNodeNet< TNodeData >::TNode::OutNIdV, and TVec< TVal, TSizeTy >::SearchBin().

Referenced by TNodeNet< TNodeData >::TNode::IsNbrNId().

45 { return OutNIdV.SearchBin(NId) != -1; }
TSizeTy SearchBin(const TVal &Val) const
Returns the position of an element with value Val.
Definition: ds.h:1519
TIntV OutNIdV
Definition: network.h:27

Here is the call graph for this function:

Here is the caller graph for this function:

template<class TNodeData>
void TNodeNet< TNodeData >::TNode::LoadShM ( TShMIn MStream)
inline

Definition at line 47 of file network.h.

References TNodeNet< TNodeData >::TNode::Id, TNodeNet< TNodeData >::TNode::InNIdV, TVec< TVal, TSizeTy >::LoadShM(), TNodeNet< TNodeData >::TNode::NodeDat, and TNodeNet< TNodeData >::TNode::OutNIdV.

Referenced by TNodeNet< TNodeData >::TNodeFunctor::operator()().

47  {
48  Id = TInt(MStream);
49  NodeDat = TNodeData(MStream);
50  InNIdV.LoadShM(MStream);
51  OutNIdV.LoadShM(MStream);
52  }
TNodeData NodeDat
Definition: network.h:26
TIntV InNIdV
Definition: network.h:27
Definition: dt.h:1134
void LoadShM(TShMIn &ShMIn)
Constructs the vector from a shared memory input.
Definition: ds.h:932
TIntV OutNIdV
Definition: network.h:27

Here is the call graph for this function:

Here is the caller graph for this function:

template<class TNodeData>
bool TNodeNet< TNodeData >::TNode::operator< ( const TNode Node) const
inline

Definition at line 53 of file network.h.

References TNodeNet< TNodeData >::TNode::NodeDat.

53 { return NodeDat < Node.NodeDat; }
TNodeData NodeDat
Definition: network.h:26
template<class TNodeData>
void TNodeNet< TNodeData >::TNode::Save ( TSOut SOut) const
inline

Definition at line 34 of file network.h.

References TNodeNet< TNodeData >::TNode::Id, TNodeNet< TNodeData >::TNode::InNIdV, TNodeNet< TNodeData >::TNode::NodeDat, TNodeNet< TNodeData >::TNode::OutNIdV, TVec< TVal, TSizeTy >::Save(), and TInt::Save().

34 { Id.Save(SOut); NodeDat.Save(SOut); InNIdV.Save(SOut); OutNIdV.Save(SOut); }
void Save(TSOut &SOut) const
Definition: dt.h:1150
TNodeData NodeDat
Definition: network.h:26
TIntV InNIdV
Definition: network.h:27
void Save(TSOut &SOut) const
Definition: ds.h:954
TIntV OutNIdV
Definition: network.h:27

Here is the call graph for this function:

Friends And Related Function Documentation

template<class TNodeData>
friend class TNodeNet< TNodeData >
friend

Definition at line 54 of file network.h.

Member Data Documentation

template<class TNodeData>
TInt TNodeNet< TNodeData >::TNode::Id
private

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