STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types | Public Attributes
stapl::generators::detail::sparse_mesh_neighbors Struct Reference

Functor which adds edges with the given probability to form a mesh of the given dimensions. More...

Public Member Functions

 sparse_mesh_neighbors (size_t x, size_t y, double p, bool bidirectional, unsigned int seed=get_location_id())
 
template<typename Vertex , typename Graph >
void operator() (Vertex v, Graph &view)
 
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...
 

Public Types

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

Public Attributes

size_t m_x
 
size_t m_y
 
double m_p
 
bool m_bidirectional
 
boost::random::mt19937 m_rng
 

Detailed Description

Functor which adds edges with the given probability to form a mesh of the given dimensions.

See also
make_sparse_mesh

Constructor & Destructor Documentation

◆ sparse_mesh_neighbors()

stapl::generators::detail::sparse_mesh_neighbors::sparse_mesh_neighbors ( size_t  x,
size_t  y,
double  p,
bool  bidirectional,
unsigned int  seed = get_location_id() 
)
Parameters
x,yDimensions of the mesh.
pProbability of adding a given edge in the mesh.
bidirectionalTrue to add back-edges in a directed graph.
seedThe seed for random-number generation.

Member Function Documentation

◆ 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: