STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types | Protected Member Functions | Protected Attributes
stapl::generators::generator< G, EF, VF > Struct Template Reference

Generator which generates a graph using the provided edge and vertex functors. More...

Public Member Functions

 generator (G &g, size_t num_vertices, EF const &edge_gen, VF const &vertex_gen=VF())
 
 generator (size_t num_vertices, EF const &edge_gen, VF const &vertex_gen=VF())
 
void add_vertices ()
 Function which is called to add vertices.
 
void add_edges ()
 Function which is called to add edges.
 
graph_type operator() ()
 Calls add_vertices and add_edges on the derived class. More...
 

Public Types

typedef generator_base< generator< G, EF, VF > > base_type
 

Protected Member Functions

graph_type & graph ()
 
void add_vertices (VF const &vf)
 Function which is called to add vertices to the graph using the provided vertex addition functor. More...
 
void add_edges (EF const &ef)
 Function which is called to add edges to the graph using the provided edge addition functor. More...
 

Protected Attributes

EF m_edge_gen
 
VF m_vertex_gen
 

Detailed Description

template<typename G, typename EF, typename VF = detail::populate_vertices>
struct stapl::generators::generator< G, EF, VF >

Generator which generates a graph using the provided edge and vertex functors.

Template Parameters
GType of the view over the generated graph.
EFType of the edge generation functor.
VFType of the vertex generation functor.

Generates a graph with N vertices. Vertices are generated using the provided functor, or are numbered [0,N) with a default property otherwise. Edges are added using the provided functor.

Constructor & Destructor Documentation

◆ generator() [1/2]

template<typename G , typename EF , typename VF = detail::populate_vertices>
stapl::generators::generator< G, EF, VF >::generator ( G &  g,
size_t  num_vertices,
EF const &  edge_gen,
VF const &  vertex_gen = VF() 
)
Parameters
gView of the graph to generate.
num_verticesThe number of vertices in the graph.
edge_genThe edge generator.
vertex_genThe vertex generator.

◆ generator() [2/2]

template<typename G , typename EF , typename VF = detail::populate_vertices>
stapl::generators::generator< G, EF, VF >::generator ( size_t  num_vertices,
EF const &  edge_gen,
VF const &  vertex_gen = VF() 
)
Parameters
num_verticesThe number of vertices in the graph.
edge_genThe edge generator.
vertex_genThe vertex generator.

Member Function Documentation

◆ add_vertices()

void stapl::generators::generator_base< generator< G, EF, VF > >::add_vertices ( VF const &  vf)
protectedinherited

Function which is called to add vertices to the graph using the provided vertex addition functor.

Parameters
vfFunctor which is used to add vertices.

◆ add_edges()

void stapl::generators::generator_base< generator< G, EF, VF > >::add_edges ( EF const &  ef)
protectedinherited

Function which is called to add edges to the graph using the provided edge addition functor.

Parameters
efFunctor which is used to add edges.

◆ operator()()

graph_type stapl::generators::generator_base< generator< G, EF, VF > >::operator() ( void  )
inherited

Calls add_vertices and add_edges on the derived class.

Returns
A view over the generated graph.

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