cds  2.3.2
cds::opt::v::random_permutation< Int > Class Template Reference

Permutation generator of arbitrary length based on rand() More...

#include <cds/opt/permutation.h>

Public Types

typedef Int integer_type
 Type of generated value.
 

Public Member Functions

 random_permutation (size_t nLength)
 Initializes the generator of arbitrary length nLength.
 
 operator integer_type () const
 Returns the curent 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 cds::opt::v::random_permutation< Int >

Permutation generator of arbitrary length based on rand()

The class is suitable for opt::permutation_generator option.

The generator calculates n = rand() and produces the sequence [n % nLen, (n + 1) % nLen, ..., (n + nLen - 1) % nLen]. The generator does not allocate any memory.

Int template argument specifies the type of generated value, it should be any integer.


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