vq3
Public Types | Public Member Functions | Public Attributes | Protected Attributes | List of all members
vq3::graph_< VERTEX_VALUE, EDGE_VALUE > Class Template Reference

Public Types

using vertex_type = vertex< VERTEX_VALUE, EDGE_VALUE >
 
using vertex_value_type = VERTEX_VALUE
 
using ref_vertex = std::shared_ptr< vertex_type >
 
using edge_type = edge< VERTEX_VALUE, EDGE_VALUE >
 
using edge_value_type = EDGE_VALUE
 
using ref_edge = std::shared_ptr< edge_type >
 
using wref_vertex = std::weak_ptr< vertex_type >
 
using wref_edge = std::weak_ptr< edge_type >
 
using vertices = std::list< ref_vertex >
 
using edges = std::list< ref_edge >
 
using weak_vertices = std::list< wref_vertex >
 
using weak_edges = std::list< wref_edge >
 

Public Member Functions

 graph_ (const graph_ &)=delete
 
graph_operator= (const graph_ &)=delete
 
unsigned int nb_vertices ()
 
unsigned int nb_edges ()
 
ref_vertex operator+= (const vertex_value_type &v)
 
ref_edge get_edge (const ref_vertex &v1, const ref_vertex &v2) const
 
template<typename VERTEX_FUN >
void foreach_vertex (const VERTEX_FUN &fun)
 
template<typename EDGE_FUN >
void foreach_edge (const EDGE_FUN &fun)
 
void garbaging_lock ()
 
void garbaging_unlock ()
 
void garbaging_force ()
 

Public Attributes

std::vector< ref_vertex > heap
 

Protected Attributes

edges E
 

Member Function Documentation

◆ garbaging_force()

template<typename VERTEX_VALUE , typename EDGE_VALUE >
void vq3::graph_< VERTEX_VALUE, EDGE_VALUE >::garbaging_force ( )
inline

This cleans up pending kills. It may be useless since garbaging is performed all along graph computations (e.g. if vertices and edges are regularly accessed for display in a sequential section). Nevertheless, if garbaging has been suspended for parallel computing (see garbaging_lock and garbaging_unlock), calling garbaging_force() may be usefull. The method garbaging_force() should be called outside parallel sections (i.e. it is not thread safe).

◆ garbaging_lock()

template<typename VERTEX_VALUE , typename EDGE_VALUE >
void vq3::graph_< VERTEX_VALUE, EDGE_VALUE >::garbaging_lock ( )
inline

Memory garbaging is not thread safe. You have to lock it before splitting your graph computations into threads.

◆ garbaging_unlock()

template<typename VERTEX_VALUE , typename EDGE_VALUE >
void vq3::graph_< VERTEX_VALUE, EDGE_VALUE >::garbaging_unlock ( )
inline

Memory garbaging is not thread safe. This unlocks the garbaging for single-thread graph computations. Indeed, this is usefull when garbaging has been locked previously before splitting the computation into threads. In this case, call this method when you're back to sequential processing.

◆ get_edge()

template<typename VERTEX_VALUE , typename EDGE_VALUE >
ref_edge vq3::graph_< VERTEX_VALUE, EDGE_VALUE >::get_edge ( const ref_vertex &  v1,
const ref_vertex &  v2 
) const
inline

This function do not modify the graph, so it is thread-safe.

◆ nb_edges()

template<typename VERTEX_VALUE , typename EDGE_VALUE >
unsigned int vq3::graph_< VERTEX_VALUE, EDGE_VALUE >::nb_edges ( )
inline

Counts the number of edges (with internal foreach)

◆ nb_vertices()

template<typename VERTEX_VALUE , typename EDGE_VALUE >
unsigned int vq3::graph_< VERTEX_VALUE, EDGE_VALUE >::nb_vertices ( )
inline

Counts the number of vertices (with internal foreach)

◆ operator+=()

template<typename VERTEX_VALUE , typename EDGE_VALUE >
ref_vertex vq3::graph_< VERTEX_VALUE, EDGE_VALUE >::operator+= ( const vertex_value_type &  v)
inline

Creates a new vertex in the graph

Member Data Documentation

◆ heap

template<typename VERTEX_VALUE , typename EDGE_VALUE >
std::vector<ref_vertex> vq3::graph_< VERTEX_VALUE, EDGE_VALUE >::heap

This is the support of minimal heaps for shortest path computation.


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