SNAP Library 2.4, User Reference  2015-05-11 19:40:56
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
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 ()
 

Private Attributes

TInt Id
 
TIntV InNIdV
 
TIntV OutNIdV
 

Friends

class TNGraph
 
class TNGraphMtx
 

Detailed Description

Definition at line 301 of file graph.h.

Constructor & Destructor Documentation

TNGraph::TNode::TNode ( )
inline

Definition at line 306 of file graph.h.

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

Definition at line 307 of file graph.h.

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

Definition at line 308 of file graph.h.

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

Definition at line 309 of file graph.h.

309 : Id(SIn), InNIdV(SIn), OutNIdV(SIn) { }
TIntV InNIdV
Definition: graph.h:304
TIntV OutNIdV
Definition: graph.h:304

Member Function Documentation

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

Definition at line 312 of file graph.h.

312 { return GetInDeg() + GetOutDeg(); }
int GetOutDeg() const
Definition: graph.h:314
int GetInDeg() const
Definition: graph.h:313
int TNGraph::TNode::GetId ( ) const
inline

Definition at line 311 of file graph.h.

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

Definition at line 313 of file graph.h.

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

Definition at line 315 of file graph.h.

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

Definition at line 317 of file graph.h.

317 { return NodeN<GetOutDeg()?GetOutNId(NodeN):GetInNId(NodeN-GetOutDeg()); }
int GetOutDeg() const
Definition: graph.h:314
int GetOutNId(const int &NodeN) const
Definition: graph.h:316
int GetInNId(const int &NodeN) const
Definition: graph.h:315
int TNGraph::TNode::GetOutDeg ( ) const
inline

Definition at line 314 of file graph.h.

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

Definition at line 316 of file graph.h.

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

Definition at line 318 of file graph.h.

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

Definition at line 320 of file graph.h.

320 { return IsOutNId(NId) || IsInNId(NId); }
bool IsOutNId(const int &NId) const
Definition: graph.h:319
bool IsInNId(const int &NId) const
Definition: graph.h:318
bool TNGraph::TNode::IsOutNId ( const int &  NId) const
inline

Definition at line 319 of file graph.h.

319 { return OutNIdV.SearchBin(NId) != -1; }
TSizeTy SearchBin(const TVal &Val) const
Returns the position of an element with value Val.
Definition: ds.h:1418
TIntV OutNIdV
Definition: graph.h:304
void TNGraph::TNode::PackNIdV ( )
inline

Definition at line 322 of file graph.h.

322 { InNIdV.Pack(); }
void Pack()
The vector reduces its capacity (frees memory) to match its size.
Definition: ds.h:987
TIntV InNIdV
Definition: graph.h:304
void TNGraph::TNode::PackOutNIdV ( )
inline

Definition at line 321 of file graph.h.

321 { OutNIdV.Pack(); }
void Pack()
The vector reduces its capacity (frees memory) to match its size.
Definition: ds.h:987
TIntV OutNIdV
Definition: graph.h:304
void TNGraph::TNode::Save ( TSOut SOut) const
inline

Definition at line 310 of file graph.h.

310 { Id.Save(SOut); InNIdV.Save(SOut); OutNIdV.Save(SOut); }
void Save(TSOut &SOut) const
Definition: dt.h:1058
void Save(TSOut &SOut) const
Definition: ds.h:885
TIntV InNIdV
Definition: graph.h:304
TIntV OutNIdV
Definition: graph.h:304

Friends And Related Function Documentation

friend class TNGraph
friend

Definition at line 323 of file graph.h.

friend class TNGraphMtx
friend

Definition at line 324 of file graph.h.

Member Data Documentation

TInt TNGraph::TNode::Id
private

Definition at line 303 of file graph.h.

TIntV TNGraph::TNode::InNIdV
private

Definition at line 304 of file graph.h.

TIntV TNGraph::TNode::OutNIdV
private

Definition at line 304 of file graph.h.


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