STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Classes | Public Member Functions | Public Types | Protected Attributes
stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits > Struct Template Reference

Base class for the graph's base-container. Provides functionality of the graph API for local storage. More...

Classes

class  cached_vertex_impl_type
 Write-back cache for hub-vertices. More...
 
struct  triple
 Class for storing a triplet. More...
 

Public Member Functions

template<typename Domain >
 graph_base_container_storage_base (Domain const &domain, cid_type const &cid, value_type const &default_value=value_type())
 Creates a graph base container with a given size and domain but does not construct elements. More...
 
 graph_base_container_storage_base (graph_base_container_storage_base const &other)
 
void init_loaded_state ()
 Initializes variables dealing with loaded state.
 
void init_fnames ()
 Initializes variables indicating file-names related to this base-container.
 
bool initialize ()
 Constructs all elements of the current base-container.
 
container_type * data ()
 
vertex_descriptor next_free_descriptor ()
 
vertex_iterator begin (void)
 
vertex_iterator end (void)
 
edge_iterator edges_begin (void)
 
edge_iterator edges_end (void)
 
vertex_descriptor add_vertex (vertex_property const &v)
 Adds vertex to the component with the given vertex property. The descriptor is assigned automatically. More...
 
void update_next_descriptor (vertex_descriptor const &vd)
 Updates the vertex descriptor generator with the next free descriptor.
 
vertex_descriptor add_vertex (vertex_descriptor const &gid, vertex_property const &v)
 Adds vertex to the component with the given descriptor and property. More...
 
vertex_descriptor add_element (vertex_type const &v)
 Adds vertex to the component with the given descriptor, property and edges. More...
 
void reserve_adjacency (vertex_descriptor const &gid, size_t num_adjacents)
 Reserves space for adjacent edges of the vertex with the specified descriptor. More...
 
bool delete_vertex (vertex_descriptor gid)
 Deletes the vertex with the specified descriptor. More...
 
bool suspend_vertex (vertex_descriptor gid)
 Deletes the vertex associated with the specified descriptor, but leave all the edges pointing to it from other vertices. Needed for migration. More...
 
vertex_iterator find_vertex (vertex_descriptor const &gid)
 Checks if the vertex with the specified descriptor is local to the component, then returns an iterator pointing to it. More...
 
const_vertex_iterator find_vertex (vertex_descriptor const &gid) const
 Checks if the vertex with the specified descriptor is local to the component, then returns an iterator pointing to it. More...
 
vertex_iterator find (vertex_descriptor const &gid)
 Same as find_vertex(vertex_descriptor const&). Provided for compatibility with other base containers.
 
edge_descriptor add_edge (edge_descriptor const &edd, edge_property const &ep)
 Adds an edge to this base-container with the given edge descriptor and edge property. More...
 
edge_descriptor add_edge (vertex_descriptor const &source, vertex_descriptor const &target, edge_property const &ep)
 Adds an edge to this base-container from given source to target and edge property. More...
 
template<typename Comp >
edge_descriptor insert_edge (edge_descriptor const &edd, edge_property const &ep, Comp const &comp)
 Inserts an edge into this base-container with the given edge descriptor and edge property, using a comparator function to determine where in edge-container of a vertex the edge will be inserted. (Requires the edges of the source vertex to already be sorted by the comparator.) More...
 
template<typename Comp >
edge_descriptor insert_edge (vertex_descriptor const &source, vertex_descriptor const &target, edge_property const &ep, Comp const &comp)
 Inserts an edge into this base-container from given source to target descriptor and edge property, using a comparator function to determine where in edge-container of a vertex the edge will be inserted. (Requires the edges of the source vertex to already be sorted by the comparator.) More...
 
template<typename Comp >
void insert_edge_async (edge_descriptor const &edd, edge_property const &ep, Comp const &comp)
 Inserts an edge into this base-container with the given edge descriptor and edge property, using a comparator function to determine where in edge-container of a vertex the edge will be inserted. (Requires the edges of the source vertex to already be sorted by the comparator.) More...
 
template<typename Comp >
void insert_edge_async (vertex_descriptor const &source, vertex_descriptor const &target, edge_property const &ep, Comp const &comp)
 Inserts an edge into this base-container from given source to target descriptor and edge property, using a comparator function to determine where in edge-container of a vertex the edge will be inserted. (Requires the edges of the source vertex to already be sorted by the comparator.) More...
 
edge_descriptor add_edge_async (edge_descriptor const &edd, edge_property const &ep)
 
edge_descriptor add_edge_async (vertex_descriptor const &source, vertex_descriptor const &target, edge_property const &ep)
 
edge_descriptor add_edge (edge_descriptor const &edd, edge_property const &ep, bool bidir)
 Adds an edge to this base-container with the given edge descriptor and edge property. If bidir is true, also adds the sibling edge, if the target also exists in this base-container. More...
 
bool delete_edge (edge_descriptor const &ed)
 Deletes an edge from this base-container with the given descriptor. More...
 
bool find_edge (edge_descriptor const &ed, vertex_iterator lit, adj_edge_iterator ei)
 Finds the edge with the given edge descriptor. More...
 
bool has_edge (vertex_descriptor const &source, vertex_descriptor const &target)
 Determines if an edge exists between two vertices. This method is similar to find_edge, but does not assign iterators.
 
size_t num_vertices (void) const
 The number of vertices in this base-container. More...
 
size_t size (void) const
 The number of vertices in this base-container. Same as num_vertices(), provided for compatibility. More...
 
bool empty (void) const
 Tests if the base-container is empty or not. More...
 
void clear (void)
 Deletes all vertices and edges in this base-container.
 
void clear_edges (void)
 Clears the edges of the graph. This resets internal counters for edge-id assignments, and clears graph edge storage.
 
template<typename Comp >
void sort_edges (Comp const &comp)
 Sorts edges of each vertex based on given comparator. More...
 
template<typename Pred >
void erase_edges_if (Pred &&pred)
 Erases all edges that match a user-defined predicate. More...
 
void remove_duplicate_edges ()
 Removes all duplicate edges with the same (source, target) pair.
 
size_t num_edges (void) const
 The number of edges in this base-container.
 
edge_descriptor add_bidirectional_edge (edge_descriptor const &ed, edge_property const &p)
 Adds a bidirectional edge to the base-container with the given descriptor and property. The sibling edge has the source and target reversed. Both vertices should be in this base-container. More...
 
template<typename F >
void apply (vertex_descriptor const &gid, F const &f)
 applies a functor f on the specified vertex. More...
 
template<typename F >
void apply_set (vertex_descriptor const &gid, F const &f)
 applies a functor f on the specified vertex. More...
 
template<typename F >
F::result_type apply_get (vertex_descriptor const &gid, F const &f)
 applies a functor f on the specified vertex and returns a value. More...
 
template<typename F >
F::result_type apply_get (vertex_descriptor const &gid, F const &f) const
 applies a functor f on the specified vertex and returns a value. More...
 
template<typename F >
F::result_type vp_apply (vertex_descriptor const &gid, F const &f)
 Applies a functor f on the property of the specified vertex. More...
 
template<typename F >
F::result_type vp_apply (vertex_descriptor const &gid, F const &f) const
 Applies a functor f on the property of the specified vertex. More...
 
void vp_set (vertex_descriptor const &gid, typename Traits::stored_type const &vp)
 Sets the property of the specified vertex to the given value. More...
 
template<typename F >
void vp_apply_async (vertex_descriptor const &gid, F const &f)
 Applies a functor f on the property of the specified vertex. More...
 
template<typename FCont >
void aggregate_vp_apply (FCont const &fcont)
 Applies each element from the given container of functors on the property of the vertex specified by each element. More...
 
template<typename F >
bool ep_find_apply (edge_descriptor const &ed, F const &f)
 Applies a functor f on the property of the specified edge, if it exists. More...
 
template<typename F >
void ep_apply (edge_descriptor const &ed, F const &f)
 Applies a functor f on the property of the specified edge. More...
 
template<typename F >
F::result_type ep_apply_get (edge_descriptor const &ed, F const &f)
 Applies a functor f on the property of the specified edge, and returns the result. More...
 
vertex_reference operator[] (gid_type const &g)
 Returns a reference to the specified vertex. More...
 
const_vertex_reference operator[] (gid_type const &g) const
 Returns a reference to the specified vertex. More...
 
vertex_reference make_reference (vertex_descriptor const &gid)
 Returns a reference to the specified vertex. More...
 
const_vertex_reference make_reference (vertex_descriptor const &gid) const
 Returns a reference to the specified vertex. More...
 
vertex_iterator make_iterator (vertex_descriptor const &gid)
 Returns an iterator to the specified vertex. More...
 
container_type & container (void)
 
cid_type get_cid (void) const
 Returns the id of this base-container.
 
cid_type cid (void) const
 Returns the id of this base-container. Same as get_cid for compatibility.
 
void set_cid (cid_type cid)
 Sets the id of this base-container.
 
domain_type const & domain (void) const
 Returns the domain of this base-container.
 
gid_type local_position (gid_type const &gid) const
 Returns the position of the given vertex in this base-container.
 
value_type get_element (gid_type const &gid)
 Returns a reference to the specified vertex. More...
 
const_reference get_element (gid_type const &gid) const
 Returns a const reference to the specified vertex. More...
 
reference get_stored_element (gid_type const &gid)
 Get the element corresponding to a specific GID. More...
 
void set_hubs (size_t max_hubs)
 Sets the hubs-cache for this base-container. Base-container must be loaded.
 
void free (void)
 Frees the memory used by this base-container.
 
bool is_valid_loaded_state () const
 Returns whether this base-container is loaded in memory. Returns true if vertices and edges are both loaded.
 
bool is_loaded (void) const
 Returns whether this base-container is loaded in memory. Returns true if vertices and edges are both loaded.
 
bool is_fully_loaded (void) const
 Returns whether this base-container is loaded in memory. Returns true if vertices and edges are both loaded.
 
bool is_partially_loaded (void) const
 Returns whether this base-container is partially loaded in memory. Returns true if only the vertices loaded, but edges are out-of-core.
 
bool is_vertices_loaded (void) const
 Returns whether this base-container's vertices are loaded.
 
bool is_edges_loaded (void) const
 Returns whether this base-container's edges are loaded.
 
void set_loaded (bool b)
 Sets this base-container's loaded state.
 
void set_vertices_loaded (bool b)
 Sets this base-container's loaded state for vertices.
 
void set_edges_loaded (bool b)
 Sets this base-container's loaded state for edges.
 
bool is_active (void)
 Returns whether this base-container is active, i.e., has any modifications that need to be persisted.
 
void set_active (bool active)
 Sets this base-container's active state, i.e., if it has any modifications that need to be persisted.
 
template<typename UF >
bool load_apply_outstanding_commits (UF const &)
 Loads the outstanding commits to a base container, then applies those commits to the base container in the order they are in the file. More...
 
template<typename UF >
void store_outstanding_commits_cached (vertex_descriptor const &vd, UF const &uf)
 Stores the outstanding commits to a base container. If vertex exists in cache, applies to that instead. Since cached vertices do not cache edges, this can only be used for vp_apply(). More...
 
template<typename UF >
void store_outstanding_commits (vertex_descriptor const &vd, UF const &uf)
 Stores the outstanding commits to a base container. More...
 
void flush_outstanding_commits (bool wait_until_finished=true)
 Flushes the outstanding commits to a base container.
 
bool load_apply_outstanding_edges (void)
 Loads the outstanding edge-commits to a base container, then adds those edges to the base container in the order they are in the file.
 
void store_outstanding_edges (edge_descriptor const &ed, edge_property const &ep, bool bidir=false)
 Stores the outstanding edge-commits to a base container.
 
void flush_outstanding_edges (bool wait_until_finished=true)
 Flushes the outstanding commits to a base container.
 
void defer (bool defer)
 

Public Types

typedef Traits::container_type container_type
 
typedef Traits::vertex_property vertex_property
 
typedef Traits::edge_property edge_property
 
typedef Traits::vertex_descriptor vertex_descriptor
 vertex_descriptor is the GID of the vertex.
 
typedef Traits::simple_vertex_descriptor simple_vertex_descriptor
 The simple vertex descriptor is an integral type. Convertible to/from vertex_descriptor.
 
typedef Traits::edge_descriptor edge_descriptor
 
typedef Traits::directness_type directness_type
 
typedef Traits::multiplicity_type multiplicity_type
 
typedef Traits::domain_type domain_type
 
typedef vertex_descriptor gid_type
 For graphs, the global identifier is the vertex descriptor.
 
typedef size_t cid_type
 
typedef Traits::vertex_impl_type vertex_type
 The type of the vertex.
 
typedef Traits::edgelist_type edgelist_type
 The type of edgelist to use for each vertex.
 
typedef Traits::edge_type edge_type
 The type of edge to use.
 
typedef vertex_type value_type
 For a graph, the vertex is the value-type.
 
typedef local_accessor_graph< graph_base_container_storage_baseaccessor_t
 
typedef proxy< vertex_type, accessor_tvertex_reference
 
typedef local_iterator< graph_base_container_storage_base, accessor_tvertex_iterator
 
typedef vertex_reference reference
 
typedef vertex_iterator iterator
 
typedef const_local_accessor_graph< graph_base_container_storage_baseconst_accessor_t
 
typedef proxy< vertex_type, const_accessor_tconst_vertex_reference
 
typedef const_vertex_reference const_reference
 
typedef const_local_iterator< graph_base_container_storage_base, const_accessor_tconst_vertex_iterator
 
typedef const_vertex_iterator const_iterator
 
typedef edgelist_type::iterator adj_edge_iterator
 
typedef edgelist_type::const_iterator const_adj_edge_iterator
 
typedef sequential::edge_iterator_adaptor< vertex_iteratoredge_iterator
 

Protected Attributes

domain_type m_domain
 The domain of this base_container.
 
container_type * m_data
 m_data is the model and storage for the graph. The model affects the performance and capabilities of the graph. For example, the adjacency_list_model provides an adjacency list of vertices.
 
bool m_initialized
 
cid_type m_cid
 This base_container's id.
 
char m_commit_buffer [commit_buffer()]
 For buffering stored commits to the graph.
 
size_t m_num_buffered
 
char m_edges_buffer [commit_buffer()]
 For buffering stored edge-commits to the graph.
 
size_t m_num_buffered_edges
 
std::unordered_map< vertex_descriptor, cached_vertex_impl_typem_hubs_cache
 
bool m_loaded
 Indicates whether this base-container is completely loaded in memory.
 
bool m_vertices_loaded
 
bool m_edge_loaded
 
bool m_active
 Indicates whether any updates were performed for this base-container.
 
bool m_graph_structure_modifications
 
char m_bc_fname [30]
 The name of the file to read/write this base-container from/to.
 
char m_bc_vp_fname [30]
 
bool m_defer_cleanup
 

Detailed Description

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
struct stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >

Base class for the graph's base-container. Provides functionality of the graph API for local storage.

Template Parameters
Dgraph-attribute specifying Directedness (DIRECTED/UNDIRECTED).
Mgraph-attribute specifying Multiedge. (MULTIEDGES/NONMULTIEDGES).
VertexPtype of property for the vertex. Must be default assignable, copyable and assignable.
EdgePtype of property for the edge. Must be default assignable, copyable and assignable.
TraitsA traits class that defines customizable components of graph, such as the domain type, vertex type, edge type, edgelist type, storage, etc. E.g. graph_base_container_traits.

Constructor & Destructor Documentation

◆ graph_base_container_storage_base()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
template<typename Domain >
stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::graph_base_container_storage_base ( Domain const &  domain,
cid_type const &  cid,
value_type const &  default_value = value_type() 
)

Creates a graph base container with a given size and domain but does not construct elements.

initialize() must be called when loading for the first time to construct elements.

Parameters
domainProvides the domain of vertex descriptors stored in this base container.
cidProvides the id of this base-container.
default_valueprovides the default value for the vertices stored in this base-container.

Member Function Documentation

◆ add_vertex() [1/2]

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
vertex_descriptor stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::add_vertex ( vertex_property const &  v)

Adds vertex to the component with the given vertex property. The descriptor is assigned automatically.

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

◆ add_vertex() [2/2]

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
vertex_descriptor stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::add_vertex ( vertex_descriptor const &  gid,
vertex_property const &  v 
)

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

Parameters
gidThe explicit descriptor of the added vertex.
vThe vertex property of the added vertex.
Returns
The descriptor of the added vertex.

◆ add_element()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
vertex_descriptor stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::add_element ( vertex_type const &  v)

Adds vertex to the component with the given descriptor, property and edges.

Parameters
vThe vertex to be added, along with edges and properties.
Returns
The descriptor of the added vertex.

◆ reserve_adjacency()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
void stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::reserve_adjacency ( vertex_descriptor const &  gid,
size_t  num_adjacents 
)

Reserves space for adjacent edges of the vertex with the specified descriptor.

Parameters
gidThe descriptor of the vertex which needs to reserve space.
num_adjacentsThe number of adjacent edges for which space will be reserved.

◆ delete_vertex()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
bool stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::delete_vertex ( vertex_descriptor  gid)

Deletes the vertex with the specified descriptor.

Parameters
gidThe descriptor of the vertex to be deleted.
Returns
Whether or not the vertex was successfully deleted.

◆ suspend_vertex()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
bool stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::suspend_vertex ( vertex_descriptor  gid)

Deletes the vertex associated with the specified descriptor, but leave all the edges pointing to it from other vertices. Needed for migration.

Parameters
gididentifier of the vertex to be suspended.
Returns
Whether or not the vertex was successfully deleted.

◆ find_vertex() [1/2]

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
vertex_iterator stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::find_vertex ( vertex_descriptor const &  gid)

Checks if the vertex with the specified descriptor is local to the component, then returns an iterator pointing to it.

Parameters
gidDescriptor of the vertex to be searched.
Note
This method should be called after we check if the element is local or not.
Returns
The iterator pointing to the vertex, if found, else, an iterator to the end of the container is returned.

◆ find_vertex() [2/2]

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
const_vertex_iterator stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::find_vertex ( vertex_descriptor const &  gid) const

Checks if the vertex with the specified descriptor is local to the component, then returns an iterator pointing to it.

Parameters
gidDescriptor of the vertex to be searched.
Note
This method should be called after we check if the element is local or not.
Returns
The iterator pointing to the vertex, if found, else, an iterator to the end of the container is returned.

◆ add_edge() [1/3]

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
edge_descriptor stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::add_edge ( edge_descriptor const &  edd,
edge_property const &  ep 
)

Adds an edge to this base-container with the given edge descriptor and edge property.

Parameters
eddThe descriptor of edge to be added.
epThe property of the edge to be added.
Returns
The descriptor of the added edge. The id of the descriptor is invalid if the edge was not added.

◆ add_edge() [2/3]

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
edge_descriptor stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::add_edge ( vertex_descriptor const &  source,
vertex_descriptor const &  target,
edge_property const &  ep 
)

Adds an edge to this base-container from given source to target and edge property.

Parameters
sourceThe vertex descriptor of source.
targetThe vertex descriptor of target.
epThe property of the edge to be added.
Returns
The descriptor of the added edge. The id of the descriptor is invalid if the edge was not added.

◆ insert_edge() [1/2]

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
template<typename Comp >
edge_descriptor stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::insert_edge ( edge_descriptor const &  edd,
edge_property const &  ep,
Comp const &  comp 
)

Inserts an edge into this base-container with the given edge descriptor and edge property, using a comparator function to determine where in edge-container of a vertex the edge will be inserted. (Requires the edges of the source vertex to already be sorted by the comparator.)

Parameters
eddThe descriptor of edge to be inserted.
epThe property of the edge to be inserted.
compPassed internal to std::lower_bound to find the spot to insert the new edge.

◆ insert_edge() [2/2]

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
template<typename Comp >
edge_descriptor stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::insert_edge ( vertex_descriptor const &  source,
vertex_descriptor const &  target,
edge_property const &  ep,
Comp const &  comp 
)

Inserts an edge into this base-container from given source to target descriptor and edge property, using a comparator function to determine where in edge-container of a vertex the edge will be inserted. (Requires the edges of the source vertex to already be sorted by the comparator.)

Parameters
sourceThe vertex descriptor of source.
targetThe vertex descriptor of target.
epThe property of the edge to be inserted.
compPassed internal to std::lower_bound to find the spot to insert the new edge.

◆ insert_edge_async() [1/2]

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
template<typename Comp >
void stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::insert_edge_async ( edge_descriptor const &  edd,
edge_property const &  ep,
Comp const &  comp 
)

Inserts an edge into this base-container with the given edge descriptor and edge property, using a comparator function to determine where in edge-container of a vertex the edge will be inserted. (Requires the edges of the source vertex to already be sorted by the comparator.)

Parameters
eddThe descriptor of edge to be inserted.
epThe property of the edge to be inserted.
compPassed internal to std::lower_bound to find the spot to insert the new edge.
Note
Used for compatibility

◆ insert_edge_async() [2/2]

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
template<typename Comp >
void stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::insert_edge_async ( vertex_descriptor const &  source,
vertex_descriptor const &  target,
edge_property const &  ep,
Comp const &  comp 
)

Inserts an edge into this base-container from given source to target descriptor and edge property, using a comparator function to determine where in edge-container of a vertex the edge will be inserted. (Requires the edges of the source vertex to already be sorted by the comparator.)

Parameters
sourceThe vertex descriptor of source.
targetThe vertex descriptor of target.
epThe property of the edge to be inserted.
compPassed internal to std::lower_bound to find the spot to insert the new edge.
Note
Used for API compatibility

◆ add_edge_async() [1/2]

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
edge_descriptor stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::add_edge_async ( edge_descriptor const &  edd,
edge_property const &  ep 
)

Note
Used for compatibility

◆ add_edge_async() [2/2]

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
edge_descriptor stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::add_edge_async ( vertex_descriptor const &  source,
vertex_descriptor const &  target,
edge_property const &  ep 
)

Note
Used for API compatibility

◆ add_edge() [3/3]

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
edge_descriptor stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::add_edge ( edge_descriptor const &  edd,
edge_property const &  ep,
bool  bidir 
)

Adds an edge to this base-container with the given edge descriptor and edge property. If bidir is true, also adds the sibling edge, if the target also exists in this base-container.

Parameters
eddThe descriptor of edge to be added.
epThe property of the edge to be added.
bidirWhether or not to add the undirected sibling edge.
Returns
The descriptor of the added edge. The id of the descriptor is invalid if the edge was not added.

◆ delete_edge()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
bool stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::delete_edge ( edge_descriptor const &  ed)

Deletes an edge from this base-container with the given descriptor.

Returns
True if the edge was deleted, false otherwise.

◆ find_edge()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
bool stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::find_edge ( edge_descriptor const &  ed,
vertex_iterator  lit,
adj_edge_iterator  ei 
)

Finds the edge with the given edge descriptor.

Parameters
edThe descriptor of the edge to be found.
litThe vertex iterator that will be updated to point to the source-vertex of the edge, if it was found.
eiThe iterator that will be updated to point to the edge, if found.
Returns
True if the edge was found, false otherwise. If found, lit and ei will be valid and pointing to the corresponding source vertex and the edge.

◆ num_vertices()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
size_t stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::num_vertices ( void  ) const

The number of vertices in this base-container.

Returns
size_t The number of vertices in this base-container.

◆ size()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
size_t stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::size ( void  ) const

The number of vertices in this base-container. Same as num_vertices(), provided for compatibility.

Returns
size_t The number of vertices in this base-container.

◆ empty()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
bool stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::empty ( void  ) const

Tests if the base-container is empty or not.

Returns
true if the component is empty and false otherwise.

◆ sort_edges()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
template<typename Comp >
void stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::sort_edges ( Comp const &  comp)

Sorts edges of each vertex based on given comparator.

Parameters
compThe comparator used to sort edges.

◆ erase_edges_if()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
template<typename Pred >
void stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::erase_edges_if ( Pred &&  pred)

Erases all edges that match a user-defined predicate.

Parameters
predA unary predicate that receives a single edge

◆ add_bidirectional_edge()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
edge_descriptor stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::add_bidirectional_edge ( edge_descriptor const &  ed,
edge_property const &  p 
)

Adds a bidirectional edge to the base-container with the given descriptor and property. The sibling edge has the source and target reversed. Both vertices should be in this base-container.

Parameters
edThe descriptor of the edge to be added. If the id is not invalid, it will be used to create the edges, otherwise one will be generated.
pThe property of the edge to be added.
Returns
The descriptor of edge added. The source is the smaller of the source and target descriptors.

◆ apply()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
template<typename F >
void stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::apply ( vertex_descriptor const &  gid,
F const &  f 
)

applies a functor f on the specified vertex.

Parameters
gidthe descriptor of the vertex on which the functor will be applied.
fthe functor to be applied.

◆ apply_set()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
template<typename F >
void stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::apply_set ( vertex_descriptor const &  gid,
F const &  f 
)

applies a functor f on the specified vertex.

Parameters
gidthe descriptor of the vertex on which the functor will be applied.
fthe functor to be applied.

◆ apply_get() [1/2]

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
template<typename F >
F::result_type stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::apply_get ( vertex_descriptor const &  gid,
F const &  f 
)

applies a functor f on the specified vertex and returns a value.

Parameters
gidthe descriptor of the vertex on which the functor will be applied.
fthe functor to be applied.

◆ apply_get() [2/2]

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
template<typename F >
F::result_type stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::apply_get ( vertex_descriptor const &  gid,
F const &  f 
) const

applies a functor f on the specified vertex and returns a value.

Parameters
gidthe descriptor of the vertex on which the functor will be applied.
fthe functor to be applied.

◆ vp_apply() [1/2]

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
template<typename F >
F::result_type stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::vp_apply ( vertex_descriptor const &  gid,
F const &  f 
)

Applies a functor f on the property of the specified vertex.

Parameters
gidThe descriptor of the vertex on which the functor will be applied.
fThe functor to be applied.
Returns
The result of applying f on the vertex property.

◆ vp_apply() [2/2]

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
template<typename F >
F::result_type stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::vp_apply ( vertex_descriptor const &  gid,
F const &  f 
) const

Applies a functor f on the property of the specified vertex.

Parameters
gidThe descriptor of the vertex on which the functor will be applied.
fThe functor to be applied.
Returns
The result of applying f on the vertex property.

◆ vp_set()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
void stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::vp_set ( vertex_descriptor const &  gid,
typename Traits::stored_type const &  vp 
)

Sets the property of the specified vertex to the given value.

Parameters
gidThe descriptor of the vertex.
vpThe new value of the property.

◆ vp_apply_async()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
template<typename F >
void stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::vp_apply_async ( vertex_descriptor const &  gid,
F const &  f 
)

Applies a functor f on the property of the specified vertex.

Parameters
gidThe descriptor of the vertex on which the functor will be applied.
fThe functor to be applied.

◆ aggregate_vp_apply()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
template<typename FCont >
void stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::aggregate_vp_apply ( FCont const &  fcont)

Applies each element from the given container of functors on the property of the vertex specified by each element.

Parameters
fcontThe container of functors to be applied. Elements must additionally provide a target() method to specify the descriptor of the vertex on which the functor will be applied.

◆ ep_find_apply()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
template<typename F >
bool stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::ep_find_apply ( edge_descriptor const &  ed,
F const &  f 
)

Applies a functor f on the property of the specified edge, if it exists.

Parameters
edThe descriptor of the edge on which the functor will be applied.
fThe functor to be applied.
Returns
True if the edge exists, False otherwise.

◆ ep_apply()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
template<typename F >
void stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::ep_apply ( edge_descriptor const &  ed,
F const &  f 
)

Applies a functor f on the property of the specified edge.

Parameters
edThe descriptor of the edge on which the functor will be applied.
fThe functor to be applied.
Note
The edge must exist.

◆ ep_apply_get()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
template<typename F >
F::result_type stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::ep_apply_get ( edge_descriptor const &  ed,
F const &  f 
)

Applies a functor f on the property of the specified edge, and returns the result.

Parameters
edThe descriptor of the edge on which the functor will be applied.
fThe functor to be applied.
Returns
The result of the application of f to the specified edge.
Note
The edge must exist.

◆ operator[]() [1/2]

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
vertex_reference stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::operator[] ( gid_type const &  g)

Returns a reference to the specified vertex.

Parameters
gThe descriptor of the vertex.
Returns
The reference to the specified vertex.

◆ operator[]() [2/2]

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
const_vertex_reference stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::operator[] ( gid_type const &  g) const

Returns a reference to the specified vertex.

Parameters
gThe descriptor of the vertex.
Returns
The reference to the specified vertex.

◆ make_reference() [1/2]

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
vertex_reference stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::make_reference ( vertex_descriptor const &  gid)

Returns a reference to the specified vertex.

Parameters
gThe descriptor of the vertex.
Returns
The reference to the specified vertex.

◆ make_reference() [2/2]

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
const_vertex_reference stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::make_reference ( vertex_descriptor const &  gid) const

Returns a reference to the specified vertex.

Parameters
gThe descriptor of the vertex.
Returns
The reference to the specified vertex.

◆ make_iterator()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
vertex_iterator stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::make_iterator ( vertex_descriptor const &  gid)

Returns an iterator to the specified vertex.

Parameters
gidThe descriptor of the vertex.
Returns
The iterator to the specified vertex.

◆ get_element() [1/2]

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
value_type stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::get_element ( gid_type const &  gid)

Returns a reference to the specified vertex.

Parameters
gidThe descriptor of the vertex.
Returns
The reference to the specified vertex.

◆ get_element() [2/2]

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
const_reference stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::get_element ( gid_type const &  gid) const

Returns a const reference to the specified vertex.

Parameters
gidThe descriptor of the vertex.
Returns
The reference to the specified vertex.

◆ get_stored_element()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
reference stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::get_stored_element ( gid_type const &  gid)

Get the element corresponding to a specific GID.

This method is used in the redistribution of composed containers. It is needed to allow the distributor object to get the instance of the container_wrapper_ref for a container instance on one location and send it to another location where it will be placed in a base container by calling set_element. set_element only accepts instances of the stored type.

Parameters
gidThe id associated with the element for which we want to read the value.
Returns
A reference to the stored instance of the specified vertex.

◆ load_apply_outstanding_commits()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
template<typename UF >
bool stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::load_apply_outstanding_commits ( UF const &  )

Loads the outstanding commits to a base container, then applies those commits to the base container in the order they are in the file.

Template Parameters
UFType of the user provided neighbor-operator.

◆ store_outstanding_commits_cached()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
template<typename UF >
void stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::store_outstanding_commits_cached ( vertex_descriptor const &  vd,
UF const &  uf 
)

Stores the outstanding commits to a base container. If vertex exists in cache, applies to that instead. Since cached vertices do not cache edges, this can only be used for vp_apply().

Template Parameters
UFType of the user provided neighbor-operator.

◆ store_outstanding_commits()

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
template<typename UF >
void stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::store_outstanding_commits ( vertex_descriptor const &  vd,
UF const &  uf 
)

Stores the outstanding commits to a base container.

Template Parameters
UFType of the user provided neighbor-operator.

Member Data Documentation

◆ m_vertices_loaded

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
bool stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::m_vertices_loaded
protected

Indicates whether or not this base-container's vertices have been loaded in memory.

◆ m_edge_loaded

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
bool stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::m_edge_loaded
protected

Indicates whether or not this base-container's edges have been loaded in memory.

◆ m_graph_structure_modifications

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
bool stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::m_graph_structure_modifications
protected

Indicates whether any structure-modifications were done for this base-container.

◆ m_bc_vp_fname

template<graph_attributes D, graph_attributes M, typename VertexP, typename EdgeP, typename Traits>
char stapl::graph_base_container_storage_base< D, M, VertexP, EdgeP, Traits >::m_bc_vp_fname[30]
protected

The name of the file to read/write this base-container's vertex-properties from/to.


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