基本的な hash table とりあえず g++ (SGI STL) の hash_map を使って実装 More...
#include <generalSimpleHashTable.h>
Classes | |
struct | Table |
Public Types | |
typedef hash::HashKey | HashKey |
Public Member Functions | |
GeneralSimpleHashTable (size_t capacity=100000) | |
~GeneralSimpleHashTable () | |
void | clear () |
Record * | allocate (const HashKey &key) |
表を探し,登録されてなければ新規エントリを登録する More... | |
Record * | find (const HashKey &key) |
表を探す.新たに登録する事はない More... | |
const Record * | find (const HashKey &key) const |
size_t | size () const |
size_t | capacity () const |
int | numCacheHit () const |
int | numRecordAfterFull () const |
bool | isVerbose () const |
int | divSize () const |
lock contention を下げるために分割した大きさ More... | |
Protected Attributes | |
boost::scoped_ptr< Table > | table |
基本的な hash table とりあえず g++ (SGI STL) の hash_map を使って実装
機能:
ある程度基本的な機能を実装したら,自分で実装しなおすほうがbetter。 この hash_map では GCを実装することは困難と思われるため
find, allocate で ポインタを返すため,要素を追加しても,既存の要素の アドレスが変化しないデータ構造を用いる必要がある.
Definition at line 39 of file generalSimpleHashTable.h.
typedef hash::HashKey osl::container::GeneralSimpleHashTable< Record >::HashKey |
Definition at line 45 of file generalSimpleHashTable.h.
|
explicit |
capacity | 表に保持する最大局面 |
Definition at line 164 of file generalSimpleHashTable.tcc.
osl::container::GeneralSimpleHashTable< Record >::~GeneralSimpleHashTable | ( | ) |
Definition at line 171 of file generalSimpleHashTable.tcc.
Record * osl::container::GeneralSimpleHashTable< Record >::allocate | ( | const HashKey & | key) |
表を探し,登録されてなければ新規エントリを登録する
TableFull |
Definition at line 184 of file generalSimpleHashTable.tcc.
size_t osl::container::GeneralSimpleHashTable< Record >::capacity | ( | ) | const |
Definition at line 214 of file generalSimpleHashTable.tcc.
Referenced by osl::container::GeneralSimpleHashTable< Record >::Table::allocate().
void osl::container::GeneralSimpleHashTable< Record >::clear | ( | ) |
Definition at line 176 of file generalSimpleHashTable.tcc.
int osl::container::GeneralSimpleHashTable< Record >::divSize | ( | ) | const |
lock contention を下げるために分割した大きさ
Definition at line 235 of file generalSimpleHashTable.tcc.
Record * osl::container::GeneralSimpleHashTable< Record >::find | ( | const HashKey & | key) |
表を探す.新たに登録する事はない
Definition at line 192 of file generalSimpleHashTable.tcc.
Referenced by osl::search::AlphaBeta2< EvalT >::alphaBetaSearchRoot(), osl::search::AlphaBeta2< EvalT >::computeBestMoveIteratively(), osl::container::GeneralSimpleHashTable< Record >::Table::findInLock(), qsearch(), search(), and osl::search::AlphaBeta2Tree< EvalT >::showPV().
const Record * osl::container::GeneralSimpleHashTable< Record >::find | ( | const HashKey & | key) | const |
Definition at line 200 of file generalSimpleHashTable.tcc.
bool osl::container::GeneralSimpleHashTable< Record >::isVerbose | ( | ) | const |
int osl::container::GeneralSimpleHashTable< Record >::numCacheHit | ( | ) | const |
Definition at line 221 of file generalSimpleHashTable.tcc.
int osl::container::GeneralSimpleHashTable< Record >::numRecordAfterFull | ( | ) | const |
Definition at line 228 of file generalSimpleHashTable.tcc.
size_t osl::container::GeneralSimpleHashTable< Record >::size | ( | ) | const |
Definition at line 207 of file generalSimpleHashTable.tcc.
Referenced by osl::container::GeneralSimpleHashTable< Record >::Table::allocate(), and osl::container::GeneralSimpleHashTable< Record >::Table::size().
|
protected |
Definition at line 42 of file generalSimpleHashTable.h.