STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types | Public Attributes | Protected Member Functions
stapl::graph_view< PG, Dom, MapFunc, Derived > Class Template Reference

View for the pGraph. Reflects all operations of a graph. More...

Public Member Functions

 graph_view (graph_view const &)=default
 
 graph_view (graph_view &&)=default
 
graph_viewoperator= (graph_view const &)=default
 
 graph_view (view_container_type *vcont, domain_type const &dom, map_func_type mfunc=MapFunc())
 Constructor used to pass ownership of the container to the view. More...
 
template<typename OV >
 graph_view (view_container_type *vcont, domain_type const &dom, map_func_type mfunc, OV const &)
 Constructor used to pass ownership of the container to the view. More...
 
 graph_view (view_container_type const &vcont, domain_type const &dom, map_func_type mfunc=MapFunc())
 Constructor that does not takes ownership over the passed container. More...
 
 graph_view (view_container_type const &vcont, domain_type const &dom, map_func_type mfunc, graph_view const &)
 Constructor that does not takes ownership over the passed container. More...
 
template<typename OV >
 graph_view (view_container_type const &vcont, domain_type const &dom, map_func_type mfunc, OV const &)
 Constructor that does not takes ownership over the passed container. More...
 
 graph_view (view_container_type *vcont)
 Constructs a view that can reference all the elements of the passed container. The view takes ownership of the container. More...
 
 graph_view (view_container_type &vcont)
 Constructs a view that can reference all the elements of the passed container. More...
 
 graph_view (view_container_type const &vcont)
 Constructs a view that can reference all the elements of the passed container. More...
 
template<typename Derived1 >
 graph_view (graph_view< PG, Dom, MapFunc, Derived1 > const &other)
 Copy constructor when the passed view is not the most derived view.
 
template<typename T1 , typename T2 >
 graph_view (graph_view< PG, iterator_domain< T1, T2 >, MapFunc, Derived > const &other)
 Copy constructor when the passed view has an iterator domain. This constructor converts a view using the default graph domain (iterator_domain) to view using a gid-based domain (domset1D) as iterator domain can't handle a selective set of elements. More...
 
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_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 add_vertex (vertex_descriptor const &vd, 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 &vd, 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...
 
void delete_vertex (vertex_descriptor const &vd)
 
void add_edge_async (vertex_descriptor const &src, vertex_descriptor const &tgt)
 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 add_edge_async (vertex_descriptor const &src, vertex_descriptor const &tgt, edge_property const &p)
 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 add_edge_async (edge_descriptor const &ed)
 Adds an edge with given descriptor. 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 (edge_descriptor const &ed, edge_property const &p)
 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...
 
edge_descriptor add_edge (vertex_descriptor const &src, vertex_descriptor const &tgt)
 Adds an edge between the two given vertices. More...
 
edge_descriptor add_edge (vertex_descriptor const &src, vertex_descriptor const &tgt, edge_property const &p)
 Adds an edge between the two given vertices with given property. More...
 
edge_descriptor add_edge (edge_descriptor const &ed)
 Adds an edge with given descriptor. More...
 
edge_descriptor add_edge (edge_descriptor const &ed, edge_property const &p)
 Adds an edge with given descriptor and property. More...
 
template<typename Comp >
edge_descriptor insert_edge (vertex_descriptor const &src, vertex_descriptor const &tgt, edge_property const &p, Comp const &comp)
 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 &p, Comp const &comp)
 Adds an edge between the two given vertices with given property. More...
 
template<typename Comp >
void insert_edge_async (vertex_descriptor const &src, vertex_descriptor const &tgt, edge_property const &p, 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 (edge_descriptor const &ed, edge_property const &p, 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 (vertex_descriptor const &src, vertex_descriptor const &tgt)
 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 delete_edge (edge_descriptor const &ed)
 Deletes the edge with given descriptor. Asynchronous. More...
 
void clear (void)
 Clears the graph. This resets internal counters for vertex-descriptor and edge-id assignments, and clears graph storage. More...
 
vertex_iterator find_vertex (vertex_descriptor const &vd) const
 Returns a global vertex iterator to the given descriptor. More...
 
size_t num_vertices (void) const
 Return the number of vertices in the graph. More...
 
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...
 
bool is_directed (void) const
 
void sort_edges_ascending (void)
 Sorts edges of each vertex in ascending order of target-vertex-id. More...
 
void sort_edges_locality (void)
 Sorts edges of each vertex by home-location of target-vertex. More...
 
template<typename Comp >
void sort_edges (Comp const &comp)
 Sorts edges of each vertex by user-defined comparison function. 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<class Functor >
void vp_apply_async (vertex_descriptor const &vd, Functor const &f)
 Applies a function to the property of vertex with given descriptor. This method is asynchronous. More...
 
template<typename Functor >
Functor::result_type vp_apply (vertex_descriptor const &vd, Functor const &f) const
 Applies a function to the property of vertex with given descriptor. More...
 
template<class Functor >
void ep_apply_async (edge_descriptor const &ed, Functor const &f)
 Applies a function to the property of edge with given descriptor. This method is asynchronous. More...
 
template<class Functor >
Functor::result_type ep_apply (edge_descriptor const &ed, Functor const &f)
 Applies a function to the property of edge with given descriptor. More...
 
vertices_view_type vertices (void) const
 Returns an Array over the vertices of the graph.
 
future< bool > has_edge (vertex_descriptor const &source, vertex_descriptor const &target)
 Determines whether there exists an edge between two vertices. More...
 
bool is_valid (void) const
 
view_container_type * get_container (void) const
 
view_container_type & container (void)
 
view_container_type & container (void) const
 
domain_type const & domain (void) const
 
domain_type & domain (void)
 
void set_domain (domain_type const &dom)
 
map_func_type const & mapfunc (void) const
 
size_type size (void) const
 Returns the number of elements referenced for the view.
 
bool empty (void) const
 Returns true if the view does not reference any element.
 
View Read Operations
value_type get_element (index_t const &index) const
 Get the element index from the container. More...
 
future< value_type > get_element_split (index_t const &index) const
 Get the element index from the container. More...
 
template<class Functor >
Functor::result_type apply_get (index_t const &index, Functor f)
 Applies the provided function to the value referenced for the given index and returns the result of the operation. More...
 
template<class Functor >
Functor::result_type apply_get (index_t const &index, Functor f) const
 Applies the provided function to the value referenced for the given index and returns the result of the operation. More...
 
View Write Operations
void set_element (index_t const &index, value_t const &value)
 Set the element index in the container to value value. More...
 
template<class Functor >
void apply_set (index_t const &index, Functor f)
 Applies the provided function to the value referenced for the given index and mutates the element with the resulting value. More...
 
View Subscript Operations
reference_t operator[] (index_t const &index) const
 The bracket operator is the basic access method.
 
reference_t make_reference (index_t const &index) const
 
Sequence Iterator
Warning
Methods in the Sequence Iterator group should only be used inside a work function which is processing a segmented view.
iterator begin (void)
 
const_iterator begin (void) const
 
iterator end (void)
 
const_iterator end (void) const
 
iterator make_iterator (index_t i)
 
index_t next (index_t const &index) const
 Computes the next index based on the given index. More...
 
index_t prev (index_t const &index) const
 Computes the previous index based on the given index. More...
 
index_t advance (index_t const &index, Distance n) const
 Computes the new index after advance n positions from the given index. More...
 
long distance (index_t const &index1, index_t const &index2) const
 
bool less_than (index_t const &index1, index_t const &index2) const
 

Public Types

typedef sequence_op_type::iterator iterator
 Type for global-iterator over vertices (compatibility).
 
typedef sequence_op_type::const_iterator const_iterator
 
typedef sequence_op_type::iterator vertex_iterator
 Type for global-iterator over vertices.
 
typedef sequence_op_type::const_iterator const_vertex_iterator
 
typedef PG::adj_edge_iterator adj_edge_iterator
 Type for iterator over adjacent edges of a vertex.
 
typedef PG::const_adj_edge_iterator const_adj_edge_iterator
 
typedef PG::vertex_property vertex_property
 
typedef PG::edge_property edge_property
 
typedef PG::vertex_descriptor vertex_descriptor
 
typedef PG::edge_descriptor edge_descriptor
 
typedef PG::vertex_reference vertex_reference
 
typedef array_view< PG, Dom > vertices_view_type
 
typedef PG view_container_type
 
typedef Dom domain_type
 
typedef MapFunc map_func_type
 
typedef mf_type_helper::index_type index_type
 
typedef mf_type_helper::gid_type gid_type
 
typedef std::size_t size_type
 
using reference_t = typename view_traits< graph_view< PG, Dom, MapFunc, Derived > >::reference
 
typedef detail::make_iterator< select_derived< Derived, graph_view< PG, Dom, MapFunc, Derived > >::type, iteratormake_iterator_t
 

Public Attributes

PG * m_ptr
 
sptr_type m_sptr
 

Protected Member Functions

PG * container_ptr (void) const
 Returns the container's pointer.
 

Detailed Description

template<typename PG, typename Dom, typename MapFunc, typename Derived>
class stapl::graph_view< PG, Dom, MapFunc, Derived >

View for the pGraph. Reflects all operations of a graph.

Template Parameters
PGThe container for the view.
DomThe domain for the view.
MapFuncThe mapping function to be used in the view. Default is f_ident.
DerivedMost derived class for use with CRTP.

Constructor & Destructor Documentation

◆ graph_view() [1/9]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
stapl::graph_view< PG, Dom, MapFunc, Derived >::graph_view ( view_container_type *  vcont,
domain_type const &  dom,
map_func_type  mfunc = MapFunc() 
)

Constructor used to pass ownership of the container to the view.

Parameters
vcontpointer to the container used to forward the operations.
domdomain to be used by the view.
mfuncmapping function to transform view indices to container gids.

◆ graph_view() [2/9]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
template<typename OV >
stapl::graph_view< PG, Dom, MapFunc, Derived >::graph_view ( view_container_type *  vcont,
domain_type const &  dom,
map_func_type  mfunc,
OV const &   
)

Constructor used to pass ownership of the container to the view.

Parameters
vcontpointer to the container used to forward the operations.
domdomain to be used by the view.
mfuncmapping function to transform view indices to container gids.
otherView to copy from.

◆ graph_view() [3/9]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
stapl::graph_view< PG, Dom, MapFunc, Derived >::graph_view ( view_container_type const &  vcont,
domain_type const &  dom,
map_func_type  mfunc = MapFunc() 
)

Constructor that does not takes ownership over the passed container.

Parameters
vcontreference to the container used to forward the operations.
domdomain to be used by the view.
mfuncmapping function to transform view indices to container gids.

◆ graph_view() [4/9]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
stapl::graph_view< PG, Dom, MapFunc, Derived >::graph_view ( view_container_type const &  vcont,
domain_type const &  dom,
map_func_type  mfunc,
graph_view< PG, Dom, MapFunc, Derived > const &   
)

Constructor that does not takes ownership over the passed container.

Parameters
vcontreference to the container used to forward the operations.
domdomain to be used by the view.
mfuncmapping function to transform view indices to container gids.

◆ graph_view() [5/9]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
template<typename OV >
stapl::graph_view< PG, Dom, MapFunc, Derived >::graph_view ( view_container_type const &  vcont,
domain_type const &  dom,
map_func_type  mfunc,
OV const &   
)

Constructor that does not takes ownership over the passed container.

Parameters
vcontreference to the container used to forward the operations.
domdomain to be used by the view.
mfuncmapping function to transform view indices to container gids.
otherView to copy from.

◆ graph_view() [6/9]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
stapl::graph_view< PG, Dom, MapFunc, Derived >::graph_view ( view_container_type *  vcont)

Constructs a view that can reference all the elements of the passed container. The view takes ownership of the container.

Parameters
vcontpointer to the container used to forward the operations.

◆ graph_view() [7/9]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
stapl::graph_view< PG, Dom, MapFunc, Derived >::graph_view ( view_container_type &  vcont)

Constructs a view that can reference all the elements of the passed container.

Parameters
vcontpointer to the container used to forward the operations.

◆ graph_view() [8/9]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
stapl::graph_view< PG, Dom, MapFunc, Derived >::graph_view ( view_container_type const &  vcont)

Constructs a view that can reference all the elements of the passed container.

Parameters
vcontpointer to the container used to forward the operations.

◆ graph_view() [9/9]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
template<typename T1 , typename T2 >
stapl::graph_view< PG, Dom, MapFunc, Derived >::graph_view ( graph_view< PG, iterator_domain< T1, T2 >, MapFunc, Derived > const &  other)

Copy constructor when the passed view has an iterator domain. This constructor converts a view using the default graph domain (iterator_domain) to view using a gid-based domain (domset1D) as iterator domain can't handle a selective set of elements.

Member Function Documentation

◆ add_vertex() [1/4]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
vertex_descriptor stapl::graph_view< PG, Dom, MapFunc, Derived >::add_vertex ( void  )

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

Returns
vertex_descriptor of the added vertex.

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

◆ add_vertex() [2/4]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
vertex_descriptor stapl::graph_view< PG, Dom, MapFunc, Derived >::add_vertex ( vertex_property const &  vp)

Adds a vertex to the pGraph with the given property.

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

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

◆ add_vertex_uniform()

template<typename PG, typename Dom, typename MapFunc, typename Derived>
vertex_descriptor stapl::graph_view< PG, Dom, MapFunc, Derived >::add_vertex_uniform ( vertex_property const &  vp)

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

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

◆ add_vertex() [3/4]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
void stapl::graph_view< PG, Dom, MapFunc, Derived >::add_vertex ( vertex_descriptor const &  vd,
vertex_property const &  vp 
)

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

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

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

◆ add_vertex() [4/4]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
template<typename Functor >
void stapl::graph_view< PG, Dom, MapFunc, Derived >::add_vertex ( vertex_descriptor const &  vd,
vertex_property const &  vp,
Functor const &  f 
)

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

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

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

◆ delete_vertex()

template<typename PG, typename Dom, typename MapFunc, typename Derived>
void stapl::graph_view< PG, Dom, MapFunc, Derived >::delete_vertex ( vertex_descriptor const &  vd)

◆ add_edge_async() [1/4]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
void stapl::graph_view< PG, Dom, MapFunc, Derived >::add_edge_async ( vertex_descriptor const &  src,
vertex_descriptor const &  tgt 
)

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.

◆ add_edge_async() [2/4]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
void stapl::graph_view< PG, Dom, MapFunc, Derived >::add_edge_async ( vertex_descriptor const &  src,
vertex_descriptor const &  tgt,
edge_property const &  p 
)

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.

◆ add_edge_async() [3/4]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
void stapl::graph_view< PG, Dom, MapFunc, Derived >::add_edge_async ( edge_descriptor const &  ed)

Adds an edge with given descriptor. 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.

◆ add_edge_async() [4/4]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
void stapl::graph_view< PG, Dom, MapFunc, Derived >::add_edge_async ( edge_descriptor const &  ed,
edge_property const &  p 
)

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() [1/4]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
edge_descriptor stapl::graph_view< PG, Dom, MapFunc, Derived >::add_edge ( vertex_descriptor const &  src,
vertex_descriptor const &  tgt 
)

Adds an edge between the two given vertices.

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

◆ add_edge() [2/4]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
edge_descriptor stapl::graph_view< PG, Dom, MapFunc, Derived >::add_edge ( vertex_descriptor const &  src,
vertex_descriptor const &  tgt,
edge_property const &  p 
)

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.

◆ add_edge() [3/4]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
edge_descriptor stapl::graph_view< PG, Dom, MapFunc, Derived >::add_edge ( edge_descriptor const &  ed)

Adds an edge with given descriptor.

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

◆ add_edge() [4/4]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
edge_descriptor stapl::graph_view< PG, Dom, MapFunc, Derived >::add_edge ( edge_descriptor const &  ed,
edge_property const &  p 
)

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.

◆ insert_edge() [1/2]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
template<typename Comp >
edge_descriptor stapl::graph_view< PG, Dom, MapFunc, Derived >::insert_edge ( vertex_descriptor const &  src,
vertex_descriptor const &  tgt,
edge_property const &  p,
Comp const &  comp 
)

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.

◆ insert_edge() [2/2]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
template<typename Comp >
edge_descriptor stapl::graph_view< PG, Dom, MapFunc, Derived >::insert_edge ( edge_descriptor const &  ed,
edge_property const &  p,
Comp const &  comp 
)

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.

◆ insert_edge_async() [1/2]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
template<typename Comp >
void stapl::graph_view< PG, Dom, MapFunc, Derived >::insert_edge_async ( vertex_descriptor const &  src,
vertex_descriptor const &  tgt,
edge_property const &  p,
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.

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

◆ insert_edge_async() [2/2]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
template<typename Comp >
void stapl::graph_view< PG, Dom, MapFunc, Derived >::insert_edge_async ( edge_descriptor const &  ed,
edge_property const &  p,
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.

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

◆ delete_edge() [1/2]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
void stapl::graph_view< PG, Dom, MapFunc, Derived >::delete_edge ( vertex_descriptor const &  src,
vertex_descriptor const &  tgt 
)

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.

◆ delete_edge() [2/2]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
void stapl::graph_view< PG, Dom, MapFunc, Derived >::delete_edge ( edge_descriptor const &  ed)

Deletes the edge with given descriptor. Asynchronous.

Parameters
edDescriptor of the desired edge.

◆ clear()

template<typename PG, typename Dom, typename MapFunc, typename Derived>
void stapl::graph_view< PG, Dom, MapFunc, Derived >::clear ( void  )

Clears the graph. This resets internal counters for vertex-descriptor and edge-id assignments, and clears graph storage.

◆ find_vertex()

template<typename PG, typename Dom, typename MapFunc, typename Derived>
vertex_iterator stapl::graph_view< PG, Dom, MapFunc, Derived >::find_vertex ( vertex_descriptor const &  vd) const

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.

◆ num_vertices()

template<typename PG, typename Dom, typename MapFunc, typename Derived>
size_t stapl::graph_view< PG, Dom, MapFunc, Derived >::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.

◆ num_edges()

template<typename PG, typename Dom, typename MapFunc, typename Derived>
size_t stapl::graph_view< PG, Dom, MapFunc, Derived >::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.

Returns
size_t number of edges in the pGraph.

◆ num_edges_collective()

template<typename PG, typename Dom, typename MapFunc, typename Derived>
size_t stapl::graph_view< PG, Dom, MapFunc, Derived >::num_edges_collective ( void  ) const

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()

template<typename PG, typename Dom, typename MapFunc, typename Derived>
size_t stapl::graph_view< PG, Dom, MapFunc, Derived >::num_local_edges ( void  ) const

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.

◆ sort_edges_ascending()

template<typename PG, typename Dom, typename MapFunc, typename Derived>
void stapl::graph_view< PG, Dom, MapFunc, Derived >::sort_edges_ascending ( void  )

Sorts edges of each vertex in ascending order of target-vertex-id.

◆ sort_edges_locality()

template<typename PG, typename Dom, typename MapFunc, typename Derived>
void stapl::graph_view< PG, Dom, MapFunc, Derived >::sort_edges_locality ( void  )

Sorts edges of each vertex by home-location of target-vertex.

◆ sort_edges()

template<typename PG, typename Dom, typename MapFunc, typename Derived>
template<typename Comp >
void stapl::graph_view< PG, Dom, MapFunc, Derived >::sort_edges ( Comp const &  comp)

Sorts edges of each vertex by user-defined comparison function.

◆ apply_set() [1/2]

template<typename PG, typename Dom, typename MapFunc, typename Derived>
template<typename F >
void stapl::graph_view< PG, Dom, MapFunc, Derived >::apply_set ( vertex_descriptor const &  gid,
F const &  f 
)

Applies a function to the vertex with the given descriptor.

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

◆ vp_apply_async()

template<typename PG, typename Dom, typename MapFunc, typename Derived>
template<class Functor >
void stapl::graph_view< PG, Dom, MapFunc, Derived >::vp_apply_async ( vertex_descriptor const &  vd,
Functor const &  f 
)

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()

template<typename PG, typename Dom, typename MapFunc, typename Derived>
template<typename Functor >
Functor::result_type stapl::graph_view< PG, Dom, MapFunc, Derived >::vp_apply ( vertex_descriptor const &  vd,
Functor const &  f 
) const

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()

template<typename PG, typename Dom, typename MapFunc, typename Derived>
template<class Functor >
void stapl::graph_view< PG, Dom, MapFunc, Derived >::ep_apply_async ( edge_descriptor const &  ed,
Functor const &  f 
)

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()

template<typename PG, typename Dom, typename MapFunc, typename Derived>
template<class Functor >
Functor::result_type stapl::graph_view< PG, Dom, MapFunc, Derived >::ep_apply ( edge_descriptor const &  ed,
Functor const &  f 
)

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.

◆ has_edge()

template<typename PG, typename Dom, typename MapFunc, typename Derived>
future<bool> stapl::graph_view< PG, Dom, MapFunc, Derived >::has_edge ( vertex_descriptor const &  source,
vertex_descriptor const &  target 
)

Determines whether there exists an edge between two vertices.

Returns
A future representing the answer to this query

◆ get_container()

view_container_type* stapl::core_view< PG , Dom, MapFunc >::get_container ( void  ) const
inherited

◆ container()

view_container_type& stapl::core_view< PG , Dom, MapFunc >::container ( void  ) const
inherited

◆ get_element()

template<typename Derived>
value_type stapl::view_operations::read< Derived >::get_element ( index_t const &  index) const
inherited

Get the element index from the container.

Parameters
indexof element to get

◆ get_element_split()

template<typename Derived>
future<value_type> stapl::view_operations::read< Derived >::get_element_split ( index_t const &  index) const
inherited

Get the element index from the container.

Parameters
indexof element to get

◆ apply_get() [1/2]

template<typename Derived>
template<class Functor >
Functor::result_type stapl::view_operations::read< Derived >::apply_get ( index_t const &  index,
Functor  f 
)
inherited

Applies the provided function to the value referenced for the given index and returns the result of the operation.

Parameters
indexof element to apply the function
ffunction to apply
Returns
result of evaluate the function f on the value referenced for the index

◆ apply_get() [2/2]

template<typename Derived>
template<class Functor >
Functor::result_type stapl::view_operations::read< Derived >::apply_get ( index_t const &  index,
Functor  f 
) const
inherited

◆ set_element()

template<typename Derived>
void stapl::view_operations::write< Derived >::set_element ( index_t const &  index,
value_t const &  value 
)
inherited

Set the element index in the container to value value.

Parameters
indexIndex of element to set.
valueNew value to set.

◆ apply_set() [2/2]

template<typename Derived>
template<class Functor >
void stapl::view_operations::write< Derived >::apply_set ( index_t const &  index,
Functor  f 
)
inherited

Applies the provided function to the value referenced for the given index and mutates the element with the resulting value.

Parameters
indexof element to apply the function
ffunction to apply

◆ next()

index_t stapl::view_operations::sequence< select_derived< Derived, graph_view< PG, Dom, MapFunc, Derived > >::type , use_default >::next ( index_t const &  index) const
inherited

Computes the next index based on the given index.

Overwriting this method allows produce a different way to traverse the elements referenced by the view.

◆ prev()

index_t stapl::view_operations::sequence< select_derived< Derived, graph_view< PG, Dom, MapFunc, Derived > >::type , use_default >::prev ( index_t const &  index) const
inherited

Computes the previous index based on the given index.

Overwriting this method allows produce a different way to traverse the elements referenced by the view.

◆ advance()

index_t stapl::view_operations::sequence< select_derived< Derived, graph_view< PG, Dom, MapFunc, Derived > >::type , use_default >::advance ( index_t const &  index,
Distance  n 
) const
inherited

Computes the new index after advance n positions from the given index.

Overwriting this method allows produce a different way to traverse the elements referenced by the view.


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