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_vector_storage< Traits > Class Template Reference

An adjacency list using an std::vector for storing vertices.Used inside the adjacency_list_model to store vertices. More...

Public Member Functions

 adjacency_list_vector_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_vector_storage (adjacency_list_vector_storage const &other)
 
void resize (size_t nv)
 Resize the internal storage to accommodate specified number of vertices.
 
iterator begin (void)
 
iterator end (void)
 
const_iterator begin (void) const
 
const_iterator end () const
 
size_t size (void) const
 Returns the number of vertices in the 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 and property. More...
 
vertex_descriptor next_free_descriptor ()
 
void reserve_adjacency (vertex_descriptor const &vd, size_t num_adjacents)
 Reserves space for storing specified number of edges in the specified vertex. More...
 
bool delete_vertex (vertex_descriptor const &, iterator const &vi)
 Deletes the vertex pointed to by the specified iterator. More...
 
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.
 
const_iterator find_vertex (vertex_descriptor const &vd) const
 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 (void)
 Returns the current max descriptor.
 
void update_next_descriptor (vertex_descriptor const &vd)
 Updates the vertex descriptor generator with the next free 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 sequential::vdg_base_int< vertex_descriptor > vdg_type
 Type of the vertex descriptor generator.
 
typedef std::vector< vertex_impl_type > vertex_set_type
 The vertices are stored in an std::vector.
 
typedef vertex_set_type::iterator iterator
 
typedef vertex_set_type::const_iterator const_iterator
 

Protected Attributes

vdg_type m_vdg
 The vertex descriptor generator.
 
vertex_set_type m_storage
 The container for storing vertices.
 
size_t my_local_start_vd
 The descriptor of the starting vertex in this storage.
 

Detailed Description

template<class Traits>
class stapl::adjacency_list_vector_storage< Traits >

An adjacency list using an std::vector 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.

Constructor & Destructor Documentation

◆ adjacency_list_vector_storage()

template<class Traits >
stapl::adjacency_list_vector_storage< Traits >::adjacency_list_vector_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_vector_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_vector_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_vector_storage< Traits >::add_vertex ( vertex_descriptor  vd,
vertex_property const &  vp 
)

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

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

◆ reserve_adjacency()

template<class Traits >
void stapl::adjacency_list_vector_storage< Traits >::reserve_adjacency ( vertex_descriptor const &  vd,
size_t  num_adjacents 
)

Reserves space for storing specified number of edges in the specified vertex.

Parameters
vdThe descriptor of the vertex.
num_adjacentsThe number of adjacents to be stored.

◆ delete_vertex()

template<class Traits >
bool stapl::adjacency_list_vector_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.
Note
As this is the static storage, deletion of vertices is not allowed.

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