ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::GraphNodes< T > Class Template Reference

the nodes, their labels and the counts shared by the realizations More...

#include <ADS/graph/Graph.h>

Classes

struct  Alive
 the names in use, for SlotIterator More...

Public member functions

bool directed (void) const
 whether the graph is oriented
int n (void) const
 the number of nodes, the G.n of the book
int m (void) const
 the number of edges, an unoriented one counted once
int bound (void) const
 the names of the nodes are in \( [ 0 , \mathrm{bound}() ) \)
bool hasNode (int u) const
 whether \( u \) is a node
std::vector< int > V (void) const
 the set of the nodes, in increasing order
const T & label (int u) const
 the label of the node \( u \)
void setLabel (int u, const T &t)
 the label of the node \( u \) becomes \( t \)
auto nodes (void) const
 the nodes in increasing order, bidirectional

Protected member functions

 GraphNodes (int n, bool directed)
int addNode (const T &t)
 a new node of label \( t \), and its name
int check (int u) const
 \( u \), which must be a node
void edge (int u, int v) const
 \( u \) and \( v \) must be two distinct nodes
bool nodesCounted (void) const
 n() counts the names in use, and each has a label

Protected attributes

bool f_directed
 oriented or not
std::vector< bool > f_alive
 whether a name is a node
std::vector< T > f_label
 the labels
int f_n = 0
 the number of nodes
int f_m = 0
 the number of edges

Detailed description

template<class T>
class ADS::GraphNodes< T >

the nodes, their labels and the counts shared by the realizations

Constructor and destructor documentation

◆ GraphNodes()

template<class T>
ADS::GraphNodes< T >::GraphNodes ( int n,
bool directed )
protected
Precondition
\( n \ge 0 \)

Member function documentation

◆ addNode()

template<class T>
int ADS::GraphNodes< T >::addNode ( const T & t)
protected

a new node of label \( t \), and its name

◆ bound()

template<class T>
int ADS::GraphNodes< T >::bound ( void ) const
inlinenodiscard

the names of the nodes are in \( [ 0 , \mathrm{bound}() ) \)

◆ check()

template<class T>
int ADS::GraphNodes< T >::check ( int u) const
protected

\( u \), which must be a node

◆ directed()

template<class T>
bool ADS::GraphNodes< T >::directed ( void ) const
inlinenodiscard

whether the graph is oriented

◆ edge()

template<class T>
void ADS::GraphNodes< T >::edge ( int u,
int v ) const
protected

\( u \) and \( v \) must be two distinct nodes

◆ hasNode()

template<class T>
bool ADS::GraphNodes< T >::hasNode ( int u) const
nodiscard

whether \( u \) is a node

◆ label()

template<class T>
const T & ADS::GraphNodes< T >::label ( int u) const
nodiscard

the label of the node \( u \)

Precondition
\( u \) is a node

◆ m()

template<class T>
int ADS::GraphNodes< T >::m ( void ) const
inlinenodiscard

the number of edges, an unoriented one counted once

◆ n()

template<class T>
int ADS::GraphNodes< T >::n ( void ) const
inlinenodiscard

the number of nodes, the G.n of the book

◆ nodes()

template<class T>
auto ADS::GraphNodes< T >::nodes ( void ) const
inlinenodiscard

the nodes in increasing order, bidirectional

◆ nodesCounted()

template<class T>
bool ADS::GraphNodes< T >::nodesCounted ( void ) const
nodiscardprotected

n() counts the names in use, and each has a label

◆ setLabel()

template<class T>
void ADS::GraphNodes< T >::setLabel ( int u,
const T & t )

the label of the node \( u \) becomes \( t \)

Precondition
\( u \) is a node

◆ V()

template<class T>
std::vector< int > ADS::GraphNodes< T >::V ( void ) const
nodiscard

the set of the nodes, in increasing order

Member data documentation

◆ f_alive

template<class T>
std::vector< bool > ADS::GraphNodes< T >::f_alive
protected

whether a name is a node

◆ f_directed

template<class T>
bool ADS::GraphNodes< T >::f_directed
protected

oriented or not

◆ f_label

template<class T>
std::vector< T > ADS::GraphNodes< T >::f_label
protected

the labels

◆ f_m

template<class T>
int ADS::GraphNodes< T >::f_m = 0
protected

the number of edges

◆ f_n

template<class T>
int ADS::GraphNodes< T >::f_n = 0
protected

the number of nodes


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