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

#include <graph.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 ()
 
void LoadShM (TShMIn &ShMIn)
 

Private Attributes

TInt Id
 
TIntV InNIdV
 
TIntV OutNIdV
 

Friends

class TNGraph
 
class TNGraphMtx
 

Detailed Description

Definition at line 351 of file graph.h.

Constructor & Destructor Documentation

TNGraph::TNode::TNode ( )
inline

Definition at line 356 of file graph.h.

356 : Id(-1), InNIdV(), OutNIdV() { }
TIntV InNIdV
Definition: graph.h:354
TIntV OutNIdV
Definition: graph.h:354
TNGraph::TNode::TNode ( const int &  NId)
inline

Definition at line 357 of file graph.h.

357 : Id(NId), InNIdV(), OutNIdV() { }
TIntV InNIdV
Definition: graph.h:354
TIntV OutNIdV
Definition: graph.h:354
TNGraph::TNode::TNode ( const TNode Node)
inline

Definition at line 358 of file graph.h.

358 : Id(Node.Id), InNIdV(Node.InNIdV), OutNIdV(Node.OutNIdV) { }
TIntV InNIdV
Definition: graph.h:354
TIntV OutNIdV
Definition: graph.h:354
TNGraph::TNode::TNode ( TSIn SIn)
inline

Definition at line 359 of file graph.h.

359 : Id(SIn), InNIdV(SIn), OutNIdV(SIn) { }
TIntV InNIdV
Definition: graph.h:354
TIntV OutNIdV
Definition: graph.h:354

Member Function Documentation

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

Definition at line 362 of file graph.h.

362 { return GetInDeg() + GetOutDeg(); }
int GetOutDeg() const
Definition: graph.h:364
int GetInDeg() const
Definition: graph.h:363
int TNGraph::TNode::GetId ( ) const
inline

Definition at line 361 of file graph.h.

361 { return Id; }
int TNGraph::TNode::GetInDeg ( ) const
inline

Definition at line 363 of file graph.h.

363 { return InNIdV.Len(); }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
TIntV InNIdV
Definition: graph.h:354
int TNGraph::TNode::GetInNId ( const int &  NodeN) const
inline

Definition at line 365 of file graph.h.

365 { return InNIdV[NodeN]; }
TIntV InNIdV
Definition: graph.h:354
int TNGraph::TNode::GetNbrNId ( const int &  NodeN) const
inline

Definition at line 367 of file graph.h.

367 { return NodeN<GetOutDeg()?GetOutNId(NodeN):GetInNId(NodeN-GetOutDeg()); }
int GetOutDeg() const
Definition: graph.h:364
int GetOutNId(const int &NodeN) const
Definition: graph.h:366
int GetInNId(const int &NodeN) const
Definition: graph.h:365
int TNGraph::TNode::GetOutDeg ( ) const
inline

Definition at line 364 of file graph.h.

364 { return OutNIdV.Len(); }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
TIntV OutNIdV
Definition: graph.h:354
int TNGraph::TNode::GetOutNId ( const int &  NodeN) const
inline

Definition at line 366 of file graph.h.

366 { return OutNIdV[NodeN]; }
TIntV OutNIdV
Definition: graph.h:354
bool TNGraph::TNode::IsInNId ( const int &  NId) const
inline

Definition at line 368 of file graph.h.

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

Definition at line 370 of file graph.h.

370 { return IsOutNId(NId) || IsInNId(NId); }
bool IsOutNId(const int &NId) const
Definition: graph.h:369
bool IsInNId(const int &NId) const
Definition: graph.h:368
bool TNGraph::TNode::IsOutNId ( const int &  NId) const
inline

Definition at line 369 of file graph.h.

369 { 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: graph.h:354
void TNGraph::TNode::LoadShM ( TShMIn ShMIn)
inline

Definition at line 374 of file graph.h.

374  {
375  Id = TInt(ShMIn);
376  InNIdV.LoadShM(ShMIn);
377  OutNIdV.LoadShM(ShMIn);
378  }
Definition: dt.h:1137
void LoadShM(TShMIn &ShMIn)
Constructs the vector from a shared memory input.
Definition: ds.h:932
TIntV InNIdV
Definition: graph.h:354
TIntV OutNIdV
Definition: graph.h:354
void TNGraph::TNode::PackNIdV ( )
inline

Definition at line 372 of file graph.h.

372 { InNIdV.Pack(); }
void Pack()
Reduces vector capacity (frees memory) to match its size.
Definition: ds.h:1057
TIntV InNIdV
Definition: graph.h:354
void TNGraph::TNode::PackOutNIdV ( )
inline

Definition at line 371 of file graph.h.

371 { OutNIdV.Pack(); }
void Pack()
Reduces vector capacity (frees memory) to match its size.
Definition: ds.h:1057
TIntV OutNIdV
Definition: graph.h:354
void TNGraph::TNode::Save ( TSOut SOut) const
inline

Definition at line 360 of file graph.h.

360 { Id.Save(SOut); InNIdV.Save(SOut); OutNIdV.Save(SOut); }
void Save(TSOut &SOut) const
Definition: dt.h:1153
void Save(TSOut &SOut) const
Definition: ds.h:954
TIntV InNIdV
Definition: graph.h:354
TIntV OutNIdV
Definition: graph.h:354
void TNGraph::TNode::SortNIdV ( )
inline

Definition at line 373 of file graph.h.

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

Friends And Related Function Documentation

friend class TNGraph
friend

Definition at line 379 of file graph.h.

friend class TNGraphMtx
friend

Definition at line 380 of file graph.h.

Member Data Documentation

TInt TNGraph::TNode::Id
private

Definition at line 353 of file graph.h.

TIntV TNGraph::TNode::InNIdV
private

Definition at line 354 of file graph.h.

TIntV TNGraph::TNode::OutNIdV
private

Definition at line 354 of file graph.h.


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