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

Parallel directed-graph container. Inherits all functionality from directed_graph_base. 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< directed_graph< D, M, OptionalParams... > > shared_from_this ()
 
Constructors
 directed_graph (void)
 Creates an empty graph.
 
 directed_graph (size_t const &n)
 Creates a graph with a given size.
 
 directed_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.
 
 directed_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.
 
 directed_graph (partition_type const &ps, mapper_type const &m)
 Creates a graph with a given partition and mapper.
 
 directed_graph (partition_type const &ps, mapper_type const &m, vertex_property const &default_value)
 Creates a graph with a given partition and mapper, with default value for vertex property.
 
 directed_graph (size_t const &n, mapper_type const &m, vertex_property const &default_value=vertex_property())
 Creates a graph with a given size and mapper, with default value for vertex property. More...
 
template<typename DistSpecsView >
 directed_graph (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 (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 >
 directed_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 >
 directed_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 >
 directed_graph (boost::tuples::cons< X, Y > dims, const DP &dis_policy)
 Creates composed pContainers with a given size-specifications. Required for pC composition. More...
 
template<typename SizesView >
 directed_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 >
 directed_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 >
 directed_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...
 
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.
 
void sort_edges (Comp const &comp)
 Sorts edges of each vertex by user-defined comparison function.
 
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...
 
void apply_set (vertex_descriptor const &gid, F const &f)
 Applies a function to the vertex with the given descriptor. More...
 
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...
 
F::result_type vp_apply (vertex_descriptor const &gid, F const &f)
 Applies a function to the property of vertex with given descriptor. More...
 
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...
 
edge_descriptor insert_edge (edge_descriptor const &ed, edge_property const &ep, Comp const &comp)
 Inserts an edge with given descriptor and property. More...
 
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...
 
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...
 
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...
 
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...
 
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...
 
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...
 
Element Manipulation
void apply_set (gid_type const &gid, F const &f)
 Applies a function f to the element specified by the GID. More...
 
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...
 
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...
 
Manipulator Aggregation
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...
 
void aggregate_apply_async (size_t const &loc, Cont const &cont, F const &f)
 Applies a functor on elements at the desired location. More...
 
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...
 

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

typedef directed_graph_base< directed_graph, D, M, OptionalParams... > base_type
 
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 directed_graph< D, M, OptionalParams... > derived_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...
 

Detailed Description

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

Parallel directed-graph container. Inherits all functionality from directed_graph_base.

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.
MapxMapper that defines how to map the subdomains produced by the partition to locations. The default mapper is mapper.
TraitsxA 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.

Member Typedef Documentation

◆ vertex_iterator

typedef distribution_type::iterator stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::vertex_iterator
inherited

Iterator over the vertices of the graph. Same as iterator for compatibility.

◆ vertex_reference

typedef distribution_type::reference stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::vertex_reference
inherited

Reference to a vertex of the graph. Same as reference for compatibility.

Constructor & Destructor Documentation

◆ directed_graph() [1/6]

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

Creates a graph with a given size and mapper, with default value for vertex property.

Parameters
nSize of the graph.
mMapper for the data distribution.

◆ directed_graph() [2/6]

template<graph_attributes D, graph_attributes M, typename ... OptionalParams>
template<typename DP >
stapl::directed_graph< D, M, OptionalParams >::directed_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.

◆ directed_graph() [3/6]

template<graph_attributes D, graph_attributes M, typename ... OptionalParams>
template<typename X , typename Y >
stapl::directed_graph< D, M, OptionalParams >::directed_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.

◆ directed_graph() [4/6]

template<graph_attributes D, graph_attributes M, typename ... OptionalParams>
template<typename X , typename Y , typename DP >
stapl::directed_graph< D, M, OptionalParams >::directed_graph ( boost::tuples::cons< X, Y >  dims,
const DP &  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.

◆ directed_graph() [5/6]

template<graph_attributes D, graph_attributes M, typename ... OptionalParams>
template<typename ComposedSpec >
stapl::directed_graph< D, M, OptionalParams >::directed_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.

◆ directed_graph() [6/6]

template<graph_attributes D, graph_attributes M, typename ... OptionalParams>
template<typename DistSpecView >
stapl::directed_graph< D, M, OptionalParams >::directed_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

◆ erase_edges_if()

void stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::erase_edges_if ( Pred &&  pred)
inherited

Erases all edges that match a user-defined predicate.

Parameters
predA unary predicate that receives a single edge

◆ operator[]()

reference stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::operator[] ( vertex_descriptor const &  gid)
inherited

Constructs a reference to the vertex with the given descriptor.

Parameters
gidDescriptor of the desired vertex.
Returns
reference to the desired vertex.

◆ make_reference() [1/2]

reference stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::make_reference ( vertex_descriptor const &  gid)
inherited

Constructs a reference to the vertex with the given descriptor.

Parameters
gidDescriptor of the desired vertex.
Returns
reference to the desired vertex.

◆ make_reference() [2/2]

const_reference stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::make_reference ( vertex_descriptor const &  gid) const
inherited

◆ begin() [1/2]

vertex_iterator stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::begin ( void  )
inherited

Returns a vertex iterator to the global beginning of the pGraph.

Returns
vertex_iterator to the global beginning of the pGraph.

◆ begin() [2/2]

const_vertex_iterator stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::begin ( void  ) const
inherited

Returns a const vertex iterator to the global beginning of the pGraph.

Returns
vertex_iterator to the global beginning of the pGraph.

◆ end() [1/2]

vertex_iterator stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::end ( void  )
inherited

Returns a vertex iterator to the global end of the pGraph.

Returns
vertex_iterator to the global end of the pGraph.

◆ end() [2/2]

const_vertex_iterator stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::end ( void  ) const
inherited

Returns a const vertex iterator to the global end of the pGraph.

Returns
vertex_iterator to the global end of the pGraph.

◆ make_iterator()

iterator stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::make_iterator ( gid_type const &  gid)
inherited

Constructs a vertex iterator to the given descriptor.

Parameters
gidDescriptor of the desired vertex.
Returns
vertex_iterator to the desired vertex.

◆ find_vertex()

vertex_iterator stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::find_vertex ( vertex_descriptor const &  gid)
inherited

Returns a global vertex iterator to the given descriptor.

Parameters
gidDescriptor of the desired vertex.
Returns
vertex_iterator to the desired vertex.

Wrapper around make_iterator for compatibility. Does not enforce the existence of the vertex.

◆ add_edge() [1/2]

edge_descriptor stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::add_edge ( edge_descriptor const &  ed,
edge_property const &  ep = edge_property() 
)
inherited

Adds an edge with given descriptor and property.

Warning
Synchronous. Edge is added before returning.
Parameters
edDescriptor of the desired edge.
epProperty of the edge.
Returns
edge_descriptor of the added edge. The id of the edge_descriptor returned is set to numeric_limits<size_t>::max() if the edge was not added.

◆ add_edge() [2/2]

edge_descriptor stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::add_edge ( vertex_descriptor const &  source,
vertex_descriptor const &  target,
edge_property const &  ep = edge_property() 
)
inherited

Adds an edge between the two given vertices with given property.

Warning
Synchronous. Edge is added before returning.
Parameters
sourceDescriptor of the source vertex.
targetDescriptor of the target vertex.
epProperty of the edge.
Returns
edge_descriptor of the added edge. The id of the edge_descriptor returned is set to numeric_limits<size_t>::max() if the edge was not added.

◆ insert_edge() [1/2]

edge_descriptor stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::insert_edge ( edge_descriptor const &  ed,
edge_property const &  ep,
Comp const &  comp 
)
inherited

Inserts an edge with given descriptor and property.

Warning
Synchronous. Edge is inserted before returning.
Parameters
edDescriptor of the desired edge.
epProperty of the edge.
compComparator workfunction passed to std::lower_bound to determine where to insert the edge.
Returns
edge_descriptor of the added edge. The id of the edge_descriptor returned is set to numeric_limits<size_t>::max() if the edge was not added.

◆ insert_edge() [2/2]

edge_descriptor stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::insert_edge ( vertex_descriptor const &  source,
vertex_descriptor const &  target,
edge_property const &  ep,
Comp const &  comp 
)
inherited

Adds an edge between the two given vertices with given property.

Warning
Synchronous. Edge is added before returning.
Parameters
sourceDescriptor of the source vertex.
targetDescriptor of the target vertex.
epProperty of the edge.
compComparator workfunction passed to std::lower_bound to determine where to insert the edge.
Returns
edge_descriptor of the added edge. The id of the edge_descriptor returned is set to numeric_limits<size_t>::max() if the edge was not added.

◆ add_edge_async() [1/2]

void stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::add_edge_async ( edge_descriptor const &  ed,
edge_property const &  ep = edge_property() 
)
inherited

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.

Parameters
edDescriptor of the desired edge.
epProperty of the edge.

◆ add_edge_async() [2/2]

void stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::add_edge_async ( vertex_descriptor const &  source,
vertex_descriptor const &  target,
edge_property const &  ep = edge_property() 
)
inherited

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.

Parameters
sourceDescriptor of the source vertex.
targetDescriptor of the target vertex.
epProperty of the edge.

◆ insert_edge_async() [1/2]

void stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::insert_edge_async ( edge_descriptor const &  ed,
edge_property const &  ep,
Comp const &  comp 
)
inherited

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.

Parameters
edDescriptor of the desired edge.
epProperty of the edge.

◆ insert_edge_async() [2/2]

void stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::insert_edge_async ( vertex_descriptor const &  source,
vertex_descriptor const &  target,
edge_property const &  ep,
Comp const &  comp 
)
inherited

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.

Parameters
edDescriptor of the desired edge.
epProperty of the edge.

◆ delete_edge() [1/2]

void stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::delete_edge ( edge_descriptor const &  ed)
inherited

Deletes the edge with given descriptor. Asynchronous.

Parameters
edDescriptor of the desired edge.

◆ delete_edge() [2/2]

void stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::delete_edge ( vertex_descriptor const &  source,
vertex_descriptor const &  target 
)
inherited

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.

Parameters
sourceDescriptor of the source vertex.
targetDescriptor of the target vertex.

◆ reserve_adjacency()

void stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::reserve_adjacency ( vertex_descriptor const &  vd,
size_t  num_adjacents 
)
inherited

Reserves space for adjacent-edges of the given vertex.

Parameters
vdDescriptor of the desired vertex.
num_adjacentsAmount of space to be reserved for said vertex.

◆ num_vertices()

size_t stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::num_vertices ( void  ) const
inherited

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.

◆ num_edges()

size_t stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::num_edges ( void  ) const
inherited

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.

Returns
size_t number of edges in the pGraph.

◆ num_edges_collective()

size_t stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::num_edges_collective ( void  ) const
inherited

Returns the number of edges in the pGraph.

Warning
This method is blocking, collective version of num_edges. Use when calling num-edges from all locations, which is faster than calling num_edges() above.
Returns
size_t number of edges in the pGraph.

◆ num_local_edges()

size_t stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::num_local_edges ( void  ) const
inherited

Returns the number of local outgoing edges in the pGraph. This is a blocking method.

Returns
size_t total number of outgoing adjacent-edges for all local vertices.

◆ redistribute() [1/3]

void stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , 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 
)
inherited

Redistribute the data stored in the container to match the distribution specified by the distribution view provided.

Parameters
dist_viewView-based specification of the desired distribution.
Note
The method is only available in graph instances that use view_based_partition and view_based_mapper as their partition and mapper types, respectively.

◆ redistribute() [2/3]

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 stapl::container< directed_graph< D, M, OptionalParams... > , bool >::redistribute ( DistSpecView const &  dist_view)
inherited

Redistribute the data stored in the container to match the distribution specified by the distribution view provided.

Parameters
dist_viewView-based specification of the desired distribution.
Note
The method is only available in array instances that use view_based_partition and view_based_mapper as their partition and mapper types, respectively.

◆ redistribute() [3/3]

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 stapl::container< directed_graph< D, M, OptionalParams... > , bool >::redistribute ( DistSpecView const *  dist_view)
inherited

Redistribute the data stored in the container to match the distribution specified by the distribution view provided.

Parameters
dist_viewView-based specification of the desired distribution.

This function is invoked from the proxy when nested containers are being redistributed.

Note
The method is only available in array instances that use view_based_partition and view_based_mapper as their partition and mapper types, respectively.

◆ apply_set() [1/2]

void stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::apply_set ( vertex_descriptor const &  gid,
F const &  f 
)
inherited

Applies a function to the vertex with the given descriptor.

Parameters
gidDescriptor of the vertex.
fFunctor to be applied to the target vertex.

◆ apply_set() [2/2]

void stapl::detail::container_impl< directed_graph< D, M, OptionalParams... > >::apply_set ( gid_type const &  gid,
F const &  f 
)
inherited

Applies a function f to the element specified by the GID.

Parameters
gidThe GID of the element.
fThe Functor to apply on the element.

◆ vp_apply_async()

void stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::vp_apply_async ( vertex_descriptor const &  gid,
F const &  f 
)
inherited

Applies a function to the property of vertex with given descriptor. This method is asynchronous.

Parameters
gidDescriptor of the vertex.
fFunctor to be applied to the target vertex's property.

◆ vp_apply() [1/2]

F::result_type stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::vp_apply ( vertex_descriptor const &  gid,
F const &  f 
)
inherited

Applies a function to the property of vertex with given descriptor.

Warning
This method is synchronous.
Parameters
gidDescriptor of the vertex.
fFunctor to be applied to the target vertex's property.
Returns
The result of applying f to the vertex's property.

◆ vp_apply() [2/2]

F::result_type stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::vp_apply ( vertex_descriptor const &  gid,
F const &  f 
) const
inherited

Applies a function to the property of vertex with given descriptor.

Warning
This method is synchronous.
Parameters
gidDescriptor of the vertex.
fFunctor to be applied to the target vertex's property.
Returns
The result of applying f to the vertex's property.

◆ ep_apply_async()

void stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::ep_apply_async ( edge_descriptor const &  ed,
F const &  f 
)
inherited

Applies a function to the property of edge with given descriptor. This method is asynchronous.

Parameters
edDescriptor of the edge.
fFunctor to be applied to the target edge's property.

◆ ep_apply()

F::result_type stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::ep_apply ( edge_descriptor const &  ed,
F const &  f 
)
inherited

Applies a function to the property of edge with given descriptor.

Warning
This method is synchronous.
Parameters
edDescriptor of the edge.
fFunctor to be applied to the target edge's property.
Returns
The result of applying f to the edge's property.

◆ aggregate_vp_apply_async()

void stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::aggregate_vp_apply_async ( size_t const &  loc,
F const &  fcont 
)
inherited

Applies functors to respective vertex-properties on the desired location. For internal use by Aggregators. This method is asynchronous.

Parameters
locLocation where functors are to be executed.
fcontContainer 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.

◆ aggregate_apply_async()

void stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::aggregate_apply_async ( size_t const &  loc,
Cont const &  cont,
F const &  f 
)
inherited

Applies a functor on elements at the desired location.

For internal use by Aggregators. This method is asynchronous.

Parameters
locLocation where functors are to be executed.
contContainer of elements to be passed-in to f.
fFunctor to be applied to each element of cont on the desired location. f is passed an element of cont.

◆ aggregate_async()

void stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::aggregate_async ( size_t const &  loc,
Cont const &  cont,
F const &  f 
)
inherited

Applies a functor on the desired location. For internal use by Aggregators. This method is asynchronous.

Parameters
locLocation where functors are to be executed.
contContainer of elements to be passed-in to f.
fFunctor 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.

◆ has_edge()

future<bool> stapl::directed_graph_base< directed_graph< D, M, OptionalParams... > , D, M, OptionalParams >::has_edge ( vertex_descriptor const &  source,
vertex_descriptor const &  target 
)
inherited

Determines whether there exists an edge between two vertices.

Returns
A future representing the answer to this query

◆ set_element()

void stapl::detail::container_impl< directed_graph< D, M, OptionalParams... > >::set_element ( index_type const &  idx,
value_type const &  val 
)
inherited

Sets the element specified by the index to the provided value.

Parameters
idxGID of the element to be set.
valThe new value of the element.

◆ set_elements()

void stapl::detail::container_impl< directed_graph< D, M, OptionalParams... > >::set_elements ( index_type const &  idx,
View &&  vals 
)
inherited

Sets a range of elements starting with a given index to a sequence of provided values.

Parameters
idxGID of start of element range to be set.
valsThe new values to be assigned to the element range.

◆ get_element()

value_type stapl::detail::container_impl< directed_graph< D, M, OptionalParams... > >::get_element ( index_type const &  idx) const
inherited

Returns the value of the element specified by the index.

Parameters
idxGID of the element to be retrieved.
Returns
The value of the element.

◆ get_element_split()

future<value_type> stapl::detail::container_impl< directed_graph< D, M, OptionalParams... > >::get_element_split ( index_type const &  idx)
inherited

Returns a stapl::future holding the value of the element specified by the index.

Parameters
idxGID of the element to be set.
Returns
The future holding the value of the element.

◆ apply_get() [1/2]

F::result_type stapl::detail::container_impl< directed_graph< D, M, OptionalParams... > >::apply_get ( gid_type const &  gid,
F const &  f 
)
inherited

Applies a function f to the element specified by the GID, and returns the result.

Parameters
gidThe GID of the element.
fThe Functor to apply on the element.
Returns
The result of applying the functor to the element.

◆ apply_get() [2/2]

F::result_type stapl::detail::container_impl< directed_graph< D, M, OptionalParams... > >::apply_get ( gid_type const &  gid,
F const &  f 
) const
inherited

Applies a function f to the element specified by the GID, and returns the result.

Parameters
gidThe GID of the element.
fThe Functor to apply on the element.
Returns
The result of applying the functor to the element.

◆ domain()

domain_type stapl::detail::container_impl< directed_graph< D, M, OptionalParams... > >::domain ( void  ) const
inherited

◆ migrate()

void stapl::detail::container_impl< directed_graph< D, M, OptionalParams... > >::migrate ( gid_type const &  gid,
location_type  destination 
)
inherited

Migrates the element specified by the gid to the destination location.

Parameters
gidGID of the element to be migrated.
destinationId of the location where the element is to be migrated.

◆ size()

size_type stapl::detail::container_impl< directed_graph< D, M, OptionalParams... > >::size ( void  ) const
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.

◆ locality()

locality_info stapl::detail::container_impl< directed_graph< D, M, OptionalParams... > >::locality ( gid_type  gid)
inherited

Return locality information about the element specified by the gid.

Returns
A locality_qualifier, affinity specifier, as well as this object's handle and associated location for this affinity.

◆ get_spec() [1/2]

std::shared_ptr<DistSpecView> stapl::detail::container_impl< directed_graph< D, M, OptionalParams... > >::get_spec ( DistSpecView const &  dist_view,
typename std::enable_if< !detail::has_is_composed_dist_spec< DistSpecView >::value >::type *  = 0 
)
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.

Parameters
dist_viewInstantiation of distribution_spec that describes the target distribution for redistribute
Returns
shared_ptr to the distribution specification

◆ get_spec() [2/2]

std::shared_ptr<typename ComposedSpec::distribution_spec> stapl::detail::container_impl< directed_graph< D, M, OptionalParams... > >::get_spec ( ComposedSpec const &  dist_view,
typename std::enable_if< detail::has_is_composed_dist_spec< ComposedSpec >::value >::type *  = 0 
)
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.

Parameters
dist_viewInstantiation of composed_dist_spec that describes the target distributions for redistribute for all container instances in a composed container
Returns
shared_ptr to the distribution specification for this container instance

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