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)
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 removeItem (Type &item)
Type removeLastItem ()
Type removeItemFastDisorder (const int &index)
Type removeItemFastDisorder (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 260 of file hasharray.h.

Referenced by LWInfo::activateRandomAtom(), LazyInfo::activateRandomAtom(), VariableState::addOneAtomToEachBlock(), MLN::appendClause(), Clause::checkPredsAreConnected(), HashArray< Type, HashFn, EqualFn >::contains(), IndexTranslator::createClauseIdxToClauseFormulaIdxsMap(), VariableState::fillLazyBlocks(), MLN::findClauseIdx(), VariableState::getActiveClauses(), MLN::getClausesOfFormula(), MLN::getFormulaWt(), LWInfo::getSupersetClauses(), LazyInfo::getSupersetClauses(), LWInfo::getUnSatCostPerPred(), LazyInfo::getUnSatCostPerPred(), LWInfo::getWalksatClauses(), LazyInfo::getWalksatClauses(), GroundClause::GroundClause(), IntClause::IntClause(), Clause::moveTermsFromUnseenToSeen(), HashArray< Type, HashFn, EqualFn >::removeItem(), HashArray< Type, HashFn, EqualFn >::removeItemFastDisorder(), MLN::setFormulaIsExistUnique(), MLN::setFormulaIsHard(), MLN::setFormulaNumPreds(), MLN::setFormulaPriorMean(), MLN::setFormulaWt(), and IndexTranslator::setPriorMeans().

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


The documentation for this class was generated from the following file:
Generated on Tue Jan 16 05:30:06 2007 for Alchemy by  doxygen 1.5.1