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 | Protected Types | Protected Attributes
stapl::generators::detail::random_k_neighbors Struct Reference

Work function which adds edges to the given graph to form a random neighborhood. More...

Public Member Functions

 random_k_neighbors (size_t num_vertices, size_t local_size, size_t ef, size_t k, bool bidirectional, unsigned int seed=get_location_id())
 
template<typename T , typename V >
void operator() (T x, V &view)
 Adds the edges for the portion of the vertices assigned to location x. More...
 

Public Types

typedef void result_type
 

Public Attributes

size_t m_size
 
size_t m_local_size
 
size_t m_ef
 
size_t m_k
 
bool m_bidirectional
 

Protected Member Functions

size_t rand (void)
 Generates a random number in the range [0, numeric_limits<size_t>::max()).
 
size_t rand (size_t max)
 Generates a random number in the range [0, max). More...
 
size_t rand (size_t min, size_t max)
 Generates a random number in the range [min, max). More...
 

Protected Types

typedef boost::random::uniform_int_distribution< size_t > rng_dist_t
 

Protected Attributes

boost::random::mt19937 m_rng
 

Detailed Description

Work function which adds edges to the given graph to form a random neighborhood.

Constructor & Destructor Documentation

◆ random_k_neighbors()

stapl::generators::detail::random_k_neighbors::random_k_neighbors ( size_t  num_vertices,
size_t  local_size,
size_t  ef,
size_t  k,
bool  bidirectional,
unsigned int  seed = get_location_id() 
)
Parameters
num_verticesTotal size of graph.
local_sizeNumber of vertices on a single location.
NameDescription
seedThe seed for random-number generation.

Member Function Documentation

◆ operator()()

template<typename T , typename V >
void stapl::generators::detail::random_k_neighbors::operator() ( x,
V &  view 
)

Adds the edges for the portion of the vertices assigned to location x.

Parameters
xLocation id which owns vertices where edges are added.
viewView over the graph to which the edges are added.

◆ rand() [1/2]

size_t stapl::generators::rand_gen::rand ( size_t  max)
inherited

Generates a random number in the range [0, max).

Parameters
maxThe maximum value of the output random number (exclusive).

◆ rand() [2/2]

size_t stapl::generators::rand_gen::rand ( size_t  min,
size_t  max 
)
inherited

Generates a random number in the range [min, max).

Parameters
minThe minimum value of the output random number.
maxThe maximum value of the output random number (exclusive).

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