|
SoPlex Doxygen Documentation
|
Go to the documentation of this file.
19 #ifndef _DATAHASHTABLE_H_
20 #define _DATAHASHTABLE_H_
72 template < class HashItem, class Info >
81 template < class ElemHashItem, class ElemInfo >
97 typedef Element< HashItem, Info > Elem;
121 bool has( const HashItem& h) const
123 return index(h) >= 0;
131 const Info* get( const HashItem& h) const
135 return (i >= 0) ? & m_elem[i].info : 0;
157 void add( const HashItem& h, const Info& info)
164 assert(m_used < m_elem.size());
185 void remove( const HashItem& h)
196 for( int i = 0; i < m_elem.size(); i++)
206 void reMax ( int newSize = -1, int newHashSize = 0)
216 for( int i = 0; i < save. size(); i++)
218 add(save[i].item, save[i].info);
228 #ifdef ENABLE_CONSISTENCY_CHECKS
231 for( int i = 0; i < m_elem.size(); i++)
243 return m_elem.isConsistent();
267 int (*hashfun)( const HashItem*),
325 int maxsize = m_elem.size();
328 for (i = 2; i < maxsize; i++)
331 for (i = 2; i < maxsize; ++i)
335 for ( int j = i; j < maxsize; j += i)
338 if ( m_elem.size() % i != 0)
342 if (hashsize > maxsize)
368 assert( m_elem.size() > 0);
370 int i = (*m_hashfun)(&h) % m_elem.size();
390 #endif // _DATAHASHTABLE_H_
|