HashArray< Type, HashFn, EqualFn > Class Template Reference

List of all members.

Public Member Functions

 HashArray (const int &initSize=0)
 HashArray (const HashArray< Type, HashFn, EqualFn > &x)
 ~HashArray ()
int append (Type item)
int append (Type item, const int &max)
int append (const HashArray< Type, HashFn, EqualFn > &newItems)
int append (const HashArray< Type, HashFn, EqualFn > *const &items)
int copyFrom (const HashArray< Type, HashFn, EqualFn > &items)
HashArray< Type, HashFn, EqualFn > & operator= (const HashArray< Type, HashFn, EqualFn > &x)
bool growToSize (const int &newSize)
bool growToSize (const int &newSize, Type fill)
void clear ()
void clearAndCompress ()
void deleteItemsAndClear ()
void deleteItemsAndClearCompress ()
int size () const
bool empty () const
const Type & operator[] (const int &index) const
Type & lastItem () const
const Type * getItems () const
int find (Type const &item) const
 Finds an item in this HashArray.
bool contains (Type const &item) const
Type removeItem (const int &index)
Type removeInputItem (Type &item)
Type removeLastItem ()
Type removeItemFastDisorder (const int &index)
Type removeInputItemFastDisorder (Type &item)
void compress ()
void shuffle ()
int getMaxIndex ()
Type getMaxValue ()

Detailed Description

template<typename Type, class HashFn, class EqualFn>
class HashArray< Type, HashFn, EqualFn >

Definition at line 81 of file hasharray.h.


Member Function Documentation

template<typename Type, class HashFn, class EqualFn>
int HashArray< Type, HashFn, EqualFn >::find ( Type const &  item  )  const [inline]

Finds an item in this HashArray.

Parameters:
item Item to be found.
Returns:
-1 if item not found, otherwise index of the item.

Definition at line 259 of file hasharray.h.

Referenced by SuperClause::addConstantTuple(), MLN::appendClause(), Clause::checkPredsAreConnected(), HashArray< Type, HashFn, EqualFn >::contains(), IndexTranslator::createClauseIdxToClauseFormulaIdxsMap(), MLN::findClauseIdx(), VariableState::fixAtom(), HVariableState::fixAtom(), VariableState::getActiveClauses(), HVariableState::getActiveClauses(), MLN::getClausesOfFormula(), MLN::getFormulaWt(), Variable::getImplicitIndex(), VariableState::getIndexOfGroundPredicate(), VariableState::getIndexOfRandomAtom(), VariableState::getTrueFixedAtomInBlock(), SuperClause::getTupleIndex(), GroundClause::GroundClause(), SuperClause::incrementTupleCount(), VariableState::initBlocksRandom(), HVariableState::initBlocksRandom(), Variable::isImplicit(), Clause::moveTermsFromUnseenToSeen(), Variable::removeImplicit(), HashArray< Type, HashFn, EqualFn >::removeInputItem(), HashArray< Type, HashFn, EqualFn >::removeInputItemFastDisorder(), VariableState::setAsEvidence(), MLN::setFormulaIsExistUnique(), MLN::setFormulaIsHard(), MLN::setFormulaNumPreds(), MLN::setFormulaPriorMean(), MLN::setFormulaWt(), VariableState::setOthersInBlockToFalse(), HVariableState::setOthersInBlockToFalse(), and IndexTranslator::setPriorMeans().

00260   {
00261     typename hash_map<Type, int, HashFn, EqualFn>::iterator it=map_->find(item);
00262     if (it == map_->end()) return -1;
00263     assert((*it).second >= 0);
00264     return (*it).second;
00265   }


The documentation for this class was generated from the following file:
Generated on Sun Jun 7 11:55:24 2009 for Alchemy by  doxygen 1.5.1