基本的な hash table とりあえず g++ (SGI STL) の hash_map を使って実装 [詳細]
#include <generalSimpleHashTable.h>
構成 | |
struct | Table |
Public 型 | |
typedef hash::HashKey | HashKey |
Public メソッド | |
GeneralSimpleHashTable (size_t capacity=100000) | |
~GeneralSimpleHashTable () | |
void | clear () |
Record * | allocate (const HashKey &key) |
表を探し,登録されてなければ新規エントリを登録する | |
Record * | find (const HashKey &key) |
表を探す.新たに登録する事はない | |
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 を下げるために分割した大きさ | |
Protected 変数 | |
boost::scoped_ptr< Table > | table |
基本的な hash table とりあえず g++ (SGI STL) の hash_map を使って実装
機能:
ある程度基本的な機能を実装したら,自分で実装しなおすほうがbetter。 この hash_map では GCを実装することは困難と思われるため
find, allocate で ポインタを返すため,要素を追加しても,既存の要素の アドレスが変化しないデータ構造を用いる必要がある.
generalSimpleHashTable.h の 39 行で定義されています。
typedef hash::HashKey osl::container::GeneralSimpleHashTable< Record >::HashKey |
generalSimpleHashTable.h の 45 行で定義されています。
osl::container::GeneralSimpleHashTable< Record >::GeneralSimpleHashTable | ( | size_t | capacity = 100000 |
) | [inline, explicit] |
capacity | 表に保持する最大局面 |
generalSimpleHashTable.tcc の 160 行で定義されています。
osl::container::GeneralSimpleHashTable< Record >::~GeneralSimpleHashTable | ( | ) | [inline] |
generalSimpleHashTable.tcc の 167 行で定義されています。
Record * osl::container::GeneralSimpleHashTable< Record >::allocate | ( | const HashKey & | key | ) | [inline] |
表を探し,登録されてなければ新規エントリを登録する
TableFull |
generalSimpleHashTable.tcc の 180 行で定義されています。
参照先 osl::container::GeneralSimpleHashTable< Record >::table.
size_t osl::container::GeneralSimpleHashTable< Record >::capacity | ( | ) | const [inline] |
void osl::container::GeneralSimpleHashTable< Record >::clear | ( | ) | [inline] |
generalSimpleHashTable.tcc の 172 行で定義されています。
参照先 osl::container::GeneralSimpleHashTable< Record >::table.
参照元 Analyzer::search().
int osl::container::GeneralSimpleHashTable< Record >::divSize | ( | ) | const [inline] |
lock contention を下げるために分割した大きさ
osl::search::SimpleHashTableで再定義されています。
generalSimpleHashTable.tcc の 231 行で定義されています。
参照先 osl::container::GeneralSimpleHashTable< Record >::Table::DIVSIZE.
const Record * osl::container::GeneralSimpleHashTable< Record >::find | ( | const HashKey & | key | ) | const [inline] |
generalSimpleHashTable.tcc の 196 行で定義されています。
参照先 osl::container::GeneralSimpleHashTable< Record >::table.
Record * osl::container::GeneralSimpleHashTable< Record >::find | ( | const HashKey & | key | ) | [inline] |
表を探す.新たに登録する事はない
generalSimpleHashTable.tcc の 188 行で定義されています。
参照先 osl::container::GeneralSimpleHashTable< Record >::table.
参照元 osl::search::AlphaBeta2< EvalT >::alphaBetaSearchRoot(), osl::search::AlphaBeta2< EvalT >::computeBestMoveIteratively(), osl::container::GeneralSimpleHashTable< Record >::Table::findInLock(), qsearch(), と osl::search::AlphaBeta2Tree< EvalT >::showPV().
bool osl::container::GeneralSimpleHashTable< Record >::isVerbose | ( | ) | const |
osl::search::SimpleHashTableで再定義されています。
int osl::container::GeneralSimpleHashTable< Record >::numCacheHit | ( | ) | const [inline] |
generalSimpleHashTable.tcc の 217 行で定義されています。
参照先 osl::container::GeneralSimpleHashTable< Record >::table.
int osl::container::GeneralSimpleHashTable< Record >::numRecordAfterFull | ( | ) | const [inline] |
generalSimpleHashTable.tcc の 224 行で定義されています。
参照先 osl::container::GeneralSimpleHashTable< Record >::table.
size_t osl::container::GeneralSimpleHashTable< Record >::size | ( | ) | const [inline] |
boost::scoped_ptr<Table> osl::container::GeneralSimpleHashTable< Record >::table [protected] |
generalSimpleHashTable.h の 42 行で定義されています。
参照元 osl::container::GeneralSimpleHashTable< Record >::allocate(), osl::container::GeneralSimpleHashTable< Record >::capacity(), osl::container::GeneralSimpleHashTable< Record >::clear(), osl::container::GeneralSimpleHashTable< Record >::find(), osl::container::GeneralSimpleHashTable< Record >::numCacheHit(), osl::container::GeneralSimpleHashTable< Record >::numRecordAfterFull(), と osl::container::GeneralSimpleHashTable< Record >::size().