Base-class for graph that implements all functionality needed for a directed static graph. Deriving classes may over-write functionality for adding/deleting edges (for Undirectedness). More...
Public Member Functions | |
std::enable_if<(is_distribution_view< DistSpecView >::value||detail::has_is_composed_dist_spec< DistSpecView >::value) &&is_view_based< partition_type >::value &&is_view_based< mapper_type >::value >::type | redistribute (DistSpecView const &dist_view) |
Redistribute the data stored in the container to match the distribution specified by the distribution view provided. More... | |
std::enable_if<(is_distribution_view< DistSpecView >::value||detail::has_is_composed_dist_spec< DistSpecView >::value) &&is_view_based< partition_type >::value &&is_view_based< mapper_type >::value >::type | redistribute (DistSpecView const *dist_view) |
Redistribute the data stored in the container to match the distribution specified by the distribution view provided. More... | |
void | destroy (void) |
Used as a target method for rmis implementing one-sided destruction, as a pointer to member variable referring to the destructor cannot be initialized, per the standard. Used when container is an element of another container. | |
size_t | get_num_locations (void) const |
location_type | get_location_id (void) const |
boost::shared_ptr< Derived > | shared_from_this () |
Constructors | |
directed_graph_base (void) | |
Creates an empty graph. | |
directed_graph_base (size_t const &n) | |
Creates a graph with a given size. | |
directed_graph_base (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. | |
directed_graph_base (size_t const &n, mapper_type const &m, vertex_property const &default_value=vertex_property()) | |
Creates a graph with a given size and mapper constructs all elements with a default value for vertex property. More... | |
directed_graph_base (partition_type const &ps, vertex_property const &default_value=vertex_property()) | |
Creates a graph with a given size and partition, constructing all vertices with the value provided for vertex property. | |
directed_graph_base (partition_type const &ps, mapper_type const &m) | |
Creates a graph with a given size, partition and mapper. | |
directed_graph_base (partition_type const &ps, mapper_type const &m, vertex_property const &default_value) | |
Creates a graph with a given size, partition and mapper, constructing all vertices with the value provided for vertex property. | |
template<typename DistSpecsView > | |
directed_graph_base (DistSpecsView const &dist_view, typename std::enable_if< is_distribution_view< DistSpecsView >::value &&!detail::has_is_composed_dist_spec< DistSpecsView >::value >::type *=0) | |
template<typename DistSpecsView > | |
directed_graph_base (DistSpecsView const &dist_view, vertex_property const &default_value, typename std::enable_if< is_distribution_view< DistSpecsView >::value &&!detail::has_is_composed_dist_spec< DistSpecsView >::value >::type *=0) | |
template<typename DP , typename VP > | |
directed_graph_base (size_t const &n, VP const &default_value, DP dis_policy, typename boost::enable_if< is_p_object< VP > >::type *=0) | |
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 > | |
directed_graph_base (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 > | |
directed_graph_base (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 > | |
directed_graph_base (SizesView const &sizes_view, typename std::enable_if< boost::is_same< size_type, typename SizesView::size_type >::value &&!is_distribution_view< SizesView >::value &&!detail::has_is_composed_dist_spec< SizesView >::value >::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 > | |
directed_graph_base (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 > | |
directed_graph_base (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... | |
Trait Reflection | |
bool | is_directed (void) const |
void | sort_edges_ascending (void) |
Sorts edges of each vertex in ascending order of target-vertex-id. | |
void | sort_edges_locality (void) |
Sorts edges of each vertex by home-location of target-vertex. | |
template<typename Comp > | |
void | sort_edges (Comp const &comp) |
Sorts edges of each vertex by user-defined comparison function. | |
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. | |
Vertex Manipulation | |
reference | operator[] (vertex_descriptor const &gid) |
Constructs a reference to the vertex with the given descriptor. More... | |
reference | make_reference (vertex_descriptor const &gid) |
Constructs a reference to the vertex with the given descriptor. More... | |
const_reference | make_reference (vertex_descriptor const &gid) const |
vertex_iterator | begin (void) |
Returns a vertex iterator to the global beginning of the pGraph. More... | |
const_vertex_iterator | begin (void) const |
Returns a const vertex iterator to the global beginning of the pGraph. More... | |
vertex_iterator | end (void) |
Returns a vertex iterator to the global end of the pGraph. More... | |
const_vertex_iterator | end (void) const |
Returns a const vertex iterator to the global end of the pGraph. More... | |
iterator | make_iterator (gid_type const &gid) |
Constructs a vertex iterator to the given descriptor. More... | |
vertex_iterator | find_vertex (vertex_descriptor const &gid) |
Returns a global vertex iterator to the given descriptor. More... | |
template<typename F > | |
void | apply_set (vertex_descriptor const &gid, F const &f) |
Applies a function to the vertex with the given descriptor. More... | |
template<typename F > | |
void | vp_apply_async (vertex_descriptor const &gid, F const &f) |
Applies a function to the property of vertex with given descriptor. This method is asynchronous. More... | |
template<typename F > | |
F::result_type | vp_apply (vertex_descriptor const &gid, F const &f) |
Applies a function to the property of vertex with given descriptor. More... | |
template<typename F > | |
F::result_type | vp_apply (vertex_descriptor const &gid, F const &f) const |
Applies a function to the property of vertex with given descriptor. More... | |
Edge Manipulation | |
edge_descriptor | add_edge (edge_descriptor const &ed, edge_property const &ep=edge_property()) |
Adds an edge with given descriptor and property. More... | |
edge_descriptor | add_edge (vertex_descriptor const &source, vertex_descriptor const &target, edge_property const &ep=edge_property()) |
Adds an edge between the two given vertices with given property. More... | |
template<typename Comp > | |
edge_descriptor | insert_edge (edge_descriptor const &ed, edge_property const &ep, Comp const &comp) |
Inserts an edge with given descriptor and property. More... | |
template<typename Comp > | |
edge_descriptor | insert_edge (vertex_descriptor const &source, vertex_descriptor const &target, edge_property const &ep, Comp const &comp) |
Adds an edge between the two given vertices with given property. More... | |
void | add_edge_async (edge_descriptor const &ed, edge_property const &ep=edge_property()) |
Adds an edge with given descriptor and property. The edge is added asynchronously and method returns immediately. Edge is not guaranteed to be added until after a global synchronization. More... | |
void | add_edge_async (vertex_descriptor const &source, vertex_descriptor const &target, edge_property const &ep=edge_property()) |
Adds an edge between the two given vertices with given property. The edge is added asynchronously and method returns immediately. Edge is not guaranteed to be added until after a global synchronization. More... | |
template<typename Comp > | |
void | insert_edge_async (edge_descriptor const &ed, edge_property const &ep, Comp const &comp) |
Inserts an edge with given descriptor and property. The edge is inserted asynchronously and method returns immediately. Edge is not guaranteed to be inserted until after a global synchronization. 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 with given descriptor and property. The edge is inserted asynchronously and method returns immediately. Edge is not guaranteed to be inserted until after a global synchronization. More... | |
void | delete_edge (edge_descriptor const &ed) |
Deletes the edge with given descriptor. Asynchronous. More... | |
void | delete_edge (vertex_descriptor const &source, vertex_descriptor const &target) |
Deletes the edge between the given source and target vertices. The edge is deleted asynchronously. The edge is not guaranteed to have been deleted until after a global synchronization. More... | |
template<typename F > | |
void | ep_apply_async (edge_descriptor const &ed, F const &f) |
Applies a function to the property of edge with given descriptor. This method is asynchronous. More... | |
template<typename F > | |
F::result_type | ep_apply (edge_descriptor const &ed, F const &f) |
Applies a function to the property of edge with given descriptor. More... | |
Memory and Domain Management | |
void | reserve_adjacency (vertex_descriptor const &vd, size_t num_adjacents) |
Reserves space for adjacent-edges of the given vertex. More... | |
size_t | num_vertices (void) const |
Return the number of vertices in the graph. More... | |
void | clear (void) |
Clears the graph. This resets internal counters for vertex-descriptor and edge-id assignments, and clears graph storage. | |
void | clear_edges (void) |
Clears the edges of the graph. This resets internal counters for edge-id assignments, and clears graph edge storage. | |
size_t | num_edges (void) const |
Returns the number of edges in the pGraph. This method is a non-collective version of num_edges. This must be used when not all locations are calling num_edges. More... | |
size_t | num_edges_collective (void) const |
Returns the number of edges in the pGraph. More... | |
size_t | num_local_edges (void) const |
Returns the number of local outgoing edges in the pGraph. This is a blocking method. More... | |
template<typename DistSpecView > | |
void | redistribute (DistSpecView const &dist_view, typename boost::enable_if< boost::mpl::and_< is_distribution_view< DistSpecView >, is_view_based< partition_type >, is_view_based< mapper_type > > >::type *=0) |
Redistribute the data stored in the container to match the distribution specified by the distribution view provided. More... | |
Manipulator Aggregation | |
template<typename F > | |
void | aggregate_vp_apply_async (size_t const &loc, F const &fcont) |
Applies functors to respective vertex-properties on the desired location. For internal use by Aggregators. This method is asynchronous. More... | |
template<typename Cont , typename F > | |
void | aggregate_apply_async (size_t const &loc, Cont const &cont, F const &f) |
Applies a functor on elements at the desired location. More... | |
template<typename Cont , typename F > | |
void | aggregate_async (size_t const &loc, Cont const &cont, F const &f) |
Applies a functor on the desired location. For internal use by Aggregators. This method is asynchronous. More... | |
future< bool > | has_edge (vertex_descriptor const &source, vertex_descriptor const &target) |
Determines whether there exists an edge between two vertices. More... | |
Element Manipulation | |
void | set_element (index_type const &idx, value_type const &val) |
Sets the element specified by the index to the provided value. More... | |
void | set_elements (index_type const &idx, View &&vals) |
Sets a range of elements starting with a given index to a sequence of provided values. More... | |
value_type | get_element (index_type const &idx) const |
Returns the value of the element specified by the index. More... | |
future< value_type > | get_element_split (index_type const &idx) |
Returns a stapl::future holding the value of the element specified by the index. More... | |
void | apply_set (gid_type const &gid, F const &f) |
Applies a function f to the element specified by the GID. More... | |
F::result_type | apply_get (gid_type const &gid, F const &f) |
Applies a function f to the element specified by the GID, and returns the result. More... | |
F::result_type | apply_get (gid_type const &gid, F const &f) const |
Applies a function f to the element specified by the GID, and returns the result. More... | |
Public Types | |
typedef base_type::value_type | value_type |
typedef base_type::partition_type | partition_type |
typedef base_type::mapper_type | mapper_type |
typedef partition_type::value_type | domain_type |
typedef mapper_type::domain_type | map_dom_t |
typedef domain_type::index_type | index_type |
typedef domain_type::index_type | gid_type |
typedef domain_type::size_type | size_type |
typedef base_type::distribution_type | distribution_type |
typedef distribution_type::reference | reference |
typedef distribution_type::const_reference | const_reference |
typedef distribution_type::accessor_type | accessor_type |
typedef distribution_type::iterator | iterator |
typedef distribution_type::loc_dist_metadata | loc_dist_metadata |
Distribution metadata type used for coarsening. | |
typedef Traits::vertex_property | vertex_property |
typedef Traits::edge_property | edge_property |
typedef Traits::vertex_descriptor | vertex_descriptor |
Type of the descriptor of the vertex. Must be convertible to simple_vertex_descriptor. | |
typedef Traits::simple_vertex_descriptor | simple_vertex_descriptor |
An integral type that is convertible from/to vertex_descriptor. | |
typedef Traits::edge_descriptor | edge_descriptor |
typedef Traits::directness_type | directness_type |
typedef Traits::multiplicity_type | multiplicity_type |
typedef distribution_type::iterator | vertex_iterator |
typedef distribution_type::const_iterator | const_vertex_iterator |
typedef distribution_type::adj_edge_iterator | adj_edge_iterator |
Iterator over the adjacent edges of a vertex. | |
typedef distribution_type::const_adj_edge_iterator | const_adj_edge_iterator |
typedef distribution_type::edge_iterator | edge_iterator |
Iterator over the edges of a graph. | |
typedef distribution_type::reference | vertex_reference |
Protected Types | |
using | VertexP = typename graph_param_selector< D, M, OptionalParams... >::vertex_prop |
using | EdgeP = typename graph_param_selector< D, M, OptionalParams... >::edge_prop |
using | PS = typename graph_param_selector< D, M, OptionalParams... >::partition_t |
using | Map = typename graph_param_selector< D, M, OptionalParams... >::mapper_t |
using | Traits = typename graph_param_selector< D, M, OptionalParams... >::traits_t |
typedef Derived | derived_type |
typedef container< derived_type > | base_type |
Memory and Domain Management | |
domain_type | domain (void) const |
void | migrate (gid_type const &gid, location_type destination) |
Migrates the element specified by the gid to the destination location. More... | |
size_type | size (void) const |
Return the number of elements in the container. More... | |
bool | empty (void) const |
distribution_type & | distribution (void) |
distribution_type const & | distribution (void) const |
distribution_type * | get_distribution (void) |
locality_info | locality (gid_type gid) |
Return locality information about the element specified by the gid. More... | |
bool | is_local (Indices const &... i) const |
Returns true if the element specified by the GID formed from the index components provided is stored on this location, or false otherwise. | |
rmi_handle::reference | get_rmi_handle_reference (void) |
std::shared_ptr< DistSpecView > | get_spec (DistSpecView const &dist_view, typename std::enable_if< !detail::has_is_composed_dist_spec< DistSpecView >::value >::type *=0) |
Return a shared_ptr to the distribution specification for this container instance. More... | |
std::shared_ptr< typename ComposedSpec::distribution_spec > | get_spec (ComposedSpec const &dist_view, typename std::enable_if< detail::has_is_composed_dist_spec< ComposedSpec >::value >::type *=0) |
Return a shared_ptr to the distribution specification for this container instance that is part of a composed container instantiation. More... | |
Base-class for graph that implements all functionality needed for a directed static graph. Deriving classes may over-write functionality for adding/deleting edges (for Undirectedness).
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. |
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 static_graph_traits. |
Derived | Most derived class for use with CRTP. |
typedef distribution_type::iterator stapl::directed_graph_base< Derived, D, M, OptionalParams >::vertex_iterator |
Iterator over the vertices of the graph. Same as iterator for compatibility.
typedef distribution_type::reference stapl::directed_graph_base< Derived, D, M, OptionalParams >::vertex_reference |
Reference to a vertex of the graph. Same as reference for compatibility.
stapl::directed_graph_base< Derived, D, M, OptionalParams >::directed_graph_base | ( | size_t const & | n, |
mapper_type const & | m, | ||
vertex_property const & | default_value = vertex_property() |
||
) |
Creates a graph with a given size and mapper constructs all elements with a default value for vertex property.
n | Size of the graph. |
m | Mapper for the data distribution. |
stapl::directed_graph_base< Derived, D, M, OptionalParams >::directed_graph_base | ( | size_t const & | n, |
VP const & | default_value, | ||
DP | dis_policy, | ||
typename boost::enable_if< is_p_object< VP > >::type * | = 0 |
||
) |
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::directed_graph_base< Derived, D, M, OptionalParams >::directed_graph_base | ( | 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::directed_graph_base< Derived, D, M, OptionalParams >::directed_graph_base | ( | 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::directed_graph_base< Derived, D, M, OptionalParams >::directed_graph_base | ( | 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::directed_graph_base< Derived, D, M, OptionalParams >::directed_graph_base | ( | 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. |
void stapl::directed_graph_base< Derived, D, M, OptionalParams >::erase_edges_if | ( | Pred && | pred | ) |
Erases all edges that match a user-defined predicate.
pred | A unary predicate that receives a single edge |
reference stapl::directed_graph_base< Derived, D, M, OptionalParams >::operator[] | ( | vertex_descriptor const & | gid | ) |
Constructs a reference to the vertex with the given descriptor.
gid | Descriptor of the desired vertex. |
reference stapl::directed_graph_base< Derived, D, M, OptionalParams >::make_reference | ( | vertex_descriptor const & | gid | ) |
Constructs a reference to the vertex with the given descriptor.
gid | Descriptor of the desired vertex. |
const_reference stapl::directed_graph_base< Derived, D, M, OptionalParams >::make_reference | ( | vertex_descriptor const & | gid | ) | const |
vertex_iterator stapl::directed_graph_base< Derived, D, M, OptionalParams >::begin | ( | void | ) |
Returns a vertex iterator to the global beginning of the pGraph.
const_vertex_iterator stapl::directed_graph_base< Derived, D, M, OptionalParams >::begin | ( | void | ) | const |
Returns a const vertex iterator to the global beginning of the pGraph.
vertex_iterator stapl::directed_graph_base< Derived, D, M, OptionalParams >::end | ( | void | ) |
Returns a vertex iterator to the global end of the pGraph.
const_vertex_iterator stapl::directed_graph_base< Derived, D, M, OptionalParams >::end | ( | void | ) | const |
Returns a const vertex iterator to the global end of the pGraph.
iterator stapl::directed_graph_base< Derived, D, M, OptionalParams >::make_iterator | ( | gid_type const & | gid | ) |
Constructs a vertex iterator to the given descriptor.
gid | Descriptor of the desired vertex. |
vertex_iterator stapl::directed_graph_base< Derived, D, M, OptionalParams >::find_vertex | ( | vertex_descriptor const & | gid | ) |
Returns a global vertex iterator to the given descriptor.
gid | Descriptor of the desired vertex. |
Wrapper around make_iterator for compatibility. Does not enforce the existence of the vertex.
edge_descriptor stapl::directed_graph_base< Derived, D, M, OptionalParams >::add_edge | ( | edge_descriptor const & | ed, |
edge_property const & | ep = edge_property() |
||
) |
Adds an edge with given descriptor and property.
ed | Descriptor of the desired edge. |
ep | Property of the edge. |
edge_descriptor stapl::directed_graph_base< Derived, D, M, OptionalParams >::add_edge | ( | vertex_descriptor const & | source, |
vertex_descriptor const & | target, | ||
edge_property const & | ep = edge_property() |
||
) |
Adds an edge between the two given vertices with given property.
source | Descriptor of the source vertex. |
target | Descriptor of the target vertex. |
ep | Property of the edge. |
edge_descriptor stapl::directed_graph_base< Derived, D, M, OptionalParams >::insert_edge | ( | edge_descriptor const & | ed, |
edge_property const & | ep, | ||
Comp const & | comp | ||
) |
Inserts an edge with given descriptor and property.
ed | Descriptor of the desired edge. |
ep | Property of the edge. |
comp | Comparator workfunction passed to std::lower_bound to determine where to insert the edge. |
edge_descriptor stapl::directed_graph_base< Derived, D, M, OptionalParams >::insert_edge | ( | vertex_descriptor const & | source, |
vertex_descriptor const & | target, | ||
edge_property const & | ep, | ||
Comp const & | comp | ||
) |
Adds an edge between the two given vertices with given property.
source | Descriptor of the source vertex. |
target | Descriptor of the target vertex. |
ep | Property of the edge. |
comp | Comparator workfunction passed to std::lower_bound to determine where to insert the edge. |
void stapl::directed_graph_base< Derived, D, M, OptionalParams >::add_edge_async | ( | edge_descriptor const & | ed, |
edge_property const & | ep = edge_property() |
||
) |
Adds an edge with given descriptor and property. The edge is added asynchronously and method returns immediately. Edge is not guaranteed to be added until after a global synchronization.
ed | Descriptor of the desired edge. |
ep | Property of the edge. |
void stapl::directed_graph_base< Derived, D, M, OptionalParams >::add_edge_async | ( | vertex_descriptor const & | source, |
vertex_descriptor const & | target, | ||
edge_property const & | ep = edge_property() |
||
) |
Adds an edge between the two given vertices with given property. The edge is added asynchronously and method returns immediately. Edge is not guaranteed to be added until after a global synchronization.
source | Descriptor of the source vertex. |
target | Descriptor of the target vertex. |
ep | Property of the edge. |
void stapl::directed_graph_base< Derived, D, M, OptionalParams >::insert_edge_async | ( | edge_descriptor const & | ed, |
edge_property const & | ep, | ||
Comp const & | comp | ||
) |
Inserts an edge with given descriptor and property. The edge is inserted asynchronously and method returns immediately. Edge is not guaranteed to be inserted until after a global synchronization.
ed | Descriptor of the desired edge. |
ep | Property of the edge. |
void stapl::directed_graph_base< Derived, D, M, OptionalParams >::insert_edge_async | ( | vertex_descriptor const & | source, |
vertex_descriptor const & | target, | ||
edge_property const & | ep, | ||
Comp const & | comp | ||
) |
Inserts an edge with given descriptor and property. The edge is inserted asynchronously and method returns immediately. Edge is not guaranteed to be inserted until after a global synchronization.
ed | Descriptor of the desired edge. |
ep | Property of the edge. |
void stapl::directed_graph_base< Derived, D, M, OptionalParams >::delete_edge | ( | edge_descriptor const & | ed | ) |
Deletes the edge with given descriptor. Asynchronous.
ed | Descriptor of the desired edge. |
void stapl::directed_graph_base< Derived, D, M, OptionalParams >::delete_edge | ( | vertex_descriptor const & | source, |
vertex_descriptor const & | target | ||
) |
Deletes the edge between the given source and target vertices. The edge is deleted asynchronously. The edge is not guaranteed to have been deleted until after a global synchronization.
source | Descriptor of the source vertex. |
target | Descriptor of the target vertex. |
void stapl::directed_graph_base< Derived, D, M, OptionalParams >::reserve_adjacency | ( | vertex_descriptor const & | vd, |
size_t | num_adjacents | ||
) |
Reserves space for adjacent-edges of the given vertex.
vd | Descriptor of the desired vertex. |
num_adjacents | Amount of space to be reserved for said vertex. |
size_t stapl::directed_graph_base< Derived, D, M, OptionalParams >::num_vertices | ( | void | ) | const |
Return the number of vertices in the graph.
This is the same as calling g.size(). This method is one-sided, If other locations may be concurrently performing operations that change their local size and the effects are desired to be observed in a deterministic way, then appropriate synchronization, e.g. a fence, may be required before or after the call to size, to enforce appropriate ordering.
size_t stapl::directed_graph_base< Derived, D, M, OptionalParams >::num_edges | ( | void | ) | const |
Returns the number of edges in the pGraph. This method is a non-collective version of num_edges. This must be used when not all locations are calling num_edges.
For a faster collective, use num_edges_collective() below.
size_t stapl::directed_graph_base< Derived, D, M, OptionalParams >::num_edges_collective | ( | void | ) | const |
Returns the number of edges in the pGraph.
size_t stapl::directed_graph_base< Derived, D, M, OptionalParams >::num_local_edges | ( | void | ) | const |
Returns the number of local outgoing edges in the pGraph. This is a blocking method.
void stapl::directed_graph_base< Derived, D, M, OptionalParams >::redistribute | ( | DistSpecView const & | dist_view, |
typename boost::enable_if< boost::mpl::and_< is_distribution_view< DistSpecView >, is_view_based< partition_type >, is_view_based< mapper_type > > >::type * | = 0 |
||
) |
Redistribute the data stored in the container to match the distribution specified by the distribution view provided.
dist_view | View-based specification of the desired distribution. |
void stapl::directed_graph_base< Derived, D, M, OptionalParams >::apply_set | ( | vertex_descriptor const & | gid, |
F const & | f | ||
) |
Applies a function to the vertex with the given descriptor.
gid | Descriptor of the vertex. |
f | Functor to be applied to the target vertex. |
void stapl::directed_graph_base< Derived, D, M, OptionalParams >::vp_apply_async | ( | vertex_descriptor const & | gid, |
F const & | f | ||
) |
Applies a function to the property of vertex with given descriptor. This method is asynchronous.
gid | Descriptor of the vertex. |
f | Functor to be applied to the target vertex's property. |
F::result_type stapl::directed_graph_base< Derived, D, M, OptionalParams >::vp_apply | ( | vertex_descriptor const & | gid, |
F const & | f | ||
) |
Applies a function to the property of vertex with given descriptor.
gid | Descriptor of the vertex. |
f | Functor to be applied to the target vertex's property. |
F::result_type stapl::directed_graph_base< Derived, D, M, OptionalParams >::vp_apply | ( | vertex_descriptor const & | gid, |
F const & | f | ||
) | const |
Applies a function to the property of vertex with given descriptor.
gid | Descriptor of the vertex. |
f | Functor to be applied to the target vertex's property. |
void stapl::directed_graph_base< Derived, D, M, OptionalParams >::ep_apply_async | ( | edge_descriptor const & | ed, |
F const & | f | ||
) |
Applies a function to the property of edge with given descriptor. This method is asynchronous.
ed | Descriptor of the edge. |
f | Functor to be applied to the target edge's property. |
F::result_type stapl::directed_graph_base< Derived, D, M, OptionalParams >::ep_apply | ( | edge_descriptor const & | ed, |
F const & | f | ||
) |
Applies a function to the property of edge with given descriptor.
ed | Descriptor of the edge. |
f | Functor to be applied to the target edge's property. |
void stapl::directed_graph_base< Derived, D, M, OptionalParams >::aggregate_vp_apply_async | ( | size_t const & | loc, |
F const & | fcont | ||
) |
Applies functors to respective vertex-properties on the desired location. For internal use by Aggregators. This method is asynchronous.
loc | Location where functors are to be executed. |
fcont | Container of functors to be applied. Each element of fcont should provide a target() method that returns the descriptor of the target vertex. Each element of fcont is given the property of its corresponding vertex. |
void stapl::directed_graph_base< Derived, D, M, OptionalParams >::aggregate_apply_async | ( | size_t const & | loc, |
Cont const & | cont, | ||
F const & | f | ||
) |
Applies a functor on elements at the desired location.
For internal use by Aggregators. This method is asynchronous.
loc | Location where functors are to be executed. |
cont | Container of elements to be passed-in to f. |
f | Functor to be applied to each element of cont on the desired location. f is passed an element of cont. |
void stapl::directed_graph_base< Derived, D, M, OptionalParams >::aggregate_async | ( | size_t const & | loc, |
Cont const & | cont, | ||
F const & | f | ||
) |
Applies a functor on the desired location. For internal use by Aggregators. This method is asynchronous.
loc | Location where functors are to be executed. |
cont | Container of elements to be passed-in to f. |
f | Functor to be applied to each element of v on the desired location. f is passed an element of v as well as a pointer to the pGraph. |
future<bool> stapl::directed_graph_base< Derived, D, M, OptionalParams >::has_edge | ( | vertex_descriptor const & | source, |
vertex_descriptor const & | target | ||
) |
Determines whether there exists an edge between two vertices.
|
inherited |
Redistribute the data stored in the container to match the distribution specified by the distribution view provided.
dist_view | View-based specification of the desired distribution. |
|
inherited |
Redistribute the data stored in the container to match the distribution specified by the distribution view provided.
dist_view | View-based specification of the desired distribution. |
This function is invoked from the proxy when nested containers are being redistributed.
|
inherited |
Sets the element specified by the index to the provided value.
idx | GID of the element to be set. |
val | The new value of the element. |
|
inherited |
Sets a range of elements starting with a given index to a sequence of provided values.
idx | GID of start of element range to be set. |
vals | The new values to be assigned to the element range. |
|
inherited |
Returns the value of the element specified by the index.
idx | GID of the element to be retrieved. |
|
inherited |
Returns a stapl::future holding the value of the element specified by the index.
idx | GID of the element to be set. |
|
inherited |
Applies a function f to the element specified by the GID.
gid | The GID of the element. |
f | The Functor to apply on the element. |
|
inherited |
Applies a function f to the element specified by the GID, and returns the result.
gid | The GID of the element. |
f | The Functor to apply on the element. |
|
inherited |
Applies a function f to the element specified by the GID, and returns the result.
gid | The GID of the element. |
f | The Functor to apply on the element. |
|
inherited |
|
inherited |
Migrates the element specified by the gid to the destination location.
gid | GID of the element to be migrated. |
destination | Id of the location where the element is to be migrated. |
|
inherited |
Return the number of elements in the container.
This method is one-sided, If other locations may be concurrently performing operations that change their local size and the effects are desired to be observed in a deterministic way, then appropriate synchronization, e.g. a fence, may be required before or after the call to size, to enforce appropriate ordering.
|
inherited |
Return locality information about the element specified by the gid.
|
protectedinherited |
Return a shared_ptr to the distribution specification for this container instance.
This function is called by redistribute when the distribution specification provided is for a single container instance instead of a collection of composed container instance.
dist_view | Instantiation of distribution_spec that describes the target distribution for redistribute |
|
protectedinherited |
Return a shared_ptr to the distribution specification for this container instance that is part of a composed container instantiation.
This function is called by redistribute when the distribution specification provided is for all container instances of a composed container.
dist_view | Instantiation of composed_dist_spec that describes the target distributions for redistribute for all container instances in a composed container |