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

Adjacency list of a vertex implemented as a vector of edges.Used inside the vertex_adj_list_impl to store adjacent edges. More...

Public Member Functions

 adjacency_list_impl (size_t n=0)
 Create an edgelist with specified number of edges.
 
 adjacency_list_impl (adjacency_list_impl const &other)
 
adjacency_list_imploperator= (adjacency_list_impl const &other)
 
iterator begin (void)
 
const_iterator begin (void) const
 
iterator end (void)
 
const_iterator end (void) const
 
iterator remote_begin (void)
 Not used, provided for compatibility.
 
const_iterator remote_begin (void) const
 Not used, provided for compatibility.
 
iterator find (vertex_descriptor const &vd)
 Returns an iterator to the edge with the specified target. More...
 
iterator find (edge_descriptor const &ed)
 Returns an iterator to the specified edge. More...
 
const_iterator find (vertex_descriptor const &vd) const
 Returns an iterator to the edge with the specified target. More...
 
const_iterator find (edge_descriptor const &ed) const
 Returns an iterator to the specified edge. More...
 
size_t size (void) const
 Returns the number of edges in the edgelist.
 
size_t capacity (void) const
 Returns the storage capacity of the edgelist.
 
void reserve (size_t n)
 Reserves space for the specified number of edges.
 
void add_dummy (void)
 Adds an edge to the front of edgelist.
 
void clear (void)
 Clears the edgelist.
 
void erase (size_t n)
 Erases all edges from index n until the end. More...
 
void erase_at (size_t n)
 Erases edge at index n. More...
 
void erase (size_t start, size_t end)
 Erases all edges from index start until one before index end. More...
 

Public Types

typedef Edge edge_type
 
typedef Edge::vertex_descriptor vertex_descriptor
 
typedef Edge::edge_descriptor_type edge_descriptor
 
typedef std::vector< Edge >::iterator iterator
 
typedef std::vector< Edge >::const_iterator const_iterator
 
typedef std::iterator_traits< iterator >::reference reference
 
typedef std::iterator_traits< iterator >::value_type value_type
 

Protected Member Functions

void add (const Edge &ed)
 Adds the specified edge to the back of edgelist. This interface is specific to adjacency list and is accessible only from sequential::adjacency_list_graph, as we need to make sure the edge's source is the correct vertex. More...
 
template<typename Comp >
void insert (Edge const &ed, Comp const &comp)
 Inserts the specified edge before the edge which causes the comp function to return false (requires the edges to already be sorted). This interface is specific to adjacency list and is accessible only from sequential::adjacency_list_graph, as we need to make sure the edge's source is the correct vertex. More...
 
void erase (iterator it)
 Erases the edge pointed to by the specified iterator. More...
 
void erase (iterator itb, iterator ite)
 

Protected Attributes

std::vector< Edge > m_data
 The actual list of edges is stored in an std::vector.
 

Friends

template<class Traits >
class adjacency_list_model
 

Detailed Description

template<class Edge>
class stapl::adjacency_list_impl< Edge >

Adjacency list of a vertex implemented as a vector of edges.

Used inside the vertex_adj_list_impl to store adjacent edges.

Template Parameters
EdgeThe type of edge to be stored.

Member Function Documentation

◆ find() [1/4]

template<class Edge >
iterator stapl::adjacency_list_impl< Edge >::find ( vertex_descriptor const &  vd)

Returns an iterator to the edge with the specified target.

Parameters
vdThe descriptor of the target vertex.

◆ find() [2/4]

template<class Edge >
iterator stapl::adjacency_list_impl< Edge >::find ( edge_descriptor const &  ed)

Returns an iterator to the specified edge.

Parameters
edThe descriptor of the edge.

◆ find() [3/4]

template<class Edge >
const_iterator stapl::adjacency_list_impl< Edge >::find ( vertex_descriptor const &  vd) const

Returns an iterator to the edge with the specified target.

Parameters
vdThe descriptor of the target vertex.

◆ find() [4/4]

template<class Edge >
const_iterator stapl::adjacency_list_impl< Edge >::find ( edge_descriptor const &  ed) const

Returns an iterator to the specified edge.

Parameters
edThe descriptor of the edge.

◆ erase() [1/3]

template<class Edge >
void stapl::adjacency_list_impl< Edge >::erase ( size_t  n)

Erases all edges from index n until the end.

Parameters
nThe starting index of the range of edges to be deleted.

◆ erase_at()

template<class Edge >
void stapl::adjacency_list_impl< Edge >::erase_at ( size_t  n)

Erases edge at index n.

Parameters
nThe index of the edge to be deleted.

◆ erase() [2/3]

template<class Edge >
void stapl::adjacency_list_impl< Edge >::erase ( size_t  start,
size_t  end 
)

Erases all edges from index start until one before index end.

Parameters
startThe starting index of the range of edges to be deleted.
endThe index right after the range of edges to be deleted.

◆ add()

template<class Edge >
void stapl::adjacency_list_impl< Edge >::add ( const Edge &  ed)
protected

Adds the specified edge to the back of edgelist. This interface is specific to adjacency list and is accessible only from sequential::adjacency_list_graph, as we need to make sure the edge's source is the correct vertex.

Parameters
edThe edge to be inserted into the edgelist.

◆ insert()

template<class Edge >
template<typename Comp >
void stapl::adjacency_list_impl< Edge >::insert ( Edge const &  ed,
Comp const &  comp 
)
protected

Inserts the specified edge before the edge which causes the comp function to return false (requires the edges to already be sorted). This interface is specific to adjacency list and is accessible only from sequential::adjacency_list_graph, as we need to make sure the edge's source is the correct vertex.

Parameters
edThe edge to be inserted into the edgelist.

◆ erase() [3/3]

template<class Edge >
void stapl::adjacency_list_impl< Edge >::erase ( iterator  it)
protected

Erases the edge pointed to by the specified iterator.

Parameters
itAn iterator pointing to the edge to be deleted.

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