STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Types | Protected Types
stapl::dynamic_graph< D, M, OptionalParams > Class Template Reference

Implementation of dynamic graph that supports addition and deletion of vertices and edges.Inherits from stapl::graph and adds functionality to add/delete vertices. More...

Public Member Functions

Constructors
 dynamic_graph (void)
 
 dynamic_graph (size_t const &n)
 Creates a graph with a given size. More...
 
 dynamic_graph (size_t const &n, vertex_property const &default_value)
 Creates a graph with a given size and constructs all elements with a default value for vertex property. More...
 
 dynamic_graph (partition_type const &ps, vertex_property const &default_value=vertex_property())
 Creates a graph with a given partition and default value for vertex property. More...
 
 dynamic_graph (partition_type const &ps, mapper_type const &mapper, vertex_property const &default_value=vertex_property())
 
template<typename DistSpecsView >
 dynamic_graph (DistSpecsView const &dist_view, typename boost::enable_if< is_distribution_view< DistSpecsView > >::type *=0)
 
template<typename DistSpecsView >
 dynamic_graph (DistSpecsView const &dist_view, vertex_property const &default_value, typename boost::enable_if< is_distribution_view< DistSpecsView > >::type *=0)
 
template<typename DP >
 dynamic_graph (size_t n, vertex_property const &default_value, DP const &dis_policy)
 Creates a graph with a given size and default value where the vertex_property may itself be a parallel container. Required for pC composition. More...
 
template<typename X , typename Y >
 dynamic_graph (boost::tuples::cons< X, Y > dims)
 Creates composed pContainers with a given size-specifications. Required for pC composition. More...
 
template<typename X , typename Y , typename DP >
 dynamic_graph (boost::tuples::cons< X, Y > dims, DP const &dis_policy)
 Creates composed pContainers with a given size-specifications. Required for pC composition. More...
 
template<typename SizesView >
 dynamic_graph (SizesView const &sizes_view, typename boost::enable_if< boost::mpl::and_< boost::is_same< size_type, typename SizesView::size_type >, boost::mpl::not_< is_distribution_view< SizesView > > > >::type *=0)
 Constructor for composed containers. For an m level composed container, sizes_view is an m-1 level composed view representing the sizes of the nested containers.
 
template<typename ComposedSpec >
 dynamic_graph (ComposedSpec const &comp_spec, typename std::enable_if< detail::has_is_composed_dist_spec< ComposedSpec >::value >::type *=0)
 Constructor for composed containers. For an m level composed container, comp_spec contains specifications of the distributions of the current container and each of its elements. More...
 
template<typename DistSpecView >
 dynamic_graph (std::vector< DistSpecView > const &dist_specs, typename std::enable_if< is_distribution_view< DistSpecView >::value &&!detail::has_is_composed_dist_spec< DistSpecView >::value >::type *=0)
 Constructor for composed containers. For an m level composed container, dist_specs contains specifications of the distributions to be used at each level of the composed container. More...
 
Memory and Domain Management
domain_type domain () const
 Returns an iterator_domain of this pGraph. More...
 
Vertex Manipulation
vertex_descriptor add_vertex (void)
 Adds a vertex to the pGraph with a default-constructed property. More...
 
vertex_descriptor add_vertex (vertex_property const &vp)
 Adds a vertex to the pGraph with the given property. More...
 
vertex_descriptor add_vertex (vertex_descriptor const &gid, vertex_property const &vp)
 Adds a vertex to the pGraph with the given property and descriptor. More...
 
template<typename Functor >
void add_vertex (vertex_descriptor const &gid, vertex_property const &vp, Functor const &f)
 Adds a vertex to the pGraph with the given property and descriptor, if the vertex does not exist, or applies the given functor to the existing vertex. The vertex is added to the home location, unlike the other add_vertex calls that add the vertex at the current location. More...
 
vertex_descriptor add_vertex_uniform (vertex_property const &vp)
 Adds a vertex to the pGraph with the given property to a location based on the vertex descriptor assigned by the graph. This method is asynchronous. This method differs from the typical add_vertex as it inserts the vertex into a potentially remote location, rather than the calling location. More...
 
void delete_vertex (vertex_descriptor const &gid)
 Deletes a vertex from the pGraph with the given descriptor. This method is asynchronous. More...
 
boost::shared_ptr< this_typeshared_from_this ()
 

Public Types

typedef partition_type::domain_type descriptor_domain_type
 
typedef domainset1D< distribution_typedomain_type
 
typedef mapper_type::domain_type map_dom_t
 

Protected Types

typedef dgraph_param_selector< D, M, OptionalParams... >::vertex_prop VertexP
 
typedef dgraph_param_selector< D, M, OptionalParams... >::edge_prop EdgeP
 
typedef dgraph_param_selector< D, M, OptionalParams... >::partition_t PS
 
typedef dgraph_param_selector< D, M, OptionalParams... >::mapper_t Map
 
typedef dgraph_param_selector< D, M, OptionalParams... >::traits_t Traits
 
typedef graph< D, M, VertexP, EdgeP, PS, Map, Traits > base_type
 
typedef dynamic_graph< D, M, OptionalParams... > this_type
 
typedef graph_directedness_container_selector< D, M, VertexP, EdgeP, PS, Map, Traits >::type directed_base_type
 

Detailed Description

template<graph_attributes D, graph_attributes M, typename ... OptionalParams>
class stapl::dynamic_graph< D, M, OptionalParams >

Implementation of dynamic graph that supports addition and deletion of vertices and edges.

Inherits from stapl::graph and adds functionality to add/delete vertices.

Parallel dynamic graph container that supports addition and deletion of vertices and edges.

Inherits from stapl::graph and adds functionality to add/delete vertices.

Template Parameters
Dgraph-attribute specifying Directedness (DIRECTED/UNDIRECTED).
Mgraph-attribute specifying Multiedge. (MULTIEDGES/NONMULTIEDGES).
VertexPxtype of property for the vertex. Default is no_property. Must be default assignable, copyable and assignable.
EdgePxtype of property for the edge. Default is no_property. Must be default assignable, copyable and assignable.
PSxPartition strategy that defines how to partition the original domain into subdomains. The default partition is balanced_partition over an indexed_domain.
MapxMapper that defines how to map the subdomains produced by the partition to locations. The default mapper is mapper.
TraitsA traits class that defines customizable components of graph, such as the domain type, base container type, storage, etc. The default traits class is dynamic_graph_traits.
Dgraph-attribute specifying Directedness (DIRECTED/UNDIRECTED).
Mgraph-attribute specifying Multiedge. (MULTIEDGES/NONMULTIEDGES).
VertexPtype of property for the vertex. Default is no_property. Must be default assignable, copyable and assignable.
EdgePtype of property for the edge. Default is no_property. Must be default assignable, copyable and assignable.
PSPartition strategy that defines how to partition the original domain into subdomains. The default partition is balanced_partition over an indexed_domain.
MapMapper that defines how to map the subdomains produced by the partition to locations. The default mapper is mapper.
TraitsA traits class that defines customizable components of graph, such as the domain type, base container type, storage, etc. The default traits class is dynamic_graph_traits.

Constructor & Destructor Documentation

◆ dynamic_graph() [1/8]

template<graph_attributes D, graph_attributes M, typename ... OptionalParams>
stapl::dynamic_graph< D, M, OptionalParams >::dynamic_graph ( size_t const &  n)

Creates a graph with a given size.

◆ dynamic_graph() [2/8]

template<graph_attributes D, graph_attributes M, typename ... OptionalParams>
stapl::dynamic_graph< D, M, OptionalParams >::dynamic_graph ( size_t const &  n,
vertex_property const &  default_value 
)

Creates a graph with a given size and constructs all elements with a default value for vertex property.

◆ dynamic_graph() [3/8]

template<graph_attributes D, graph_attributes M, typename ... OptionalParams>
stapl::dynamic_graph< D, M, OptionalParams >::dynamic_graph ( partition_type const &  ps,
vertex_property const &  default_value = vertex_property() 
)

Creates a graph with a given partition and default value for vertex property.

◆ dynamic_graph() [4/8]

template<graph_attributes D, graph_attributes M, typename ... OptionalParams>
template<typename DP >
stapl::dynamic_graph< D, M, OptionalParams >::dynamic_graph ( size_t  n,
vertex_property const &  default_value,
DP const &  dis_policy 
)

Creates a graph with a given size and default value where the vertex_property may itself be a parallel container. Required for pC composition.

Parameters
nThe number of vertices
default_valueThe initial value of the vertices' properties.
dis_policyA distribution policy that specifies how to distribute the nested containers, in the context of containers of containers.

◆ dynamic_graph() [5/8]

template<graph_attributes D, graph_attributes M, typename ... OptionalParams>
template<typename X , typename Y >
stapl::dynamic_graph< D, M, OptionalParams >::dynamic_graph ( boost::tuples::cons< X, Y >  dims)

Creates composed pContainers with a given size-specifications. Required for pC composition.

Parameters
dimsdimensions of the internal containers.

◆ dynamic_graph() [6/8]

template<graph_attributes D, graph_attributes M, typename ... OptionalParams>
template<typename X , typename Y , typename DP >
stapl::dynamic_graph< D, M, OptionalParams >::dynamic_graph ( boost::tuples::cons< X, Y >  dims,
DP const &  dis_policy 
)

Creates composed pContainers with a given size-specifications. Required for pC composition.

Parameters
dimsdimensions of the internal containers.
dis_policyA distribution policy that specifies how to distribute the nested containers, in the context of containers of containers.

◆ dynamic_graph() [7/8]

template<graph_attributes D, graph_attributes M, typename ... OptionalParams>
template<typename ComposedSpec >
stapl::dynamic_graph< D, M, OptionalParams >::dynamic_graph ( ComposedSpec const &  comp_spec,
typename std::enable_if< detail::has_is_composed_dist_spec< ComposedSpec >::value >::type *  = 0 
)

Constructor for composed containers. For an m level composed container, comp_spec contains specifications of the distributions of the current container and each of its elements.

The specification of the current container's distribution is accessed by calling the spec() method, while the distribution specification of an element is accessed via operator[].

Parameters
comp_specInstance of composed_dist_spec representing the distribution specifications for each nested container.

◆ dynamic_graph() [8/8]

template<graph_attributes D, graph_attributes M, typename ... OptionalParams>
template<typename DistSpecView >
stapl::dynamic_graph< D, M, OptionalParams >::dynamic_graph ( std::vector< DistSpecView > const &  dist_specs,
typename std::enable_if< is_distribution_view< DistSpecView >::value &&!detail::has_is_composed_dist_spec< DistSpecView >::value >::type *  = 0 
)

Constructor for composed containers. For an m level composed container, dist_specs contains specifications of the distributions to be used at each level of the composed container.

The first element of the vector specifies the distribution of the outer container, the second the distribution of the containers at the first level of composition, etc. The number of elements in dist_specs must be at least the same as the number of levels of container composition.

The result of the constructor is a container composition where the size and distribution of the container elements at a given level of the composition are the same.

Parameters
dist_specsdistribution specifications that are used to construct the nested containers at a given level of the composition.

Member Function Documentation

◆ domain()

template<graph_attributes D, graph_attributes M, typename ... OptionalParams>
domain_type stapl::dynamic_graph< D, M, OptionalParams >::domain ( ) const

Returns an iterator_domain of this pGraph.

Returns
iterator_domain over the pGraph.

◆ add_vertex() [1/4]

template<graph_attributes D, graph_attributes M, typename ... OptionalParams>
vertex_descriptor stapl::dynamic_graph< D, M, OptionalParams >::add_vertex ( void  )

Adds a vertex to the pGraph with a default-constructed property.

Returns
vertex_descriptor of the added vertex.

Vertex-descriptor is assigned automatically by the pGraph. This method is asynchronous. The vertex is added at the calling location, which is also the home location for the vertex.

◆ add_vertex() [2/4]

template<graph_attributes D, graph_attributes M, typename ... OptionalParams>
vertex_descriptor stapl::dynamic_graph< D, M, OptionalParams >::add_vertex ( vertex_property const &  vp)

Adds a vertex to the pGraph with the given property.

Parameters
vpProperty of the vertex.
Returns
vertex_descriptor of the added vertex.

Vertex-descriptor is assigned automatically by the pGraph. This method is asynchronous. The vertex is added at the calling location, which is also the home location for the vertex.

◆ add_vertex() [3/4]

template<graph_attributes D, graph_attributes M, typename ... OptionalParams>
vertex_descriptor stapl::dynamic_graph< D, M, OptionalParams >::add_vertex ( vertex_descriptor const &  gid,
vertex_property const &  vp 
)

Adds a vertex to the pGraph with the given property and descriptor.

Parameters
giddescriptor of the vertex.
vpProperty of the vertex.
Returns
vertex_descriptor of the added vertex.

This method is asynchronous. The vertex is added at the calling location. An async is sent to the home-location of the vertex.

◆ add_vertex() [4/4]

template<graph_attributes D, graph_attributes M, typename ... OptionalParams>
template<typename Functor >
void stapl::dynamic_graph< D, M, OptionalParams >::add_vertex ( vertex_descriptor const &  gid,
vertex_property const &  vp,
Functor const &  f 
)

Adds a vertex to the pGraph with the given property and descriptor, if the vertex does not exist, or applies the given functor to the existing vertex. The vertex is added to the home location, unlike the other add_vertex calls that add the vertex at the current location.

Parameters
giddescriptor of the vertex.
vpProperty of the vertex.
fFunction to apply to the vertex if it already exists.

This method is asynchronous. The vertex is added at the home-location.

◆ add_vertex_uniform()

template<graph_attributes D, graph_attributes M, typename ... OptionalParams>
vertex_descriptor stapl::dynamic_graph< D, M, OptionalParams >::add_vertex_uniform ( vertex_property const &  vp)

Adds a vertex to the pGraph with the given property to a location based on the vertex descriptor assigned by the graph. This method is asynchronous. This method differs from the typical add_vertex as it inserts the vertex into a potentially remote location, rather than the calling location.

Parameters
vpProperty of the vertex.
Returns
vertex_descriptor of the added vertex.

◆ delete_vertex()

template<graph_attributes D, graph_attributes M, typename ... OptionalParams>
void stapl::dynamic_graph< D, M, OptionalParams >::delete_vertex ( vertex_descriptor const &  gid)

Deletes a vertex from the pGraph with the given descriptor. This method is asynchronous.

Parameters
giddescriptor of the vertex.

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