selector(3)

NAME

Selector - a random permutation of a random combination

SYNOPSIS

#include <Selector.h>
Public Member Functions
Selector (UWORD32 m, std::string pp)
Selector (UWORD32 m)
Selector (const std::vector< UWORD32 > &retvals)
~Selector (void)
UWORD32 operator[] (UWORD32 i)
UWORD32 getRange (void) const
Private Member Functions
void calculate (UWORD32 m)
bool idxX (UWORD32 v, UWORD32 m, UWORD32 *p) const
void setX (UWORD32 i, UWORD32 v)
Private Attributes
std::vector< UWORD32 > X
std::vector< UWORD32 > Y
sgi::hash_map< UWORD32, UWORD32 > Xreversed
UWORD32 Maximum
    operator[] will return a value in {0,...,Maximum-1}
UWORD32 NumInArray
    the number of calculated positions in the arrays
PseudoRandomSource * PRandom

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
Selector::Selector (UWORD32 m)
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

UWORD32 Selector::operator[] (UWORD32 i)
get the value at the i-th position
Parameters:
i an index
UWORD32 Selector::getRange (void) const [inline] void Selector::calculate (UWORD32 m) [private]
fill X, Y and Xreversed until but not including index m
bool Selector::idxX (UWORD32 v, UWORD32 m, UWORD32 * p) const [private]
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
void Selector::setX (UWORD32 i, UWORD32 v) [private]
set X[i] to v while maintaining Xreversed

Member Data Documentation

std::vector<UWORD32> Selector::X [private] std::vector<UWORD32> Selector::Y [private] sgi::hash_map<UWORD32,UWORD32> Selector::Xreversed [private] UWORD32 Selector::Maximum [private] UWORD32 Selector::NumInArray [private] PseudoRandomSource* Selector::PRandom [private]

Author

Generated automatically by Doxygen for steghide from the source code.
Copyright © 2010-2024 Platon Technologies, s.r.o.           Home | Man pages | tLDP | Documents | Utilities | About
Design by styleshout