Selector Class Reference
a random permutation of a random combination
#include <Selector.h>
List of all members.
Constructor & Destructor Documentation
Selector::Selector |
( |
UWORD32 |
m, |
|
|
std::string |
pp | |
|
) |
| | |
construct a Selector object
- Parameters:
-
| m | the range - operator[] will return numbers in {0,...,m-1} |
| pp | a passphrase used to generate the seed |
construct a Selector object that resembles the identity permutation with range m
- Parameters:
-
| m | the range - (*this)[i] will be i for i in {0,...,m-1} |
Selector::Selector |
( |
const std::vector< UWORD32 > & |
retvals |
) |
|
construct a Selector object that will return predefined values
- Parameters:
-
| retvals | the values that operator[] shall return |
The Maximum is set to retvals.size().
Selector::~Selector |
( |
void |
|
) |
|
Member Function Documentation
void Selector::calculate |
( |
UWORD32 |
m |
) |
[private] |
fill X, Y and Xreversed until but not including index m
UWORD32 Selector::getRange |
( |
void |
|
) |
const [inline] |
search an index i such that 0 <= i < m and X[i] == v
- Parameters:
-
| v | the value to be searched for in the X-array |
| m | the upper bound for the index |
| p | a pointer to a variable where the found index can be stored |
- Returns:
- true iff such an index is found (*p is set to i in this case
get the value at the i-th position
- Parameters:
-
set X[i] to v while maintaining Xreversed
Member Data Documentation
The documentation for this class was generated from the following files: