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
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 29 of file graphmp.h.

Constructor & Destructor Documentation

TNGraphMP::TNode::TNode ( )
inline

Definition at line 34 of file graphmp.h.

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

Definition at line 35 of file graphmp.h.

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

Definition at line 36 of file graphmp.h.

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

Definition at line 37 of file graphmp.h.

37 : Id(SIn), InNIdV(SIn), OutNIdV(SIn) { }
TIntV OutNIdV
Definition: graphmp.h:32
TIntV InNIdV
Definition: graphmp.h:32

Member Function Documentation

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

Definition at line 40 of file graphmp.h.

40 { return GetInDeg() + GetOutDeg(); }
int GetInDeg() const
Definition: graphmp.h:41
int GetOutDeg() const
Definition: graphmp.h:42
int TNGraphMP::TNode::GetId ( ) const
inline

Definition at line 39 of file graphmp.h.

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

Definition at line 41 of file graphmp.h.

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

Definition at line 43 of file graphmp.h.

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

Definition at line 45 of file graphmp.h.

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

Definition at line 42 of file graphmp.h.

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

Definition at line 44 of file graphmp.h.

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

Definition at line 46 of file graphmp.h.

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

Definition at line 48 of file graphmp.h.

48 { return IsOutNId(NId) || IsInNId(NId); }
bool IsInNId(const int &NId) const
Definition: graphmp.h:46
bool IsOutNId(const int &NId) const
Definition: graphmp.h:47
bool TNGraphMP::TNode::IsOutNId ( const int &  NId) const
inline

Definition at line 47 of file graphmp.h.

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

Definition at line 50 of file graphmp.h.

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

Definition at line 49 of file graphmp.h.

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

Definition at line 38 of file graphmp.h.

38 { Id.Save(SOut); InNIdV.Save(SOut); OutNIdV.Save(SOut); }
void Save(TSOut &SOut) const
Definition: dt.h:1060
TIntV OutNIdV
Definition: graphmp.h:32
void Save(TSOut &SOut) const
Definition: ds.h:903
TIntV InNIdV
Definition: graphmp.h:32
void TNGraphMP::TNode::SortNIdV ( )
inline

Definition at line 51 of file graphmp.h.

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

Friends And Related Function Documentation

friend class TNGraphMP
friend

Definition at line 52 of file graphmp.h.

Member Data Documentation

TInt TNGraphMP::TNode::Id
private

Definition at line 31 of file graphmp.h.

TIntV TNGraphMP::TNode::InNIdV
private

Definition at line 32 of file graphmp.h.

TIntV TNGraphMP::TNode::OutNIdV
private

Definition at line 32 of file graphmp.h.


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