SNAP Library 3.0, Developer 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
TNGraph::TNode Class Reference

#include <graph.h>

Collaboration diagram for TNGraph::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 TNGraph
 
class TNGraphMtx
 

Detailed Description

Definition at line 312 of file graph.h.

Constructor & Destructor Documentation

TNGraph::TNode::TNode ( )
inline

Definition at line 317 of file graph.h.

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

Definition at line 318 of file graph.h.

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

Definition at line 319 of file graph.h.

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

Definition at line 320 of file graph.h.

320 : Id(SIn), InNIdV(SIn), OutNIdV(SIn) { }
TIntV InNIdV
Definition: graph.h:315
TIntV OutNIdV
Definition: graph.h:315

Member Function Documentation

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

Definition at line 323 of file graph.h.

References GetInDeg(), and GetOutDeg().

323 { return GetInDeg() + GetOutDeg(); }
int GetOutDeg() const
Definition: graph.h:325
int GetInDeg() const
Definition: graph.h:324

Here is the call graph for this function:

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

Definition at line 322 of file graph.h.

References Id.

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

322 { return Id; }

Here is the caller graph for this function:

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

Definition at line 324 of file graph.h.

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

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

324 { return InNIdV.Len(); }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:547
TIntV InNIdV
Definition: graph.h:315

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 326 of file graph.h.

References InNIdV.

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

326 { return InNIdV[NodeN]; }
TIntV InNIdV
Definition: graph.h:315

Here is the caller graph for this function:

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

Definition at line 328 of file graph.h.

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

328 { return NodeN<GetOutDeg()?GetOutNId(NodeN):GetInNId(NodeN-GetOutDeg()); }
int GetOutDeg() const
Definition: graph.h:325
int GetOutNId(const int &NodeN) const
Definition: graph.h:327
int GetInNId(const int &NodeN) const
Definition: graph.h:326

Here is the call graph for this function:

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

Definition at line 325 of file graph.h.

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

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

325 { return OutNIdV.Len(); }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:547
TIntV OutNIdV
Definition: graph.h:315

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 327 of file graph.h.

References OutNIdV.

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

327 { return OutNIdV[NodeN]; }
TIntV OutNIdV
Definition: graph.h:315

Here is the caller graph for this function:

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

Definition at line 329 of file graph.h.

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

Referenced by IsNbrNId().

329 { return InNIdV.SearchBin(NId) != -1; }
TSizeTy SearchBin(const TVal &Val) const
Returns the position of an element with value Val.
Definition: ds.h:1454
TIntV InNIdV
Definition: graph.h:315

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 331 of file graph.h.

References IsInNId(), and IsOutNId().

331 { return IsOutNId(NId) || IsInNId(NId); }
bool IsOutNId(const int &NId) const
Definition: graph.h:330
bool IsInNId(const int &NId) const
Definition: graph.h:329

Here is the call graph for this function:

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

Definition at line 330 of file graph.h.

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

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

330 { return OutNIdV.SearchBin(NId) != -1; }
TSizeTy SearchBin(const TVal &Val) const
Returns the position of an element with value Val.
Definition: ds.h:1454
TIntV OutNIdV
Definition: graph.h:315

Here is the call graph for this function:

Here is the caller graph for this function:

void TNGraph::TNode::PackNIdV ( )
inline

Definition at line 333 of file graph.h.

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

333 { InNIdV.Pack(); }
void Pack()
Reduces vector capacity (frees memory) to match its size.
Definition: ds.h:1005
TIntV InNIdV
Definition: graph.h:315

Here is the call graph for this function:

void TNGraph::TNode::PackOutNIdV ( )
inline

Definition at line 332 of file graph.h.

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

332 { OutNIdV.Pack(); }
void Pack()
Reduces vector capacity (frees memory) to match its size.
Definition: ds.h:1005
TIntV OutNIdV
Definition: graph.h:315

Here is the call graph for this function:

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

Definition at line 321 of file graph.h.

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

321 { Id.Save(SOut); InNIdV.Save(SOut); OutNIdV.Save(SOut); }
void Save(TSOut &SOut) const
Definition: dt.h:1060
void Save(TSOut &SOut) const
Definition: ds.h:903
TIntV InNIdV
Definition: graph.h:315
TIntV OutNIdV
Definition: graph.h:315

Here is the call graph for this function:

void TNGraph::TNode::SortNIdV ( )
inline

Definition at line 334 of file graph.h.

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

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

Here is the call graph for this function:

Friends And Related Function Documentation

friend class TNGraph
friend

Definition at line 335 of file graph.h.

friend class TNGraphMtx
friend

Definition at line 336 of file graph.h.

Member Data Documentation

TInt TNGraph::TNode::Id
private

Definition at line 314 of file graph.h.

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


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