GraphDom
Loading...
Searching...
No Matches
graphdom::graph< VertexType > Class Template Referenceabstract

Every graph created using this library is an instance of a concrete class publicly derived, directly or indirectly, from this polymorphic template class. More...

#include <graph.h>

Inheritance diagram for graphdom::graph< VertexType >:

Classes

class  adj_list
 Every valid instance of this class is a "container-like and non-owning" handle to a subset of the set of all out-edges of a vertex. More...
class  const_adj_list
 Every valid instance of this class is a "container-like and non-owning" handle to a subset of the set of all out-edges of a vertex.
A valid instance adj of this class cannot create objects that allow modification of the graph to which the vertex associated with adj belongs without a non-constant reference to that graph. More...
class  vertex_const_handle
 Every valid instance of this class can be used to identify a specific vertex of a graph and to access its core by reference or pointer.
A valid instance hndl of this class cannot create objects that allow modification of the graph to which the vertex identified by hndl belongs without a non-const reference to that graph. More...
class  vertex_handle
 Every valid instance of this class can be used to identify a specific vertex of a graph and to access its core by reference or pointer. More...

Public Member Functions

virtual ~graph ()=default
 To be polymorphic, this class has a virtual destructor.
virtual std::size_t order () const =0
 Returns the order of *this, i.e. the number of vertices inside the graph.
virtual void erase_vertex (const vertex_const_handle &vertex)=0
 Removes the vertex identified by vertex.
virtual adj_list_iterator erase_edge (const adj_list_const_iterator &)=0

Detailed Description

template<typename VertexType>
class graphdom::graph< VertexType >

Every graph created using this library is an instance of a concrete class publicly derived, directly or indirectly, from this polymorphic template class.

Creating an object of a user-defined class derived, directly or indirectly, from this one will cause undefined behavior.

Every graph created with this library can be considered equivalent, with the necessary precautions listed below, to a graph consistent with the definition found on the "Mathematical Introduction" page.
Referring to the symbols used in that definition and considering a non-const reference g to this class, the "precautions" are as follows:

  • \( V_\text{type} \) is the set of all possible instances of VertexType ;
  • The set \( V \) must be considered dynamic, to allow, obviously, the insertion and erasion of vertices from g;
  • If c is a reference to the core of a vertex \( v \) in g, then \( v = ( \) c \( , \) &c \( ) \);
  • g stores only the cores of its vertices; (this is a direct consequence of the previous point)
  • The sets \( E_\text{di} \) and \( E_\text{un} \) must be considered dynamic to allow, obviously, the insertion and erasion of edges from g;
  • If g is a labeled-vertex graph and \( v \) is a vertex in g, then \( l_V(v) \) must be considered dynamic to allow, obviously, the label of \( v \) to be changed;
  • If g is a labeled-edge graph and \( y \) is an edge in g, then \( l_E(y) \) must be considered dynamic to allow, obviously, the label of \( y \) to be changed;

Member Function Documentation

◆ erase_vertex()

template<typename VertexType>
virtual void graphdom::graph< VertexType >::erase_vertex ( const vertex_const_handle & vertex)
pure virtual

Removes the vertex identified by vertex.

After erasion, vertex and all its equivalents are invalidated.

Parameters
vertexAn object that identifies the vertex to be erased.
vertex must be valid and must identify a vertex belonging to *this, otherwise the erasion will cause undefined behavior.

◆ order()


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