cds  2.3.2
cds::opt::v::random_shuffle_permutation< Int, RandomGenerator, RandomDevice > Class Template Reference

Permutation generator based on std::shuffle. More...

#include <cds/opt/permutation.h>

Public Types

typedef Int integer_type
 Type of generated value.
 
typedef RandomGenerator random_generator
 random generator
 
typedef RandomDevice random_device
 random device
 

Public Member Functions

 random_shuffle_permutation (size_t nLength)
 Initializes the generator of arbitrary length nLength.
 
 operator integer_type () const
 Returns the current value.
 
bool next ()
 Goes to next value. Returns false if the sequence is exhausted.
 
void reset ()
 Resets the generator to produce new sequence.
 

Detailed Description

template<typename Int = int, class RandomGenerator = std::mt19937, class RandomDevice = std::random_device>
class cds::opt::v::random_shuffle_permutation< Int, RandomGenerator, RandomDevice >

Permutation generator based on std::shuffle.

The class is suitable for opt::permutation_generator option.

The generator produces a permutation of [0, nLen) sequence. The generator instance allocates a memory block.

Template parameters:

  • Int - specifies the type of generated value, it should be any integer.
  • RandomGenerator - random generator, default is std::mt19937
  • RandomDevice - random device, default is std::random_device

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

cds 2.3.2 Developed by Maxim Khizhinsky aka khizmax and other contributors 2007 - 2017
Autogenerated Sun Dec 31 2017 12:10:52 by Doxygen 1.8.13