SNAP Library 6.0, User Reference  2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
TNGraphMP::TNode Class Reference

#include <graphmp.h>

Public Member Functions

 TNode ()
 
 TNode (const int &NId)
 
 TNode (const TNode &Node)
 
 TNode (TSIn &SIn)
 
void Save (TSOut &SOut) const
 
int GetId () const
 
int GetDeg () const
 
int GetInDeg () const
 
int GetOutDeg () const
 
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 PackOutNIdV ()
 
void PackNIdV ()
 
void SortNIdV ()
 

Private Attributes

TInt Id
 
TIntV InNIdV
 
TIntV OutNIdV
 

Friends

class TNGraphMP
 

Detailed Description

Definition at line 32 of file graphmp.h.

Constructor & Destructor Documentation

TNGraphMP::TNode::TNode ( )
inline

Definition at line 37 of file graphmp.h.

37 : Id(-1), InNIdV(), OutNIdV() { }
TIntV OutNIdV
Definition: graphmp.h:35
TIntV InNIdV
Definition: graphmp.h:35
TNGraphMP::TNode::TNode ( const int &  NId)
inline

Definition at line 38 of file graphmp.h.

38 : Id(NId), InNIdV(), OutNIdV() { }
TIntV OutNIdV
Definition: graphmp.h:35
TIntV InNIdV
Definition: graphmp.h:35
TNGraphMP::TNode::TNode ( const TNode Node)
inline

Definition at line 39 of file graphmp.h.

39 : Id(Node.Id), InNIdV(Node.InNIdV), OutNIdV(Node.OutNIdV) { }
TIntV OutNIdV
Definition: graphmp.h:35
TIntV InNIdV
Definition: graphmp.h:35
TNGraphMP::TNode::TNode ( TSIn SIn)
inline

Definition at line 40 of file graphmp.h.

40 : Id(SIn), InNIdV(SIn), OutNIdV(SIn) { }
TIntV OutNIdV
Definition: graphmp.h:35
TIntV InNIdV
Definition: graphmp.h:35

Member Function Documentation

int TNGraphMP::TNode::GetDeg ( ) const
inline

Definition at line 43 of file graphmp.h.

43 { return GetInDeg() + GetOutDeg(); }
int GetInDeg() const
Definition: graphmp.h:44
int GetOutDeg() const
Definition: graphmp.h:45
int TNGraphMP::TNode::GetId ( ) const
inline

Definition at line 42 of file graphmp.h.

42 { return Id; }
int TNGraphMP::TNode::GetInDeg ( ) const
inline

Definition at line 44 of file graphmp.h.

44 { return InNIdV.Len(); }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
TIntV InNIdV
Definition: graphmp.h:35
int TNGraphMP::TNode::GetInNId ( const int &  NodeN) const
inline

Definition at line 46 of file graphmp.h.

46 { return InNIdV[NodeN]; }
TIntV InNIdV
Definition: graphmp.h:35
int TNGraphMP::TNode::GetNbrNId ( const int &  NodeN) const
inline

Definition at line 48 of file graphmp.h.

48 { return NodeN<GetOutDeg()?GetOutNId(NodeN):GetInNId(NodeN-GetOutDeg()); }
int GetOutNId(const int &NodeN) const
Definition: graphmp.h:47
int GetInNId(const int &NodeN) const
Definition: graphmp.h:46
int GetOutDeg() const
Definition: graphmp.h:45
int TNGraphMP::TNode::GetOutDeg ( ) const
inline

Definition at line 45 of file graphmp.h.

45 { return OutNIdV.Len(); }
TIntV OutNIdV
Definition: graphmp.h:35
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
int TNGraphMP::TNode::GetOutNId ( const int &  NodeN) const
inline

Definition at line 47 of file graphmp.h.

47 { return OutNIdV[NodeN]; }
TIntV OutNIdV
Definition: graphmp.h:35
bool TNGraphMP::TNode::IsInNId ( const int &  NId) const
inline

Definition at line 49 of file graphmp.h.

49 { return InNIdV.SearchBin(NId) != -1; }
TIntV InNIdV
Definition: graphmp.h:35
TSizeTy SearchBin(const TVal &Val) const
Returns the position of an element with value Val.
Definition: ds.h:1519
bool TNGraphMP::TNode::IsNbrNId ( const int &  NId) const
inline

Definition at line 51 of file graphmp.h.

51 { return IsOutNId(NId) || IsInNId(NId); }
bool IsInNId(const int &NId) const
Definition: graphmp.h:49
bool IsOutNId(const int &NId) const
Definition: graphmp.h:50
bool TNGraphMP::TNode::IsOutNId ( const int &  NId) const
inline

Definition at line 50 of file graphmp.h.

50 { return OutNIdV.SearchBin(NId) != -1; }
TIntV OutNIdV
Definition: graphmp.h:35
TSizeTy SearchBin(const TVal &Val) const
Returns the position of an element with value Val.
Definition: ds.h:1519
void TNGraphMP::TNode::PackNIdV ( )
inline

Definition at line 53 of file graphmp.h.

53 { InNIdV.Pack(); }
TIntV InNIdV
Definition: graphmp.h:35
void Pack()
Reduces vector capacity (frees memory) to match its size.
Definition: ds.h:1057
void TNGraphMP::TNode::PackOutNIdV ( )
inline

Definition at line 52 of file graphmp.h.

52 { OutNIdV.Pack(); }
TIntV OutNIdV
Definition: graphmp.h:35
void Pack()
Reduces vector capacity (frees memory) to match its size.
Definition: ds.h:1057
void TNGraphMP::TNode::Save ( TSOut SOut) const
inline

Definition at line 41 of file graphmp.h.

41 { Id.Save(SOut); InNIdV.Save(SOut); OutNIdV.Save(SOut); }
void Save(TSOut &SOut) const
Definition: dt.h:1153
TIntV OutNIdV
Definition: graphmp.h:35
void Save(TSOut &SOut) const
Definition: ds.h:954
TIntV InNIdV
Definition: graphmp.h:35
void TNGraphMP::TNode::SortNIdV ( )
inline

Definition at line 54 of file graphmp.h.

54 { InNIdV.Sort(); OutNIdV.Sort();}
TIntV OutNIdV
Definition: graphmp.h:35
void Sort(const bool &Asc=true)
Sorts the elements of the vector.
Definition: ds.h:1318
TIntV InNIdV
Definition: graphmp.h:35

Friends And Related Function Documentation

friend class TNGraphMP
friend

Definition at line 55 of file graphmp.h.

Member Data Documentation

TInt TNGraphMP::TNode::Id
private

Definition at line 34 of file graphmp.h.

TIntV TNGraphMP::TNode::InNIdV
private

Definition at line 35 of file graphmp.h.

TIntV TNGraphMP::TNode::OutNIdV
private

Definition at line 35 of file graphmp.h.


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