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_type > | shared_from_this () |
Public Types | |
typedef partition_type::domain_type | descriptor_domain_type |
typedef domainset1D< distribution_type > | domain_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 |
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.
D | graph-attribute specifying Directedness (DIRECTED/UNDIRECTED). |
M | graph-attribute specifying Multiedge. (MULTIEDGES/NONMULTIEDGES). |
VertexPx | type of property for the vertex. Default is no_property. Must be default assignable, copyable and assignable. |
EdgePx | type of property for the edge. Default is no_property. Must be default assignable, copyable and assignable. |
PSx | Partition strategy that defines how to partition the original domain into subdomains. The default partition is balanced_partition over an indexed_domain. |
Mapx | Mapper that defines how to map the subdomains produced by the partition to locations. The default mapper is mapper. |
Traits | A 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. |
D | graph-attribute specifying Directedness (DIRECTED/UNDIRECTED). |
M | graph-attribute specifying Multiedge. (MULTIEDGES/NONMULTIEDGES). |
VertexP | type of property for the vertex. Default is no_property. Must be default assignable, copyable and assignable. |
EdgeP | type of property for the edge. Default is no_property. Must be default assignable, copyable and assignable. |
PS | Partition strategy that defines how to partition the original domain into subdomains. The default partition is balanced_partition over an indexed_domain. |
Map | Mapper that defines how to map the subdomains produced by the partition to locations. The default mapper is mapper. |
Traits | A 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. |
stapl::dynamic_graph< D, M, OptionalParams >::dynamic_graph | ( | size_t const & | n | ) |
Creates a graph with a given size.
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.
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.
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.
n | The number of vertices |
default_value | The initial value of the vertices' properties. |
dis_policy | A distribution policy that specifies how to distribute the nested containers, in the context of containers of containers. |
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.
dims | dimensions of the internal containers. |
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.
dims | dimensions of the internal containers. |
dis_policy | A distribution policy that specifies how to distribute the nested containers, in the context of containers of containers. |
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
[].
comp_spec | Instance of composed_dist_spec representing the distribution specifications for each nested container. |
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.
dist_specs | distribution specifications that are used to construct the nested containers at a given level of the composition. |
domain_type stapl::dynamic_graph< D, M, OptionalParams >::domain | ( | ) | const |
Returns an iterator_domain of this pGraph.
vertex_descriptor stapl::dynamic_graph< D, M, OptionalParams >::add_vertex | ( | void | ) |
Adds a vertex to the pGraph with a default-constructed property.
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.
vertex_descriptor stapl::dynamic_graph< D, M, OptionalParams >::add_vertex | ( | vertex_property const & | vp | ) |
Adds a vertex to the pGraph with the given property.
vp | Property of the 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.
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.
gid | descriptor of the vertex. |
vp | Property of the vertex. |
This method is asynchronous. The vertex is added at the calling location. An async is sent to the home-location of the vertex.
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.
gid | descriptor of the vertex. |
vp | Property of the vertex. |
f | Function to apply to the vertex if it already exists. |
This method is asynchronous. The vertex is added at the home-location.
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.
vp | Property of the vertex. |
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.
gid | descriptor of the vertex. |