Main Page | Class Hierarchy | Class List | File List | Class Members

RandomIndexes Class Reference

#include <RandomIndexes.h>

List of all members.

Public Member Functions

 RandomIndexes (const Decomposition &decomposition, Randomizer &randomizer)
 Constructor.
void init (const vlist_type &uninstantiatedVariables)
 Calculate all the random indexes.
void init (const Variable &variable, Domain &domain)
void done ()
 Clean up the cache.
void setVariable (const Variable &variable)
size_t randomIndex (const Value &value) const
const hash_map< const Value *,
int > & 
randomIndexes (const Variable &variable) const
bool contains (const Variable &variable) const
void clear ()
 Clear the entire cache.
bool empty ()
 Return `true' if the cache is empty, `false' otherwise.


Detailed Description

A cache of random indexes for values.


Member Function Documentation

bool RandomIndexes::contains const Variable variable  )  const [inline]
 

Check whether or not the cache contains data for the values of a given variable.

Parameters:
variable the variable to be looked up.
Returns:
`true' if the cache contains random indexes for variable's values, `false' otherwise.

void RandomIndexes::init const Variable variable,
Domain domain
 

Calculate the random indexes for the values in the domain of the given variable.

Parameters:
variable the variable whose values are to be considered.
domain the variable's domain (not available as variable.domain(), as per the logic in Decomposition::selectValue()).

size_t RandomIndexes::randomIndex const Value value  )  const
 

Return the random index of a given value.

Parameters:
value the value whose random index is to be calculated.
Returns:
the random index of the given value.

const hash_map< const Value *, int > & RandomIndexes::randomIndexes const Variable variable  )  const
 

Return the map of random indexes for the values belonging to the domain of a given variable.

Parameters:
variable the variable whose values we're interested in.
Returns:
a hash table of random indexes.

void RandomIndexes::setVariable const Variable variable  )  [inline]
 

Set the variable whose values are to be compared.

Parameters:
variable the variable whose values are to be compared.


The documentation for this class was generated from the following files:
Generated on Wed May 25 12:21:21 2005 for csp.kdevelop by  doxygen 1.3.9.1