cds
2.3.2
|
Skew permutation generator. More...
#include <cds/opt/permutation.h>
Public Types | |
typedef Generator | base_generator |
Original permutation generator. | |
typedef base_generator::integer_type | integer_type |
Type of generated value. | |
Public Member Functions | |
skew_permutation (integer_type nOffset, size_t nLength) | |
Initializes the generator. More... | |
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. | |
Skew permutation generator.
This generator produces offset permutation based on Generator:
int(Generator) + nOffset
where Generator
- a permutation generator.
The class is suitable for opt::permutation_generator
option if the goal sequence should be a permutation of [nOffset, nOffset + nLength)
|
inline |
Initializes the generator.
nOffset | The offset, i.e. first value of generated sequence |
nLength | The length of sequence |