Selector Class Reference

a random permutation of a random combination

#include <Selector.h>

List of all members.

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< UWORD32X
std::vector< UWORD32Y
sgi::hash_map< UWORD32, UWORD32Xreversed
UWORD32 Maximum
 operator[] will return a value in {0,...,Maximum-1}
UWORD32 NumInArray
 the number of calculated positions in the arrays
PseudoRandomSourcePRandom


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]


The documentation for this class was generated from the following files:
Generated on Thu Jan 3 18:39:33 2008 for steghide by  doxygen 1.5.4