STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Classes | Public Member Functions | Public Types | Protected Attributes
stapl::kla_detail::vertex_operator_apply_base< ReinvokeBehavior, Graph, VertexOp, Frontier, Derived, Predicate > Class Template Reference

Work function to wrap the user provided vertex-operator. More...

Classes

struct  make_wrapped_neighbor_operator
 Helper class used to create a wrapped neighbor operator, which may or may not include a copy of the vertex operator, depending on the reinvoke behavior. More...
 

Public Member Functions

 vertex_operator_apply_base (Graph *g, VertexOp wf, size_t curr_level, size_t max_level, Predicate pred=Predicate())
 Vertex Operator Apply Base. More...
 
template<class Vertex >
result_type operator() (Vertex &&v) const
 Function operator that invokes the vertex operator. More...
 
void increment_level ()
 
size_t const & level () const
 
size_t const & max_level () const
 
void increment_iteration (size_t k)
 
graph_type *const graph () const
 

Public Types

using graph_type = Graph
 
using derived_type = Derived
 
using vertex_operator_type = VertexOp
 
using frontier_type = Frontier
 
using result_type = std::pair< bool, bool >
 

Protected Attributes

Graph * m_graph
 
VertexOp m_wf
 
size_t m_curr_level
 
size_t m_max_level
 
Predicate m_pred
 

Detailed Description

template<reinvoke_behavior ReinvokeBehavior, class Graph, class VertexOp, class Frontier, class Derived, class Predicate = kla_detail::false_predicate>
class stapl::kla_detail::vertex_operator_apply_base< ReinvokeBehavior, Graph, VertexOp, Frontier, Derived, Predicate >

Work function to wrap the user provided vertex-operator.

The work function is applied on a vertex if the vertex is active. Active vertices may perform some computation and update their values, and may visit their neighboring vertices with the user provided neighbor-operator. Returns true if vertex was active (i.e. the user's work function returned true), false otherwise.

Template Parameters
ReinvokeBehaviorEnum to specify under which conditions to reinvoke the vertex operator from the neighor operator vertex is visited with the neighbor operator, the vertex operator will not be invoked on it if its degree exceeds a user-defined threshold.
GraphType of the input graph view.
VertexOpType of the user provided work function.
FrontierThe type of the frontier
Derivedvertex_operator_apply class, which uses CRTP to provide certain interfaces (such as hub avoidance)
PredicateType of a predicate work function that recieves a vertex and returns a bool indicating whether or not to terminate. This defaults to a false_predicate which always returns false.

Constructor & Destructor Documentation

◆ vertex_operator_apply_base()

template<reinvoke_behavior ReinvokeBehavior, class Graph, class VertexOp, class Frontier, class Derived, class Predicate = kla_detail::false_predicate>
stapl::kla_detail::vertex_operator_apply_base< ReinvokeBehavior, Graph, VertexOp, Frontier, Derived, Predicate >::vertex_operator_apply_base ( Graph *  g,
VertexOp  wf,
size_t  curr_level,
size_t  max_level,
Predicate  pred = Predicate() 
)

Vertex Operator Apply Base.

Parameters
wfvertex operator
curr_levelThe current KLA-level of this visit.
max_levelThe maximum KLA-level of this visit.
preda predicate which recieves a vertex and is used to decide whether to terminate early

Member Function Documentation

◆ operator()()

template<reinvoke_behavior ReinvokeBehavior, class Graph, class VertexOp, class Frontier, class Derived, class Predicate = kla_detail::false_predicate>
template<class Vertex >
result_type stapl::kla_detail::vertex_operator_apply_base< ReinvokeBehavior, Graph, VertexOp, Frontier, Derived, Predicate >::operator() ( Vertex &&  v) const

Function operator that invokes the vertex operator.

Returns
A pair of bools, the first representing this vertex's vote to continue and the second representing this vertex's vote to halt.

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