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

#include <graphmp.h>

Collaboration diagram for TNGraphMP::TNode:

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.

References GetInDeg(), and GetOutDeg().

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

Here is the call graph for this function:

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

Definition at line 42 of file graphmp.h.

References Id.

Referenced by TNGraphMP::DelNode(), TNGraphMP::Dump(), and TNGraphMP::IsOk().

42 { return Id; }

Here is the caller graph for this function:

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

Definition at line 44 of file graphmp.h.

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

Referenced by TNGraphMP::DelNode(), TNGraphMP::Dump(), GetDeg(), and TNGraphMP::IsOk().

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

Here is the call graph for this function:

Here is the caller graph for this function:

int TNGraphMP::TNode::GetInNId ( const int &  NodeN) const
inline

Definition at line 46 of file graphmp.h.

References InNIdV.

Referenced by TNGraphMP::DelNode(), TNGraphMP::Dump(), GetNbrNId(), and TNGraphMP::IsOk().

46 { return InNIdV[NodeN]; }
TIntV InNIdV
Definition: graphmp.h:35

Here is the caller graph for this function:

int TNGraphMP::TNode::GetNbrNId ( const int &  NodeN) const
inline

Definition at line 48 of file graphmp.h.

References GetInNId(), GetOutDeg(), and GetOutNId().

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

Here is the call graph for this function:

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

Definition at line 45 of file graphmp.h.

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

Referenced by TNGraphMP::DelNode(), TNGraphMP::Dump(), GetDeg(), GetNbrNId(), and TNGraphMP::IsOk().

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

Here is the call graph for this function:

Here is the caller graph for this function:

int TNGraphMP::TNode::GetOutNId ( const int &  NodeN) const
inline

Definition at line 47 of file graphmp.h.

References OutNIdV.

Referenced by TNGraphMP::DelNode(), TNGraphMP::Dump(), GetNbrNId(), and TNGraphMP::IsOk().

47 { return OutNIdV[NodeN]; }
TIntV OutNIdV
Definition: graphmp.h:35

Here is the caller graph for this function:

bool TNGraphMP::TNode::IsInNId ( const int &  NId) const
inline

Definition at line 49 of file graphmp.h.

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

Referenced by IsNbrNId().

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

Here is the call graph for this function:

Here is the caller graph for this function:

bool TNGraphMP::TNode::IsNbrNId ( const int &  NId) const
inline

Definition at line 51 of file graphmp.h.

References IsInNId(), and IsOutNId().

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

Here is the call graph for this function:

bool TNGraphMP::TNode::IsOutNId ( const int &  NId) const
inline

Definition at line 50 of file graphmp.h.

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

Referenced by TNGraphMP::IsEdge(), and IsNbrNId().

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

Here is the call graph for this function:

Here is the caller graph for this function:

void TNGraphMP::TNode::PackNIdV ( )
inline

Definition at line 53 of file graphmp.h.

References InNIdV, and TVec< TVal, TSizeTy >::Pack().

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

Here is the call graph for this function:

void TNGraphMP::TNode::PackOutNIdV ( )
inline

Definition at line 52 of file graphmp.h.

References OutNIdV, and TVec< TVal, TSizeTy >::Pack().

52 { OutNIdV.Pack(); }
TIntV OutNIdV
Definition: graphmp.h:35
void Pack()
Reduces vector capacity (frees memory) to match its size.
Definition: ds.h:1057

Here is the call graph for this function:

void TNGraphMP::TNode::Save ( TSOut SOut) const
inline

Definition at line 41 of file graphmp.h.

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

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

Here is the call graph for this function:

void TNGraphMP::TNode::SortNIdV ( )
inline

Definition at line 54 of file graphmp.h.

References InNIdV, OutNIdV, and TVec< TVal, TSizeTy >::Sort().

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

Here is the call graph for this function:

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.

Referenced by TNGraphMP::AddNode(), GetId(), and Save().


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