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::random_neighborhood< G > Struct Template Reference

Graph generator for a random neighborhood graph. More...

Public Member Functions

 random_neighborhood (G &g, size_t n, size_t ef, size_t k, bool bidirectional=true)
 
 random_neighborhood (size_t n, size_t ef, size_t k, bool bidirectional=true)
 
void add_vertices ()
 Function which adds vertices to the graph.
 
void add_edges ()
 Function which adds the edges to the graph. More...
 
graph_type operator() ()
 Calls add_vertices and add_edges on the derived class. More...
 

Public Types

typedef generator_base< random_neighborhood< G > > 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

size_t m_ef
 
size_t m_k
 
bool m_bidirectional
 

Detailed Description

template<typename G>
struct stapl::generators::random_neighborhood< G >

Graph generator for a random neighborhood graph.

Template Parameters
GType of the graph view used to construct the graph.
See also
make_random_neighborhood

Constructor & Destructor Documentation

◆ random_neighborhood() [1/2]

template<typename G >
stapl::generators::random_neighborhood< G >::random_neighborhood ( G &  g,
size_t  n,
size_t  ef,
size_t  k,
bool  bidirectional = true 
)
Parameters
gView of the graph to generate
nThe number of nodes in the graph
efThe average number of edges per vertex in the graph.
kThe farthest neighbor that a vertex may connect to (+-k).
bidirectionalTrue to add back-edges in a directed graph, false for forward edges only.

◆ random_neighborhood() [2/2]

template<typename G >
stapl::generators::random_neighborhood< G >::random_neighborhood ( size_t  n,
size_t  ef,
size_t  k,
bool  bidirectional = true 
)
Parameters
nThe number of nodes in the graph
efThe average number of edges per vertex in the graph.
kThe farthest neighbor that a vertex may connect to (+-k).
bidirectionalTrue to add back-edges in a directed graph, false for forward edges only.

Member Function Documentation

◆ add_edges() [1/2]

template<typename G >
void stapl::generators::random_neighborhood< G >::add_edges ( )

Function which adds the edges to the graph.

See also
detail::random_k_neighbors

◆ add_vertices()

void stapl::generators::generator_base< random_neighborhood< G > >::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() [2/2]

void stapl::generators::generator_base< random_neighborhood< G > >::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< random_neighborhood< G > >::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: