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::ws_rewire< Delete > Class Template Reference

Functor which rewires edges in a Watts-Strogatz graph. More...

Public Member Functions

 ws_rewire (double p, size_t n, bool bidirectional, size_t max_proc, 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

using result_type = void
 
typedef boost::random::uniform_int_distribution< size_t > rng_dist_t
 

Public Attributes

boost::random::mt19937 m_rng
 

Detailed Description

template<bool Delete>
class stapl::generators::detail::ws_rewire< Delete >

Functor which rewires edges in a Watts-Strogatz graph.

Template Parameters
DeleteFlag which indicates if an existing edge is deleted when a new one is added.
See also
make_watts_strogatz
make_newman_watts_strogatz

Constructor & Destructor Documentation

◆ ws_rewire()

template<bool Delete>
stapl::generators::detail::ws_rewire< Delete >::ws_rewire ( double  p,
size_t  n,
bool  bidirectional,
size_t  max_proc,
unsigned int  seed = get_location_id() 
)
Parameters
pThe probability of rewiring each edge.
nSize of the graph.
bidirectionalTrue to add backedges, false otherwise.
max_procMaximum number of locations used in a scaling study
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 class was generated from the following file: