STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types | Protected Attributes
stapl::adjacency_list_hashmap_storage< Traits > Class Template Reference

An adjacency list using an unordered map for storing vertices.Used inside the adjacency_list_model to store vertices. More...

Public Member Functions

 adjacency_list_hashmap_storage (size_t const &start_vd, size_t const &num_vds, vertex_impl_type const &default_value)
 Constructs a storage with the given number of vertices starting from the specified descriptor, with the given default value. Vertices have contiguous descriptors. More...
 
 adjacency_list_hashmap_storage (adjacency_list_hashmap_storage const &other)
 
void resize (size_t nv)
 Resize the internal storage to accommodate more vertices.
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
size_t size () const
 Returns the size of storage; for use in g.num_vertices().
 
vertex_descriptor add_vertex (vertex_descriptor &vd)
 Adds vertex to the storage with the given vertex descriptor. More...
 
vertex_descriptor add_vertex (vertex_property const &vp)
 Adds vertex to the storage with the given vertex property. The descriptor is assigned automatically using the descriptor generator. More...
 
vertex_descriptor add_vertex (vertex_descriptor vd, vertex_property const &vp)
 Adds vertex to the storage with the given descriptor & property. More...
 
void update_next_descriptor (vertex_descriptor const &vd)
 Updates the vertex descriptor generator with the next free descriptor.
 
bool delete_vertex (vertex_descriptor const &, iterator const &vi)
 Deletes the vertex pointed to by the specified iterator. More...
 
vertex_descriptor next_free_descriptor ()
 
void clear (void)
 Clears the storage container of all vertices and edges.
 
void clear_edges (void)
 Clears the storage container of all edges.
 
iterator find_vertex (vertex_descriptor const &vd)
 Returns an iterator to the specified vertex.
 
void update_descriptor (vertex_descriptor &vd, iterator const &vi)
 Not used. Provided for compatibility.
 
vertex_descriptor get_max_descriptor ()
 Returns the current max descriptor.
 

Public Types

typedef Traits::vertex_descriptor vertex_descriptor
 
typedef Traits::vertex_property vertex_property
 
typedef Traits::edge_type edge_type
 
typedef Traits::edgelist_type edgelist_type
 
typedef Traits::vertex_impl_type vertex_impl_type
 
typedef vdg_strided< vertex_descriptor > vdg_type
 Type of the vertex descriptor generator.
 
typedef stapl::hash_map< vertex_descriptor, vertex_impl_type > vertex_set_type
 The vertices are stored in a hash_map.
 
typedef std::pair< vertex_descriptor, vertex_impl_type > iv_type
 Internal value type for the hash_map storage.
 
typedef sequential::mit_adaptor< typename vertex_set_type::iteratoriterator
 
typedef sequential::mit_adaptor< typename vertex_set_type::const_iteratorconst_iterator
 

Protected Attributes

vdg_type m_vdg
 The vertex descriptor generator.
 
vertex_set_type m_storage
 The container for storing vertices.
 

Detailed Description

template<class Traits>
class stapl::adjacency_list_hashmap_storage< Traits >

An adjacency list using an unordered map for storing vertices.

Used inside the adjacency_list_model to store vertices.

Template Parameters
TraitsThe traits class for specifying the types of descriptors, storages, edges and vertices, etc.

Constructor & Destructor Documentation

◆ adjacency_list_hashmap_storage()

template<class Traits >
stapl::adjacency_list_hashmap_storage< Traits >::adjacency_list_hashmap_storage ( size_t const &  start_vd,
size_t const &  num_vds,
vertex_impl_type const &  default_value 
)

Constructs a storage with the given number of vertices starting from the specified descriptor, with the given default value. Vertices have contiguous descriptors.

Parameters
start_vdThe starting descriptor of the vertices.
num_vdsThe number of vertices to be initially stored.
default_valueThe default value for the vertices.

Member Function Documentation

◆ add_vertex() [1/3]

template<class Traits >
vertex_descriptor stapl::adjacency_list_hashmap_storage< Traits >::add_vertex ( vertex_descriptor &  vd)

Adds vertex to the storage with the given vertex descriptor.

Parameters
vdThe descriptor of the added vertex.
Returns
The descriptor of the added vertex.

◆ add_vertex() [2/3]

template<class Traits >
vertex_descriptor stapl::adjacency_list_hashmap_storage< Traits >::add_vertex ( vertex_property const &  vp)

Adds vertex to the storage with the given vertex property. The descriptor is assigned automatically using the descriptor generator.

Parameters
vpThe vertex property of the added vertex.
Returns
The descriptor of the added vertex.

◆ add_vertex() [3/3]

template<class Traits >
vertex_descriptor stapl::adjacency_list_hashmap_storage< Traits >::add_vertex ( vertex_descriptor  vd,
vertex_property const &  vp 
)

Adds vertex to the storage with the given descriptor & property.

Parameters
vdThe explicit descriptor of the added vertex.
vpThe vertex property of the added vertex.
Returns
The descriptor of the added vertex.

◆ delete_vertex()

template<class Traits >
bool stapl::adjacency_list_hashmap_storage< Traits >::delete_vertex ( vertex_descriptor const &  ,
iterator const &  vi 
)

Deletes the vertex pointed to by the specified iterator.

Parameters
viThe iterator of the vertex to be deleted.
Returns
Whether or not the vertex was successfully deleted.

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